@UnstableApi
interface ChunkExtractor

Known direct subclasses
BundledChunkExtractor

ChunkExtractor implementation that uses ExoPlayer app-bundled Extractors.

MediaParserChunkExtractor

ChunkExtractor implemented on top of the platform's MediaParser.


Extracts samples and track Formats from chunks.

The TrackOutputProvider passed to init provides the TrackOutputs that receive the extracted data.

Summary

Nested types

Creates ChunkExtractor instances.

Provides TrackOutput instances to be written to during extraction.

Public functions

ChunkIndex?

Returns the ChunkIndex most recently obtained from the chunks, or null if a has not been obtained.

Array<Format!>?

Returns the sample Formats for the tracks identified by the extractor, or null if the extractor has not finished identifying tracks.

Unit
init(
    trackOutputProvider: ChunkExtractor.TrackOutputProvider?,
    startTimeUs: Long,
    endTimeUs: Long
)

Initializes the wrapper to output to TrackOutputs provided by the specified , and configures the extractor to receive data from a new chunk.

Boolean

Reads from the given ExtractorInput.

Unit

Releases any held resources.

Public functions

getChunkIndex

fun getChunkIndex(): ChunkIndex?

Returns the ChunkIndex most recently obtained from the chunks, or null if a has not been obtained.

getSampleFormats

fun getSampleFormats(): Array<Format!>?

Returns the sample Formats for the tracks identified by the extractor, or null if the extractor has not finished identifying tracks.

init

fun init(
    trackOutputProvider: ChunkExtractor.TrackOutputProvider?,
    startTimeUs: Long,
    endTimeUs: Long
): Unit

Initializes the wrapper to output to TrackOutputs provided by the specified , and configures the extractor to receive data from a new chunk.

Parameters
trackOutputProvider: ChunkExtractor.TrackOutputProvider?

The provider of TrackOutputs that will receive sample data.

startTimeUs: Long

The start position in the new chunk, or TIME_UNSET to output samples from the start of the chunk.

endTimeUs: Long

The end position in the new chunk, or TIME_UNSET to output samples to the end of the chunk.

read

fun read(input: ExtractorInput!): Boolean

Reads from the given ExtractorInput.

Parameters
input: ExtractorInput!

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.

release

fun release(): Unit

Releases any held resources.