Back to Exoplayer

Chunk (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/chunk/Chunk.html

latest9.9 KB
Original Source

Package com.google.android.exoplayer2.source.chunk

Class Chunk

  • java.lang.Object

    • com.google.android.exoplayer2.source.chunk.Chunk
  • All Implemented Interfaces:Loader.LoadableDirect Known Subclasses:DataChunk, InitializationChunk, MediaChunk


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classChunkextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Loader.Loadable](../../upstream/Loader.Loadable.html "interface in com.google.android.exoplayer2.upstream")

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 for Loader.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.

The DataSpec that defines the data to be loaded. | | long | endTimeUs | Deprecated.

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 | loadTaskId | Deprecated.

Identifies the load task for this loadable. | | long | startTimeUs | Deprecated.

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 | 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 the selection reasons if the chunk belongs to a track. | | @com.google.android.exoplayer2.C.DataType int | type | Deprecated.

The data 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 last DataSource.open(com.google.android.exoplayer2.upstream.DataSpec) call. | | Uri | getUri() | Deprecated.

Returns the Uri associated with the last DataSource.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](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec

Deprecated.

The DataSpec that defines the data to be loaded.

- 

type

public final @com.google.android.exoplayer2.C.DataType int type

Deprecated.

The data type of the chunk. For reporting only.

- 

trackFormat

public final[Format](../../Format.html "class in com.google.android.exoplayer2")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 the selection 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](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")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, or C.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, or C.TIME_UNSET if the data being loaded does not contain media samples.

- 

dataSource

protected final[StatsDataSource](../../upstream/StatsDataSource.html "class in com.google.android.exoplayer2.upstream")dataSource

Deprecated.

Constructor Detail

- 

Chunk

public Chunk​([DataSource](../../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")dataSource,[DataSpec](../../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
             @com.google.android.exoplayer2.C.DataType int type,[Format](../../Format.html "class in com.google.android.exoplayer2")trackFormat,
             @com.google.android.exoplayer2.C.SelectionReason int trackSelectionReason,
             @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")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 - See type.trackFormat - See trackFormat.trackSelectionReason - See trackSelectionReason.trackSelectionData - See trackSelectionData.startTimeUs - See startTimeUs.endTimeUs - See endTimeUs.

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](https://developer.android.com/reference/android/net/Uri.html "class or interface in android.net")getUri()

Deprecated.

Returns the Uri associated with the last DataSource.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](https://developer.android.com/reference/java/util/Map.html "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang"),​[List](https://developer.android.com/reference/java/util/List.html?is-external=true "class or interface in java.util")<[String](https://developer.android.com/reference/java/lang/String.html?is-external=true "class or interface in java.lang")>> getResponseHeaders()

Deprecated.

Returns the response headers associated with the last DataSource.open(com.google.android.exoplayer2.upstream.DataSpec) call. Must only be called after the load completed, failed, or was canceled. See Also:DataSource.getResponseHeaders()