public interface

CmcdConfiguration.RequestConfig

 androidx.media3.exoplayer.upstream.CmcdConfiguration.RequestConfig

Overview

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

Methods
public <any>getCustomData()

Retrieves the custom data associated with CMCD logging.

public intgetRequestedMaximumThroughputKbps(int throughputKbps)

Returns the maximum throughput requested in kbps, or C.RATE_UNSET_INT if the maximum throughput is unknown in which case the maximum throughput will not be logged upstream.

public booleanisKeyAllowed(java.lang.String key)

Checks whether the specified key is allowed in CMCD logging.

Methods

public boolean isKeyAllowed(java.lang.String key)

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

Parameters:

key: The key to check.

Returns:

Whether the key is allowed.

public <any> 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 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:

An ImmutableListMultimap containing the custom data.

public int getRequestedMaximumThroughputKbps(int throughputKbps)

Returns the maximum throughput requested in kbps, or C.RATE_UNSET_INT if the maximum throughput is unknown in which case the maximum throughput will not be logged upstream.

Parameters:

throughputKbps: The throughput in kbps of the audio or video object being requested.

Returns:

The maximum throughput requested in kbps.