public final class ChunkExtractorWrapper extends java.lang.Object implements ExtractorOutput
Extractor wrapper for loading chunks that contain a single primary track, and possibly
additional embedded tracks.
The wrapper allows switching of the TrackOutputs that receive parsed data.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ChunkExtractorWrapper.TrackOutputProvider
Provides
TrackOutput instances to be written to by the wrapper. |
| Constructor and Description |
|---|
ChunkExtractorWrapper(Extractor extractor,
int primaryTrackType,
Format primaryTrackManifestFormat) |
| Modifier and Type | Method and Description |
|---|---|
void |
endTracks()
Called when all tracks have been identified, meaning no new
trackId values will be
passed to ExtractorOutput.track(int, int). |
Format[] |
getSampleFormats()
Returns the sample
Formats most recently output by the extractor, or null. |
SeekMap |
getSeekMap()
Returns the
SeekMap most recently output by the extractor, or null. |
void |
init(ChunkExtractorWrapper.TrackOutputProvider trackOutputProvider,
long startTimeUs,
long endTimeUs)
Initializes the wrapper to output to
TrackOutputs provided by the specified ChunkExtractorWrapper.TrackOutputProvider, and configures the extractor to receive data from a new chunk. |
void |
seekMap(SeekMap seekMap)
Called when a
SeekMap has been extracted from the stream. |
TrackOutput |
track(int id,
int type)
Called by the
Extractor to get the TrackOutput for a specific track. |
public final Extractor extractor
public SeekMap getSeekMap()
SeekMap most recently output by the extractor, or null.public Format[] getSampleFormats()
Formats most recently output by the extractor, or null.public void init(@Nullable
ChunkExtractorWrapper.TrackOutputProvider trackOutputProvider,
long startTimeUs,
long endTimeUs)
TrackOutputs provided by the specified ChunkExtractorWrapper.TrackOutputProvider, and configures the extractor to receive data from a new chunk.trackOutputProvider - The provider of TrackOutputs that will receive sample data.startTimeUs - The start position in the new chunk, or C.TIME_UNSET to output
samples from the start of the chunk.endTimeUs - The end position in the new chunk, or C.TIME_UNSET to output samples
to the end of the chunk.public TrackOutput track(int id, int type)
ExtractorOutputExtractor to get the TrackOutput for a specific track.
The same TrackOutput is returned if multiple calls are made with the same id.
track in interface ExtractorOutputid - A track identifier.type - The type of the track. Typically one of the C
TRACK_TYPE_* constants.TrackOutput for the given track identifier.public void endTracks()
ExtractorOutputtrackId values will be
passed to ExtractorOutput.track(int, int).endTracks in interface ExtractorOutputpublic void seekMap(SeekMap seekMap)
ExtractorOutputSeekMap has been extracted from the stream.seekMap in interface ExtractorOutputseekMap - The extracted SeekMap.