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.
This commit is contained in:
Arun Raghavan 2010-09-07 14:55:38 +05:30
parent 33a3bc34c8
commit 948a3d042c
4 changed files with 25 additions and 43 deletions

View file

@ -37,7 +37,6 @@ typedef struct pa_echo_canceller_params pa_echo_canceller_params;
struct pa_echo_canceller_params {
union {
struct {
uint32_t blocksize;
SpeexEchoState *state;
} speex;
struct {
@ -56,10 +55,10 @@ struct pa_echo_canceller {
pa_channel_map *source_map,
pa_sample_spec *sink_ss,
pa_channel_map *sink_map,
uint32_t *blocksize,
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);
pa_echo_canceller_params params;
};
@ -68,16 +67,14 @@ struct pa_echo_canceller {
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);
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);
/* Adrian Andre's echo canceller */
pa_bool_t pa_adrian_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);
void pa_adrian_ec_run(pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out);
void pa_adrian_ec_done(pa_echo_canceller *ec);
uint32_t pa_adrian_ec_get_block_size(pa_echo_canceller *ec);