SegmentBase.MultiSegmentBase


public abstract class SegmentBase.MultiSegmentBase extends SegmentBase

Known direct subclasses
SegmentBase.SegmentList

A MultiSegmentBase that uses a SegmentList to define its segments.

SegmentBase.SegmentTemplate

A MultiSegmentBase that uses a SegmentTemplate to define its segments.


A SegmentBase that consists of multiple segments.

Summary

Public constructors

MultiSegmentBase(
    @Nullable RangedUri initialization,
    long timescale,
    long presentationTimeOffset,
    long startNumber,
    long duration,
    @Nullable List<SegmentBase.SegmentTimelineElement> segmentTimeline,
    long availabilityTimeOffsetUs,
    long timeShiftBufferDepthUs,
    long periodStartUnixTimeUs
)

Public methods

long
getAvailableSegmentCount(long periodDurationUs, long nowUnixTimeUs)

See getAvailableSegmentCount.

long
getFirstAvailableSegmentNum(long periodDurationUs, long nowUnixTimeUs)

See getFirstAvailableSegmentNum.

long

See getFirstSegmentNum.

long
getNextSegmentAvailableTimeUs(
    long periodDurationUs,
    long nowUnixTimeUs
)

See getNextSegmentAvailableTimeUs.

abstract long
getSegmentCount(long periodDurationUs)

See getSegmentCount.

final long
getSegmentDurationUs(long sequenceNumber, long periodDurationUs)

See getDurationUs.

long
getSegmentNum(long timeUs, long periodDurationUs)

See getSegmentNum.

final long
getSegmentTimeUs(long sequenceNumber)

See getTimeUs.

abstract RangedUri
getSegmentUrl(Representation representation, long index)

Returns a RangedUri defining the location of a segment for the given index in the given representation.

boolean

See isExplicit

Inherited methods

From androidx.media3.exoplayer.dash.manifest.SegmentBase
@Nullable RangedUri
getInitialization(
    @UnderInitialization(value = Representation) @UnderInitialization(value = Representation) Representation representation
)

Returns the RangedUri defining the location of initialization data for a given representation, or null if no initialization data exists.

long

Returns the presentation time offset, in microseconds.

Public constructors

MultiSegmentBase

public MultiSegmentBase(
    @Nullable RangedUri initialization,
    long timescale,
    long presentationTimeOffset,
    long startNumber,
    long duration,
    @Nullable List<SegmentBase.SegmentTimelineElement> segmentTimeline,
    long availabilityTimeOffsetUs,
    long timeShiftBufferDepthUs,
    long periodStartUnixTimeUs
)
Parameters
@Nullable RangedUri initialization

A RangedUri corresponding to initialization data, if such data exists.

long timescale

The timescale in units per second.

long presentationTimeOffset

The presentation time offset. The value in seconds is the division of this value and timescale.

long startNumber

The sequence number of the first segment.

long duration

The duration of each segment in the case of fixed duration segments. The value in seconds is the division of this value and timescale. If segmentTimeline is non-null then this parameter is ignored.

@Nullable List<SegmentBase.SegmentTimelineElement> segmentTimeline

A segment timeline corresponding to the segments. If null, then segments are assumed to be of fixed duration as specified by the duration parameter.

long availabilityTimeOffsetUs

The offset to the current realtime at which segments become available in microseconds, or TIME_UNSET if not applicable.

long timeShiftBufferDepthUs

The time shift buffer depth in microseconds.

long periodStartUnixTimeUs

The start of the enclosing period in microseconds since the Unix epoch.

Public methods

getAvailableSegmentCount

public long getAvailableSegmentCount(long periodDurationUs, long nowUnixTimeUs)

See getAvailableSegmentCount.

getFirstAvailableSegmentNum

public long getFirstAvailableSegmentNum(long periodDurationUs, long nowUnixTimeUs)

See getFirstAvailableSegmentNum.

getFirstSegmentNum

public long getFirstSegmentNum()

See getFirstSegmentNum.

getNextSegmentAvailableTimeUs

public long getNextSegmentAvailableTimeUs(
    long periodDurationUs,
    long nowUnixTimeUs
)

See getNextSegmentAvailableTimeUs.

getSegmentCount

public abstract long getSegmentCount(long periodDurationUs)

See getSegmentCount.

getSegmentDurationUs

public final long getSegmentDurationUs(long sequenceNumber, long periodDurationUs)

See getDurationUs.

getSegmentNum

public long getSegmentNum(long timeUs, long periodDurationUs)

See getSegmentNum.

getSegmentTimeUs

public final long getSegmentTimeUs(long sequenceNumber)

See getTimeUs.

getSegmentUrl

public abstract RangedUri getSegmentUrl(Representation representation, long index)

Returns a RangedUri defining the location of a segment for the given index in the given representation.

See getSegmentUrl.

isExplicit

public boolean isExplicit()

See isExplicit