summaryrefslogtreecommitdiff
path: root/visualizer
diff options
context:
space:
mode:
authorvivek mehta <mvivek@codeaurora.org>2015-09-18 10:39:16 -0700
committervivek mehta <mvivek@codeaurora.org>2015-09-22 12:27:34 -0700
commit39cfce611328a94ec96474a7ac7dd102b6553230 (patch)
treef41f3ee53dc43d9e1b0c3bd939a4fad8f347b217 /visualizer
parentf90f8ea32e2dd0b7e0606e252c58c4d3bb24f11c (diff)
hal: effect: visualizer: support two offload sessions
add support to get visualizer data for two offload session. Change-Id: I273aa392080e67a605137c43a3a5b798f66513fb
Diffstat (limited to 'visualizer')
-rw-r--r--visualizer/offload_visualizer.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/visualizer/offload_visualizer.c b/visualizer/offload_visualizer.c
index d363b778..b2f09528 100644
--- a/visualizer/offload_visualizer.c
+++ b/visualizer/offload_visualizer.c
@@ -300,20 +300,40 @@ bool effects_enabled() {
return false;
}
-int configure_proxy_capture(struct mixer *mixer, int value) {
- const char *proxy_ctl_name = "AFE_PCM_RX Audio Mixer MultiMedia4";
+int set_control(const char* name, struct mixer *mixer, int value) {
struct mixer_ctl *ctl;
- if (value && acdb_send_audio_cal)
- acdb_send_audio_cal(AFE_PROXY_ACDB_ID, ACDB_DEV_TYPE_OUT);
-
- ctl = mixer_get_ctl_by_name(mixer, proxy_ctl_name);
+ ctl = mixer_get_ctl_by_name(mixer, name);
if (ctl == NULL) {
- ALOGW("%s: could not get %s ctl", __func__, proxy_ctl_name);
+ ALOGW("%s: could not get %s ctl", __func__, name);
return -EINVAL;
}
- if (mixer_ctl_set_value(ctl, 0, value) != 0)
- ALOGW("%s: error setting value %d on %s ", __func__, value, proxy_ctl_name);
+ if (mixer_ctl_set_value(ctl, 0, value) != 0) {
+ ALOGW("%s: error setting value %d on %s ", __func__, value, name);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+int configure_proxy_capture(struct mixer *mixer, int value) {
+ int retval = 0;
+
+ if (value && acdb_send_audio_cal)
+ acdb_send_audio_cal(AFE_PROXY_ACDB_ID, ACDB_DEV_TYPE_OUT);
+
+ retval = set_control("AFE_PCM_RX Audio Mixer MultiMedia4", mixer, value);
+
+ if (retval != 0)
+ return retval;
+
+ // Extending visualizer to capture for compress2 path as well.
+ // for extending it to multiple offload either this needs to be extended
+ // or need to find better solution to enable only active offload sessions
+
+ retval = set_control("AFE_PCM_RX Audio Mixer MultiMedia7", mixer, value);
+ if (retval != 0)
+ return retval;
return 0;
}