summaryrefslogtreecommitdiff
path: root/qahw
diff options
context:
space:
mode:
authorTrinath Thammishetty <tthamish@codeaurora.org>2017-12-18 14:56:50 +0530
committerTrinath Thammishetty <tthamish@codeaurora.org>2017-12-29 11:58:40 +0530
commit85b1929d4ee23b3ad11ca266e63dc22ae340306c (patch)
tree5519cd6df0335c79b1ee19e1b525a7d2d61dfa5a /qahw
parent3605a761663252a714c7dbd75b09d8a3bd50afac (diff)
qahw_api: Propagate missing changes from 2.2.c4 to 4.0
Add support for audio effects through binder server calls if QAS is enabled. Else the required APIs are called directly. Change-Id: I1f45ae89b839e69c49cbca407ddb05b7a02d3dc6
Diffstat (limited to 'qahw')
-rw-r--r--qahw/inc/qahw.h37
-rw-r--r--qahw/src/qahw_effect.c19
2 files changed, 46 insertions, 10 deletions
diff --git a/qahw/inc/qahw.h b/qahw/inc/qahw.h
index b7088ed5..e91fd004 100644
--- a/qahw/inc/qahw.h
+++ b/qahw/inc/qahw.h
@@ -27,8 +27,10 @@
#include <cutils/bitops.h>
#include <system/audio.h>
#include "qahw_defs.h"
+#include "qahw_effect_api.h"
__BEGIN_DECLS
+
/*
* Helper macros for module implementors.
*
@@ -473,6 +475,41 @@ int qahw_get_audio_port_l(qahw_module_handle_t *hw_module,
/* Set audio port configuration */
int qahw_set_audio_port_config_l(qahw_module_handle_t *hw_module,
const struct audio_port_config *config);
+
+/* Audio effects API */
+qahw_effect_lib_handle_t qahw_effect_load_library_l(const char *lib_path);
+
+int32_t qahw_effect_unload_library_l(qahw_effect_lib_handle_t handle);
+
+int32_t qahw_effect_create_l(qahw_effect_lib_handle_t handle,
+ const qahw_effect_uuid_t *uuid,
+ int32_t io_handle,
+ qahw_effect_handle_t *effect_handle);
+
+int32_t qahw_effect_release_l(qahw_effect_lib_handle_t handle,
+ qahw_effect_handle_t effect_handle);
+
+int32_t qahw_effect_get_descriptor_l(qahw_effect_lib_handle_t handle,
+ const qahw_effect_uuid_t *uuid,
+ qahw_effect_descriptor_t *effect_desc);
+
+int32_t qahw_effect_get_version_l();
+
+int32_t qahw_effect_process_l(qahw_effect_handle_t self,
+ qahw_audio_buffer_t *in_buffer,
+ qahw_audio_buffer_t *out_buffer);
+
+int32_t qahw_effect_command_l(qahw_effect_handle_t self,
+ uint32_t cmd_code,
+ uint32_t cmd_size,
+ void *cmd_data,
+ uint32_t *reply_size,
+ void *reply_data);
+
+int32_t qahw_effect_process_reverse_l(qahw_effect_handle_t self,
+ qahw_audio_buffer_t *in_buffer,
+ qahw_audio_buffer_t *out_buffer);
+
#ifdef __cplusplus
}
#endif
diff --git a/qahw/src/qahw_effect.c b/qahw/src/qahw_effect.c
index 2eff79f2..9bee2a1b 100644
--- a/qahw/src/qahw_effect.c
+++ b/qahw/src/qahw_effect.c
@@ -39,7 +39,6 @@
#include <stdlib.h>
#include "qahw.h"
-#include "qahw_effect_api.h"
// The current effect API version.
#define QAHW_EFFECT_API_VERSION_CURRENT QAHW_EFFECT_API_VERSION_0_0
@@ -97,7 +96,7 @@ exit:
}
-qahw_effect_lib_handle_t qahw_effect_load_library(const char *lib_path) {
+qahw_effect_lib_handle_t qahw_effect_load_library_l(const char *lib_path) {
audio_effect_library_t *desc;
qahw_effect_lib_t *qahw_effect_lib;
void *handle;
@@ -175,7 +174,7 @@ error:
}
-int32_t qahw_effect_unload_library(qahw_effect_lib_handle_t handle) {
+int32_t qahw_effect_unload_library_l(qahw_effect_lib_handle_t handle) {
qahw_effect_lib_t *qahw_effect_lib;
pthread_mutex_lock(&effect_libraries_lock);
@@ -214,7 +213,7 @@ done:
}
-int32_t qahw_effect_create(qahw_effect_lib_handle_t handle,
+int32_t qahw_effect_create_l(qahw_effect_lib_handle_t handle,
const qahw_effect_uuid_t *uuid,
int32_t io_handle,
qahw_effect_handle_t *effect_handle) {
@@ -230,7 +229,7 @@ int32_t qahw_effect_create(qahw_effect_lib_handle_t handle,
}
-int32_t qahw_effect_release(qahw_effect_lib_handle_t handle,
+int32_t qahw_effect_release_l(qahw_effect_lib_handle_t handle,
qahw_effect_handle_t effect_handle) {
int32_t rc = -EINVAL;
audio_effect_library_t *desc = (audio_effect_library_t *)handle;
@@ -243,7 +242,7 @@ int32_t qahw_effect_release(qahw_effect_lib_handle_t handle,
}
-int32_t qahw_effect_get_descriptor(qahw_effect_lib_handle_t handle,
+int32_t qahw_effect_get_descriptor_l(qahw_effect_lib_handle_t handle,
const qahw_effect_uuid_t *uuid,
qahw_effect_descriptor_t *effect_desc) {
int32_t rc = -EINVAL;
@@ -257,12 +256,12 @@ int32_t qahw_effect_get_descriptor(qahw_effect_lib_handle_t handle,
}
-int32_t qahw_effect_get_version() {
+int32_t qahw_effect_get_version_l() {
return QAHW_EFFECT_API_VERSION_CURRENT;
}
-int32_t qahw_effect_process(qahw_effect_handle_t self,
+int32_t qahw_effect_process_l(qahw_effect_handle_t self,
qahw_audio_buffer_t *in_buffer,
qahw_audio_buffer_t *out_buffer) {
int32_t rc = -EINVAL;
@@ -281,7 +280,7 @@ int32_t qahw_effect_process(qahw_effect_handle_t self,
}
-int32_t qahw_effect_command(qahw_effect_handle_t self,
+int32_t qahw_effect_command_l(qahw_effect_handle_t self,
uint32_t cmd_code,
uint32_t cmd_size,
void *cmd_data,
@@ -302,7 +301,7 @@ int32_t qahw_effect_command(qahw_effect_handle_t self,
}
-int32_t qahw_effect_process_reverse(qahw_effect_handle_t self,
+int32_t qahw_effect_process_reverse_l(qahw_effect_handle_t self,
qahw_audio_buffer_t *in_buffer,
qahw_audio_buffer_t *out_buffer) {
int32_t rc = -EINVAL;