# CastTrackSelector.CastTrackSelectorRequest

Artifact: [androidx.media3:media3-cast](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/cast/CastTrackSelector.java+class:androidx.media3.cast.CastTrackSelector.CastTrackSelectorRequest)

*** ** * ** ***

<br />

```
public final class CastTrackSelector.CastTrackSelectorRequest
```

<br />

*** ** * ** ***

Holds parameters associated with a `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector#evaluate(androidx.media3.cast.CastTrackSelector.CastTrackSelectorRequest)`.

## Summary

| ### Public fields |
|---|---|
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup>` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#currentlySelectedTrackGroups()` The currently selected track groups, as reported by Cast remote media client. |
| `final int` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaItemId()` The id of the active Cast media item when the evaluation is made. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack.html>` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaTracks()` The Cast media tracks, where positions match the corresponding `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackGroupList()`. |
| `final https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup>` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackGroupList()` The list of available `https://developer.android.com/reference/androidx/media3/common/TrackGroup`, where positions match the track group's corresponding `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaTracks()`. |
| `final https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackSelectionParameters()` The currently active track selection parameters. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.TrackSelectionRequestReason https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackSelectionRequestReason()` The reason for this track selection evaluation request. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#CastTrackSelectorRequest(int,androidx.media3.common.TrackSelectionParameters,com.google.common.collect.ImmutableList<androidx.media3.common.TrackGroup>,com.google.common.collect.ImmutableList<com.google.android.gms.cast.MediaTrack>,com.google.common.collect.ImmutableSet<androidx.media3.common.TrackGroup>,int)( int mediaItemId, https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters trackSelectionParameters, https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup> trackGroupList, https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack.html> mediaTracks, https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup> currentlySelectedTrackGroups, @https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.TrackSelectionRequestReason int trackSelectionRequestReason )` Creates a new instance. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult.Builder` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#buildResultUpon()()` Returns a `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult.Builder` that's already initialized with the values from this `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest`, so that clients can easily limit changes to fields they want to modify. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html o)` |
| `int` | `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#hashCode()()` |

## Public fields

### currentlySelectedTrackGroups

```
public final ImmutableSet<TrackGroup> currentlySelectedTrackGroups
```

The currently selected track groups, as reported by Cast remote media client.

### mediaItemId

```
public final int mediaItemId
```

The id of the active Cast media item when the evaluation is made.

### mediaTracks

```
public final ImmutableList<MediaTrack> mediaTracks
```

The Cast media tracks, where positions match the corresponding `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackGroupList()`.

### trackGroupList

```
public final ImmutableList<TrackGroup> trackGroupList
```

The list of available `https://developer.android.com/reference/androidx/media3/common/TrackGroup`, where positions match the track group's corresponding `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaTracks()`.

### trackSelectionParameters

```
public final TrackSelectionParameters trackSelectionParameters
```

The currently active track selection parameters.

### trackSelectionRequestReason

```
@CastTrackSelector.TrackSelectionRequestReason
public final int trackSelectionRequestReason
```

The reason for this track selection evaluation request.

Can be used to determine whether to change the `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult#selections()` (for example, in response to new `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters`), or the `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult#trackSelectionParameters()` (for example, in response to a receiver-side track selection change).

## Public constructors

### CastTrackSelectorRequest

```
public CastTrackSelectorRequest(
    int mediaItemId,
    TrackSelectionParameters trackSelectionParameters,
    ImmutableList<TrackGroup> trackGroupList,
    ImmutableList<MediaTrack> mediaTracks,
    ImmutableSet<TrackGroup> currentlySelectedTrackGroups,
    @CastTrackSelector.TrackSelectionRequestReason int trackSelectionRequestReason
)
```

Creates a new instance.

| Parameters |
|---|---|
| `int mediaItemId` | See `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaItemId()`. |
| `https://developer.android.com/reference/androidx/media3/common/TrackSelectionParameters trackSelectionParameters` | See `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackSelectionParameters()`. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup> trackGroupList` | See `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackGroupList()`. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developers.google.com/android/reference/com/google/android/gms/cast/MediaTrack.html> mediaTracks` | See `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaTracks()`. |
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://developer.android.com/reference/androidx/media3/common/TrackGroup> currentlySelectedTrackGroups` | See `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#currentlySelectedTrackGroups()`. |
| `@https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.TrackSelectionRequestReason int trackSelectionRequestReason` | See `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackSelectionRequestReason()`. |

## Public methods

### buildResultUpon

```
public CastTrackSelector.CastTrackSelectorResult.Builder buildResultUpon()
```

Returns a `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult.Builder` that's already initialized with the values from this `https://developer.android.com/reference/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest`, so that clients can easily limit changes to fields they want to modify.

### equals

```
public boolean equals(@Nullable Object o)
```

### hashCode

```
public int hashCode()
```