DefaultDashChunkSource.RepresentationSegmentIterator


protected final class DefaultDashChunkSource.RepresentationSegmentIterator extends BaseMediaChunkIterator


MediaChunkIterator wrapping a RepresentationHolder.

Summary

Public constructors

RepresentationSegmentIterator(
    DefaultDashChunkSource.RepresentationHolder representation,
    long firstAvailableSegmentNum,
    long lastAvailableSegmentNum,
    long nowPeriodTimeUs
)

Creates iterator.

Public methods

long

Returns the media end time of the chunk, in microseconds.

long

Returns the media start time of the chunk, in microseconds.

DataSpec

Returns the DataSpec used to load the media chunk.

Inherited Constants

From androidx.media3.exoplayer.source.chunk.MediaChunkIterator
static final MediaChunkIterator

An empty media chunk iterator without available data.

Inherited methods

From androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator
final void

Verifies that the iterator points to a valid element.

final long

Returns the current index this iterator is pointing to.

boolean

Returns whether the iteration has reached the end of the available data.

boolean

Moves the iterator to the next media chunk.

void

Resets the iterator to the initial position.

Public constructors

RepresentationSegmentIterator

public RepresentationSegmentIterator(
    DefaultDashChunkSource.RepresentationHolder representation,
    long firstAvailableSegmentNum,
    long lastAvailableSegmentNum,
    long nowPeriodTimeUs
)

Creates iterator.

Parameters
DefaultDashChunkSource.RepresentationHolder representation

The RepresentationHolder to wrap.

long firstAvailableSegmentNum

The number of the first available segment.

long lastAvailableSegmentNum

The number of the last available segment.

long nowPeriodTimeUs

The current time in microseconds since the start of the period used for calculating if segments are available at full network speed.

Public methods

getChunkEndTimeUs

public long getChunkEndTimeUs()

Returns the media end time of the chunk, in microseconds.

Throws
java.util.NoSuchElementException

If the method is called before the first call to next or when isEnded is true.

getChunkStartTimeUs

public long getChunkStartTimeUs()

Returns the media start time of the chunk, in microseconds.

Throws
java.util.NoSuchElementException

If the method is called before the first call to next or when isEnded is true.

getDataSpec

public DataSpec getDataSpec()

Returns the DataSpec used to load the media chunk.

Throws
java.util.NoSuchElementException

If the method is called before the first call to next or when isEnded is true.