BaseMediaChunk
@UnstableApi
public abstract class BaseMediaChunk extends MediaChunk
| java.lang.Object | |||
| ↳ | androidx.media3.exoplayer.source.chunk.Chunk | ||
| ↳ | androidx.media3.exoplayer.source.chunk.MediaChunk | ||
| ↳ | androidx.media3.exoplayer.source.chunk.BaseMediaChunk |
ContainerMediaChunk |
A |
SingleSampleMediaChunk |
This class is deprecated. The only use for this class is subtitle playback, but it is only compatible with legacy subtitle decoding, which is not supported by default. |
A base implementation of MediaChunk that outputs to a BaseMediaChunkOutput.
Summary
Public fields |
|
|---|---|
final long |
The time from which output will end, or |
final long |
The time from which output will begin, or |
Protected fields |
|
|---|---|
@MonotonicNonNull BaseMediaChunkOutput |
Public constructors |
|---|
BaseMediaChunk( |
Public methods |
|
|---|---|
final int |
getFirstSampleIndex(int trackIndex)Returns the index of the first sample in the specified track of the output that will originate from this chunk. |
void |
init(BaseMediaChunkOutput output)Initializes the chunk for loading, setting the |
Protected methods |
|
|---|---|
final BaseMediaChunkOutput |
Returns the output most recently passed to |
Inherited fields |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||
|
Inherited methods |
||||
|---|---|---|---|---|
|
||||
|
Public fields
clippedEndTimeUs
public final long clippedEndTimeUs
The time from which output will end, or TIME_UNSET if output will end at the end of the chunk.
clippedStartTimeUs
public final long clippedStartTimeUs
The time from which output will begin, or TIME_UNSET if output will begin from the start of the chunk.
Protected fields
Public constructors
BaseMediaChunk
public BaseMediaChunk(
DataSource dataSource,
DataSpec dataSpec,
Format trackFormat,
@C.SelectionReason int trackSelectionReason,
@Nullable Object trackSelectionData,
long startTimeUs,
long endTimeUs,
long clippedStartTimeUs,
long clippedEndTimeUs,
long chunkIndex
)
| Parameters | |
|---|---|
DataSource dataSource |
The source from which the data should be loaded. |
DataSpec dataSpec |
Defines the data to be loaded. |
Format trackFormat |
See |
@C.SelectionReason int trackSelectionReason |
See |
@Nullable Object trackSelectionData |
See |
long startTimeUs |
The start time of the media contained by the chunk, in microseconds. |
long endTimeUs |
The end time of the media contained by the chunk, in microseconds. |
long clippedStartTimeUs |
The time in the chunk from which output will begin, or |
long clippedEndTimeUs |
The time in the chunk from which output will end, or |
long chunkIndex |
The index of the chunk, or |
Public methods
getFirstSampleIndex
public final int getFirstSampleIndex(int trackIndex)
Returns the index of the first sample in the specified track of the output that will originate from this chunk.
init
public void init(BaseMediaChunkOutput output)
Initializes the chunk for loading, setting the BaseMediaChunkOutput that will receive samples as they are loaded.
| Parameters | |
|---|---|
BaseMediaChunkOutput output |
The output that will receive the loaded media samples. |
Protected methods
getOutput
protected final BaseMediaChunkOutput getOutput()
Returns the output most recently passed to init.