OutputConsumerAdapterV30


@RequiresApi(value = 30)
@UnstableApi
public final class OutputConsumerAdapterV30 implements MediaParser.OutputConsumer


MediaParser.OutputConsumer implementation that redirects output to an .

Summary

Public constructors

Equivalent to OutputConsumerAdapterV30(primaryTrackManifestFormat= null, primaryTrackType= C.TRACK_TYPE_NONE, expectDummySeekMap= false)

OutputConsumerAdapterV30(
    @Nullable Format primaryTrackManifestFormat,
    @C.TrackType int primaryTrackType,
    boolean expectDummySeekMap
)

Creates a new instance.

Public methods

void

Overrides future received SeekMaps with non-seekable instances.

@Nullable ChunkIndex

Returns the most recently output ChunkIndex, or null if none has been output.

@Nullable MediaParser.SeekMap

Returns a dummy MediaParser.SeekMap, or null if not available.

@Nullable Format[]

Returns the last output format for each track, or null if not all the tracks have been identified.

Pair<MediaParser.SeekPointMediaParser.SeekPoint>
getSeekPoints(long seekTimeUs)

Returns the MediaParser.SeekPoint instances corresponding to the given timestamp.

void
onSampleCompleted(
    int trackIndex,
    long timeUs,
    int flags,
    int size,
    int offset,
    @Nullable MediaCodec.CryptoInfo cryptoInfo
)
void
onSampleDataFound(int trackIndex, MediaParser.InputReader sampleData)
void
void
onTrackCountFound(int numberOfTracks)
void
onTrackDataFound(int trackIndex, MediaParser.TrackData trackData)
void

Sets the ExtractorOutput to which MediaParser's output is directed.

void
setMuxedCaptionFormats(List<Format> muxedCaptionFormats)

Sets Format information associated to the caption tracks multiplexed in the media.

void
setSampleTimestampUpperLimitFilterUs(
    long sampleTimestampUpperLimitFilterUs
)

Sets an upper limit for sample timestamp filtering.

void

Defines the container MIME type to propagate through format.

void

Sets a TimestampAdjuster for adjusting the timestamps of the output samples.

Public fields

dummySeekMap

public @Nullable MediaParser.SeekMap dummySeekMap

Public constructors

OutputConsumerAdapterV30

public OutputConsumerAdapterV30(
    @Nullable Format primaryTrackManifestFormat,
    @C.TrackType int primaryTrackType,
    boolean expectDummySeekMap
)

Creates a new instance.

Parameters
@Nullable Format primaryTrackManifestFormat

The manifest-obtained format of the primary track, or null if not applicable.

@C.TrackType int primaryTrackType

The type of the primary track. TRACK_TYPE_NONE if there is no primary track.

boolean expectDummySeekMap

Whether the output consumer should expect an initial dummy seek map which should be exposed through getDummySeekMap.

Public methods

disableSeeking

public void disableSeeking()

Overrides future received SeekMaps with non-seekable instances.

getChunkIndex

public @Nullable ChunkIndex getChunkIndex()

Returns the most recently output ChunkIndex, or null if none has been output.

getDummySeekMap

public @Nullable MediaParser.SeekMap getDummySeekMap()

Returns a dummy MediaParser.SeekMap, or null if not available.

the dummy MediaParser.SeekMap returns a single MediaParser.SeekPoint whose timeMicros matches the requested timestamp, and position is 0.

getSampleFormats

public @Nullable Format[] getSampleFormats()

Returns the last output format for each track, or null if not all the tracks have been identified.

getSeekPoints

public Pair<MediaParser.SeekPointMediaParser.SeekPointgetSeekPoints(long seekTimeUs)

Returns the MediaParser.SeekPoint instances corresponding to the given timestamp.

Parameters
long seekTimeUs

The timestamp in microseconds to retrieve MediaParser.SeekPoint instances for.

Returns
Pair<MediaParser.SeekPointMediaParser.SeekPoint>

The MediaParser.SeekPoint instances corresponding to the given timestamp.

onSampleCompleted

public void onSampleCompleted(
    int trackIndex,
    long timeUs,
    int flags,
    int size,
    int offset,
    @Nullable MediaCodec.CryptoInfo cryptoInfo
)

onSampleDataFound

public void onSampleDataFound(int trackIndex, MediaParser.InputReader sampleData)

onSeekMapFound

public void onSeekMapFound(MediaParser.SeekMap seekMap)

onTrackCountFound

public void onTrackCountFound(int numberOfTracks)

onTrackDataFound

public void onTrackDataFound(int trackIndex, MediaParser.TrackData trackData)

setExtractorOutput

public void setExtractorOutput(ExtractorOutput extractorOutput)

Sets the ExtractorOutput to which MediaParser's output is directed.

setMuxedCaptionFormats

public void setMuxedCaptionFormats(List<Format> muxedCaptionFormats)

Sets Format information associated to the caption tracks multiplexed in the media.

setSampleTimestampUpperLimitFilterUs

public void setSampleTimestampUpperLimitFilterUs(
    long sampleTimestampUpperLimitFilterUs
)

Sets an upper limit for sample timestamp filtering.

When set, samples with timestamps greater than sampleTimestampUpperLimitFilterUs will be discarded.

Parameters
long sampleTimestampUpperLimitFilterUs

The maximum allowed sample timestamp, or TIME_UNSET to remove filtering.

setSelectedParserName

public void setSelectedParserName(String parserName)

Defines the container MIME type to propagate through format.

Parameters
String parserName

The name of the selected parser.

setTimestampAdjuster

public void setTimestampAdjuster(TimestampAdjuster timestampAdjuster)

Sets a TimestampAdjuster for adjusting the timestamps of the output samples.