Class SingleSampleMediaChunk
- java.lang.Object
-
- com.google.android.exoplayer2.source.chunk.Chunk
-
- com.google.android.exoplayer2.source.chunk.MediaChunk
-
- com.google.android.exoplayer2.source.chunk.BaseMediaChunk
-
- com.google.android.exoplayer2.source.chunk.SingleSampleMediaChunk
-
- All Implemented Interfaces:
Loader.Loadable
@Deprecated public final class SingleSampleMediaChunk extends BaseMediaChunk
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.ABaseMediaChunk
for chunks consisting of a single raw sample.
-
-
Field Summary
-
Fields inherited from class com.google.android.exoplayer2.source.chunk.BaseMediaChunk
clippedEndTimeUs, clippedStartTimeUs
-
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 SingleSampleMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long startTimeUs, long endTimeUs, long chunkIndex, @com.google.android.exoplayer2.C.TrackType int trackType, Format sampleFormat)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
cancelLoad()
Deprecated.Cancels the load.boolean
isLoadCompleted()
Deprecated.Returns whether the chunk has been fully loaded.void
load()
Deprecated.Performs the load, returning on completion or cancellation.-
Methods inherited from class com.google.android.exoplayer2.source.chunk.BaseMediaChunk
getFirstSampleIndex, getOutput, init
-
Methods inherited from class com.google.android.exoplayer2.source.chunk.MediaChunk
getNextChunkIndex
-
Methods inherited from class com.google.android.exoplayer2.source.chunk.Chunk
bytesLoaded, getDurationUs, getResponseHeaders, getUri
-
-
-
-
Constructor Detail
-
SingleSampleMediaChunk
public SingleSampleMediaChunk(DataSource dataSource, DataSpec dataSpec, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long startTimeUs, long endTimeUs, long chunkIndex, @com.google.android.exoplayer2.C.TrackType int trackType, Format sampleFormat)
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.chunkIndex
- The index of the chunk, orC.INDEX_UNSET
if it is not known.trackType
- Thetrack type
of the chunk.sampleFormat
- TheFormat
of the sample in the chunk.
-
-
Method Detail
-
isLoadCompleted
public boolean isLoadCompleted()
Deprecated.Description copied from class:MediaChunk
Returns whether the chunk has been fully loaded.- Specified by:
isLoadCompleted
in classMediaChunk
-
cancelLoad
public void cancelLoad()
Deprecated.Description copied from interface:Loader.Loadable
Cancels the load.Loadable implementations should ensure that a currently executing
Loader.Loadable.load()
call will exit reasonably quickly after this method is called. TheLoader.Loadable.load()
call may exit either by returning or by throwing anIOException
.If there is a currently executing
Loader.Loadable.load()
call, then the thread on which that call is being made will be interrupted immediately after the call to this method. Hence implementations do not need to (and should not attempt to) interrupt the loading thread themselves.Although the loading thread will be interrupted, Loadable implementations should not use the interrupted status of the loading thread in
Loader.Loadable.load()
to determine whether the load has been canceled. This approach is not robust [Internal ref: b/79223737]. Instead, implementations should use their own flag to signal cancelation (for example, usingAtomicBoolean
).
-
load
public void load() throws IOException
Deprecated.Description copied from interface:Loader.Loadable
Performs the load, returning on completion or cancellation.- Throws:
IOException
- If the input could not be loaded.
-
-