Class ContainerMediaChunk
- 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.ContainerMediaChunk
-
- All Implemented Interfaces:
Loader.Loadable
@Deprecated public class ContainerMediaChunk 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.ABaseMediaChunkthat uses anExtractorto decode sample data.
-
-
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 ContainerMediaChunk(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, int chunkCount, long sampleOffsetUs, ChunkExtractor chunkExtractor)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcancelLoad()Deprecated.Cancels the load.longgetNextChunkIndex()Deprecated.Returns the next chunk index orC.INDEX_UNSETif it is not known.protected ChunkExtractor.TrackOutputProvidergetTrackOutputProvider(BaseMediaChunkOutput baseMediaChunkOutput)Deprecated.Returns theChunkExtractor.TrackOutputProviderto be used by the wrapped extractor.booleanisLoadCompleted()Deprecated.Returns whether the chunk has been fully loaded.voidload()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.Chunk
bytesLoaded, getDurationUs, getResponseHeaders, getUri
-
-
-
-
Constructor Detail
-
ContainerMediaChunk
public ContainerMediaChunk(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, int chunkCount, long sampleOffsetUs, ChunkExtractor chunkExtractor)
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_UNSETto output from the start of the chunk.clippedEndTimeUs- The time in the chunk from which output will end, orC.TIME_UNSETto output to the end of the chunk.chunkIndex- The index of the chunk, orC.INDEX_UNSETif it is not known.chunkCount- The number of chunks in the underlying media that are spanned by this instance. Normally equal to one, but may be larger if multiple chunks as defined by the underlying media are being merged into a single load.sampleOffsetUs- An offset to add to the sample timestamps parsed by the extractor.chunkExtractor- A wrapped extractor to use for parsing the data.
-
-
Method Detail
-
getNextChunkIndex
public long getNextChunkIndex()
Deprecated.Description copied from class:MediaChunkReturns the next chunk index orC.INDEX_UNSETif it is not known.- Overrides:
getNextChunkIndexin classMediaChunk
-
isLoadCompleted
public boolean isLoadCompleted()
Deprecated.Description copied from class:MediaChunkReturns whether the chunk has been fully loaded.- Specified by:
isLoadCompletedin classMediaChunk
-
cancelLoad
public final void cancelLoad()
Deprecated.Description copied from interface:Loader.LoadableCancels 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 final void load() throws IOExceptionDeprecated.Description copied from interface:Loader.LoadablePerforms the load, returning on completion or cancellation.- Throws:
IOException- If the input could not be loaded.
-
getTrackOutputProvider
protected ChunkExtractor.TrackOutputProvider getTrackOutputProvider(BaseMediaChunkOutput baseMediaChunkOutput)
Deprecated.Returns theChunkExtractor.TrackOutputProviderto be used by the wrapped extractor.- Parameters:
baseMediaChunkOutput- TheBaseMediaChunkOutputmost recently passed toBaseMediaChunk.init(BaseMediaChunkOutput).- Returns:
- A
ChunkExtractor.TrackOutputProviderto be used by the wrapped extractor.
-
-