summaryrefslogtreecommitdiffstats
path: root/qahw
diff options
context:
space:
mode:
authorTrinath Thammishetty <tthamish@codeaurora.org>2018-09-28 12:43:24 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-10-29 20:09:03 -0700
commit580f1de09e9724ba0c44a097e644b2eb3f568c9c (patch)
treec37775097daf966376178dd6f2b968570643aa12 /qahw
parentcb5b57891769acd7d9a8e6081c326c16e072664c (diff)
downloadandroid_hardware_qcom_audio-580f1de09e9724ba0c44a097e644b2eb3f568c9c.tar.gz
android_hardware_qcom_audio-580f1de09e9724ba0c44a097e644b2eb3f568c9c.tar.bz2
android_hardware_qcom_audio-580f1de09e9724ba0c44a097e644b2eb3f568c9c.zip
hal: add support for configuring render window
Add support to set render window in transcode loopback usecase. Render window is used by DSP to take rendering decision, i.e, whether input frame should be rendered, dropped or repeated. Change-Id: I87560a8e437b33dcd15094f30a532b3ed3d3749f
Diffstat (limited to 'qahw')
-rw-r--r--qahw/inc/qahw.h9
-rw-r--r--qahw/inc/qahw_defs.h8
-rw-r--r--qahw/src/qahw.c39
3 files changed, 55 insertions, 1 deletions
diff --git a/qahw/inc/qahw.h b/qahw/inc/qahw.h
index e91fd004..dd5b403f 100644
--- a/qahw/inc/qahw.h
+++ b/qahw/inc/qahw.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2011 The Android Open Source Project *
@@ -463,6 +463,13 @@ int qahw_create_audio_patch_l(qahw_module_handle_t *hw_module,
/* Release an audio patch */
int qahw_release_audio_patch_l(qahw_module_handle_t *hw_module,
audio_patch_handle_t handle);
+
+/* API to set loopback stream specific config parameters. */
+int qahw_loopback_set_param_data_l(qahw_module_handle_t *hw_module,
+ audio_patch_handle_t handle,
+ qahw_loopback_param_id param_id,
+ qahw_loopback_param_payload *payload);
+
/* Fills the list of supported attributes for a given audio port.
* As input, "port" contains the information (type, role, address etc...)
* needed by the HAL to identify the port.
diff --git a/qahw/inc/qahw_defs.h b/qahw/inc/qahw_defs.h
index 4e7faff7..755553b2 100644
--- a/qahw/inc/qahw_defs.h
+++ b/qahw/inc/qahw_defs.h
@@ -417,6 +417,14 @@ typedef enum {
QAHW_PARAM_LICENSE_PARAMS,
} qahw_param_id;
+typedef union {
+ struct qahw_out_render_window_param render_window_params;
+} qahw_loopback_param_payload;
+
+typedef enum {
+ QAHW_PARAM_LOOPBACK_RENDER_WINDOW /* PARAM to set render window */
+} qahw_loopback_param_id;
+
__END_DECLS
#endif // QTI_AUDIO_HAL_DEFS_H
diff --git a/qahw/src/qahw.c b/qahw/src/qahw.c
index 0c00158b..126f794f 100644
--- a/qahw/src/qahw.c
+++ b/qahw/src/qahw.c
@@ -69,6 +69,10 @@ typedef int (*qahwi_out_get_param_data_t)(struct audio_stream_out *out,
qahw_param_id param_id,
qahw_param_payload *payload);
+typedef int (*qahwi_loopback_set_param_data_t)(audio_patch_handle_t patch_handle,
+ qahw_param_id param_id,
+ qahw_param_payload *payload);
+
typedef struct {
audio_hw_device_t *audio_device;
char module_name[MAX_MODULE_NAME_LENGTH];
@@ -80,6 +84,7 @@ typedef struct {
const hw_module_t* module;
qahwi_get_param_data_t qahwi_get_param_data;
qahwi_set_param_data_t qahwi_set_param_data;
+ qahwi_loopback_set_param_data_t qahwi_loopback_set_param_data;
} qahw_module_t;
typedef struct {
@@ -1438,6 +1443,34 @@ exit:
return ret;
}
+int qahw_loopback_set_param_data_l(qahw_module_handle_t *hw_module,
+ audio_patch_handle_t handle,
+ qahw_loopback_param_id param_id,
+ qahw_loopback_param_payload *payload)
+
+{
+ int ret = -EINVAL;
+ qahw_module_t *qahw_module = (qahw_module_t *)hw_module;
+
+ if (!payload) {
+ ALOGE("%s:: invalid param", __func__);
+ goto exit;
+ }
+
+ if (qahw_module->qahwi_loopback_set_param_data) {
+ ret = qahw_module->qahwi_loopback_set_param_data(handle,
+ param_id,
+ (void *)payload);
+ } else {
+ ret = -ENOSYS;
+ ALOGE("%s not supported\n", __func__);
+ }
+
+exit:
+ return ret;
+
+}
+
/* Fills the list of supported attributes for a given audio port.
* As input, "port" contains the information (type, role, address etc...)
* needed by the HAL to identify the port.
@@ -1889,6 +1922,12 @@ qahw_module_handle_t *qahw_load_module_l(const char *hw_module_id)
if (!qahw_module->qahwi_set_param_data)
ALOGD("%s::qahwi_set_param_data api is not defined\n",__func__);
+ qahw_module->qahwi_loopback_set_param_data = (qahwi_loopback_set_param_data_t)
+ dlsym(module->dso,
+ "qahwi_loopback_set_param_data");
+ if (!qahw_module->qahwi_loopback_set_param_data)
+ ALOGD("%s::qahwi_loopback_set_param_data api is not defined\n", __func__);
+
if (!qahw_list_count)
list_init(&qahw_module_list);
qahw_list_count++;