@UnstableApi
public final class StreamKey implements Comparable, Parcelable, Bundleable


A key for a subset of media that can be separately loaded (a "stream").

The stream key consists of a period index, a group index within the period and a stream index within the group. The interpretation of these indices depends on the type of media for which the stream key is used. Note that they are not the same as track group and track indices, because multiple tracks can be multiplexed into a single stream.

Application code should not generally attempt to build StreamKey instances directly. Instead, DownloadHelper.getDownloadRequest can be used to generate download requests with the correct StreamKeys for the track selections that have been configured on the helper. MediaPeriod.getStreamKeys provides a lower level way of generating StreamKeys corresponding to a particular track selection.

Summary

Constants

static final Parcelable.Creator<StreamKey>

Public fields

final int

The group index.

final int

The period index.

final int

The stream index.

Public constructors

StreamKey(int groupIndex, int streamIndex)

Creates an instance with periodIndex set to 0.

StreamKey(int periodIndex, int groupIndex, int streamIndex)

Creates an instance of StreamKey using 3 indices.

Public methods

int
int
boolean
static StreamKey

Constructs an instance of StreamKey from a Bundle produced by toBundle.

int
Bundle

Returns a Bundle representing the information stored in this object.

String
void
writeToParcel(Parcel dest, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Constants

CREATOR

public static final Parcelable.Creator<StreamKeyCREATOR

Public fields

groupIndex

public final int groupIndex

The group index.

periodIndex

public final int periodIndex

The period index.

streamIndex

public final int streamIndex

The stream index.

Public constructors

StreamKey

public StreamKey(int groupIndex, int streamIndex)

Creates an instance with periodIndex set to 0.

Parameters
int groupIndex

The group index.

int streamIndex

The stream index.

StreamKey

public StreamKey(int periodIndex, int groupIndex, int streamIndex)

Creates an instance of StreamKey using 3 indices.

Parameters
int periodIndex

The period index.

int groupIndex

The group index.

int streamIndex

The stream index.

Public methods

compareTo

public int compareTo(StreamKey o)

describeContents

public int describeContents()

equals

public boolean equals(@Nullable Object o)

fromBundle

public static StreamKey fromBundle(Bundle bundle)

Constructs an instance of StreamKey from a Bundle produced by toBundle.

hashCode

public int hashCode()

toBundle

public Bundle toBundle()

Returns a Bundle representing the information stored in this object.

toString

public String toString()

writeToParcel

public void writeToParcel(Parcel dest, int flags)