MappingTrackSelector.MappedTrackInfo


public final class MappingTrackSelector.MappedTrackInfo


Provides mapped track information for each renderer.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = )
@IntDef(value = )
public annotation MappingTrackSelector.MappedTrackInfo.RendererSupport

Levels of renderer support.

Constants

static final int

The renderer has tracks mapped to it and at least one is of a supported type, but all such tracks exceed the renderer's capabilities.

static final int

The renderer does not have any associated tracks.

static final int

The renderer has tracks mapped to it, and at least one such track is playable.

static final int

The renderer has tracks mapped to it, but all are unsupported.

Public fields

final int
final TrackGroupArray

Public methods

int
@RendererCapabilities.AdaptiveSupport
getAdaptiveSupport(
    int rendererIndex,
    int groupIndex,
    boolean includeCapabilitiesExceededTracks
)

Returns the extent to which a renderer supports adaptation between supported tracks in a specified TrackGroup.

int
@RendererCapabilities.AdaptiveSupport
getAdaptiveSupport(
    int rendererIndex,
    int groupIndex,
    int[] trackIndices
)

Returns the extent to which a renderer supports adaptation between specified tracks within a TrackGroup.

int
@RendererCapabilities.Capabilities
getCapabilities(int rendererIndex, int groupIndex, int trackIndex)

Returns the Capabilities of the renderer for an individual track.

int

Returns the number of renderers.

String
getRendererName(int rendererIndex)

Returns the name of the renderer at a given index.

int

Returns the extent to which a renderer can play the tracks that are mapped to it.

int
@C.TrackType
getRendererType(int rendererIndex)

Returns the track type that the renderer at a given index handles.

TrackGroupArray
getTrackGroups(int rendererIndex)

Returns the TrackGroups mapped to the renderer at the specified index.

int
@C.FormatSupport
getTrackSupport(int rendererIndex, int groupIndex, int trackIndex)

Returns the extent to which an individual track is supported by the renderer.

int

Returns the extent to which tracks of a specified type are supported.

TrackGroupArray

Returns TrackGroups not mapped to any renderer.

Constants

RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS

public static final int RENDERER_SUPPORT_EXCEEDS_CAPABILITIES_TRACKS = 2

The renderer has tracks mapped to it and at least one is of a supported type, but all such tracks exceed the renderer's capabilities. In other words, getTrackSupport returns FORMAT_EXCEEDS_CAPABILITIES for at least one track mapped to the renderer, but does not return FORMAT_HANDLED for any tracks mapped to the renderer.

RENDERER_SUPPORT_NO_TRACKS

public static final int RENDERER_SUPPORT_NO_TRACKS = 0

The renderer does not have any associated tracks.

RENDERER_SUPPORT_PLAYABLE_TRACKS

public static final int RENDERER_SUPPORT_PLAYABLE_TRACKS = 3

The renderer has tracks mapped to it, and at least one such track is playable. In other words, getTrackSupport returns FORMAT_HANDLED for at least one track mapped to the renderer.

RENDERER_SUPPORT_UNSUPPORTED_TRACKS

public static final int RENDERER_SUPPORT_UNSUPPORTED_TRACKS = 1

The renderer has tracks mapped to it, but all are unsupported. In other words, getTrackSupport returns FORMAT_UNSUPPORTED_DRM, FORMAT_UNSUPPORTED_SUBTYPE or FORMAT_UNSUPPORTED_TYPE for all tracks mapped to the renderer.

Public fields

rendererCount

public final int rendererCount

unmappedTrackGroups

public final TrackGroupArray unmappedTrackGroups

Public methods

getAdaptiveSupport

@RendererCapabilities.AdaptiveSupport
public int getAdaptiveSupport(
    int rendererIndex,
    int groupIndex,
    boolean includeCapabilitiesExceededTracks
)

Returns the extent to which a renderer supports adaptation between supported tracks in a specified TrackGroup.

Tracks for which getTrackSupport returns FORMAT_HANDLED are always considered. Tracks for which getTrackSupport returns FORMAT_EXCEEDS_CAPABILITIES are also considered if includeCapabilitiesExceededTracks is set to true. Tracks for which getTrackSupport returns FORMAT_UNSUPPORTED_DRM, FORMAT_UNSUPPORTED_TYPE or FORMAT_UNSUPPORTED_SUBTYPE are never considered.

Parameters
int rendererIndex

The renderer index.

int groupIndex

The index of the track group.

boolean includeCapabilitiesExceededTracks

Whether tracks that exceed the capabilities of the renderer are included when determining support.

Returns
int

The AdaptiveSupport.

getAdaptiveSupport

@RendererCapabilities.AdaptiveSupport
public int getAdaptiveSupport(
    int rendererIndex,
    int groupIndex,
    int[] trackIndices
)

Returns the extent to which a renderer supports adaptation between specified tracks within a TrackGroup.

Parameters
int rendererIndex

The renderer index.

int groupIndex

The index of the track group.

int[] trackIndices

The indices of the tracks in the track group for which to query support.

Returns
int

The AdaptiveSupport.

getCapabilities

@RendererCapabilities.Capabilities
public int getCapabilities(int rendererIndex, int groupIndex, int trackIndex)

Returns the Capabilities of the renderer for an individual track.

Parameters
int rendererIndex

The renderer index.

int groupIndex

The index of the track group to which the track belongs.

int trackIndex

The index of the track within the track group.

Returns
int

The Capabilities.

getRendererCount

public int getRendererCount()

Returns the number of renderers.

getRendererName

public String getRendererName(int rendererIndex)

Returns the name of the renderer at a given index.

Parameters
int rendererIndex

The renderer index.

Returns
String

The name of the renderer.

See also
getName

getRendererSupport

@MappingTrackSelector.MappedTrackInfo.RendererSupport
public int getRendererSupport(int rendererIndex)

Returns the extent to which a renderer can play the tracks that are mapped to it.

Parameters
int rendererIndex

The renderer index.

Returns
int

The RendererSupport.

getRendererType

@C.TrackType
public int getRendererType(int rendererIndex)

Returns the track type that the renderer at a given index handles.

Parameters
int rendererIndex

The renderer index.

Returns
int

The C.TrackType of the renderer.

See also
getTrackType

getTrackGroups

public TrackGroupArray getTrackGroups(int rendererIndex)

Returns the TrackGroups mapped to the renderer at the specified index.

Parameters
int rendererIndex

The renderer index.

Returns
TrackGroupArray

The corresponding TrackGroups.

getTrackSupport

@C.FormatSupport
public int getTrackSupport(int rendererIndex, int groupIndex, int trackIndex)

Returns the extent to which an individual track is supported by the renderer.

Parameters
int rendererIndex

The renderer index.

int groupIndex

The index of the track group to which the track belongs.

int trackIndex

The index of the track within the track group.

Returns
int

The FormatSupport.

getTypeSupport

@MappingTrackSelector.MappedTrackInfo.RendererSupport
public int getTypeSupport(@C.TrackType int trackType)

Returns the extent to which tracks of a specified type are supported. This is the best level of support obtained from getRendererSupport for all renderers that handle the specified type. If no such renderers exist then RENDERER_SUPPORT_NO_TRACKS is returned.

Parameters
@C.TrackType int trackType

The track type.

Returns
int

The RendererSupport.

getUnmappedTrackGroups

public TrackGroupArray getUnmappedTrackGroups()

Returns TrackGroups not mapped to any renderer.