Package com.google.android.exoplayer2.metadata.flac

## Class PictureFrame

- java.lang.Object
- - com.google.android.exoplayer2.metadata.flac.PictureFrame

- All Implemented Interfaces:
    `Parcelable`, `Metadata.Entry`

      public final class PictureFrame
      extends Object
      implements Metadata.Entry

  A picture parsed from a Vorbis Comment or a FLAC picture block.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface android.os.Parcelable

      `Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `colors` | For indexed-color pictures (e.g.
    `static Parcelable.Creator<PictureFrame>` | `CREATOR` |
    `int` | `depth` | The color depth of the picture in bits-per-pixel.
    `String` | `description` | A description of the picture.
    `int` | `height` | The height of the picture in pixels.
    `String` | `mimeType` | The mime type of the picture.
    `byte[]` | `pictureData` | The encoded picture data.
    `int` | `pictureType` | The type of the picture.
    `int` | `width` | The width of the picture in pixels.

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PictureFrame​(int pictureType, String mimeType, String description, int width, int height, int depth, int colors, byte[] pictureData)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `describeContents()` |
    `boolean` | `equals​(Object obj)` |
    `static PictureFrame` | `fromPictureBlock​(ParsableByteArray pictureBlock)` | Parses a `METADATA_BLOCK_PICTURE` into a `PictureFrame` instance.
    `int` | `hashCode()` |
    `void` | `populateMediaMetadata​(MediaMetadata.Builder builder)` | Updates the `MediaMetadata.Builder` with the type-specific values stored in this `Entry`.
    `String` | `toString()` |
    `void` | `writeToParcel​(Parcel dest, int flags)` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.google.android.exoplayer2.metadata.Metadata.Entry

      `getWrappedMetadataBytes, getWrappedMetadataFormat`

- - ### Field Detail

    - #### pictureType

          public final int pictureType

      The type of the picture.

    - #### mimeType

          public final String mimeType

      The mime type of the picture.

    - #### description

          public final String description

      A description of the picture.

    - #### width

          public final int width

      The width of the picture in pixels.

    - #### height

          public final int height

      The height of the picture in pixels.

    - #### depth

          public final int depth

      The color depth of the picture in bits-per-pixel.

    - #### colors

          public final int colors

      For indexed-color pictures (e.g. GIF), the number of colors used. 0 otherwise.

    - #### pictureData

          public final byte[] pictureData

      The encoded picture data.

    - #### CREATOR

          public static final Parcelable.Creator<PictureFrame> CREATOR

  - ### Constructor Detail

    - #### PictureFrame

          public PictureFrame​(int pictureType,
                              String mimeType,
                              String description,
                              int width,
                              int height,
                              int depth,
                              int colors,
                              byte[] pictureData)

  - ### Method Detail

    - #### populateMediaMetadata

          public void populateMediaMetadata​(MediaMetadata.Builder builder)

      Description copied from interface: `Metadata.Entry`
      Updates the `MediaMetadata.Builder` with the type-specific values stored in this `Entry`.
      Specified by:
        `populateMediaMetadata` in interface `Metadata.Entry`
      Parameters:
        `builder` - The builder to be updated.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### writeToParcel

          public void writeToParcel​(Parcel dest,
                                    int flags)

      Specified by:
        `writeToParcel` in interface `Parcelable`

    - #### describeContents

          public int describeContents()

      Specified by:
        `describeContents` in interface `Parcelable`

    - #### fromPictureBlock

          public static PictureFrame fromPictureBlock​(ParsableByteArray pictureBlock)

      Parses a `METADATA_BLOCK_PICTURE` into a `PictureFrame` instance.

      `pictureBlock` may be read directly from a FLAC file, or decoded from the base64 content of a Vorbis Comment.

      Parameters:
        `pictureBlock` - The data of the `METADATA_BLOCK_PICTURE`, not including any headers.
      Returns:
        A `PictureFrame` parsed from `pictureBlock`.