@UnstableApi
public 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

public interface ChunkExtractor.Factory

Creates ChunkExtractor instances.

Provides TrackOutput instances to be written to during extraction.

Public methods

abstract @Nullable ChunkIndex

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

abstract @Nullable Format[]

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

abstract void
init(
    @Nullable ChunkExtractor.TrackOutputProvider trackOutputProvider,
    long startTimeUs,
    long endTimeUs
)

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

abstract boolean

Reads from the given ExtractorInput.

abstract void

Releases any held resources.

Public methods

getChunkIndex

abstract @Nullable ChunkIndex getChunkIndex()

Returns the ChunkIndex most recently obtained from the chunks, or null if a 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 , and configures the extractor to receive data from a new chunk.

Parameters
@Nullable ChunkExtractor.TrackOutputProvider trackOutputProvider

The provider of TrackOutputs that will receive sample data.

long startTimeUs

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

long endTimeUs

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

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.

release

abstract void release()

Releases any held resources.