diff options
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; |