diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2010-08-11 07:18:08 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2010-08-11 07:18:08 +0000 |
commit | 3ba193765e2b418e7688eb9088fbbeb6ce492e56 (patch) | |
tree | ea932c16fbae9946c0fdbf39c70dda34ec723f1e /pjmedia | |
parent | eac79b106f7b928ef0ff06350f4486ae39008fc3 (diff) |
Re #1106: Reverted back the IPP codec APIs pjmedia_codec_ipp_set/get_config() as currently to set PCM signal level adjustment can be done using the existing G722.1 API pjmedia_codec_g7221_set_pcm_shift().
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3263 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/include/pjmedia-codec/g7221.h | 4 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/ipp_codecs.h | 39 | ||||
-rw-r--r-- | pjmedia/src/pjmedia-codec/ipp_codecs.c | 41 |
3 files changed, 17 insertions, 67 deletions
diff --git a/pjmedia/include/pjmedia-codec/g7221.h b/pjmedia/include/pjmedia-codec/g7221.h index 9785b44a..737dedd2 100644 --- a/pjmedia/include/pjmedia-codec/g7221.h +++ b/pjmedia/include/pjmedia-codec/g7221.h @@ -129,6 +129,10 @@ PJ_DECL(pj_status_t) pjmedia_codec_g7221_set_mode(unsigned sample_rate, * be shifted right by this value, and similarly PCM output samples from * the decoder will be shifted left by this value. * + * \note + * This function is also applicable for G722.1 implementation with IPP + * back-end. + * * Default value is PJMEDIA_G7221_DEFAULT_PCM_SHIFT. * * @param val The value diff --git a/pjmedia/include/pjmedia-codec/ipp_codecs.h b/pjmedia/include/pjmedia-codec/ipp_codecs.h index 42db8a0f..f0642382 100644 --- a/pjmedia/include/pjmedia-codec/ipp_codecs.h +++ b/pjmedia/include/pjmedia-codec/ipp_codecs.h @@ -291,23 +291,6 @@ PJ_BEGIN_DECL -/** - * IPP codecs configuration settings. - */ -typedef struct pjmedia_codec_ipp_config -{ - /** - * Specifies 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. - */ - unsigned g7221_pcm_shift; - -} pjmedia_codec_ipp_config; - /** * Initialize and register IPP codecs factory to pjmedia endpoint. @@ -320,28 +303,6 @@ PJ_DECL(pj_status_t) pjmedia_codec_ipp_init( pjmedia_endpt *endpt ); /** - * Get current IPP codecs configuration settings. - * - * @param cfg The IPP codecs configuration settings buffer. - * - * @return PJ_SUCCESS on success. - */ -PJ_DECL(pj_status_t) pjmedia_codec_ipp_get_config( - pjmedia_codec_ipp_config *cfg); - - -/** - * Set IPP codecs configuration settings. - * - * @param setting The IPP codecs configuration settings to be applied. - * - * @return PJ_SUCCESS on success. - */ -PJ_DECL(pj_status_t) pjmedia_codec_ipp_set_config( - const pjmedia_codec_ipp_config *cfg); - - -/** * Unregister IPP codecs factory from pjmedia endpoint and deinitialize * the IPP codecs library. * diff --git a/pjmedia/src/pjmedia-codec/ipp_codecs.c b/pjmedia/src/pjmedia-codec/ipp_codecs.c index 86449268..1caf08c4 100644 --- a/pjmedia/src/pjmedia-codec/ipp_codecs.c +++ b/pjmedia/src/pjmedia-codec/ipp_codecs.c @@ -644,6 +644,19 @@ static pj_status_t pack_g7221( ipp_private_t *codec_data, void *pkt, return PJ_SUCCESS; } + +#include <pjmedia-codec/g7221.h> + + +PJ_DEF(pj_status_t) pjmedia_codec_g7221_set_pcm_shift(int val) +{ + PJ_ASSERT_RETURN(val >= 0, PJ_EINVAL); + + ipp_factory.g7221_pcm_shift = val; + return PJ_SUCCESS; +} + + #endif /* PJMEDIA_HAS_INTEL_IPP_CODEC_G722_1 */ /* @@ -734,34 +747,6 @@ PJ_DEF(pj_status_t) pjmedia_codec_ipp_deinit(void) return status; } -/* - * Get current IPP codecs configuration settings. - */ -PJ_DEF(pj_status_t) pjmedia_codec_ipp_get_config( - pjmedia_codec_ipp_config *cfg) -{ - PJ_ASSERT_RETURN(cfg, PJ_EINVAL); - - pj_bzero(cfg, sizeof(*cfg)); - cfg->g7221_pcm_shift = ipp_factory.g7221_pcm_shift; - - return PJ_SUCCESS; -} - - -/* - * Set IPP codecs configuration settings. - */ -PJ_DECL(pj_status_t) pjmedia_codec_ipp_set_config( - const pjmedia_codec_ipp_config *cfg) -{ - PJ_ASSERT_RETURN(cfg, PJ_EINVAL); - - ipp_factory.g7221_pcm_shift = cfg->g7221_pcm_shift; - - return PJ_SUCCESS; -} - /* * Check if factory can allocate the specified codec. |