Provide an easy way to set MPEG-D DRC codec parameters
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Android supports setting various MPEG-D DRC codec parameters to adjust the listening experience. These can be passed in the `MediaFormat` used to configure the codec, and updated dynamically via `MediaCodec.setParameters`. The available parameters are listed [here](https://developer.android.com/reference/android/media/MediaFormat#KEY_AAC_DRC_ALBUM_MODE).
It's currently quite awkward to set these parameters when using ExoPlayer. We should provide a mechanism that makes it relatively straightforward. Any solution should (a) permit dynamic adjustment of multiple parameters via a single `MediaCodec.setParameters` call, (b) be smart enough to retain the parameter values across any cases where the player needs to release the codec and instantiate a new one, and (c) ditto for the case where the parameters are passed when the player has not yet instantiated a codec.
### Proposed solution
One fairly generic solution might be to define a `MSG_SET_CODEC_PARAMETERS` for passing codec parameters to `MediaCodecRenderer` instances. The payload object would have to be capable of holding multiple parameters, and would have to support transferring its parameters into both `MediaFormat` (for initial configuration) and `Bundle` (for dynamic reconfiguration). We could optionally define a `SimpleExoPlayer.setCodecParameters(trackType, parameters)` convenience method to take care of constructing the message and delivering it to the target renderers. That's just one idea. There are probably quite a few ways of doing it!
Contributor guide
Assessment
This issue has not been assessed yet.