From f8ca7b03d701cd46ead9a61ee18c17d232a616a1 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 20 Apr 2009 14:19:11 +0000 Subject: More ticket #774: added option to shift PCM input to encoder right by some value (default is 1) to make it compatible with some other app git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2620 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/include/pjmedia-codec/config.h | 16 +++++++++++++++- pjmedia/include/pjmedia-codec/g7221.h | 15 +++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'pjmedia/include') diff --git a/pjmedia/include/pjmedia-codec/config.h b/pjmedia/include/pjmedia-codec/config.h index 046c8618..314506e5 100644 --- a/pjmedia/include/pjmedia-codec/config.h +++ b/pjmedia/include/pjmedia-codec/config.h @@ -237,8 +237,22 @@ * G.722.1 codec is disabled by default, it's currently under development. */ #ifndef PJMEDIA_HAS_G7221_CODEC -# define PJMEDIA_HAS_G7221_CODEC 0 +# define PJMEDIA_HAS_G7221_CODEC 0 #endif +/** + * Default G.722.1 codec encoder and decoder level adjustment. + * If the value is non-zero, then PCM input samples to the encoder will + * be shifted right by this value, and similarly PCM output samples from + * the decoder will be shifted left by this value. + * + * This can be changed at run-time after initialization by calling + * #pjmedia_codec_g7221_set_pcm_shift(). + */ +#ifndef PJMEDIA_G7221_DEFAULT_PCM_SHIFT +# define PJMEDIA_G7221_DEFAULT_PCM_SHIFT 1 +#endif + + #endif /* __PJMEDIA_CODEC_CONFIG_H__ */ diff --git a/pjmedia/include/pjmedia-codec/g7221.h b/pjmedia/include/pjmedia-codec/g7221.h index 11ec11f4..8c7cbd20 100644 --- a/pjmedia/include/pjmedia-codec/g7221.h +++ b/pjmedia/include/pjmedia-codec/g7221.h @@ -93,6 +93,21 @@ PJ_DECL(pj_status_t) pjmedia_codec_g7221_set_mode(unsigned sample_rate, unsigned bitrate, pj_bool_t enabled); +/** + * Set the G.722.1 codec encoder and decoder level adjustment. + * If the value is non-zero, then PCM input samples to the encoder will + * be shifted right by this value, and similarly PCM output samples from + * the decoder will be shifted left by this value. + * + * Default value is PJMEDIA_G7221_DEFAULT_PCM_SHIFT. + * + * @param val The value + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_g7221_set_pcm_shift(int val); + + /** * Unregister G722.1 codecs factory from pjmedia endpoint. -- cgit v1.2.3