public static class SegmentBase.SegmentTemplate extends SegmentBase.MultiSegmentBase
SegmentBase.MultiSegmentBase
that uses a SegmentTemplate to define its segments.SegmentBase.MultiSegmentBase, SegmentBase.SegmentList, SegmentBase.SegmentTemplate, SegmentBase.SegmentTimelineElement, SegmentBase.SingleSegmentBase
Constructor and Description |
---|
SegmentTemplate(RangedUri initialization,
long timescale,
long presentationTimeOffset,
int startNumber,
long duration,
List<SegmentBase.SegmentTimelineElement> segmentTimeline,
UrlTemplate initializationTemplate,
UrlTemplate mediaTemplate,
String baseUrl) |
Modifier and Type | Method and Description |
---|---|
RangedUri |
getInitialization(Representation representation)
Returns the
RangedUri defining the location of initialization data for a given
representation, or null if no initialization data exists. |
int |
getLastSegmentNum(long periodDurationUs) |
RangedUri |
getSegmentUrl(Representation representation,
int sequenceNumber)
Returns a
RangedUri defining the location of a segment for the given index in the
given representation. |
getFirstSegmentNum, getSegmentDurationUs, getSegmentNum, getSegmentTimeUs, isExplicit
getPresentationTimeOffsetUs
public SegmentTemplate(RangedUri initialization, long timescale, long presentationTimeOffset, int startNumber, long duration, List<SegmentBase.SegmentTimelineElement> segmentTimeline, UrlTemplate initializationTemplate, UrlTemplate mediaTemplate, String baseUrl)
initialization
- A RangedUri
corresponding to initialization data, if such data
exists. The value of this parameter is ignored if initializationTemplate
is
non-null.timescale
- The timescale in units per second.presentationTimeOffset
- The presentation time offset. The value in seconds is the
division of this value and timescale
.startNumber
- The sequence number of the first segment.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.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.initializationTemplate
- A template defining the location of initialization data, if
such data exists. If non-null then the initialization
parameter is ignored. If
null then initialization
will be used.mediaTemplate
- A template defining the location of each media segment.baseUrl
- A url to use as the base for relative urls generated by the templates.public RangedUri getInitialization(Representation representation)
SegmentBase
RangedUri
defining the location of initialization data for a given
representation, or null if no initialization data exists.getInitialization
in class SegmentBase
representation
- The Representation
for which initialization data is required.RangedUri
defining the location of the initialization data, or null.public RangedUri getSegmentUrl(Representation representation, int sequenceNumber)
SegmentBase.MultiSegmentBase
RangedUri
defining the location of a segment for the given index in the
given representation.getSegmentUrl
in class SegmentBase.MultiSegmentBase
DashSegmentIndex.getSegmentUrl(int)
public int getLastSegmentNum(long periodDurationUs)
getLastSegmentNum
in class SegmentBase.MultiSegmentBase
DashSegmentIndex.getLastSegmentNum(long)