Package com.google.android.exoplayer2.trackselection

## 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

  Extends `DefaultTrackSelector.Parameters` by adding fields that are specific to `DefaultTrackSelector`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `DefaultTrackSelector.Parameters.Builder` | A builder for `DefaultTrackSelector.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 of `RendererCapabilities.DecoderSupport` and `RendererCapabilities.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` | `allowMultipleAdaptiveSelections` | Whether multiple adaptive selections with more than one track are allowed.
    `boolean` | `allowVideoMixedDecoderSupportAdaptiveness` | Whether to allow adaptive video selections with mixed levels of `RendererCapabilities.DecoderSupport` and `RendererCapabilities.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 restore `Parameters` from a `Bundle`.
    `static DefaultTrackSelector.Parameters` | `DEFAULT` | Deprecated. This instance is not configured using `Context` constraints.
    `static DefaultTrackSelector.Parameters` | `DEFAULT_WITHOUT_CONTEXT` | An instance with default values, except those obtained from the `Context`.
    `boolean` | `exceedAudioConstraintsIfNecessary` | Whether to exceed the `TrackSelectionParameters.maxAudioChannelCount` and `TrackSelectionParameters.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 the `TrackSelectionParameters.maxVideoWidth`, `TrackSelectionParameters.maxVideoHeight` and `TrackSelectionParameters.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 new `DefaultTrackSelector.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 deprecated `DefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)`.
    `int` | `hashCode()` |
    `boolean` | `hasSelectionOverride​(int rendererIndex, TrackGroupArray groups)` | Deprecated. Only works to retrieve the overrides set with the deprecated `DefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)`.
    `Bundle` | `toBundle()` | Returns a `Bundle` representing the information stored in this object.

    - ### Methods inherited from class com.google.android.exoplayer2.trackselection.TrackSelectionParameters

      `fromBundle`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_WITHOUT_CONTEXT

          public static final DefaultTrackSelector.Parameters DEFAULT_WITHOUT_CONTEXT

      An instance with default values, except those obtained from the `Context`.

      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 using `Context` constraints. Use `getDefaults(Context)` instead.

    - #### exceedVideoConstraintsIfNecessary

          public final boolean exceedVideoConstraintsIfNecessary

      Whether to exceed the `TrackSelectionParameters.maxVideoWidth`, `TrackSelectionParameters.maxVideoHeight` and `TrackSelectionParameters.maxVideoBitrate` constraints when no selection can be made otherwise. The default value is `true`.

    - #### 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 case `allowVideoNonSeamlessAdaptiveness` also needs to be `true` for mixed MIME type selections to be made. The default value is `false`.

    - #### allowVideoNonSeamlessAdaptiveness

          public final boolean allowVideoNonSeamlessAdaptiveness

      Whether to allow adaptive video selections where adaptation may not be completely seamless. The default value is `true`.

    - #### allowVideoMixedDecoderSupportAdaptiveness

          public final boolean allowVideoMixedDecoderSupportAdaptiveness

      Whether to allow adaptive video selections with mixed levels of `RendererCapabilities.DecoderSupport` and `RendererCapabilities.HardwareAccelerationSupport`.

    - #### exceedAudioConstraintsIfNecessary

          public final boolean exceedAudioConstraintsIfNecessary

      Whether to exceed the `TrackSelectionParameters.maxAudioChannelCount` and `TrackSelectionParameters.maxAudioBitrate` constraints when no selection can be made otherwise. The default value is `true`.

    - #### 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 is `false`.

    - #### 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 is `false`.

    - #### 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 is `false`.

    - #### allowAudioMixedDecoderSupportAdaptiveness

          public final boolean allowAudioMixedDecoderSupportAdaptiveness

      Whether to allow adaptive audio selections with mixed levels of `RendererCapabilities.DecoderSupport` and `RendererCapabilities.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 is `true`.

    - #### 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. If `false` then no track will be selected. The default value is `true`.

    - #### 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 is `true`.

      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.

    - #### CREATOR

          public static final Bundleable.Creator<DefaultTrackSelector.Parameters> CREATOR

      Object that can restore `Parameters` from a `Bundle`.

  - ### 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 deprecated `DefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)`. Use `TrackSelectionParameters.overrides` instead.
      Returns whether there is an override for the specified renderer and `TrackGroupArray`.
      Parameters:
        `rendererIndex` - The renderer index.
        `groups` - The `TrackGroupArray`.
      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 deprecated `DefaultTrackSelector.Parameters.Builder.setSelectionOverride(int, TrackGroupArray, SelectionOverride)`. Use `TrackSelectionParameters.overrides` instead.
      Returns the override for the specified renderer and `TrackGroupArray`.
      Parameters:
        `rendererIndex` - The renderer index.
        `groups` - The `TrackGroupArray`.
      Returns:
        The override, or null if no override exists.

    - #### buildUpon

          public DefaultTrackSelector.Parameters.Builder buildUpon()

      Creates a new `DefaultTrackSelector.Parameters.Builder`, copying the initial values from this instance.
      Overrides:
        `buildUpon` in class `TrackSelectionParameters`

    - #### equals

          public boolean equals​(@Nullable
                                Object obj)

      Overrides:
        `equals` in class `TrackSelectionParameters`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `TrackSelectionParameters`

    - #### toBundle

          public Bundle toBundle()

      Description copied from interface: `Bundleable`
      Returns a `Bundle` representing the information stored in this object.
      Specified by:
        `toBundle` in interface `Bundleable`
      Overrides:
        `toBundle` in class `TrackSelectionParameters`