Class OutputConsumerAdapterV30
- java.lang.Object
-
- com.google.android.exoplayer2.source.mediaparser.OutputConsumerAdapterV30
-
- All Implemented Interfaces:
MediaParser.OutputConsumer
@RequiresApi(30) public final class OutputConsumerAdapterV30 extends Object implements MediaParser.OutputConsumer
MediaParser.OutputConsumerimplementation that redirects output to anExtractorOutput.
-
-
Constructor Summary
Constructors Constructor Description OutputConsumerAdapterV30()OutputConsumerAdapterV30(Format primaryTrackManifestFormat, @com.google.android.exoplayer2.C.TrackType int primaryTrackType, boolean expectDummySeekMap)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddisableSeeking()Overrides future receivedSeekMapswith non-seekable instances.ChunkIndexgetChunkIndex()Returns the most recently outputChunkIndex, or null if none has been output.MediaParser.SeekMapgetDummySeekMap()Returns a dummyMediaParser.SeekMap, or null if not available.Format[]getSampleFormats()Returns the last output format for each track, or null if not all the tracks have been identified.Pair<MediaParser.SeekPoint,MediaParser.SeekPoint>getSeekPoints(long seekTimeUs)Returns theMediaParser.SeekPointinstances corresponding to the given timestamp.voidonSampleCompleted(int trackIndex, long timeUs, int flags, int size, int offset, MediaCodec.CryptoInfo cryptoInfo)voidonSampleDataFound(int trackIndex, MediaParser.InputReader sampleData)voidonSeekMapFound(MediaParser.SeekMap seekMap)voidonTrackCountFound(int numberOfTracks)voidonTrackDataFound(int trackIndex, MediaParser.TrackData trackData)voidsetExtractorOutput(ExtractorOutput extractorOutput)Sets theExtractorOutputto whichMediaParser'soutput is directed.voidsetMuxedCaptionFormats(List<Format> muxedCaptionFormats)SetsFormatinformation associated to the caption tracks multiplexed in the media.voidsetSampleTimestampUpperLimitFilterUs(long sampleTimestampUpperLimitFilterUs)Sets an upper limit for sample timestamp filtering.voidsetSelectedParserName(String parserName)Defines the container mime type to propagate throughTrackOutput.format(com.google.android.exoplayer2.Format).voidsetTimestampAdjuster(TimestampAdjuster timestampAdjuster)Sets aTimestampAdjusterfor adjusting the timestamps of the output samples.
-
-
-
Constructor Detail
-
OutputConsumerAdapterV30
public OutputConsumerAdapterV30()
-
OutputConsumerAdapterV30
public OutputConsumerAdapterV30(@Nullable Format primaryTrackManifestFormat, @com.google.android.exoplayer2.C.TrackType int primaryTrackType, boolean expectDummySeekMap)Creates a new instance.- Parameters:
primaryTrackManifestFormat- The manifest-obtained format of the primary track, or null if not applicable.primaryTrackType- Thetypeof the primary track.C.TRACK_TYPE_NONEif there is no primary track.expectDummySeekMap- Whether the output consumer should expect an initial dummy seek map which should be exposed throughgetDummySeekMap().
-
-
Method Detail
-
setSampleTimestampUpperLimitFilterUs
public void setSampleTimestampUpperLimitFilterUs(long sampleTimestampUpperLimitFilterUs)
Sets an upper limit for sample timestamp filtering.When set, samples with timestamps greater than
sampleTimestampUpperLimitFilterUswill be discarded.- Parameters:
sampleTimestampUpperLimitFilterUs- The maximum allowed sample timestamp, orC.TIME_UNSETto remove filtering.
-
setTimestampAdjuster
public void setTimestampAdjuster(TimestampAdjuster timestampAdjuster)
Sets aTimestampAdjusterfor adjusting the timestamps of the output samples.
-
setExtractorOutput
public void setExtractorOutput(ExtractorOutput extractorOutput)
Sets theExtractorOutputto whichMediaParser'soutput is directed.
-
setMuxedCaptionFormats
public void setMuxedCaptionFormats(List<Format> muxedCaptionFormats)
SetsFormatinformation associated to the caption tracks multiplexed in the media.
-
disableSeeking
public void disableSeeking()
Overrides future receivedSeekMapswith non-seekable instances.
-
getDummySeekMap
@Nullable public MediaParser.SeekMap getDummySeekMap()
Returns a dummyMediaParser.SeekMap, or null if not available.the dummy
MediaParser.SeekMapreturns a singleMediaParser.SeekPointwhoseMediaParser.SeekPoint.timeMicrosmatches the requested timestamp, andMediaParser.SeekPoint.positionis 0.
-
getChunkIndex
@Nullable public ChunkIndex getChunkIndex()
Returns the most recently outputChunkIndex, or null if none has been output.
-
getSeekPoints
public Pair<MediaParser.SeekPoint,MediaParser.SeekPoint> getSeekPoints(long seekTimeUs)
Returns theMediaParser.SeekPointinstances corresponding to the given timestamp.- Parameters:
seekTimeUs- The timestamp in microseconds to retrieveMediaParser.SeekPointinstances for.- Returns:
- The
MediaParser.SeekPointinstances corresponding to the given timestamp.
-
setSelectedParserName
public void setSelectedParserName(String parserName)
Defines the container mime type to propagate throughTrackOutput.format(com.google.android.exoplayer2.Format).- Parameters:
parserName- The name of the selected parser.
-
getSampleFormats
@Nullable public Format[] getSampleFormats()
Returns the last output format for each track, or null if not all the tracks have been identified.
-
onTrackCountFound
public void onTrackCountFound(int numberOfTracks)
- Specified by:
onTrackCountFoundin interfaceMediaParser.OutputConsumer
-
onSeekMapFound
public void onSeekMapFound(MediaParser.SeekMap seekMap)
- Specified by:
onSeekMapFoundin interfaceMediaParser.OutputConsumer
-
onTrackDataFound
public void onTrackDataFound(int trackIndex, MediaParser.TrackData trackData)- Specified by:
onTrackDataFoundin interfaceMediaParser.OutputConsumer
-
onSampleDataFound
public void onSampleDataFound(int trackIndex, MediaParser.InputReader sampleData) throws IOException- Specified by:
onSampleDataFoundin interfaceMediaParser.OutputConsumer- Throws:
IOException
-
onSampleCompleted
public void onSampleCompleted(int trackIndex, long timeUs, int flags, int size, int offset, @Nullable MediaCodec.CryptoInfo cryptoInfo)- Specified by:
onSampleCompletedin interfaceMediaParser.OutputConsumer
-
-