Class BaseMediaChunk
- java.lang.Object
-
- com.google.android.exoplayer2.source.chunk.Chunk
-
- com.google.android.exoplayer2.source.chunk.MediaChunk
-
- com.google.android.exoplayer2.source.chunk.BaseMediaChunk
-
- All Implemented Interfaces:
Loader.Loadable
- Direct Known Subclasses:
ContainerMediaChunk
,SingleSampleMediaChunk
@Deprecated public abstract class BaseMediaChunk extends MediaChunk
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 ofMediaChunk
that outputs to aBaseMediaChunkOutput
.
-
-
Field Summary
Fields Modifier and Type Field Description long
clippedEndTimeUs
Deprecated.The time from which output will end, orC.TIME_UNSET
if output will end at the end of the chunk.long
clippedStartTimeUs
Deprecated.The time from which output will begin, orC.TIME_UNSET
if output will begin from the start of the chunk.-
Fields inherited from class com.google.android.exoplayer2.source.chunk.MediaChunk
chunkIndex
-
Fields inherited from class com.google.android.exoplayer2.source.chunk.Chunk
dataSource, dataSpec, endTimeUs, loadTaskId, startTimeUs, trackFormat, trackSelectionData, trackSelectionReason, type
-
-
Constructor Summary
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.
-
Method Summary
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 toinit(BaseMediaChunkOutput)
.void
init(BaseMediaChunkOutput output)
Deprecated.Initializes the chunk for loading, setting theBaseMediaChunkOutput
that will receive samples as they are loaded.-
Methods inherited from class com.google.android.exoplayer2.source.chunk.MediaChunk
getNextChunkIndex, isLoadCompleted
-
Methods inherited from class com.google.android.exoplayer2.source.chunk.Chunk
bytesLoaded, getDurationUs, getResponseHeaders, getUri
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.upstream.Loader.Loadable
cancelLoad, load
-
-
-
-
Field Detail
-
clippedStartTimeUs
public final long clippedStartTimeUs
Deprecated.The time from which output will begin, orC.TIME_UNSET
if output will begin from the start of the chunk.
-
clippedEndTimeUs
public final long clippedEndTimeUs
Deprecated.The time from which output will end, orC.TIME_UNSET
if output will end at the end of the chunk.
-
-
Constructor Detail
-
BaseMediaChunk
public BaseMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object 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
- SeeChunk.trackFormat
.trackSelectionReason
- SeeChunk.trackSelectionReason
.trackSelectionData
- SeeChunk.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, orC.TIME_UNSET
to output from the start of the chunk.clippedEndTimeUs
- The time in the chunk from which output will end, orC.TIME_UNSET
to output to the end of the chunk.chunkIndex
- The index of the chunk, orC.INDEX_UNSET
if it is not known.
-
-
Method Detail
-
init
public void init(BaseMediaChunkOutput output)
Deprecated.Initializes the chunk for loading, setting theBaseMediaChunkOutput
that will receive samples as they are loaded.- Parameters:
output
- The output that will receive the loaded media samples.
-
getFirstSampleIndex
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.
-
getOutput
protected final BaseMediaChunkOutput getOutput()
Deprecated.Returns the output most recently passed toinit(BaseMediaChunkOutput)
.
-
-