diff options
author | Scott Mertz <scott@cyngn.com> | 2015-09-11 12:09:06 -0700 |
---|---|---|
committer | Dan Pasanen <dan.pasanen@gmail.com> | 2015-10-13 12:21:58 -0700 |
commit | 5b2337c434acff34d85ae14b9cc2d3507fdffe52 (patch) | |
tree | eea51a6ccd2427d05ae1eafda767d1d975255433 | |
parent | 135a6383b72db0df5227f6b12e5c203954e630ab (diff) | |
download | hardware_libhardware-5b2337c434acff34d85ae14b9cc2d3507fdffe52.zip hardware_libhardware-5b2337c434acff34d85ae14b9cc2d3507fdffe52.tar.gz hardware_libhardware-5b2337c434acff34d85ae14b9cc2d3507fdffe52.tar.bz2 |
amplifier: add set_parameters method
- audio hal should pass the audio_device parameters to the amplifier
to allow the amplifier to make decisions based on the additional
parameters. For example, we may want to change settings for DTS
TrueMedia use case.
Change-Id: Iccf6ef7ced2abd2e12e857eea8e580cda15eec04
-rw-r--r-- | include/hardware/audio_amplifier.h | 6 | ||||
-rw-r--r-- | modules/audio/audio_amplifier.c | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/hardware/audio_amplifier.h b/include/hardware/audio_amplifier.h index bb788c2..4305094 100644 --- a/include/hardware/audio_amplifier.h +++ b/include/hardware/audio_amplifier.h @@ -105,6 +105,12 @@ typedef struct amplifier_device { */ int (*input_stream_standby)(struct amplifier_device *device, struct audio_stream_in *stream); + + /** + * set/get output audio device parameters. + */ + int (*set_parameters)(struct amplifier_device *device, + struct str_parms *parms); } amplifier_device_t; typedef struct amplifier_module { diff --git a/modules/audio/audio_amplifier.c b/modules/audio/audio_amplifier.c index 05f3641..816b636 100644 --- a/modules/audio/audio_amplifier.c +++ b/modules/audio/audio_amplifier.c @@ -21,6 +21,7 @@ #include <sys/types.h> #include <cutils/log.h> +#include <cutils/str_parms.h> #include <hardware/audio_amplifier.h> #include <hardware/hardware.h> @@ -76,6 +77,12 @@ static int amp_input_stream_standby(amplifier_device_t *device, return 0; } +static int amp_set_parameters(struct amplifier_device *device, + struct str_parms *parms) +{ + return 0; +} + static int amp_dev_close(hw_device_t *device) { if (device) @@ -114,6 +121,7 @@ static int amp_module_open(const hw_module_t *module, const char *name, amp_dev->input_stream_start = amp_input_stream_start; amp_dev->output_stream_standby = amp_output_stream_standby; amp_dev->input_stream_standby = amp_input_stream_standby; + amp_dev->set_parameters = amp_set_parameters; *device = (hw_device_t *) amp_dev; |