hal: compilation fix for extended feature flags
- Fix compilation error for offload, Dolby,
HDMI pass through, FLAC decoder, and hardware
accelerated effects when extended feature
flags are disabled.
Change-Id: I5b36d7668f63a396ed930d62c0337c2c3f311c95
diff --git a/post_proc/Android.mk b/post_proc/Android.mk
index be70166..ed46f17 100644
--- a/post_proc/Android.mk
+++ b/post_proc/Android.mk
@@ -14,8 +14,12 @@
virtualizer.c \
reverb.c \
effect_api.c \
- effect_util.c \
- hw_accelerator.c
+ effect_util.c
+
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS)),true)
+ LOCAL_CFLAGS += -DHW_ACCELERATED_EFFECTS
+ LOCAL_SRC_FILES += hw_accelerator.c
+endif
LOCAL_CFLAGS+= -O2 -fvisibility=hidden
diff --git a/post_proc/bundle.c b/post_proc/bundle.c
index e38a41c..99958a3 100644
--- a/post_proc/bundle.c
+++ b/post_proc/bundle.c
@@ -38,6 +38,7 @@
#define LOG_TAG "offload_effect_bundle"
//#define LOG_NDEBUG 0
+#include <stdlib.h>
#include <cutils/list.h>
#include <cutils/log.h>
#include <system/thread_defs.h>
@@ -69,7 +70,9 @@
&ins_env_reverb_descriptor,
&aux_preset_reverb_descriptor,
&ins_preset_reverb_descriptor,
+#ifdef HW_ACCELERATED_EFFECTS
&hw_accelerator_descriptor,
+#endif
NULL,
};
@@ -604,6 +607,7 @@
reverb_preset_init(reverb_ctxt);
}
reverb_ctxt->ctl = NULL;
+#ifdef HW_ACCELERATED_EFFECTS
} else if (memcmp(uuid, &hw_accelerator_descriptor.uuid,
sizeof(effect_uuid_t)) == 0) {
hw_accelerator_context_t *hw_acc_ctxt = (hw_accelerator_context_t *)
@@ -625,6 +629,7 @@
context->ops.process = hw_accelerator_process;
context->desc = &hw_accelerator_descriptor;
+#endif
} else {
return -EINVAL;
}
@@ -911,6 +916,7 @@
} break;
+#ifdef HW_ACCELERATED_EFFECTS
case EFFECT_CMD_HW_ACC: {
ALOGV("EFFECT_CMD_HW_ACC cmdSize %d pCmdData %p, *replySize %d, pReplyData %p",
cmdSize, pCmdData, *replySize, pReplyData);
@@ -925,6 +931,7 @@
context->hw_acc_enabled = (value > 0) ? true : false;
break;
}
+#endif
default:
if (cmdCode >= EFFECT_CMD_FIRST_PROPRIETARY && context->ops.command)
status = context->ops.command(context, cmdCode, cmdSize,
diff --git a/post_proc/effect_api.c b/post_proc/effect_api.c
index e15db17..16c370b 100644
--- a/post_proc/effect_api.c
+++ b/post_proc/effect_api.c
@@ -55,6 +55,7 @@
#endif
#include <stdbool.h>
+#include <errno.h>
#include <cutils/log.h>
#include <tinyalsa/asoundlib.h>
#include <sound/audio_effects.h>
diff --git a/post_proc/effect_util.c b/post_proc/effect_util.c
index 8f7a604..52f623d 100644
--- a/post_proc/effect_util.c
+++ b/post_proc/effect_util.c
@@ -16,6 +16,7 @@
#include <utils/Log.h>
#include <stdlib.h>
+#include <string.h>
#include "effect_util.h"
#ifdef LOG_TAG