@UnstableApi
abstract class BaseMediaChunk : MediaChunk

Known direct subclasses
ContainerMediaChunk

A BaseMediaChunk that uses an Extractor to decode sample data.

SingleSampleMediaChunk

A BaseMediaChunk for chunks consisting of a single raw sample.


A base implementation of MediaChunk that outputs to a BaseMediaChunkOutput.

Summary

Public constructors

BaseMediaChunk(
    dataSource: DataSource!,
    dataSpec: DataSpec!,
    trackFormat: Format!,
    @C.SelectionReason trackSelectionReason: Int,
    trackSelectionData: Any?,
    startTimeUs: Long,
    endTimeUs: Long,
    clippedStartTimeUs: Long,
    clippedEndTimeUs: Long,
    chunkIndex: Long
)

Public functions

Int
getFirstSampleIndex(trackIndex: Int)

Returns the index of the first sample in the specified track of the output that will originate from this chunk.

Unit

Initializes the chunk for loading, setting the BaseMediaChunkOutput that will receive samples as they are loaded.

Public properties

Long

The time from which output will end, or TIME_UNSET if output will end at the end of the chunk.

Long

The time from which output will begin, or TIME_UNSET if output will begin from the start of the chunk.

Inherited functions

From androidx.media3.exoplayer.source.chunk.Chunk
Long

Returns the number of bytes that have been loaded.

Long

Returns the duration of the chunk in microseconds.

(Mutable)Map<String!, (Mutable)List<String!>!>!

Returns the response headers associated with the last open call.

Uri!

Returns the Uri associated with the last open call.

From androidx.media3.exoplayer.upstream.Loader.Loadable
abstract Unit

Cancels the load.

abstract Unit

Performs the load, returning on completion or cancellation.

From androidx.media3.exoplayer.source.chunk.MediaChunk
Long

Returns the next chunk index or INDEX_UNSET if it is not known.

abstract Boolean

Returns whether the chunk has been fully loaded.

Inherited properties

From androidx.media3.exoplayer.source.chunk.Chunk
StatsDataSource!
DataSpec!

The DataSpec that defines the data to be loaded.

Long

The end time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.

Long

Identifies the load task for this loadable.

Long

The start time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.

Format!

The format of the track to which this chunk belongs.

Any?

Optional data associated with the selection of the track to which this chunk belongs.

Int

One of the selection reasons if the chunk belongs to a track.

Int

The data type of the chunk.

From androidx.media3.exoplayer.source.chunk.MediaChunk
Long

The chunk index, or INDEX_UNSET if it is not known.

Public constructors

BaseMediaChunk

BaseMediaChunk(
    dataSource: DataSource!,
    dataSpec: DataSpec!,
    trackFormat: Format!,
    @C.SelectionReason trackSelectionReason: Int,
    trackSelectionData: Any?,
    startTimeUs: Long,
    endTimeUs: Long,
    clippedStartTimeUs: Long,
    clippedEndTimeUs: Long,
    chunkIndex: Long
)
Parameters
dataSource: DataSource!

The source from which the data should be loaded.

dataSpec: DataSpec!

Defines the data to be loaded.

trackFormat: Format!

See trackFormat.

@C.SelectionReason trackSelectionReason: Int

See trackSelectionReason.

trackSelectionData: Any?

See trackSelectionData.

startTimeUs: Long

The start time of the media contained by the chunk, in microseconds.

endTimeUs: Long

The end time of the media contained by the chunk, in microseconds.

clippedStartTimeUs: Long

The time in the chunk from which output will begin, or TIME_UNSET to output from the start of the chunk.

clippedEndTimeUs: Long

The time in the chunk from which output will end, or TIME_UNSET to output to the end of the chunk.

chunkIndex: Long

The index of the chunk, or INDEX_UNSET if it is not known.

Public functions

getFirstSampleIndex

fun getFirstSampleIndex(trackIndex: Int): Int

Returns the index of the first sample in the specified track of the output that will originate from this chunk.

init

fun init(output: BaseMediaChunkOutput!): Unit

Initializes the chunk for loading, setting the BaseMediaChunkOutput that will receive samples as they are loaded.

Parameters
output: BaseMediaChunkOutput!

The output that will receive the loaded media samples.

Public properties

clippedEndTimeUs

val clippedEndTimeUsLong

The time from which output will end, or TIME_UNSET if output will end at the end of the chunk.

clippedStartTimeUs

val clippedStartTimeUsLong

The time from which output will begin, or TIME_UNSET if output will begin from the start of the chunk.

Protected properties