Class Representation.MultiSegmentRepresentation

    • Constructor Detail

      • MultiSegmentRepresentation

        public MultiSegmentRepresentation​(long revisionId,
                                          Format format,
                                          String baseUrl,
                                          SegmentBase.MultiSegmentBase segmentBase,
                                          @Nullable
                                          List<Descriptor> inbandEventStreams)
        Creates the multi-segment Representation.
        Parameters:
        revisionId - Identifies the revision of the content.
        format - The format of the representation.
        baseUrl - The base URL of the representation.
        segmentBase - The segment base underlying the representation.
        inbandEventStreams - The in-band event streams in the representation. May be null.
    • Method Detail

      • getIndexUri

        @Nullable
        public RangedUri 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
      • getSegmentNum

        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 DashSegmentIndex
        Parameters:
        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.
      • getTimeUs

        public long getTimeUs​(long segmentIndex)
        Description copied from interface: DashSegmentIndex
        Returns the start time of a segment.
        Specified by:
        getTimeUs in interface DashSegmentIndex
        Parameters:
        segmentIndex - The segment number.
        Returns:
        The corresponding start time in microseconds.
      • getDurationUs

        public long getDurationUs​(long segmentIndex,
                                  long periodDurationUs)
        Description copied from interface: DashSegmentIndex
        Returns the duration of a segment.
        Specified by:
        getDurationUs in interface DashSegmentIndex
        Parameters:
        segmentIndex - 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.
      • getFirstAvailableSegmentNum

        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 DashSegmentIndex
        Parameters:
        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.
      • getAvailableSegmentCount

        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 DashSegmentIndex
        Parameters:
        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.
      • getNextSegmentAvailableTimeUs

        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 DashSegmentIndex
        Parameters:
        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.
      • isExplicit

        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 DashSegmentIndex
        Returns:
        Whether segments are defined explicitly by the index.