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:
    `Parcelable`
  Enclosing class:
    DefaultTrackSelector

      public static final class DefaultTrackSelector.Parameters
      extends TrackSelectionParameters

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

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.google.android.exoplayer2.trackselection.TrackSelectionParameters

      `TrackSelectionParameters.Builder`

    - ### Nested classes/interfaces inherited from interface android.os.Parcelable

      `Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `boolean` | `allowAudioMixedChannelCountAdaptiveness` | Whether to allow adaptive audio selections containing mixed channel counts.
    `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` | `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.
    `static Parcelable.Creator<DefaultTrackSelector.Parameters>` | `CREATOR` |
    `static DefaultTrackSelector.Parameters` | `DEFAULT_WITHOUT_CONTEXT` | An instance with default values, except those obtained from the `Context`.
    `boolean` | `exceedAudioConstraintsIfNecessary` | Whether to exceed the `maxAudioChannelCount` and `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 `maxVideoWidth`, `maxVideoHeight` and `maxVideoBitrate` constraints when no selection can be made otherwise.
    `boolean` | `forceHighestSupportedBitrate` | Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints.
    `boolean` | `forceLowestBitrate` | Whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints.
    `int` | `maxAudioBitrate` | Maximum allowed audio bitrate in bits per second.
    `int` | `maxAudioChannelCount` | Maximum allowed audio channel count.
    `int` | `maxVideoBitrate` | Maximum allowed video bitrate in bits per second.
    `int` | `maxVideoFrameRate` | Maximum allowed video frame rate in hertz.
    `int` | `maxVideoHeight` | Maximum allowed video height in pixels.
    `int` | `maxVideoWidth` | Maximum allowed video width in pixels.
    `int` | `minVideoBitrate` | Minimum allowed video bitrate in bits per second.
    `int` | `minVideoFrameRate` | Minimum allowed video frame rate in hertz.
    `int` | `minVideoHeight` | Minimum allowed video height in pixels.
    `int` | `minVideoWidth` | Minimum allowed video width in pixels.
    `ImmutableList<String>` | `preferredAudioMimeTypes` | The preferred sample MIME types for audio tracks in order of preference, or an empty list for no preference.
    `ImmutableList<String>` | `preferredVideoMimeTypes` | The preferred sample MIME types for video tracks in order of preference, or an empty list for no preference.
    `boolean` | `tunnelingEnabled` | Whether to enable tunneling if possible.
    `int` | `viewportHeight` | Viewport height in pixels.
    `boolean` | `viewportOrientationMayChange` | Whether the viewport orientation may change during playback.
    `int` | `viewportWidth` | Viewport width in pixels.

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

      `DEFAULT, disabledTextTrackSelectionFlags, preferredAudioLanguages, preferredAudioRoleFlags, preferredTextLanguages, preferredTextRoleFlags, selectUndeterminedTextLanguage`

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DefaultTrackSelector.ParametersBuilder` | `buildUpon()` | Creates a new `DefaultTrackSelector.ParametersBuilder`, copying the initial values from this instance.
    `int` | `describeContents()` |
    `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)` | Returns the override for the specified renderer and `TrackGroupArray`.
    `int` | `hashCode()` |
    `boolean` | `hasSelectionOverride​(int rendererIndex, TrackGroupArray groups)` | Returns whether there is an override for the specified renderer and `TrackGroupArray`.
    `void` | `writeToParcel​(Parcel dest, int flags)` |

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

    - #### maxVideoWidth

          public final int maxVideoWidth

      Maximum allowed video width in pixels. The default value is `Integer.MAX_VALUE` (i.e. no constraint).

      To constrain adaptive video track selections to be suitable for a given viewport (the region of the display within which video will be played), use (`viewportWidth`, `viewportHeight` and `viewportOrientationMayChange`) instead.

    - #### maxVideoHeight

          public final int maxVideoHeight

      Maximum allowed video height in pixels. The default value is `Integer.MAX_VALUE` (i.e. no constraint).

      To constrain adaptive video track selections to be suitable for a given viewport (the region of the display within which video will be played), use (`viewportWidth`, `viewportHeight` and `viewportOrientationMayChange`) instead.

    - #### maxVideoFrameRate

          public final int maxVideoFrameRate

      Maximum allowed video frame rate in hertz. The default value is `Integer.MAX_VALUE` (i.e. no constraint).

    - #### maxVideoBitrate

          public final int maxVideoBitrate

      Maximum allowed video bitrate in bits per second. The default value is `Integer.MAX_VALUE` (i.e. no constraint).

    - #### minVideoWidth

          public final int minVideoWidth

      Minimum allowed video width in pixels. The default value is 0 (i.e. no constraint).

    - #### minVideoHeight

          public final int minVideoHeight

      Minimum allowed video height in pixels. The default value is 0 (i.e. no constraint).

    - #### minVideoFrameRate

          public final int minVideoFrameRate

      Minimum allowed video frame rate in hertz. The default value is 0 (i.e. no constraint).

    - #### minVideoBitrate

          public final int minVideoBitrate

      Minimum allowed video bitrate in bits per second. The default value is 0 (i.e. no constraint).

    - #### exceedVideoConstraintsIfNecessary

          public final boolean exceedVideoConstraintsIfNecessary

      Whether to exceed the `maxVideoWidth`, `maxVideoHeight` and `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`.

    - #### viewportWidth

          public final int viewportWidth

      Viewport width in pixels. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is the physical width of the primary display, in pixels.

    - #### viewportHeight

          public final int viewportHeight

      Viewport height in pixels. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is the physical height of the primary display, in pixels.

    - #### viewportOrientationMayChange

          public final boolean viewportOrientationMayChange

      Whether the viewport orientation may change during playback. Constrains video track selections for adaptive content so that only tracks suitable for the viewport are selected. The default value is `true`.

    - #### preferredVideoMimeTypes

          public final ImmutableList<String> preferredVideoMimeTypes

      The preferred sample MIME types for video tracks in order of preference, or an empty list for no preference. The default is an empty list.

    - #### maxAudioChannelCount

          public final int maxAudioChannelCount

      Maximum allowed audio channel count. The default value is `Integer.MAX_VALUE` (i.e. no constraint).

    - #### maxAudioBitrate

          public final int maxAudioBitrate

      Maximum allowed audio bitrate in bits per second. The default value is `Integer.MAX_VALUE` (i.e. no constraint).

    - #### exceedAudioConstraintsIfNecessary

          public final boolean exceedAudioConstraintsIfNecessary

      Whether to exceed the `maxAudioChannelCount` and `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`.

    - #### preferredAudioMimeTypes

          public final ImmutableList<String> preferredAudioMimeTypes

      The preferred sample MIME types for audio tracks in order of preference, or an empty list for no preference. The default is an empty list.

    - #### forceLowestBitrate

          public final boolean forceLowestBitrate

      Whether to force selection of the single lowest bitrate audio and video tracks that comply with all other constraints. The default value is `false`.

    - #### forceHighestSupportedBitrate

          public final boolean forceHighestSupportedBitrate

      Whether to force selection of the highest bitrate audio and video tracks that comply with all other constraints. The default value is `false`.

    - #### 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 Parcelable.Creator<DefaultTrackSelector.Parameters> CREATOR

  - ### Method Detail

    - #### getDefaults

          public static DefaultTrackSelector.Parameters getDefaults​(Context context)

      Returns an instance configured with default values.

    - #### getRendererDisabled

          public final boolean getRendererDisabled​(int rendererIndex)

      Returns whether the renderer is disabled.
      Parameters:
        `rendererIndex` - The renderer index.
      Returns:
        Whether the renderer is disabled.

    - #### hasSelectionOverride

          public final boolean hasSelectionOverride​(int rendererIndex,
                                                    TrackGroupArray groups)

      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

          @Nullable
          public final DefaultTrackSelector.SelectionOverride getSelectionOverride​(int rendererIndex,
                                                                                   TrackGroupArray groups)

      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.ParametersBuilder buildUpon()

      Creates a new `DefaultTrackSelector.ParametersBuilder`, 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`

    - #### describeContents

          public int describeContents()

      Specified by:
        `describeContents` in interface `Parcelable`
      Overrides:
        `describeContents` in class `TrackSelectionParameters`

    - #### writeToParcel

          public void writeToParcel​(Parcel dest,
                                    int flags)

      Specified by:
        `writeToParcel` in interface `Parcelable`
      Overrides:
        `writeToParcel` in class `TrackSelectionParameters`