Class DefaultTrackSelector.Parameters
- java.lang.Object
-
- com.google.android.exoplayer2.trackselection.TrackSelectionParameters
-
- com.google.android.exoplayer2.trackselection.DefaultTrackSelector.Parameters
-
- All Implemented Interfaces:
Bundleable
- Enclosing class:
- DefaultTrackSelector
public static final class DefaultTrackSelector.Parameters extends TrackSelectionParameters implements Bundleable
ExtendsDefaultTrackSelector.Parameters
by adding fields that are specific toDefaultTrackSelector
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultTrackSelector.Parameters.Builder
A builder forDefaultTrackSelector.Parameters
.-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable
Bundleable.Creator<T extends Bundleable>
-
-
Field Summary
Fields Modifier and Type Field Description boolean
allowAudioMixedChannelCountAdaptiveness
Whether to allow adaptive audio selections containing mixed channel counts.boolean
allowAudioMixedDecoderSupportAdaptiveness
Whether to allow adaptive audio selections with mixed levels ofRendererCapabilities.DecoderSupport
andRendererCapabilities.HardwareAccelerationSupport
.boolean
allowAudioMixedMimeTypeAdaptiveness
Whether to allow adaptive audio selections containing mixed MIME types.boolean
allowAudioMixedSampleRateAdaptiveness
Whether to allow adaptive audio selections containing mixed sample rates.boolean
allowInvalidateSelectionsOnRendererCapabilitiesChange
Whether to allow to invalidate selections on renderer capabilities change.boolean
allowMultipleAdaptiveSelections
Whether multiple adaptive selections with more than one track are allowed.boolean
allowVideoMixedDecoderSupportAdaptiveness
Whether to allow adaptive video selections with mixed levels ofRendererCapabilities.DecoderSupport
andRendererCapabilities.HardwareAccelerationSupport
.boolean
allowVideoMixedMimeTypeAdaptiveness
Whether to allow adaptive video selections containing mixed MIME types.boolean
allowVideoNonSeamlessAdaptiveness
Whether to allow adaptive video selections where adaptation may not be completely seamless.boolean
constrainAudioChannelCountToDeviceCapabilities
Whether to constrain audio track selection so that the selected track's channel count does not exceed the device's output capabilities.static Bundleable.Creator<DefaultTrackSelector.Parameters>
CREATOR
Object that can restoreParameters
from aBundle
.static DefaultTrackSelector.Parameters
DEFAULT
Deprecated.This instance is not configured usingContext
constraints.static DefaultTrackSelector.Parameters
DEFAULT_WITHOUT_CONTEXT
An instance with default values, except those obtained from theContext
.boolean
exceedAudioConstraintsIfNecessary
Whether to exceed theTrackSelectionParameters.maxAudioChannelCount
andTrackSelectionParameters.maxAudioBitrate
constraints when no selection can be made otherwise.boolean
exceedRendererCapabilitiesIfNecessary
Whether to exceed renderer capabilities when no selection can be made otherwise.boolean
exceedVideoConstraintsIfNecessary
Whether to exceed theTrackSelectionParameters.maxVideoWidth
,TrackSelectionParameters.maxVideoHeight
andTrackSelectionParameters.maxVideoBitrate
constraints when no selection can be made otherwise.boolean
tunnelingEnabled
Whether to enable tunneling if possible.-
Fields inherited from class com.google.android.exoplayer2.trackselection.TrackSelectionParameters
disabledTrackTypes, FIELD_CUSTOM_ID_BASE, forceHighestSupportedBitrate, forceLowestBitrate, ignoredTextSelectionFlags, maxAudioBitrate, maxAudioChannelCount, maxVideoBitrate, maxVideoFrameRate, maxVideoHeight, maxVideoWidth, minVideoBitrate, minVideoFrameRate, minVideoHeight, minVideoWidth, overrides, preferredAudioLanguages, preferredAudioMimeTypes, preferredAudioRoleFlags, preferredTextLanguages, preferredTextRoleFlags, preferredVideoMimeTypes, preferredVideoRoleFlags, selectUndeterminedTextLanguage, viewportHeight, viewportOrientationMayChange, viewportWidth
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DefaultTrackSelector.Parameters.Builder
buildUpon()
Creates a newDefaultTrackSelector.Parameters.Builder
, copying the initial values from this instance.boolean
equals(Object obj)
static DefaultTrackSelector.Parameters
getDefaults(Context context)
Returns an instance configured with default values.boolean
getRendererDisabled(int rendererIndex)
Returns whether the renderer is disabled.DefaultTrackSelector.SelectionOverride
getSelectionOverride(int rendererIndex, TrackGroupArray groups)
Deprecated.Only works to retrieve the overrides set with the deprecatedDefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)
.int
hashCode()
boolean
hasSelectionOverride(int rendererIndex, TrackGroupArray groups)
Deprecated.Only works to retrieve the overrides set with the deprecatedDefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)
.Bundle
toBundle()
Returns aBundle
representing the information stored in this object.-
Methods inherited from class com.google.android.exoplayer2.trackselection.TrackSelectionParameters
fromBundle
-
-
-
-
Field Detail
-
DEFAULT_WITHOUT_CONTEXT
public static final DefaultTrackSelector.Parameters DEFAULT_WITHOUT_CONTEXT
An instance with default values, except those obtained from theContext
.If possible, use
getDefaults(Context)
instead.This instance will not have the following settings:
- Viewport constraints configured for the primary display.
- Preferred text language and role flags configured to the accessibility settings of
CaptioningManager
.
-
DEFAULT
@Deprecated public static final DefaultTrackSelector.Parameters DEFAULT
Deprecated.This instance is not configured usingContext
constraints. UsegetDefaults(Context)
instead.
-
exceedVideoConstraintsIfNecessary
public final boolean exceedVideoConstraintsIfNecessary
Whether to exceed theTrackSelectionParameters.maxVideoWidth
,TrackSelectionParameters.maxVideoHeight
andTrackSelectionParameters.maxVideoBitrate
constraints when no selection can be made otherwise. The default value istrue
.
-
allowVideoMixedMimeTypeAdaptiveness
public final boolean allowVideoMixedMimeTypeAdaptiveness
Whether to allow adaptive video selections containing mixed MIME types. Adaptations between different MIME types may not be completely seamless, in which caseallowVideoNonSeamlessAdaptiveness
also needs to betrue
for mixed MIME type selections to be made. The default value isfalse
.
-
allowVideoNonSeamlessAdaptiveness
public final boolean allowVideoNonSeamlessAdaptiveness
Whether to allow adaptive video selections where adaptation may not be completely seamless. The default value istrue
.
-
allowVideoMixedDecoderSupportAdaptiveness
public final boolean allowVideoMixedDecoderSupportAdaptiveness
Whether to allow adaptive video selections with mixed levels ofRendererCapabilities.DecoderSupport
andRendererCapabilities.HardwareAccelerationSupport
.
-
exceedAudioConstraintsIfNecessary
public final boolean exceedAudioConstraintsIfNecessary
Whether to exceed theTrackSelectionParameters.maxAudioChannelCount
andTrackSelectionParameters.maxAudioBitrate
constraints when no selection can be made otherwise. The default value istrue
.
-
allowAudioMixedMimeTypeAdaptiveness
public final boolean allowAudioMixedMimeTypeAdaptiveness
Whether to allow adaptive audio selections containing mixed MIME types. Adaptations between different MIME types may not be completely seamless. The default value isfalse
.
-
allowAudioMixedSampleRateAdaptiveness
public final boolean allowAudioMixedSampleRateAdaptiveness
Whether to allow adaptive audio selections containing mixed sample rates. Adaptations between different sample rates may not be completely seamless. The default value isfalse
.
-
allowAudioMixedChannelCountAdaptiveness
public final boolean allowAudioMixedChannelCountAdaptiveness
Whether to allow adaptive audio selections containing mixed channel counts. Adaptations between different channel counts may not be completely seamless. The default value isfalse
.
-
allowAudioMixedDecoderSupportAdaptiveness
public final boolean allowAudioMixedDecoderSupportAdaptiveness
Whether to allow adaptive audio selections with mixed levels ofRendererCapabilities.DecoderSupport
andRendererCapabilities.HardwareAccelerationSupport
.
-
constrainAudioChannelCountToDeviceCapabilities
public final boolean constrainAudioChannelCountToDeviceCapabilities
Whether to constrain audio track selection so that the selected track's channel count does not exceed the device's output capabilities. The default value istrue
.
-
exceedRendererCapabilitiesIfNecessary
public final boolean exceedRendererCapabilitiesIfNecessary
Whether to exceed renderer capabilities when no selection can be made otherwise.This parameter applies when all of the tracks available for a renderer exceed the renderer's reported capabilities. If the parameter is
true
then the lowest quality track will still be selected. Playback may succeed if the renderer has under-reported its true capabilities. Iffalse
then no track will be selected. The default value istrue
.
-
tunnelingEnabled
public final boolean tunnelingEnabled
Whether to enable tunneling if possible.
-
allowMultipleAdaptiveSelections
public final boolean allowMultipleAdaptiveSelections
Whether multiple adaptive selections with more than one track are allowed. The default value istrue
.Note that tracks are only eligible for adaptation if they define a bitrate, the renderers support the tracks and allow adaptation between them, and they are not excluded based on other track selection parameters.
-
allowInvalidateSelectionsOnRendererCapabilitiesChange
public final boolean allowInvalidateSelectionsOnRendererCapabilitiesChange
Whether to allow to invalidate selections on renderer capabilities change. The default value isfalse
.
-
CREATOR
public static final Bundleable.Creator<DefaultTrackSelector.Parameters> CREATOR
Object that can restoreParameters
from aBundle
.
-
-
Method Detail
-
getDefaults
public static DefaultTrackSelector.Parameters getDefaults(Context context)
Returns an instance configured with default values.
-
getRendererDisabled
public boolean getRendererDisabled(int rendererIndex)
Returns whether the renderer is disabled.- Parameters:
rendererIndex
- The renderer index.- Returns:
- Whether the renderer is disabled.
-
hasSelectionOverride
@Deprecated public boolean hasSelectionOverride(int rendererIndex, TrackGroupArray groups)
Deprecated.Only works to retrieve the overrides set with the deprecatedDefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)
. UseTrackSelectionParameters.overrides
instead.Returns whether there is an override for the specified renderer andTrackGroupArray
.- Parameters:
rendererIndex
- The renderer index.groups
- TheTrackGroupArray
.- Returns:
- Whether there is an override.
-
getSelectionOverride
@Deprecated @Nullable public DefaultTrackSelector.SelectionOverride getSelectionOverride(int rendererIndex, TrackGroupArray groups)
Deprecated.Only works to retrieve the overrides set with the deprecatedDefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)
. UseTrackSelectionParameters.overrides
instead.Returns the override for the specified renderer andTrackGroupArray
.- Parameters:
rendererIndex
- The renderer index.groups
- TheTrackGroupArray
.- Returns:
- The override, or null if no override exists.
-
buildUpon
public DefaultTrackSelector.Parameters.Builder buildUpon()
Creates a newDefaultTrackSelector.Parameters.Builder
, copying the initial values from this instance.- Overrides:
buildUpon
in classTrackSelectionParameters
-
equals
public boolean equals(@Nullable Object obj)
- Overrides:
equals
in classTrackSelectionParameters
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTrackSelectionParameters
-
toBundle
public Bundle toBundle()
Description copied from interface:Bundleable
Returns aBundle
representing the information stored in this object.- Specified by:
toBundle
in interfaceBundleable
- Overrides:
toBundle
in classTrackSelectionParameters
-
-