public class DefaultTrackSelector extends MappingTrackSelector
MappingTrackSelector
that allows configuration of common parameters. It is safe to call
the methods of this class from the application thread. See Parameters#Parameters()
for
default selection parameters.Modifier and Type | Class and Description |
---|---|
static class |
DefaultTrackSelector.Parameters
Holder for available configurations for the
DefaultTrackSelector . |
MappingTrackSelector.MappedTrackInfo, MappingTrackSelector.SelectionOverride
TrackSelector.EventListener<T>, TrackSelector.InvalidationListener
Constructor and Description |
---|
DefaultTrackSelector(Handler eventHandler)
Constructs an instance that does not support adaptive video.
|
DefaultTrackSelector(Handler eventHandler,
TrackSelection.Factory adaptiveVideoTrackSelectionFactory)
Constructs an instance that uses a factory to create adaptive video track selections.
|
Modifier and Type | Method and Description |
---|---|
DefaultTrackSelector.Parameters |
getParameters()
Gets the current selection parameters.
|
protected TrackSelection |
selectAudioTrack(TrackGroupArray groups,
int[][] formatSupport,
String preferredAudioLanguage) |
protected TrackSelection |
selectOtherTrack(int trackType,
TrackGroupArray groups,
int[][] formatSupport) |
protected TrackSelection |
selectTextTrack(TrackGroupArray groups,
int[][] formatSupport,
String preferredTextLanguage,
String preferredAudioLanguage) |
protected TrackSelection[] |
selectTracks(RendererCapabilities[] rendererCapabilities,
TrackGroupArray[] rendererTrackGroupArrays,
int[][][] rendererFormatSupports)
Given an array of renderers and a set of
TrackGroup s mapped to each of them, provides a
TrackSelection per renderer. |
protected TrackSelection |
selectVideoTrack(RendererCapabilities rendererCapabilities,
TrackGroupArray groups,
int[][] formatSupport,
int maxVideoWidth,
int maxVideoHeight,
boolean allowNonSeamlessAdaptiveness,
boolean allowMixedMimeAdaptiveness,
int viewportWidth,
int viewportHeight,
boolean orientationMayChange,
TrackSelection.Factory adaptiveVideoTrackSelectionFactory,
boolean exceedConstraintsIfNecessary) |
void |
setParameters(DefaultTrackSelector.Parameters params)
Atomically sets the provided parameters for track selection.
|
clearSelectionOverride, clearSelectionOverrides, clearSelectionOverrides, getRendererDisabled, getSelectionOverride, hasSelectionOverride, selectTracks, setRendererDisabled, setSelectionOverride
addListener, getCurrentSelections, init, invalidate, onSelectionActivated, removeListener
public DefaultTrackSelector(Handler eventHandler)
eventHandler
- A handler to use when delivering events to listeners. May be null if
listeners will not be added.public DefaultTrackSelector(Handler eventHandler, TrackSelection.Factory adaptiveVideoTrackSelectionFactory)
eventHandler
- A handler to use when delivering events to listeners. May be null if
listeners will not be added.adaptiveVideoTrackSelectionFactory
- A factory for adaptive video TrackSelection
s,
or null if the selector should not support adaptive video.public void setParameters(DefaultTrackSelector.Parameters params)
params
- The parameters for track selection.public DefaultTrackSelector.Parameters getParameters()
protected TrackSelection[] selectTracks(RendererCapabilities[] rendererCapabilities, TrackGroupArray[] rendererTrackGroupArrays, int[][][] rendererFormatSupports) throws ExoPlaybackException
MappingTrackSelector
TrackGroup
s mapped to each of them, provides a
TrackSelection
per renderer.selectTracks
in class MappingTrackSelector
rendererCapabilities
- The RendererCapabilities
of the renderers for which
TrackSelection
s are to be generated.rendererTrackGroupArrays
- An array of TrackGroupArray
s where each entry
corresponds to the renderer of equal index in renderers
.rendererFormatSupports
- Maps every available track to a specific level of support as
defined by the renderer FORMAT_*
constants.ExoPlaybackException
- If an error occurs while selecting the tracks.protected TrackSelection selectVideoTrack(RendererCapabilities rendererCapabilities, TrackGroupArray groups, int[][] formatSupport, int maxVideoWidth, int maxVideoHeight, boolean allowNonSeamlessAdaptiveness, boolean allowMixedMimeAdaptiveness, int viewportWidth, int viewportHeight, boolean orientationMayChange, TrackSelection.Factory adaptiveVideoTrackSelectionFactory, boolean exceedConstraintsIfNecessary) throws ExoPlaybackException
ExoPlaybackException
protected TrackSelection selectAudioTrack(TrackGroupArray groups, int[][] formatSupport, String preferredAudioLanguage)
protected TrackSelection selectTextTrack(TrackGroupArray groups, int[][] formatSupport, String preferredTextLanguage, String preferredAudioLanguage)
protected TrackSelection selectOtherTrack(int trackType, TrackGroupArray groups, int[][] formatSupport)