From b6b8a7b7a7f4f8badd39ebb4ee2be1c11ff1a204 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 7 Sep 2010 14:55:38 +0530 Subject: echo-cancel: Make blocksize a module-wide parameter Since all algorithms will need to specify a block size (the amount of data to be processed together), we make this a common parameter and have the implementation set it at initialisation time. --- src/modules/echo-cancel/speex.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/modules/echo-cancel/speex.c') diff --git a/src/modules/echo-cancel/speex.c b/src/modules/echo-cancel/speex.c index cb8212e1..0d4d1236 100644 --- a/src/modules/echo-cancel/speex.c +++ b/src/modules/echo-cancel/speex.c @@ -51,7 +51,7 @@ static void pa_speex_ec_fixate_spec(pa_sample_spec *source_ss, pa_channel_map *s 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) + uint32_t *blocksize, const char *args) { int framelen, y, rate; uint32_t frame_size_ms, filter_size_ms; @@ -84,9 +84,9 @@ pa_bool_t pa_speex_ec_init(pa_echo_canceller *ec, y >>= 1; framelen = y; - ec->params.priv.speex.blocksize = framelen * pa_frame_size (source_ss); + *blocksize = framelen * pa_frame_size (source_ss); - pa_log_debug ("Using framelen %d, blocksize %lld, channels %d, rate %d", framelen, (long long) ec->params.priv.speex.blocksize, source_ss->channels, source_ss->rate); + pa_log_debug ("Using framelen %d, blocksize %u, channels %d, rate %d", framelen, *blocksize, source_ss->channels, source_ss->rate); ec->params.priv.speex.state = speex_echo_state_init_mc (framelen, (rate * filter_size_ms) / 1000, source_ss->channels, source_ss->channels); @@ -114,8 +114,3 @@ void pa_speex_ec_done(pa_echo_canceller *ec) speex_echo_state_destroy (ec->params.priv.speex.state); ec->params.priv.speex.state = NULL; } - -uint32_t pa_speex_ec_get_block_size(pa_echo_canceller *ec) -{ - return ec->params.priv.speex.blocksize; -} -- cgit