audio: enable 24bits camcorder am: be5c67e731
am: 100497f6ac
Change-Id: If68ea7dc5c71482557a6bc2cf4e178b017e4bd7c
diff --git a/hal/Android.mk b/hal/Android.mk
index b73038a..236ed11 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -207,6 +207,10 @@
LOCAL_SRC_FILES += audio_extn/maxxaudio.c
endif
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_24BITS_CAMCORDER)), true)
+ LOCAL_CFLAGS += -DENABLED_24BITS_CAMCORDER
+endif
+
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_BG_CAL)),true)
LOCAL_CFLAGS += -DBG_CODEC_CAL
endif
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 0e92bfe..5dfdcf1 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -540,6 +540,20 @@
return false;
}
+static bool is_supported_24bits_audiosource(audio_source_t source)
+{
+ switch (source) {
+ case AUDIO_SOURCE_UNPROCESSED:
+#ifdef ENABLED_24BITS_CAMCORDER
+ case AUDIO_SOURCE_CAMCORDER:
+#endif
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
static inline bool is_mmap_usecase(audio_usecase_t uc_id)
{
return (uc_id == USECASE_AUDIO_RECORD_AFE_PROXY) ||
@@ -5111,7 +5125,7 @@
on error flinger will retry with supported format passed
*/
- if (source != AUDIO_SOURCE_UNPROCESSED) {
+ if (!is_supported_24bits_audiosource(source)) {
config->format = AUDIO_FORMAT_PCM_16_BIT;
ret_error = true;
} else if (config->format != AUDIO_FORMAT_PCM_8_24_BIT) {