@UnstableApi
public final class PictureFrame implements Metadata.Entry


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

Summary

Public fields

final int

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

final int

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

final String

A description of the picture.

final int

The height of the picture in pixels.

final String

The MIME type of the picture.

final byte[]

The encoded picture data.

final int

The type of the picture.

final int

The width of the picture in pixels.

Public constructors

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

Public methods

boolean
static PictureFrame

Parses a METADATA_BLOCK_PICTURE into a PictureFrame instance.

int
void

Updates the MediaMetadata.Builder with the type-specific values stored in this Entry.

String

Inherited methods

From androidx.media3.common.Metadata.Entry
@Nullable byte[]

Returns the bytes of the wrapped metadata in this Entry, or null if it doesn't contain wrapped metadata.

@Nullable Format

Returns the Format that can be used to decode the wrapped metadata in getWrappedMetadataBytes, or null if this Entry doesn't contain wrapped metadata.

Public fields

colors

public final int colors

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

depth

public final int depth

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

description

public final String description

A description of the picture.

height

public final int height

The height of the picture in pixels.

mimeType

public final String mimeType

The MIME type of the picture.

pictureData

public final byte[] pictureData

The encoded picture data.

pictureType

public final int pictureType

The type of the picture.

width

public final int width

The width of the picture in pixels.

Public constructors

PictureFrame

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

Public methods

equals

public boolean equals(@Nullable Object obj)

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
ParsableByteArray pictureBlock

The data of the METADATA_BLOCK_PICTURE, not including any headers.

Returns
PictureFrame

A PictureFrame parsed from pictureBlock.

hashCode

public int hashCode()

populateMediaMetadata

public void populateMediaMetadata(MediaMetadata.Builder builder)

Updates the MediaMetadata.Builder with the type-specific values stored in this Entry.

Parameters
MediaMetadata.Builder builder

The builder to be updated.

toString

public String toString()