public abstract class Chunk extends java.lang.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. |
Format |
format
The format associated with the data being loaded, or null if the data being loaded is not
associated with a specific format.
|
static int |
NO_PARENT_ID
Value of
parentId if no parent id need be specified. |
int |
parentId
Optional identifier for a parent from which this chunk originates.
|
int |
trigger
The reason why the chunk was generated.
|
static int |
TRIGGER_ADAPTIVE
Value of
trigger for a load triggered by an adaptive format selection. |
static int |
TRIGGER_CUSTOM_BASE
Implementations may define custom
trigger codes greater than or equal to this value. |
static int |
TRIGGER_INITIAL
Value of
trigger for a load triggered by an initial format selection. |
static int |
TRIGGER_MANUAL
Value of
trigger for a load triggered by a user initiated format selection. |
static int |
TRIGGER_TRICK_PLAY
Value of
trigger for a load triggered whilst in a trick play mode. |
static int |
TRIGGER_UNSPECIFIED
Value of
trigger for a load whose reason is unspecified. |
int |
type
The type of the chunk.
|
static int |
TYPE_CUSTOM_BASE
Implementations may define custom
type codes greater than or equal to this value. |
static int |
TYPE_DRM
Value of
type for chunks containing drm related data. |
static int |
TYPE_MANIFEST
Value of
type for chunks containing manifest or playlist data. |
static int |
TYPE_MEDIA
Value of
type for chunks containing media data. |
static int |
TYPE_MEDIA_INITIALIZATION
Value of
type for chunks containing media initialization data. |
static int |
TYPE_UNSPECIFIED
Value of
type for chunks containing unspecified data. |
Constructor and Description |
---|
Chunk(DataSource dataSource,
DataSpec dataSpec,
int type,
int trigger,
Format format,
int parentId) |
Modifier and Type | Method and Description |
---|---|
abstract long |
bytesLoaded()
Gets the number of bytes that have been loaded.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cancelLoad, isLoadCanceled, load
public static final int TYPE_UNSPECIFIED
type
for chunks containing unspecified data.public static final int TYPE_MEDIA
type
for chunks containing media data.public static final int TYPE_MEDIA_INITIALIZATION
type
for chunks containing media initialization data.public static final int TYPE_DRM
type
for chunks containing drm related data.public static final int TYPE_MANIFEST
type
for chunks containing manifest or playlist data.public static final int TYPE_CUSTOM_BASE
type
codes greater than or equal to this value.public static final int TRIGGER_UNSPECIFIED
trigger
for a load whose reason is unspecified.public static final int TRIGGER_INITIAL
trigger
for a load triggered by an initial format selection.public static final int TRIGGER_MANUAL
trigger
for a load triggered by a user initiated format selection.public static final int TRIGGER_ADAPTIVE
trigger
for a load triggered by an adaptive format selection.public static final int TRIGGER_TRICK_PLAY
trigger
for a load triggered whilst in a trick play mode.public static final int TRIGGER_CUSTOM_BASE
trigger
codes greater than or equal to this value.public static final int NO_PARENT_ID
parentId
if no parent id need be specified.public final int type
public final int trigger
public final Format format
public final int parentId
protected final DataSource dataSource
public Chunk(DataSource dataSource, DataSpec dataSpec, int type, int trigger, Format format, int parentId)
dataSource
- The source from which the data should be loaded.dataSpec
- Defines the data to be loaded. dataSpec.length
must not exceed
Integer.MAX_VALUE
. If dataSpec.length == C.LENGTH_UNBOUNDED
then
the length resolved by dataSource.open(dataSpec)
must not exceed
Integer.MAX_VALUE
.type
- See type
.trigger
- See trigger
.format
- See format
.parentId
- See parentId
.