public class SsManifest.StreamElement


Represents a StreamIndex element.

Summary

Public fields

final int
final int
final int
final Format[]
final @Nullable String
final int
final int
final String
final String
final long
final int

Public constructors

StreamElement(
    String baseUri,
    String chunkTemplate,
    @C.TrackType 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
)

Public methods

Uri
buildRequestUri(int track, int chunkIndex)

Builds a uri for requesting the specified chunk of the specified track.

SsManifest.StreamElement
copy(Format[] formats)

Creates a copy of this stream element with the formats replaced with those specified.

long
getChunkDurationUs(int chunkIndex)

Returns the duration of the specified chunk.

int
getChunkIndex(long timeUs)

Returns the index of the chunk that contains the specified time.

long
getStartTimeUs(int chunkIndex)

Returns the start time of the specified chunk.

Public fields

chunkCount

public final int chunkCount

displayHeight

public final int displayHeight

displayWidth

public final int displayWidth

formats

public final Format[] formats

language

public final @Nullable String language

maxHeight

public final int maxHeight

maxWidth

public final int maxWidth

name

public final String name

subType

public final String subType

timescale

public final long timescale

type

@C.TrackType
public final int type

Public constructors

StreamElement

public StreamElement(
    String baseUri,
    String chunkTemplate,
    @C.TrackType 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
)

Public methods

buildRequestUri

public Uri buildRequestUri(int track, int chunkIndex)

Builds a uri for requesting the specified chunk of the specified track.

Parameters
int track

The index of the track for which to build the URL.

int chunkIndex

The index of the chunk for which to build the URL.

Returns
Uri

The request uri.

copy

public SsManifest.StreamElement copy(Format[] formats)

Creates a copy of this stream element with the formats replaced with those specified.

Parameters
Format[] formats

The formats to be included in the copy.

Returns
SsManifest.StreamElement

A copy of this stream element with the formats replaced.

Throws
java.lang.IndexOutOfBoundsException

If a key has an invalid index.

getChunkDurationUs

public long getChunkDurationUs(int chunkIndex)

Returns the duration of the specified chunk.

Parameters
int chunkIndex

The index of the chunk.

Returns
long

The duration of the chunk, in microseconds.

getChunkIndex

public int getChunkIndex(long timeUs)

Returns the index of the chunk that contains the specified time.

Parameters
long timeUs

The time in microseconds.

Returns
int

The index of the corresponding chunk.

getStartTimeUs

public long getStartTimeUs(int chunkIndex)

Returns the start time of the specified chunk.

Parameters
int chunkIndex

The index of the chunk.

Returns
long

The start time of the chunk, in microseconds.