Class Chunk
- java.lang.Object
-
- com.google.android.exoplayer2.source.chunk.Chunk
-
- All Implemented Interfaces:
Loader.Loadable
- Direct Known Subclasses:
DataChunk
,InitializationChunk
,MediaChunk
@Deprecated public abstract class Chunk extends Object implements Loader.Loadable
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.An abstract base class forLoader.Loadable
implementations that load chunks of data required for the playback of streams.
-
-
Field Summary
Fields Modifier and Type Field Description protected StatsDataSource
dataSource
Deprecated.DataSpec
dataSpec
Deprecated.TheDataSpec
that defines the data to be loaded.long
endTimeUs
Deprecated.The end time of the media contained by the chunk, orC.TIME_UNSET
if the data being loaded does not contain media samples.long
loadTaskId
Deprecated.Identifies the load task for this loadable.long
startTimeUs
Deprecated.The start time of the media contained by the chunk, orC.TIME_UNSET
if the data being loaded does not contain media samples.Format
trackFormat
Deprecated.The format of the track to which this chunk belongs.Object
trackSelectionData
Deprecated.Optional data associated with the selection of the track to which this chunk belongs.@com.google.android.exoplayer2.C.SelectionReason int
trackSelectionReason
Deprecated.One of theselection reasons
if the chunk belongs to a track.@com.google.android.exoplayer2.C.DataType int
type
Deprecated.Thedata type
of the chunk.
-
Constructor Summary
Constructors Constructor Description Chunk(DataSource dataSource, DataSpec dataSpec, @com.google.android.exoplayer2.C.DataType int type, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, Object trackSelectionData, long startTimeUs, long endTimeUs)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
bytesLoaded()
Deprecated.Returns the number of bytes that have been loaded.long
getDurationUs()
Deprecated.Returns the duration of the chunk in microseconds.Map<String,List<String>>
getResponseHeaders()
Deprecated.Returns the response headers associated with the lastDataSource.open(com.google.android.exoplayer2.upstream.DataSpec)
call.Uri
getUri()
Deprecated.Returns theUri
associated with the lastDataSource.open(com.google.android.exoplayer2.upstream.DataSpec)
call.-
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
-
loadTaskId
public final long loadTaskId
Deprecated.Identifies the load task for this loadable.
-
dataSpec
public final DataSpec dataSpec
Deprecated.TheDataSpec
that defines the data to be loaded.
-
type
public final @com.google.android.exoplayer2.C.DataType int type
Deprecated.Thedata type
of the chunk. For reporting only.
-
trackFormat
public final Format trackFormat
Deprecated.The format of the track to which this chunk belongs.
-
trackSelectionReason
public final @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason
Deprecated.One of theselection reasons
if the chunk belongs to a track.C.SELECTION_REASON_UNKNOWN
if the chunk does not belong to a track, or if the selection reason is unknown.
-
trackSelectionData
@Nullable public final Object trackSelectionData
Deprecated.Optional data associated with the selection of the track to which this chunk belongs. Null if the chunk does not belong to a track, or if there is no associated track selection data.
-
startTimeUs
public final long startTimeUs
Deprecated.The start time of the media contained by the chunk, orC.TIME_UNSET
if the data being loaded does not contain media samples.
-
endTimeUs
public final long endTimeUs
Deprecated.The end time of the media contained by the chunk, orC.TIME_UNSET
if the data being loaded does not contain media samples.
-
dataSource
protected final StatsDataSource dataSource
Deprecated.
-
-
Constructor Detail
-
Chunk
public Chunk(DataSource dataSource, DataSpec dataSpec, @com.google.android.exoplayer2.C.DataType int type, Format trackFormat, @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason, @Nullable Object trackSelectionData, long startTimeUs, long endTimeUs)
Deprecated.- Parameters:
dataSource
- The source from which the data should be loaded.dataSpec
- Defines the data to be loaded.type
- Seetype
.trackFormat
- SeetrackFormat
.trackSelectionReason
- SeetrackSelectionReason
.trackSelectionData
- SeetrackSelectionData
.startTimeUs
- SeestartTimeUs
.endTimeUs
- SeeendTimeUs
.
-
-
Method Detail
-
getDurationUs
public final long getDurationUs()
Deprecated.Returns the duration of the chunk in microseconds.
-
bytesLoaded
public final long bytesLoaded()
Deprecated.Returns the number of bytes that have been loaded. Must only be called after the load completed, failed, or was canceled.
-
getUri
public final Uri getUri()
Deprecated.Returns theUri
associated with the lastDataSource.open(com.google.android.exoplayer2.upstream.DataSpec)
call. If redirection occurred, this is the redirected uri. Must only be called after the load completed, failed, or was canceled.- See Also:
DataSource.getUri()
-
getResponseHeaders
public final Map<String,List<String>> getResponseHeaders()
Deprecated.Returns the response headers associated with the lastDataSource.open(com.google.android.exoplayer2.upstream.DataSpec)
call. Must only be called after the load completed, failed, or was canceled.- See Also:
DataSource.getResponseHeaders()
-
-