ChunkExtractor
@UnstableApi
public interface ChunkExtractor
BundledChunkExtractor |
|
MediaParserChunkExtractor |
|
Extracts samples and track Formats from chunks.
The TrackOutputProvider passed to init provides the TrackOutputs that receive the extracted data.
Summary
Nested types |
|---|
public interface ChunkExtractor.FactoryCreates |
public interface ChunkExtractor.TrackOutputProviderProvides |
Public methods |
|
|---|---|
abstract @Nullable ChunkIndex |
Returns the |
abstract @Nullable Format[] |
Returns the sample |
abstract void |
init(Initializes the wrapper to output to |
abstract boolean |
read(ExtractorInput input)Reads from the given |
abstract void |
release()Releases any held resources. |
Public methods
getChunkIndex
abstract @Nullable ChunkIndex getChunkIndex()
Returns the ChunkIndex most recently obtained from the chunks, or null if a ChunkIndex has not been obtained.
getSampleFormats
abstract @Nullable Format[] getSampleFormats()
Returns the sample Formats for the tracks identified by the extractor, or null if the extractor has not finished identifying tracks.
init
abstract void init(
@Nullable ChunkExtractor.TrackOutputProvider trackOutputProvider,
long startTimeUs,
long endTimeUs
)
Initializes the wrapper to output to TrackOutputs provided by the specified TrackOutputProvider, and configures the extractor to receive data from a new chunk.
| Parameters | |
|---|---|
@Nullable ChunkExtractor.TrackOutputProvider trackOutputProvider |
The provider of |
long startTimeUs |
The start position in the new chunk, or |
long endTimeUs |
The end position in the new chunk, or |
read
abstract boolean read(ExtractorInput input)
Reads from the given ExtractorInput.
| Parameters | |
|---|---|
ExtractorInput input |
The input to read from. |
| Returns | |
|---|---|
boolean |
Whether there is any data left to extract. Returns false if the end of input has been reached. |
| Throws | |
|---|---|
java.io.IOException |
If an error occurred reading from or parsing the input. |