summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-04-20 14:19:11 +0000
committerBenny Prijono <bennylp@teluu.com>2009-04-20 14:19:11 +0000
commitf8ca7b03d701cd46ead9a61ee18c17d232a616a1 (patch)
treebc15ac76df66a68066a694455608a3307c1971ab /pjmedia/include
parent96d0f3f079f982be294f694590c49b8e9fed2420 (diff)
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
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia-codec/config.h16
-rw-r--r--pjmedia/include/pjmedia-codec/g7221.h15
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.