[asterisk-commits] branch group/rtpjitterbuffer r30195 - /team/group/rtpjitterbuffer/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 25 06:57:35 MST 2006


Author: russell
Date: Thu May 25 08:57:34 2006
New Revision: 30195

URL: http://svn.digium.com/view/asterisk?rev=30195&view=rev
Log:
add generic jitterbuffer support to chan_alsa

Note that this allows testing of this code even if you don't have a zap device
available for testing!

Modified:
    team/group/rtpjitterbuffer/channels/chan_alsa.c

Modified: team/group/rtpjitterbuffer/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_alsa.c?rev=30195&r1=30194&r2=30195&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_alsa.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_alsa.c Thu May 25 08:57:34 2006
@@ -69,6 +69,19 @@
 #ifdef ALSA_MONITOR
 #include "alsa-monitor.h"
 #endif
+
+#ifdef AST_JB
+#include "asterisk/abstract_jb.h"
+/* Global jitterbuffer configuration - by default, jb is disabled */
+static struct ast_jb_conf default_jbconf =
+{
+	.flags = 0,
+	.max_size = -1,
+	.resync_threshold = -1,
+	.impl = ""
+};
+static struct ast_jb_conf global_jbconf;
+#endif /* AST_JB */
 
 #define DEBUG 0
 /* Which device to use */
@@ -812,6 +825,9 @@
 				tmp = NULL;
 			}
 		}
+#ifdef AST_JB
+		ast_jb_configure(tmp, &global_jbconf);
+#endif
 	}
 	return tmp;
 }
@@ -1051,9 +1067,22 @@
 	int x;
 	struct ast_config *cfg;
 	struct ast_variable *v;
+
+#ifdef AST_JB
+	/* Copy the default jb config over global_jbconf */
+	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
+#endif /* AST_JB */
+
 	if ((cfg = ast_config_load(config))) {
 		v = ast_variable_browse(cfg, "general");
 		while(v) {
+#ifdef AST_JB
+			/* handle jb conf */
+			if (!ast_jb_read_conf(&global_jbconf, v->name, v->value)) {
+				v = v->next;
+				continue;
+			}
+#endif /* AST_JB */
 			if (!strcasecmp(v->name, "autoanswer"))
 				autoanswer = ast_true(v->value);
 			else if (!strcasecmp(v->name, "silencesuppression"))



More information about the asterisk-commits mailing list