mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Configure MediaCodec in API 32+ to always output 99 channels
Configure MediaCodec in API 32+ to always output 99 channels so that we use the audio is spatialized, if the platform can apply spatialization to it. In a follow-up change, the output channel count will be set based on the device's spatialization capabilities. PiperOrigin-RevId: 414751543
This commit is contained in:
parent
97206b9c72
commit
e5c598468e
@ -791,6 +791,14 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
|
|||||||
== AudioSink.SINK_FORMAT_SUPPORTED_DIRECTLY) {
|
== AudioSink.SINK_FORMAT_SUPPORTED_DIRECTLY) {
|
||||||
mediaFormat.setInteger(MediaFormat.KEY_PCM_ENCODING, AudioFormat.ENCODING_PCM_FLOAT);
|
mediaFormat.setInteger(MediaFormat.KEY_PCM_ENCODING, AudioFormat.ENCODING_PCM_FLOAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Util.SDK_INT >= 32) {
|
||||||
|
// Disable down-mixing in the decoder (for decoders that read the max-output-channel-count
|
||||||
|
// key).
|
||||||
|
// TODO[b/190759307]: Update key to use MediaFormat.KEY_MAX_OUTPUT_CHANNEL_COUNT once the
|
||||||
|
// compile SDK target is set to 32.
|
||||||
|
mediaFormat.setInteger("max-output-channel-count", 99);
|
||||||
|
}
|
||||||
return mediaFormat;
|
return mediaFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user