hal: Add new parameter in SA+ effects and resolve compilation issue
Add new parameter in SA+ effects to get latency introduced
by each effect. Use #ifdef instead of #if in environmentalreverb header
file since _cplusplus macro not being defined is raising errors.
Change-Id: I0d5e410414502ac2bef77f1cbd7b041e4f26844d
diff --git a/post_proc/equalizer.c b/post_proc/equalizer.c
index c1c1303..479f848 100644
--- a/post_proc/equalizer.c
+++ b/post_proc/equalizer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -29,6 +29,8 @@
#include "effect_api.h"
#include "equalizer.h"
+#define EQUALIZER_MAX_LATENCY 0
+
/* Offload equalizer UUID: a0dac280-401c-11e3-9379-0002a5d5c51b */
const effect_descriptor_t equalizer_descriptor = {
{0x0bed4300, 0xddd6, 0x11db, 0x8f34, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}, // type
@@ -253,6 +255,12 @@
p->vsize = (2 + NUM_EQ_BANDS) * sizeof(uint16_t);
break;
+ case EQ_PARAM_LATENCY:
+ if (p->vsize < sizeof(uint32_t))
+ p->status = -EINVAL;
+ p->vsize = sizeof(uint32_t);
+ break;
+
default:
p->status = -EINVAL;
}
@@ -352,6 +360,10 @@
}
} break;
+ case EQ_PARAM_LATENCY:
+ *(uint32_t *)value = EQUALIZER_MAX_LATENCY;
+ break;
+
default:
p->status = -EINVAL;
break;