Package com.google.android.exoplayer2.testutil

## Class FakeTrackSelector

- java.lang.Object
- - com.google.android.exoplayer2.trackselection.TrackSelector
  - - com.google.android.exoplayer2.trackselection.MappingTrackSelector
    - - com.google.android.exoplayer2.trackselection.DefaultTrackSelector
      - - com.google.android.exoplayer2.testutil.FakeTrackSelector

-     public class FakeTrackSelector
      extends DefaultTrackSelector

  A fake `MappingTrackSelector` that returns `FakeTrackSelection`s.

- - ### Nested Class Summary

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

      `DefaultTrackSelector.Parameters, DefaultTrackSelector.ParametersBuilder, DefaultTrackSelector.SelectionEligibility, DefaultTrackSelector.SelectionOverride`

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

      `MappingTrackSelector.MappedTrackInfo`

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

      `TrackSelector.InvalidationListener`

  - ### Field Summary

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

      `context, SELECTION_ELIGIBILITY_ADAPTIVE, SELECTION_ELIGIBILITY_FIXED, SELECTION_ELIGIBILITY_NO`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FakeTrackSelector()` |
    `FakeTrackSelector​(boolean mayReuseTrackSelection)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `List<FakeTrackSelection>` | `getAllTrackSelections()` | Returns list of all `FakeTrackSelection`s that this track selector has made so far.
    `protected @NullableType ExoTrackSelection.Definition[]` | `selectAllTracks​(MappingTrackSelector.MappedTrackInfo mappedTrackInfo, @com.google.android.exoplayer2.RendererCapabilities.Capabilities int[][][] rendererFormatSupports, @com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport int[] rendererMixedMimeTypeAdaptationSupports, DefaultTrackSelector.Parameters params)` | Called from `DefaultTrackSelector.selectTracks(MappedTrackInfo, int[][][], int[], MediaPeriodId, Timeline)` to make a track selection for each renderer, prior to overrides and disabled flags being applied.

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

      `buildUponParameters, getFormatLanguageScore, getParameters, isSetParametersSupported, isSupported, normalizeUndeterminedLanguageToNull, release, selectAudioTrack, selectOtherTrack, selectTextTrack, selectTracks, selectVideoTrack, setAudioAttributes, setParameters, setParameters, setParameters`

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

      `getCurrentMappedTrackInfo, onSelectionActivated, selectTracks`

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

      `getBandwidthMeter, init, invalidate`

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

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

- - ### Constructor Detail

    - #### FakeTrackSelector

          public FakeTrackSelector()

    - #### FakeTrackSelector

          public FakeTrackSelector​(boolean mayReuseTrackSelection)

      Parameters:
        `mayReuseTrackSelection` - Whether this `FakeTrackSelector` will reuse `ExoTrackSelection`s during track selection, when it finds previously-selected track selection using the same `TrackGroup`.

  - ### Method Detail

    - #### selectAllTracks

          protected @NullableType ExoTrackSelection.Definition[] selectAllTracks​(MappingTrackSelector.MappedTrackInfo mappedTrackInfo,
                                                                                 @com.google.android.exoplayer2.RendererCapabilities.Capabilities int[][][] rendererFormatSupports,
                                                                                 @com.google.android.exoplayer2.RendererCapabilities.AdaptiveSupport int[] rendererMixedMimeTypeAdaptationSupports,
                                                                                 DefaultTrackSelector.Parameters params)

      Description copied from class: `DefaultTrackSelector`
      Called from `DefaultTrackSelector.selectTracks(MappedTrackInfo, int[][][], int[], MediaPeriodId, Timeline)` to make a track selection for each renderer, prior to overrides and disabled flags being applied.

      The implementation should not account for overrides and disabled flags. Track selections generated by this method will be overridden to account for these properties.

      Overrides:
        `selectAllTracks` in class `DefaultTrackSelector`
      Parameters:
        `mappedTrackInfo` - Mapped track information.
        `rendererFormatSupports` - The `RendererCapabilities.Capabilities` for each mapped track, indexed by renderer, track group and track (in that order).
        `rendererMixedMimeTypeAdaptationSupports` - The `RendererCapabilities.AdaptiveSupport` for mixed MIME type adaptation for the renderer.
      Returns:
        The `ExoTrackSelection.Definition`s for the renderers. A null entry indicates no selection was made.

    - #### getAllTrackSelections

          public List<FakeTrackSelection> getAllTrackSelections()

      Returns list of all `FakeTrackSelection`s that this track selector has made so far.