summaryrefslogtreecommitdiffstats
path: root/src/modules/echo-cancel/speex.c
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2010-09-07 14:55:38 +0530
committerArun Raghavan <arun.raghavan@collabora.co.uk>2011-03-28 14:41:00 +0530
commitb6b8a7b7a7f4f8badd39ebb4ee2be1c11ff1a204 (patch)
tree6a8a55197b911e23e54bbfbc755f2f9eb440c66a /src/modules/echo-cancel/speex.c
parent4a9fa8cc7ff0963fbf794a0018445604f69721e7 (diff)
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.
Diffstat (limited to 'src/modules/echo-cancel/speex.c')
-rw-r--r--src/modules/echo-cancel/speex.c11
1 files changed, 3 insertions, 8 deletions
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;
-}