diff options
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia-codec/config.h | 16 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/g7221.h | 15 |
2 files changed, 30 insertions, 1 deletions
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. |