MediaParserUtil


@UnstableApi
public final class MediaParserUtil


Miscellaneous constants and utility methods related to the MediaParser integration.

For documentation on constants, please see the MediaParser documentation.

Summary

Constants

static final String
PARAMETER_EAGERLY_EXPOSE_TRACK_TYPE = "android.media.mediaparser.eagerlyExposeTrackType"
static final String
PARAMETER_EXPOSE_CAPTION_FORMATS = "android.media.mediaParser.exposeCaptionFormats"
static final String
PARAMETER_EXPOSE_CHUNK_INDEX_AS_MEDIA_FORMAT = "android.media.mediaParser.exposeChunkIndexAsMediaFormat"
static final String
PARAMETER_EXPOSE_DUMMY_SEEK_MAP = "android.media.mediaparser.exposeDummySeekMap"
static final String
PARAMETER_IGNORE_TIMESTAMP_OFFSET = "android.media.mediaparser.ignoreTimestampOffset"
static final String
PARAMETER_INCLUDE_SUPPLEMENTAL_DATA = "android.media.mediaparser.includeSupplementalData"
static final String
PARAMETER_IN_BAND_CRYPTO_INFO = "android.media.mediaparser.inBandCryptoInfo"
static final String
PARAMETER_OVERRIDE_IN_BAND_CAPTION_DECLARATIONS = "android.media.mediaParser.overrideInBandCaptionDeclarations"

Public methods

static void
@RequiresApi(value = 31)
setLogSessionIdOnMediaParser(
    MediaParser mediaParser,
    PlayerId playerId
)

Calls setLogSessionId.

static MediaFormat

Returns a MediaFormat with equivalent KEY_MIME and KEY_CAPTION_SERVICE_NUMBER to the given Format.

Constants

PARAMETER_EAGERLY_EXPOSE_TRACK_TYPE

public static final String PARAMETER_EAGERLY_EXPOSE_TRACK_TYPE = "android.media.mediaparser.eagerlyExposeTrackType"

PARAMETER_EXPOSE_CAPTION_FORMATS

public static final String PARAMETER_EXPOSE_CAPTION_FORMATS = "android.media.mediaParser.exposeCaptionFormats"

PARAMETER_EXPOSE_CHUNK_INDEX_AS_MEDIA_FORMAT

public static final String PARAMETER_EXPOSE_CHUNK_INDEX_AS_MEDIA_FORMAT = "android.media.mediaParser.exposeChunkIndexAsMediaFormat"

PARAMETER_EXPOSE_DUMMY_SEEK_MAP

public static final String PARAMETER_EXPOSE_DUMMY_SEEK_MAP = "android.media.mediaparser.exposeDummySeekMap"

PARAMETER_IGNORE_TIMESTAMP_OFFSET

public static final String PARAMETER_IGNORE_TIMESTAMP_OFFSET = "android.media.mediaparser.ignoreTimestampOffset"

PARAMETER_INCLUDE_SUPPLEMENTAL_DATA

public static final String PARAMETER_INCLUDE_SUPPLEMENTAL_DATA = "android.media.mediaparser.includeSupplementalData"

PARAMETER_IN_BAND_CRYPTO_INFO

public static final String PARAMETER_IN_BAND_CRYPTO_INFO = "android.media.mediaparser.inBandCryptoInfo"

PARAMETER_OVERRIDE_IN_BAND_CAPTION_DECLARATIONS

public static final String PARAMETER_OVERRIDE_IN_BAND_CAPTION_DECLARATIONS = "android.media.mediaParser.overrideInBandCaptionDeclarations"

Public methods

setLogSessionIdOnMediaParser

@RequiresApi(value = 31)
public static void setLogSessionIdOnMediaParser(
    MediaParser mediaParser,
    PlayerId playerId
)

Calls setLogSessionId.

Parameters
MediaParser mediaParser

The MediaParser to call the method on.

PlayerId playerId

The PlayerId to obtain the LogSessionId from.

toCaptionsMediaFormat

public static MediaFormat toCaptionsMediaFormat(Format format)

Returns a MediaFormat with equivalent KEY_MIME and KEY_CAPTION_SERVICE_NUMBER to the given Format.