summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2016-09-15 11:40:57 -0700
committerEric Laurent <elaurent@google.com>2016-09-15 11:52:22 -0700
commit4725741d0ede9166900fa08f5c20b6c79c7229df (patch)
tree1feb77da1cb6cab68198b95b2aadfd4839fb4cf0
parent890a976bb97086501c6e5d88b38389b1f53a6394 (diff)
downloadlibhardware-nougat-mr1-dev.tar.gz
audio effect: add flag for effects without actual processingnougat-mr1-dev
Add a flag for effect descriptor indicating that the effect does not implement a process function. This tells the framework that no latency or performance penalty comes with enabling this effect. When this flag is set, the process function does not have to be implemented by the effect implementation. Bug: 31491112 Change-Id: I69e6959eb17e04266f4de3f2943c226e34868b1f
-rw-r--r--include/hardware/audio_effect.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hardware/audio_effect.h b/include/hardware/audio_effect.h
index 41cd2e61..e49980d1 100644
--- a/include/hardware/audio_effect.h
+++ b/include/hardware/audio_effect.h
@@ -150,6 +150,13 @@ typedef struct effect_descriptor_s {
// | Effect offload supported | 22 | 0 The effect cannot be offloaded to an audio DSP
// | | | 1 The effect can be offloaded to an audio DSP
// +---------------------------+-----------+-----------------------------------
+// | Process function not | 23 | 0 The effect implements a process function.
+// | implemented | | 1 The effect does not implement a process function:
+// | | | enabling the effect has no impact on latency or
+// | | | CPU load.
+// | | | Effect implementations setting this flag do not have
+// | | | to implement a process function.
+// +---------------------------+-----------+-----------------------------------
// Insert mode
#define EFFECT_FLAG_TYPE_SHIFT 0
@@ -240,6 +247,14 @@ typedef struct effect_descriptor_s {
<< EFFECT_FLAG_OFFLOAD_SHIFT)
#define EFFECT_FLAG_OFFLOAD_SUPPORTED (1 << EFFECT_FLAG_OFFLOAD_SHIFT)
+// Effect has no process indication
+#define EFFECT_FLAG_NO_PROCESS_SHIFT (EFFECT_FLAG_OFFLOAD_SHIFT + \
+ EFFECT_FLAG_OFFLOAD_SIZE)
+#define EFFECT_FLAG_NO_PROCESS_SIZE 1
+#define EFFECT_FLAG_NO_PROCESS_MASK (((1 << EFFECT_FLAG_NO_PROCESS_SIZE) -1) \
+ << EFFECT_FLAG_NO_PROCESS_SHIFT)
+#define EFFECT_FLAG_NO_PROCESS (1 << EFFECT_FLAG_NO_PROCESS_SHIFT)
+
#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF))
#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16)
#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF)