SingleSampleMediaChunk


@UnstableApi
public final class SingleSampleMediaChunk extends BaseMediaChunk


Summary

Public constructors

SingleSampleMediaChunk(
    DataSource dataSource,
    DataSpec dataSpec,
    Format trackFormat,
    @C.SelectionReason int trackSelectionReason,
    @Nullable Object trackSelectionData,
    long startTimeUs,
    long endTimeUs,
    long chunkIndex,
    @C.TrackType int trackType,
    Format sampleFormat
)

This method is deprecated. Deprecated in Java

Public methods

void

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Inherited fields

From androidx.media3.exoplayer.source.chunk.BaseMediaChunk
final long

This field is deprecated. Deprecated in Java

final long

This field is deprecated. Deprecated in Java

@MonotonicNonNull BaseMediaChunkOutput

This field is deprecated. Deprecated in Java

From androidx.media3.exoplayer.source.chunk.Chunk
final StatsDataSource

This field is deprecated. Deprecated in Java

final DataSpec

This field is deprecated. Deprecated in Java

final long

This field is deprecated. Deprecated in Java

final long

This field is deprecated. Deprecated in Java

final long

This field is deprecated. Deprecated in Java

final @Nullable String

This field is deprecated. Deprecated in Java

final Format

This field is deprecated. Deprecated in Java

final @Nullable Object

This field is deprecated. Deprecated in Java

final int

This field is deprecated. Deprecated in Java

final int

This field is deprecated. Deprecated in Java

From androidx.media3.exoplayer.source.chunk.MediaChunk
final long

This field is deprecated. Deprecated in Java

Inherited methods

From androidx.media3.exoplayer.source.chunk.BaseMediaChunk
final int
getFirstSampleIndex(int trackIndex)

This method is deprecated. Deprecated in Java

final BaseMediaChunkOutput

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

From androidx.media3.exoplayer.source.chunk.Chunk
final long

This method is deprecated. Deprecated in Java

final long

This method is deprecated. Deprecated in Java

final Map<String, List<String>>

This method is deprecated. Deprecated in Java

final Uri

This method is deprecated. Deprecated in Java

From androidx.media3.exoplayer.source.chunk.MediaChunk
long

This method is deprecated. Deprecated in Java

Public constructors

SingleSampleMediaChunk

public SingleSampleMediaChunk(
    DataSource dataSource,
    DataSpec dataSpec,
    Format trackFormat,
    @C.SelectionReason int trackSelectionReason,
    @Nullable Object trackSelectionData,
    long startTimeUs,
    long endTimeUs,
    long chunkIndex,
    @C.TrackType int trackType,
    Format sampleFormat
)
Parameters
DataSource dataSource

The source from which the data should be loaded.

DataSpec dataSpec

Defines the data to be loaded.

Format trackFormat

See trackFormat.

@C.SelectionReason int trackSelectionReason

See trackSelectionReason.

@Nullable Object trackSelectionData

See trackSelectionData.

long startTimeUs

The start time of the media contained by the chunk, in microseconds.

long endTimeUs

The end time of the media contained by the chunk, in microseconds.

long chunkIndex

The index of the chunk, or INDEX_UNSET if it is not known.

@C.TrackType int trackType

The track type of the chunk.

Format sampleFormat

The Format of the sample in the chunk.

Public methods

cancelLoad

public void cancelLoad()

Cancels the load.

Loadable implementations should ensure that a currently executing load call will exit reasonably quickly after this method is called. The load call may exit either by returning or by throwing an IOException.

If there is a currently executing load call, then the thread on which that call is being made will be interrupted immediately after the call to this method. Hence implementations do not need to (and should not attempt to) interrupt the loading thread themselves.

Although the loading thread will be interrupted, Loadable implementations should not use the interrupted status of the loading thread in load to determine whether the load has been canceled. This approach is not robust [Internal ref: b/79223737]. Instead, implementations should use their own flag to signal cancelation (for example, using AtomicBoolean).

isLoadCompleted

public boolean isLoadCompleted()

Returns whether the chunk has been fully loaded.

load

public void load()

Performs the load, returning on completion or cancellation.

Throws
java.io.IOException

If the input could not be loaded.