google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.02k forks source link

Provide an easy way to set MPEG-D DRC codec parameters #8636

Open ojw28 opened 3 years ago

ojw28 commented 3 years ago

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.

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!

ronak2121 commented 3 years ago

Hi @ojw28 are there any updates on this item?