Class SsManifest.StreamElement

  • Enclosing class:
    SsManifest

    public static class SsManifest.StreamElement
    extends Object
    Represents a StreamIndex element.
    • Field Detail

      • type

        public final int type
      • subType

        public final String subType
      • timescale

        public final long timescale
      • name

        public final String name
      • maxWidth

        public final int maxWidth
      • maxHeight

        public final int maxHeight
      • displayWidth

        public final int displayWidth
      • displayHeight

        public final int displayHeight
      • language

        @Nullable
        public final String language
      • formats

        public final Format[] formats
      • chunkCount

        public final int chunkCount
    • Constructor Detail

      • StreamElement

        public StreamElement​(String baseUri,
                             String chunkTemplate,
                             int type,
                             String subType,
                             long timescale,
                             String name,
                             int maxWidth,
                             int maxHeight,
                             int displayWidth,
                             int displayHeight,
                             @Nullable
                             String language,
                             Format[] formats,
                             List<Long> chunkStartTimes,
                             long lastChunkDuration)
    • Method Detail

      • copy

        public SsManifest.StreamElement copy​(Format[] formats)
        Creates a copy of this stream element with the formats replaced with those specified.
        Parameters:
        formats - The formats to be included in the copy.
        Returns:
        A copy of this stream element with the formats replaced.
        Throws:
        IndexOutOfBoundsException - If a key has an invalid index.
      • getChunkIndex

        public int getChunkIndex​(long timeUs)
        Returns the index of the chunk that contains the specified time.
        Parameters:
        timeUs - The time in microseconds.
        Returns:
        The index of the corresponding chunk.
      • getStartTimeUs

        public long getStartTimeUs​(int chunkIndex)
        Returns the start time of the specified chunk.
        Parameters:
        chunkIndex - The index of the chunk.
        Returns:
        The start time of the chunk, in microseconds.
      • getChunkDurationUs

        public long getChunkDurationUs​(int chunkIndex)
        Returns the duration of the specified chunk.
        Parameters:
        chunkIndex - The index of the chunk.
        Returns:
        The duration of the chunk, in microseconds.
      • buildRequestUri

        public Uri buildRequestUri​(int track,
                                   int chunkIndex)
        Builds a uri for requesting the specified chunk of the specified track.
        Parameters:
        track - The index of the track for which to build the URL.
        chunkIndex - The index of the chunk for which to build the URL.
        Returns:
        The request uri.