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!
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 viaMediaCodec.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 toMediaCodecRenderer
instances. The payload object would have to be capable of holding multiple parameters, and would have to support transferring its parameters into bothMediaFormat
(for initial configuration) andBundle
(for dynamic reconfiguration). We could optionally define aSimpleExoPlayer.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!