ExtractorOutput
, ChunkExtractor
public final class BundledChunkExtractor extends Object implements ExtractorOutput, ChunkExtractor
ChunkExtractor
implementation that uses ExoPlayer app-bundled Extractors
.ChunkExtractor.TrackOutputProvider
PLACEHOLDER
Constructor | Description |
---|---|
BundledChunkExtractor(Extractor extractor,
int primaryTrackType,
Format primaryTrackManifestFormat) |
Creates an instance.
|
Modifier and Type | Method | Description |
---|---|---|
void |
endTracks() |
Called when all tracks have been identified, meaning no new
trackId values will be
passed to ExtractorOutput.track(int, int) . |
ChunkIndex |
getChunkIndex() |
Returns the
ChunkIndex most recently obtained from the chunks, or null if a ChunkIndex has not been obtained. |
Format[] |
getSampleFormats() |
Returns the sample
Format s for the tracks identified by the extractor, or null if the
extractor has not finished identifying tracks. |
void |
init(ChunkExtractor.TrackOutputProvider trackOutputProvider,
long startTimeUs,
long endTimeUs) |
Initializes the wrapper to output to
TrackOutput s provided by the specified ChunkExtractor.TrackOutputProvider , and configures the extractor to receive data from a new chunk. |
boolean |
read(ExtractorInput input) |
Reads from the given
ExtractorInput . |
void |
release() |
Releases any held resources.
|
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. |
@Nullable public ChunkIndex getChunkIndex()
ChunkExtractor
ChunkIndex
most recently obtained from the chunks, or null if a ChunkIndex
has not been obtained.getChunkIndex
in interface ChunkExtractor
@Nullable public Format[] getSampleFormats()
ChunkExtractor
Format
s for the tracks identified by the extractor, or null if the
extractor has not finished identifying tracks.getSampleFormats
in interface ChunkExtractor
public void init(@Nullable ChunkExtractor.TrackOutputProvider trackOutputProvider, long startTimeUs, long endTimeUs)
ChunkExtractor
TrackOutput
s provided by the specified ChunkExtractor.TrackOutputProvider
, and configures the extractor to receive data from a new chunk.init
in interface ChunkExtractor
trackOutputProvider
- The provider of TrackOutput
s 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 void release()
ChunkExtractor
release
in interface ChunkExtractor
public boolean read(ExtractorInput input) throws IOException
ChunkExtractor
ExtractorInput
.read
in interface ChunkExtractor
input
- The input to read from.IOException
- If an error occurred reading from or parsing the input.public TrackOutput track(int id, int type)
ExtractorOutput
Extractor
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 ExtractorOutput
id
- 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()
ExtractorOutput
trackId
values will be
passed to ExtractorOutput.track(int, int)
.endTracks
in interface ExtractorOutput
public void seekMap(SeekMap seekMap)
ExtractorOutput
SeekMap
has been extracted from the stream.seekMap
in interface ExtractorOutput
seekMap
- The extracted SeekMap
.