summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-09-16 14:33:16 +0000
committerBenny Prijono <bennylp@teluu.com>2008-09-16 14:33:16 +0000
commitb1c66224a0fab355eefa3bcbc9e791c13a31ce0f (patch)
treee30fcb1c7298ea37d7bd364f0dcd2ed6d398f2c3 /pjmedia/include
parent1a617d04a43d1bb2b32f7eca393f6ac3c65523e4 (diff)
Ticket #619: added configuration to force floating point algorithm to be used in the tone generator, and added fade-in and fade out options
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2281 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/config.h59
1 files changed, 57 insertions, 2 deletions
diff --git a/pjmedia/include/pjmedia/config.h b/pjmedia/include/pjmedia/config.h
index 46bf18b9..e592fcfb 100644
--- a/pjmedia/include/pjmedia/config.h
+++ b/pjmedia/include/pjmedia/config.h
@@ -541,10 +541,65 @@
* Enable high quality of tone generation, the better quality will cost
* more CPU load. This is only applied to floating point enabled machines.
*
- * By default it is enabled.
+ * By default it is enabled when PJ_HAS_FLOATING_POINT is set.
+ *
+ * @see PJMEDIA_TONEGEN_FORCE_FLOAT
*/
#ifndef PJMEDIA_USE_HIGH_QUALITY_TONEGEN
-# define PJMEDIA_USE_HIGH_QUALITY_TONEGEN 1
+# define PJMEDIA_USE_HIGH_QUALITY_TONEGEN PJ_HAS_FLOATING_POINT
+#endif
+
+
+/**
+ * Force the tone generation to use floating point computation, even when
+ * PJ_HAS_FLOATING_POINT is disabled. This may be necessary if the tone
+ * generator is used to produce DTMF to be sent inband, since the fixed
+ * point algorithm may not have the correct frequency accuracy.
+ *
+ * This option, combined with PJ_HAS_FLOATING_POINT will produce the
+ * following selection of tone generator algorithm:
+ * - if both PJ_HAS_FLOATING_POINT and PJMEDIA_USE_HIGH_QUALITY_TONEGEN
+ * are set, the standard sin() function will be used. This will produce
+ * the highest quality tones, at the expense of more processing power.
+ * - if PJ_HAS_FLOATING_POINT is not set:
+ * - if both PJMEDIA_USE_HIGH_QUALITY_TONEGEN and
+ * PJMEDIA_TONEGEN_FORCE_FLOAT are set, sin() based algorithm will
+ * be used (similar as above).
+ * - if PJMEDIA_USE_HIGH_QUALITY_TONEGEN is not set but the
+ * PJMEDIA_TONEGEN_FORCE_FLOAT is set, a floating point approximation
+ * algorithm will be used. This should produce good enough tone
+ * for most uses, and the performance is faster than using pure
+ * sin() based algorithm. Note that linking to math library may
+ * still be needed.
+ * - if both are not set, the fixed point approximation algorithm
+ * will be used.
+ *
+ * Default: 1
+ */
+#ifndef PJMEDIA_TONEGEN_FORCE_FLOAT
+# define PJMEDIA_TONEGEN_FORCE_FLOAT 1
+#endif
+
+
+/**
+ * Fade-in duration for the tone, in milliseconds. Set to zero to disable
+ * this feature.
+ *
+ * Default: 1 (msec)
+ */
+#ifndef PJMEDIA_TONEGEN_FADE_IN_TIME
+# define PJMEDIA_TONEGEN_FADE_IN_TIME 1
+#endif
+
+
+/**
+ * Fade-out duration for the tone, in milliseconds. Set to zero to disable
+ * this feature.
+ *
+ * Default: 2 (msec)
+ */
+#ifndef PJMEDIA_TONEGEN_FADE_OUT_TIME
+# define PJMEDIA_TONEGEN_FADE_OUT_TIME 2
#endif