Package com.google.android.exoplayer2.trackselection

## Class TrackSelectorResult

- java.lang.Object
- - com.google.android.exoplayer2.trackselection.TrackSelectorResult

-     public final class TrackSelectorResult
      extends Object

  The result of a `TrackSelector` operation.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `Object` | `info` | An opaque object that will be returned to `TrackSelector.onSelectionActivated(Object)` should the selections be activated.
    `int` | `length` | The number of selections in the result.
    `@NullableType RendererConfiguration[]` | `rendererConfigurations` | A `RendererConfiguration` for each renderer.
    `@NullableType ExoTrackSelection[]` | `selections` | A `ExoTrackSelection` array containing the track selection for each renderer.
    `Tracks` | `tracks` | Describe the tracks and which one were selected.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TrackSelectorResult​(@NullableType RendererConfiguration[] rendererConfigurations, @NullableType ExoTrackSelection[] selections, Tracks tracks, Object info)` |
    `TrackSelectorResult​(@NullableType RendererConfiguration[] rendererConfigurations, @NullableType ExoTrackSelection[] selections, Object info)` | Deprecated. Use `TrackSelectorResult(RendererConfiguration[], ExoTrackSelection[], Tracks, Object)`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `isEquivalent​(TrackSelectorResult other)` | Returns whether this result is equivalent to `other` for all renderers.
    `boolean` | `isEquivalent​(TrackSelectorResult other, int index)` | Returns whether this result is equivalent to `other` for the renderer at the given index.
    `boolean` | `isRendererEnabled​(int index)` | Returns whether the renderer at the specified index is enabled.

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

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

- - ### Field Detail

    - #### length

          public final int length

      The number of selections in the result. Greater than or equal to zero.

    - #### rendererConfigurations

          public final @NullableType RendererConfiguration[] rendererConfigurations

      A `RendererConfiguration` for each renderer. A null entry indicates the corresponding renderer should be disabled.

    - #### selections

          public final @NullableType ExoTrackSelection[] selections

      A `ExoTrackSelection` array containing the track selection for each renderer.

    - #### tracks

          public final Tracks tracks

      Describe the tracks and which one were selected.

    - #### info

          @Nullable
          public final Object info

      An opaque object that will be returned to `TrackSelector.onSelectionActivated(Object)` should the selections be activated.

  - ### Constructor Detail

    - #### TrackSelectorResult

          @Deprecated
          public TrackSelectorResult​(@NullableType RendererConfiguration[] rendererConfigurations,
                                     @NullableType ExoTrackSelection[] selections,
                                     @Nullable
                                     Object info)

      Deprecated.
      Use `TrackSelectorResult(RendererConfiguration[], ExoTrackSelection[], Tracks, Object)`.
      Parameters:
        `rendererConfigurations` - A `RendererConfiguration` for each renderer. A null entry indicates the corresponding renderer should be disabled.
        `selections` - A `ExoTrackSelection` array containing the selection for each renderer.
        `info` - An opaque object that will be returned to `TrackSelector.onSelectionActivated(Object)` should the selection be activated. May be `null`.

    - #### TrackSelectorResult

          public TrackSelectorResult​(@NullableType RendererConfiguration[] rendererConfigurations,
                                     @NullableType ExoTrackSelection[] selections,
                                     Tracks tracks,
                                     @Nullable
                                     Object info)

      Parameters:
        `rendererConfigurations` - A `RendererConfiguration` for each renderer. A null entry indicates the corresponding renderer should be disabled.
        `selections` - A `ExoTrackSelection` array containing the selection for each renderer.
        `tracks` - Description of the available tracks and which one were selected.
        `info` - An opaque object that will be returned to `TrackSelector.onSelectionActivated(Object)` should the selection be activated. May be `null`.

  - ### Method Detail

    - #### isRendererEnabled

          public boolean isRendererEnabled​(int index)

      Returns whether the renderer at the specified index is enabled.

    - #### isEquivalent

          public boolean isEquivalent​(@Nullable
                                      TrackSelectorResult other)

      Returns whether this result is equivalent to `other` for all renderers.
      Parameters:
        `other` - The other `TrackSelectorResult`. May be null, in which case `false` will be returned.
      Returns:
        Whether this result is equivalent to `other` for all renderers.

    - #### isEquivalent

          public boolean isEquivalent​(@Nullable
                                      TrackSelectorResult other,
                                      int index)

      Returns whether this result is equivalent to `other` for the renderer at the given index. The results are equivalent if they have equal track selections and configurations for the renderer.
      Parameters:
        `other` - The other `TrackSelectorResult`. May be null, in which case `false` will be returned.
        `index` - The renderer index to check for equivalence.
      Returns:
        Whether this result is equivalent to `other` for the renderer at the specified index.