MediaParserChunkExtractor


@RequiresApi(value = 30)
@UnstableApi
class MediaParserChunkExtractor : ChunkExtractor


ChunkExtractor implemented on top of the platform's MediaParser.

Summary

Constants

const ChunkExtractor.Factory!

Public constructors

MediaParserChunkExtractor(
    @C.TrackType primaryTrackType: Int,
    manifestFormat: Format!,
    closedCaptionFormats: (Mutable)List<Format!>!,
    playerId: PlayerId!
)

Creates a new instance.

Public functions

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.

Public properties

Array<Format!>?

Constants

FACTORY

const val FACTORYChunkExtractor.Factory!

Public constructors

MediaParserChunkExtractor

MediaParserChunkExtractor(
    @C.TrackType primaryTrackType: Int,
    manifestFormat: Format!,
    closedCaptionFormats: (Mutable)List<Format!>!,
    playerId: PlayerId!
)

Creates a new instance.

Parameters
@C.TrackType primaryTrackType: Int

The type of the primary track. TRACK_TYPE_NONE if there is no primary track.

manifestFormat: Format!

The chunks Format as obtained from the manifest.

closedCaptionFormats: (Mutable)List<Format!>!

A list containing the Formats of the closed-caption tracks in the chunks.

playerId: PlayerId!

The PlayerId of the player this chunk extractor is used for.

Public functions

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.

Public properties

sampleFormats

val sampleFormatsArray<Format!>?