docs/doc/reference/com/google/android/exoplayer2/source/chunk/BaseMediaChunk.html
Package com.google.android.exoplayer2.source.chunk
All Implemented Interfaces:Loader.LoadableDirect Known Subclasses:ContainerMediaChunk, SingleSampleMediaChunk
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classBaseMediaChunkextends[MediaChunk](MediaChunk.html "class in com.google.android.exoplayer2.source.chunk")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
A base implementation of MediaChunk that outputs to a BaseMediaChunkOutput.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| long | clippedEndTimeUs |
Deprecated.
The time from which output will end, or C.TIME_UNSET if output will end at the end of the chunk.
|
| long | clippedStartTimeUs |
Deprecated.
The time from which output will begin, or C.TIME_UNSET if output will begin from the start of the chunk.
|
-
chunkIndex
-
dataSource, dataSpec, endTimeUs, loadTaskId, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, type
Constructors | Constructor | Description |
| --- | --- |
| BaseMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long startTimeUs, long endTimeUs, long clippedStartTimeUs, long clippedEndTimeUs, long chunkIndex) |
Deprecated.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| int | getFirstSampleIndex(int trackIndex) |
Deprecated.
Returns the index of the first sample in the specified track of the output that will originate from this chunk.
|
| protected BaseMediaChunkOutput | getOutput() |
Deprecated.
Returns the output most recently passed to init(BaseMediaChunkOutput).
|
| void | init(BaseMediaChunkOutput output) |
Deprecated.
Initializes the chunk for loading, setting the BaseMediaChunkOutput that will receive samples as they are loaded.
|
-
getNextChunkIndex, isLoadCompleted
-
bytesLoaded, getDurationUs, getResponseHeaders, getUri
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
cancelLoad, load
-
public final long clippedStartTimeUs
Deprecated.
The time from which output will begin, or C.TIME_UNSET if output will begin from the start of the chunk.
-
public final long clippedEndTimeUs
Deprecated.
The time from which output will end, or C.TIME_UNSET if output will end at the end of the chunk.
-
public BaseMediaChunk([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,[DataSpec](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,[Format](../../Format.html "class in com.google.android.exoplayer2")trackFormat,
@com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")trackSelectionData,
long startTimeUs,
long endTimeUs,
long clippedStartTimeUs,
long clippedEndTimeUs,
long chunkIndex)
Deprecated.
Parameters:dataSource - The source from which the data should be loaded.dataSpec - Defines the data to be loaded.trackFormat - See Chunk.trackFormat.trackSelectionReason - See Chunk.trackSelectionReason.trackSelectionData - See Chunk.trackSelectionData.startTimeUs - The start time of the media contained by the chunk, in microseconds.endTimeUs - The end time of the media contained by the chunk, in microseconds.clippedStartTimeUs - The time in the chunk from which output will begin, or C.TIME_UNSET to output from the start of the chunk.clippedEndTimeUs - The time in the chunk from which output will end, or C.TIME_UNSET to output to the end of the chunk.chunkIndex - The index of the chunk, or C.INDEX_UNSET if it is not known.
-
public void init([BaseMediaChunkOutput](BaseMediaChunkOutput.html "class in com.google.android.exoplayer2.source.chunk")output)
Deprecated.
Initializes the chunk for loading, setting the BaseMediaChunkOutput that will receive samples as they are loaded.
Parameters:output - The output that will receive the loaded media samples.
-
public final int getFirstSampleIndex(int trackIndex)
Deprecated.
Returns the index of the first sample in the specified track of the output that will originate from this chunk.
-
protected final[BaseMediaChunkOutput](BaseMediaChunkOutput.html "class in com.google.android.exoplayer2.source.chunk")getOutput()
Deprecated.
Returns the output most recently passed to init(BaseMediaChunkOutput).