docs/doc/reference/com/google/android/exoplayer2/source/dash/manifest/Representation.MultiSegmentRepresentation.html
Package com.google.android.exoplayer2.source.dash.manifest
All Implemented Interfaces:DashSegmentIndexEnclosing class:Representation
public static classRepresentation.MultiSegmentRepresentationextends[Representation](Representation.html "class in com.google.android.exoplayer2.source.dash.manifest")implements[DashSegmentIndex](../DashSegmentIndex.html "interface in com.google.android.exoplayer2.source.dash")
A DASH representation consisting of multiple segments.
-
Representation.MultiSegmentRepresentation, Representation.SingleSegmentRepresentation
-
baseUrls, essentialProperties, format, inbandEventStreams, presentationTimeOffsetUs, REVISION_ID_DEFAULT, revisionId, supplementalProperties
-
INDEX_UNBOUNDED
Constructors | Constructor | Description |
| --- | --- |
| MultiSegmentRepresentation(long revisionId, Format format, List<BaseUrl> baseUrls, SegmentBase.MultiSegmentBase segmentBase, List<Descriptor> inbandEventStreams, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties) |
Creates the multi-segment Representation.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| long | getAvailableSegmentCount(long periodDurationUs, long nowUnixTimeUs) |
Returns the number of available segments in the index.
|
| String | getCacheKey() |
Returns a cache key for the representation if set, or null.
|
| long | getDurationUs(long segmentNum, long periodDurationUs) |
Returns the duration of a segment.
|
| long | getFirstAvailableSegmentNum(long periodDurationUs, long nowUnixTimeUs) |
Returns the segment number of the first available segment in the index.
|
| long | getFirstSegmentNum() |
Returns the segment number of the first defined segment in the index.
|
| DashSegmentIndex | getIndex() |
Returns an index if the representation provides one directly, or null otherwise.
|
| RangedUri | getIndexUri() |
Returns a RangedUri defining the location of the representation's segment index, or null if the representation provides an index directly.
|
| long | getNextSegmentAvailableTimeUs(long periodDurationUs, long nowUnixTimeUs) |
Returns the time, in microseconds, at which a new segment becomes available, or C.TIME_UNSET if not applicable.
|
| long | getSegmentCount(long periodDurationUs) |
Returns the number of segments defined in the index, or DashSegmentIndex.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.
|
-
getInitializationUri, newInstance, newInstance
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public MultiSegmentRepresentation(long revisionId,[Format](../../../Format.html "class in com.google.android.exoplayer2")format,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[BaseUrl](BaseUrl.html "class in com.google.android.exoplayer2.source.dash.manifest")> baseUrls,[SegmentBase.MultiSegmentBase](SegmentBase.MultiSegmentBase.html "class in com.google.android.exoplayer2.source.dash.manifest")segmentBase,
@Nullable[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Descriptor](Descriptor.html "class in com.google.android.exoplayer2.source.dash.manifest")> inbandEventStreams,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Descriptor](Descriptor.html "class in com.google.android.exoplayer2.source.dash.manifest")> essentialProperties,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Descriptor](Descriptor.html "class in com.google.android.exoplayer2.source.dash.manifest")> supplementalProperties)
Creates the multi-segment Representation.
Parameters:revisionId - Identifies the revision of the content.format - The format of the representation.baseUrls - The base URLs of the representation.segmentBase - The segment base underlying the representation.inbandEventStreams - The in-band event streams in the representation. May be null.essentialProperties - Essential properties in the representation. May be empty.supplementalProperties - Supplemental properties in the representation. May be empty.
-
@Nullable
public[RangedUri](RangedUri.html "class in com.google.android.exoplayer2.source.dash.manifest")getIndexUri()
Description copied from class: Representation
Returns a RangedUri defining the location of the representation's segment index, or null if the representation provides an index directly.
Specified by:getIndexUri in class Representation
-
public[DashSegmentIndex](../DashSegmentIndex.html "interface in com.google.android.exoplayer2.source.dash")getIndex()
Description copied from class: Representation
Returns an index if the representation provides one directly, or null otherwise.
Specified by:getIndex in class Representation
-
@Nullable
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getCacheKey()
Description copied from class: Representation
Returns a cache key for the representation if set, or null.
Specified by:getCacheKey in class Representation
-
public[RangedUri](RangedUri.html "class in com.google.android.exoplayer2.source.dash.manifest")getSegmentUrl(long segmentNum)
Description copied from interface: DashSegmentIndex
Returns a RangedUri defining the location of a segment.
Specified by:getSegmentUrl in interface DashSegmentIndexParameters:segmentNum - The segment number.Returns:The RangedUri defining the location of the data.
-
public long getSegmentNum(long timeUs,
long periodDurationUs)
Description copied from interface: DashSegmentIndex
Returns 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.
Specified by:getSegmentNum in interface DashSegmentIndexParameters: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.Returns:The segment number of the corresponding segment.
-
public long getTimeUs(long segmentNum)
Description copied from interface: DashSegmentIndex
Returns the start time of a segment.
Specified by:getTimeUs in interface DashSegmentIndexParameters:segmentNum - The segment number.Returns:The corresponding start time in microseconds.
-
public long getDurationUs(long segmentNum,
long periodDurationUs)
Description copied from interface: DashSegmentIndex
Returns the duration of a segment.
Specified by:getDurationUs in interface DashSegmentIndexParameters: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.Returns:The duration of the segment, in microseconds.
-
public long getFirstSegmentNum()
Description copied from interface: DashSegmentIndex
Returns the segment number of the first defined segment in the index.
Specified by:getFirstSegmentNum in interface DashSegmentIndex
-
public long getFirstAvailableSegmentNum(long periodDurationUs,
long nowUnixTimeUs)
Description copied from interface: DashSegmentIndex
Returns the segment number of the first available segment in the index.
Specified by:getFirstAvailableSegmentNum in interface DashSegmentIndexParameters:periodDurationUs - The duration of the enclosing period in microseconds, or C.TIME_UNSET if the period's duration is not yet known.nowUnixTimeUs - The current time in milliseconds since the Unix epoch.Returns:The number of the first available segment.
-
public long getSegmentCount(long periodDurationUs)
Description copied from interface: DashSegmentIndex
Returns the number of segments defined in the index, or DashSegmentIndex.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 can query the available segment using DashSegmentIndex.getFirstAvailableSegmentNum(long, long) and DashSegmentIndex.getAvailableSegmentCount(long, long).
Specified by:getSegmentCount in interface DashSegmentIndexParameters:periodDurationUs - The duration of the enclosing period in microseconds, or C.TIME_UNSET if the period's duration is not yet known.Returns:The number of segments in the index, or DashSegmentIndex.INDEX_UNBOUNDED.
-
public long getAvailableSegmentCount(long periodDurationUs,
long nowUnixTimeUs)
Description copied from interface: DashSegmentIndex
Returns the number of available segments in the index.
Specified by:getAvailableSegmentCount in interface DashSegmentIndexParameters:periodDurationUs - The duration of the enclosing period in microseconds, or C.TIME_UNSET if the period's duration is not yet known.nowUnixTimeUs - The current time in milliseconds since the Unix epoch.Returns:The number of available segments in the index.
-
public long getNextSegmentAvailableTimeUs(long periodDurationUs,
long nowUnixTimeUs)
Description copied from interface: DashSegmentIndex
Returns the time, in microseconds, at which a new segment becomes available, or C.TIME_UNSET if not applicable.
Specified by:getNextSegmentAvailableTimeUs in interface DashSegmentIndexParameters:periodDurationUs - The duration of the enclosing period in microseconds, or C.TIME_UNSET if the period's duration is not yet known.nowUnixTimeUs - The current time in milliseconds since the Unix epoch.Returns:The time, in microseconds, at which a new segment becomes available, or C.TIME_UNSET if not applicable.
-
public boolean isExplicit()
Description copied from interface: DashSegmentIndex
Returns true if segments are defined explicitly by the index.
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.
Specified by:isExplicit in interface DashSegmentIndexReturns:Whether segments are defined explicitly by the index.