Merge "libstagefright: Bug Fix"
diff --git a/media/codec2/sfplugin/CCodecConfig.cpp b/media/codec2/sfplugin/CCodecConfig.cpp
index 582bc98..0f998dd 100644
--- a/media/codec2/sfplugin/CCodecConfig.cpp
+++ b/media/codec2/sfplugin/CCodecConfig.cpp
@@ -960,7 +960,23 @@
.limitTo(D::ENCODER & D::VIDEO & D::READ));
add(ConfigMapper(KEY_PICTURE_TYPE, C2_PARAMKEY_PICTURE_TYPE, "value")
- .limitTo(D::ENCODER & D::VIDEO & D::READ));
+ .limitTo(D::ENCODER & D::VIDEO & D::READ)
+ .withMappers([](C2Value v) -> C2Value {
+ int32_t sdk;
+ C2Config::picture_type_t c2;
+ if (v.get(&sdk) && C2Mapper::map(sdk, &c2)) {
+ return C2Value(c2);
+ }
+ return C2Value();
+ }, [](C2Value v) -> C2Value {
+ C2Config::picture_type_t c2;
+ int32_t sdk = PICTURE_TYPE_UNKNOWN;
+ using C2ValueType=typename _c2_reduce_enum_to_underlying_type<decltype(c2)>::type;
+ if (v.get((C2ValueType*)&c2) && C2Mapper::map(c2, &sdk)) {
+ return sdk;
+ }
+ return C2Value();
+ }));
/* still to do
not yet used by MediaCodec, but defined as MediaFormat
diff --git a/media/codec2/sfplugin/utils/Codec2Mapper.cpp b/media/codec2/sfplugin/utils/Codec2Mapper.cpp
index 93f29ca..3a94016 100644
--- a/media/codec2/sfplugin/utils/Codec2Mapper.cpp
+++ b/media/codec2/sfplugin/utils/Codec2Mapper.cpp
@@ -435,6 +435,13 @@
{ HAL_PIXEL_FORMAT_RGBA_FP16, COLOR_Format64bitABGRFloat },
};
+ALookup<C2Config::picture_type_t, int32_t> sPictureType = {
+ { C2Config::picture_type_t::SYNC_FRAME, PICTURE_TYPE_I },
+ { C2Config::picture_type_t::I_FRAME, PICTURE_TYPE_I },
+ { C2Config::picture_type_t::P_FRAME, PICTURE_TYPE_P },
+ { C2Config::picture_type_t::B_FRAME, PICTURE_TYPE_B },
+};
+
/**
* A helper that passes through vendor extension profile and level values.
*/
@@ -1024,3 +1031,13 @@
}
return true;
}
+
+// static
+bool C2Mapper::map(C2Config::picture_type_t from, int32_t *to) {
+ return sPictureType.map(from, to);
+}
+
+// static
+bool C2Mapper::map(int32_t from, C2Config::picture_type_t *to) {
+ return sPictureType.map(from, to);
+}
diff --git a/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml b/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml
index 22ff954..d34cca0 100644
--- a/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml
+++ b/services/audiopolicy/config/bluetooth_audio_policy_configuration.xml
@@ -11,17 +11,7 @@
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<!-- Le Audio Audio Ports -->
- <mixPort name="le audio output" role="source">
- <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
- samplingRates="8000,16000,24000,32000,44100,48000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
- <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
- samplingRates="8000,16000,24000,32000,44100,48000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
- <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
- samplingRates="8000,16000,24000,32000,44100,48000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO"/>
- </mixPort>
+ <mixPort name="le audio output" role="source"/>
<mixPort name="le audio input" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000,16000,24000,32000,44100,48000"
diff --git a/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml b/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml
index aad00d6..ef92d08 100644
--- a/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml
+++ b/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml
@@ -11,17 +11,7 @@
channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
</mixPort>
<!-- Le Audio Audio Ports -->
- <mixPort name="le audio output" role="source">
- <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
- samplingRates="8000 16000 24000 32000 44100 48000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
- <profile name="" format="AUDIO_FORMAT_PCM_24_BIT_PACKED"
- samplingRates="8000 16000 24000 32000 44100 48000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
- <profile name="" format="AUDIO_FORMAT_PCM_32_BIT"
- samplingRates="8000 16000 24000 32000 44100 48000"
- channelMasks="AUDIO_CHANNEL_OUT_MONO AUDIO_CHANNEL_OUT_STEREO"/>
- </mixPort>
+ <mixPort name="le audio output" role="source"/>
<mixPort name="le audio input" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="8000 16000 24000 32000 44100 48000"