BundledChunkExtractor


@UnstableApi
class BundledChunkExtractor : ExtractorOutput, ChunkExtractor


ChunkExtractor implementation that uses ExoPlayer app-bundled Extractors.

Summary

Public constructors

BundledChunkExtractor(
    extractor: Extractor!,
    @C.TrackType primaryTrackType: Int,
    primaryTrackManifestFormat: Format!
)

Creates an instance.

Public functions

Unit

Called when all tracks have been identified, meaning no new trackId values will be passed to track.

ChunkIndex?

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

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.

Unit
seekMap(seekMap: SeekMap!)

Called when a SeekMap has been extracted from the stream.

TrackOutput!
track(id: Int, type: Int)

Called by the Extractor to get the TrackOutput for a specific track.

Public properties

@MonotonicNonNull Array<Format!>!

Inherited Constants

From androidx.media3.extractor.ExtractorOutput
const ExtractorOutput!

Placeholder ExtractorOutput implementation throwing an in each method.

Constants

Public constructors

BundledChunkExtractor

BundledChunkExtractor(
    extractor: Extractor!,
    @C.TrackType primaryTrackType: Int,
    primaryTrackManifestFormat: Format!
)

Creates an instance.

Parameters
extractor: Extractor!

The extractor to wrap.

@C.TrackType primaryTrackType: Int

The type of the primary track.

primaryTrackManifestFormat: Format!

A manifest defined Format whose data should be merged into any sample Format output from the Extractor for the primary track.

Public functions

endTracks

fun endTracks(): Unit

Called when all tracks have been identified, meaning no new trackId values will be passed to track.

getChunkIndex

fun getChunkIndex(): ChunkIndex?

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

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.

seekMap

fun seekMap(seekMap: SeekMap!): Unit

Called when a SeekMap has been extracted from the stream.

Parameters
seekMap: SeekMap!

The extracted SeekMap.

track

fun track(id: Int, type: Int): TrackOutput!

Called by the Extractor to get the TrackOutput for a specific track.

The same TrackOutput is returned if multiple calls are made with the same id.

Parameters
id: Int

A track identifier.

type: Int

The track type.

Returns
TrackOutput!

The TrackOutput for the given track identifier.

Public properties

sampleFormats

val sampleFormats: @MonotonicNonNull Array<Format!>!