public abstract class Chunk extends Object implements Loader.Loadable
Loader.Loadable
implementations that load chunks of data required
for the playback of streams.Modifier and Type | Field and Description |
---|---|
protected DataSource |
dataSource |
DataSpec |
dataSpec
The
DataSpec that defines the data to be loaded. |
long |
endTimeUs
The end time of the media contained by the chunk, or
C.TIME_UNSET if the data being
loaded does not contain media samples. |
long |
startTimeUs
The start time of the media contained by the chunk, or
C.TIME_UNSET if the data
being loaded does not contain media samples. |
Format |
trackFormat
The format of the track to which this chunk belongs, or null if the chunk does not belong to
a track.
|
Object |
trackSelectionData
Optional data associated with the selection of the track to which this chunk belongs.
|
int |
trackSelectionReason
One of the
C SELECTION_REASON_* constants if the chunk belongs to a track. |
int |
type
The type of the chunk.
|
Constructor and Description |
---|
Chunk(DataSource dataSource,
DataSpec dataSpec,
int type,
Format trackFormat,
int trackSelectionReason,
Object trackSelectionData,
long startTimeUs,
long endTimeUs) |
Modifier and Type | Method and Description |
---|---|
abstract long |
bytesLoaded()
Returns the number of bytes that have been loaded.
|
long |
getDurationUs()
Returns the duration of the chunk in microseconds.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancelLoad, isLoadCanceled, load
public final int type
DATA_TYPE_*
constants defined in C
. For
reporting only.public final Format trackFormat
public final int trackSelectionReason
C
SELECTION_REASON_*
constants if the chunk belongs to a track.
C.SELECTION_REASON_UNKNOWN
if the chunk does not belong to a track.public final Object trackSelectionData
public final long startTimeUs
C.TIME_UNSET
if the data
being loaded does not contain media samples.public final long endTimeUs
C.TIME_UNSET
if the data being
loaded does not contain media samples.protected final DataSource dataSource
public Chunk(DataSource dataSource, DataSpec dataSpec, int type, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long startTimeUs, long endTimeUs)
dataSource
- The source from which the data should be loaded.dataSpec
- Defines the data to be loaded.type
- See type
.trackFormat
- See trackFormat
.trackSelectionReason
- See trackSelectionReason
.trackSelectionData
- See trackSelectionData
.startTimeUs
- See startTimeUs
.endTimeUs
- See endTimeUs
.