public interface DashSegmentIndex
Modifier and Type | Field and Description |
---|---|
static int |
INDEX_UNBOUNDED |
Modifier and Type | Method and Description |
---|---|
long |
getDurationUs(long segmentNum,
long periodDurationUs)
Returns the duration of a segment.
|
long |
getFirstSegmentNum()
Returns the segment number of the first segment.
|
int |
getSegmentCount(long periodDurationUs)
Returns the number of segments in the index, or
INDEX_UNBOUNDED . |
long |
getSegmentNum(long timeUs,
long periodDurationUs)
Returns
getFirstSegmentNum() if the index has no segments or if the given media time is
earlier than the start of the first segment. |
RangedUri |
getSegmentUrl(long segmentNum)
Returns a
RangedUri defining the location of a segment. |
long |
getTimeUs(long segmentNum)
Returns the start time of a segment.
|
boolean |
isExplicit()
Returns true if segments are defined explicitly by the index.
|
static final int INDEX_UNBOUNDED
long getSegmentNum(long timeUs, long periodDurationUs)
getFirstSegmentNum()
if the index has no segments or if the given media time is
earlier than the start of the first segment. Returns getFirstSegmentNum() +
getSegmentCount() - 1
if the given media time is later than the end of the last segment.
Otherwise, returns the segment number of the segment containing the given media time.timeUs
- The time in microseconds.periodDurationUs
- The duration of the enclosing period in microseconds, or C.TIME_UNSET
if the period's duration is not yet known.long getTimeUs(long segmentNum)
segmentNum
- The segment number.long getDurationUs(long segmentNum, long periodDurationUs)
segmentNum
- The segment number.periodDurationUs
- The duration of the enclosing period in microseconds, or C.TIME_UNSET
if the period's duration is not yet known.RangedUri getSegmentUrl(long segmentNum)
RangedUri
defining the location of a segment.segmentNum
- The segment number.RangedUri
defining the location of the data.long getFirstSegmentNum()
int getSegmentCount(long periodDurationUs)
INDEX_UNBOUNDED
.
An unbounded index occurs if a dynamic manifest uses SegmentTemplate elements without a SegmentTimeline element, and if the period duration is not yet known. In this case the caller must manually determine the window of currently available segments.
periodDurationUs
- The duration of the enclosing period in microseconds, or
C.TIME_UNSET
if the period's duration is not yet known.INDEX_UNBOUNDED
.boolean isExplicit()
If true is returned, each segment is defined explicitly by the index data, and all of the listed segments are guaranteed to be available at the time when the index was obtained.
If false is returned then segment information was derived from properties such as a fixed segment duration. If the presentation is dynamic, it's possible that only a subset of the segments are available.