From 126e1336b214dacda511f3dbf5a463aaaa1f10ee Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Mon, 6 Sep 2010 22:23:51 +0530 Subject: echo-cancel: Let AEC module determine source/sink spec Since the source and sink specification will need to be determined by the AEC algorithm (can it handle multi-channel audio, does it work with a fixed sample rate, etc.), we negotiate these using inout parameters at initialisation time. There is opportunity to make the sink-handling more elegant. Since the sink data isn't used for playback (just processing), we could pass through the data as-is and resample to the required spec before using in the cancellation algorithm. This isn't too important immediately, but would be nice to have. --- src/modules/echo-cancel/echo-cancel.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/modules/echo-cancel/echo-cancel.h') diff --git a/src/modules/echo-cancel/echo-cancel.h b/src/modules/echo-cancel/echo-cancel.h index 186ce327..205c4d14 100644 --- a/src/modules/echo-cancel/echo-cancel.h +++ b/src/modules/echo-cancel/echo-cancel.h @@ -46,7 +46,12 @@ struct pa_echo_canceller_params { typedef struct pa_echo_canceller pa_echo_canceller; struct pa_echo_canceller { - pa_bool_t (*init) (pa_echo_canceller *ec, pa_sample_spec ss, pa_channel_map map, const char *args); + pa_bool_t (*init) (pa_echo_canceller *ec, + pa_sample_spec *source_ss, + pa_channel_map *source_map, + pa_sample_spec *sink_ss, + pa_channel_map *sink_map, + const char *args); void (*run) (pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out); void (*done) (pa_echo_canceller *ec); uint32_t (*get_block_size) (pa_echo_canceller *ec); @@ -55,7 +60,10 @@ struct pa_echo_canceller { }; /* Speex canceller functions */ -pa_bool_t pa_speex_ec_init(pa_echo_canceller *ec, pa_sample_spec ss, pa_channel_map map, const char *args); +pa_bool_t pa_speex_ec_init(pa_echo_canceller *ec, + pa_sample_spec *source_ss, pa_channel_map *source_map, + pa_sample_spec *sink_ss, pa_channel_map *sink_map, + const char *args); void pa_speex_ec_run(pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out); void pa_speex_ec_done(pa_echo_canceller *ec); uint32_t pa_speex_ec_get_block_size(pa_echo_canceller *ec); -- cgit