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

```
class CastTrackSelector.CastTrackSelectorRequest
```

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/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)( mediaItemId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, trackSelectionParameters: https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters!, trackGroupList: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/kotlin/androidx/media3/common/TrackGroup!>!, mediaTracks: 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!>!, currentlySelectedTrackGroups: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://developer.android.com/reference/kotlin/androidx/media3/common/TrackGroup!>!, @https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.TrackSelectionRequestReason trackSelectionRequestReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Creates a new instance. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult.Builder!` | `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#buildResultUpon()()` Returns a `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorResult.Builder` that's already initialized with the values from this `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest`, so that clients can easily limit changes to fields they want to modify. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#hashCode()()` |

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

## Public constructors

### CastTrackSelectorRequest

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

Creates a new instance.

| Parameters |
|---|---|
| `mediaItemId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | See `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaItemId()`. |
| `trackSelectionParameters: https://developer.android.com/reference/kotlin/androidx/media3/common/TrackSelectionParameters!` | See `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackSelectionParameters()`. |
| `trackGroupList: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/kotlin/androidx/media3/common/TrackGroup!>!` | See `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackGroupList()`. |
| `mediaTracks: 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!>!` | See `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#mediaTracks()`. |
| `currentlySelectedTrackGroups: https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://developer.android.com/reference/kotlin/androidx/media3/common/TrackGroup!>!` | See `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#currentlySelectedTrackGroups()`. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.TrackSelectionRequestReason trackSelectionRequestReason: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | See `https://developer.android.com/reference/kotlin/androidx/media3/cast/CastTrackSelector.CastTrackSelectorRequest#trackSelectionRequestReason()`. |

## Public functions

### buildResultUpon

```
fun buildResultUpon(): CastTrackSelector.CastTrackSelectorResult.Builder!
```

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

### equals

```
fun equals(o: Any?): Boolean
```

### hashCode

```
fun hashCode(): Int
```

## Public properties

### currentlySelectedTrackGroups

```
val currentlySelectedTrackGroups: ImmutableSet<TrackGroup!>!
```

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

### mediaItemId

```
val mediaItemId: Int
```

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

### mediaTracks

```
val mediaTracks: ImmutableList<MediaTrack!>!
```

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

### trackGroupList

```
val trackGroupList: ImmutableList<TrackGroup!>!
```

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

### trackSelectionParameters

```
val trackSelectionParameters: TrackSelectionParameters!
```

The currently active track selection parameters.

### trackSelectionRequestReason

```
@CastTrackSelector.TrackSelectionRequestReason
val trackSelectionRequestReason: Int
```

The reason for this track selection evaluation request.

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