Chunk
@UnstableApi
public abstract class Chunk implements Loader.Loadable
DataChunk |
A base class for |
InitializationChunk |
A |
MediaChunk |
An abstract base class for |
BaseMediaChunk |
A base implementation of |
ContainerMediaChunk |
A |
FakeMediaChunk |
Fake |
SingleSampleMediaChunk |
This class is deprecated. The only use for this class is subtitle playback, but it is only compatible with legacy subtitle decoding, which is not supported by default. |
An abstract base class for Loadable implementations that load chunks of data required for the playback of streams.
Summary
Public fields |
|
|---|---|
final DataSpec |
The |
final long |
The end time of the media contained by the chunk, or |
final long |
Identifies the load task for this loadable. |
final long |
The start time of the media contained by the chunk, or |
final Format |
The format of the track to which this chunk belongs. |
final @Nullable Object |
Optional data associated with the selection of the track to which this chunk belongs. |
final int |
One of the |
final int |
The |
Protected fields |
|
|---|---|
final StatsDataSource |
Public constructors |
|---|
Chunk( |
Public methods |
|
|---|---|
final long |
Returns the number of bytes that have been loaded. |
final long |
Returns the duration of the chunk in microseconds. |
final Map<String, List<String>> |
Returns the response headers associated with the last |
final Uri |
getUri() |
Inherited methods |
||||
|---|---|---|---|---|
|
Public fields
endTimeUs
public final long endTimeUs
The end time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.
startTimeUs
public final long startTimeUs
The start time of the media contained by the chunk, or TIME_UNSET if the data being loaded does not contain media samples.
trackSelectionData
public final @Nullable Object trackSelectionData
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.
trackSelectionReason
@C.SelectionReason
public final int trackSelectionReason
One of the selection reasons if the chunk belongs to a track. SELECTION_REASON_UNKNOWN if the chunk does not belong to a track, or if the selection reason is unknown.
Protected fields
Public constructors
Chunk
public Chunk(
DataSource dataSource,
DataSpec dataSpec,
@C.DataType int type,
Format trackFormat,
@C.SelectionReason int trackSelectionReason,
@Nullable Object trackSelectionData,
long startTimeUs,
long endTimeUs
)
| Parameters | |
|---|---|
DataSource dataSource |
The source from which the data should be loaded. |
DataSpec dataSpec |
Defines the data to be loaded. |
@C.DataType int type |
See |
Format trackFormat |
See |
@C.SelectionReason int trackSelectionReason |
See |
@Nullable Object trackSelectionData |
See |
long startTimeUs |
See |
long endTimeUs |
See |
Public methods
bytesLoaded
public final long bytesLoaded()
Returns the number of bytes that have been loaded. Must only be called after the load completed, failed, or was canceled.
getResponseHeaders
public final Map<String, List<String>> getResponseHeaders()
Returns the response headers associated with the last open call. Must only be called after the load completed, failed, or was canceled.
| See also | |
|---|---|
getResponseHeaders |