diff options
author | Eric Laurent <elaurent@google.com> | 2011-06-17 16:21:11 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2011-07-11 12:01:13 -0700 |
commit | 2d97c20601f97dc375c65c6f4da4ad37eb7bf1d9 (patch) | |
tree | 75ced3ccb726774b76186d4fab40cd7ad46f0cd1 /audio | |
parent | bdd1ef0af8eef781d1df22204331c76d23c96c87 (diff) | |
download | hardware_libhardware_legacy-2d97c20601f97dc375c65c6f4da4ad37eb7bf1d9.zip hardware_libhardware_legacy-2d97c20601f97dc375c65c6f4da4ad37eb7bf1d9.tar.gz hardware_libhardware_legacy-2d97c20601f97dc375c65c6f4da4ad37eb7bf1d9.tar.bz2 |
Audio HAL: added interface for audio preprocessing
Change-Id: I0a84ddbff53f13662873f69d9be4dfa13ebcb8fe
Diffstat (limited to 'audio')
-rw-r--r-- | audio/audio_hw_hal.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/audio/audio_hw_hal.cpp b/audio/audio_hw_hal.cpp index 4fb4a8e..e6805c5 100644 --- a/audio/audio_hw_hal.cpp +++ b/audio/audio_hw_hal.cpp @@ -162,6 +162,16 @@ static int out_get_render_position(const struct audio_stream_out *stream, return out->legacy_out->getRenderPosition(dsp_frames); } +static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect) +{ + return 0; +} + +static int out_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect) +{ + return 0; +} + /** audio_stream_in implementation **/ static uint32_t in_get_sample_rate(const struct audio_stream *stream) { @@ -263,6 +273,20 @@ static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream) return in->legacy_in->getInputFramesLost(); } +static int in_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect) +{ + const struct legacy_stream_in *in = + reinterpret_cast<const struct legacy_stream_in *>(stream); + return in->legacy_in->addAudioEffect(effect); +} + +static int in_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect) +{ + const struct legacy_stream_in *in = + reinterpret_cast<const struct legacy_stream_in *>(stream); + return in->legacy_in->removeAudioEffect(effect); +} + /** audio_hw_device implementation **/ static inline struct legacy_audio_device * to_ladev(struct audio_hw_device *dev) { @@ -397,6 +421,8 @@ static int adev_open_output_stream(struct audio_hw_device *dev, out->stream.common.dump = out_dump; out->stream.common.set_parameters = out_set_parameters; out->stream.common.get_parameters = out_get_parameters; + out->stream.common.add_audio_effect = out_add_audio_effect; + out->stream.common.remove_audio_effect = out_remove_audio_effect; out->stream.get_latency = out_get_latency; out->stream.set_volume = out_set_volume; out->stream.write = out_write; @@ -455,6 +481,8 @@ static int adev_open_input_stream(struct audio_hw_device *dev, in->stream.common.dump = in_dump; in->stream.common.set_parameters = in_set_parameters; in->stream.common.get_parameters = in_get_parameters; + in->stream.common.add_audio_effect = in_add_audio_effect; + in->stream.common.remove_audio_effect = in_remove_audio_effect; in->stream.set_gain = in_set_gain; in->stream.read = in_read; in->stream.get_input_frames_lost = in_get_input_frames_lost; |