From c36ab6896fd75931531f709844ea7f95c5829228 Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Tue, 7 Sep 2010 15:07:39 +0530 Subject: [PATCH] echo-cancel: Mark immutable parameters as const in vfunc Marks the recording and playback streams as const in the pa_echo_canceller->run method for clarity. --- src/modules/echo-cancel/adrian.c | 2 +- src/modules/echo-cancel/echo-cancel.h | 6 +++--- src/modules/echo-cancel/speex.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/echo-cancel/adrian.c b/src/modules/echo-cancel/adrian.c index 1b91373..86db1e2 100644 --- a/src/modules/echo-cancel/adrian.c +++ b/src/modules/echo-cancel/adrian.c @@ -93,7 +93,7 @@ fail: return FALSE; } -void pa_adrian_ec_run(pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out) +void pa_adrian_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out) { unsigned int i; diff --git a/src/modules/echo-cancel/echo-cancel.h b/src/modules/echo-cancel/echo-cancel.h index bf81b1d..448ad99 100644 --- a/src/modules/echo-cancel/echo-cancel.h +++ b/src/modules/echo-cancel/echo-cancel.h @@ -57,7 +57,7 @@ struct pa_echo_canceller { 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 (*run) (pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out); void (*done) (pa_echo_canceller *ec); pa_echo_canceller_params params; @@ -68,7 +68,7 @@ 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, 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_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out); void pa_speex_ec_done(pa_echo_canceller *ec); /* Adrian Andre's echo canceller */ @@ -76,5 +76,5 @@ 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, 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_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out); void pa_adrian_ec_done(pa_echo_canceller *ec); diff --git a/src/modules/echo-cancel/speex.c b/src/modules/echo-cancel/speex.c index 0d4d123..17a89d2 100644 --- a/src/modules/echo-cancel/speex.c +++ b/src/modules/echo-cancel/speex.c @@ -104,7 +104,7 @@ fail: return FALSE; } -void pa_speex_ec_run(pa_echo_canceller *ec, uint8_t *rec, uint8_t *play, uint8_t *out) +void pa_speex_ec_run(pa_echo_canceller *ec, const uint8_t *rec, const uint8_t *play, uint8_t *out) { speex_echo_cancellation(ec->params.priv.speex.state, (const spx_int16_t *) rec, (const spx_int16_t *) play, (spx_int16_t *) out); } -- 2.7.4