# CmcdConfiguration.RequestConfig

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

*** ** * ** ***

<br />

```
public interface CmcdConfiguration.RequestConfig
```

<br />

*** ** * ** ***

Represents configuration which can vary on each request.

Implementations must not make assumptions about which thread called their methods; and must be thread-safe.

## Summary

| ### Public methods |
|---|---|
| `default https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableListMultimap.html<@https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.HeaderKey https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.RequestConfig#getCustomData()()` Retrieves the custom data associated with CMCD logging. |
| `default int` | `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.RequestConfig#getRequestedMaximumThroughputKbps(int)(int throughputKbps)` Returns the maximum throughput requested in kbps, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if the maximum throughput is unknown in which case the maximum throughput will not be logged upstream. |
| `default boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.RequestConfig#isKeyAllowed(java.lang.String)( @https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.CmcdKey @https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.CmcdKey https://developer.android.com/reference/java/lang/String.html key )` Checks whether the specified key is allowed in CMCD logging. |

## Public methods

### getCustomData

```
default ImmutableListMultimap<@CmcdConfiguration.HeaderKey String, String> getCustomData()
```

Retrieves the custom data associated with CMCD logging.

By default, no custom data is provided.

The data payload consists of a series of key/value pairs constructed according to the following rules:

- Custom keys SHOULD be allocated to one of the four defined header names defined in the `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.HeaderKey` annotation.
- All information in the payload MUST be represented as key=value pairs.
- The key and value MUST be separated by an equals sign. If the value type is boolean and the value is `true`, then the equals sign and the value MUST be omitted.
- The key names are case-sensitive and reserved. Custom key names MUST carry a hyphenated prefix to ensure no namespace collision with future revisions to Common Media Client Data (CMCD) specification. Clients SHOULD use a reverse-DNS syntax when defining their own prefix.
- Any value of type String MUST be enclosed by opening and closing double quotes. Double quotes and backslashes MUST be escaped using a backslash "\\" character. Any value that is not of type string does not require quoting.

**Note:** The key words MUST and SHOULD are to be interpreted as described in RFC 2119.

Example:

- CMCD-Request:custom-field1=25400
- CMCD-Object:custom-field2=3200,custom-field3=4004,custom-field4=v,custom-field5=6000
- CMCD-Status:custom-field6,custom-field7=15000
- CMCD-Session:custom-field8="stringValue"

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableListMultimap.html<@https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.HeaderKey https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>` | An `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableListMultimap.html` containing the custom data. |

### getRequestedMaximumThroughputKbps

```
default int getRequestedMaximumThroughputKbps(int throughputKbps)
```

Returns the maximum throughput requested in kbps, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET_INT()` if the maximum throughput is unknown in which case the maximum throughput will not be logged upstream.

| Parameters |
|---|---|
| `int throughputKbps` | The throughput in kbps of the audio or video object being requested. |

| Returns |
|---|---|
| `int` | The maximum throughput requested in kbps. |

### isKeyAllowed

```
default boolean isKeyAllowed(
    @CmcdConfiguration.CmcdKey @CmcdConfiguration.CmcdKey String key
)
```

Checks whether the specified key is allowed in CMCD logging. By default, all keys are allowed.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.CmcdKey @https://developer.android.com/reference/androidx/media3/exoplayer/upstream/CmcdConfiguration.CmcdKey https://developer.android.com/reference/java/lang/String.html key` | The key to check. |

| Returns |
|---|---|
| `boolean` | Whether the key is allowed. |