[asterisk-commits] branch group/rtpjitterbuffer r30861 - in /team/group/rtpjitterbuffer: ./ buil...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue May 30 11:32:32 MST 2006


Author: russell
Date: Tue May 30 13:32:31 2006
New Revision: 30861

URL: http://svn.digium.com/view/asterisk?rev=30861&view=rev
Log:
- remove the AST_JB define since you have to add configuration to enable
  it anyway
- add the jitterbuffer options docs to oss.conf.sample, chan_oss can use it, too

Modified:
    team/group/rtpjitterbuffer/abstract_jb.c
    team/group/rtpjitterbuffer/build_tools/cflags.xml
    team/group/rtpjitterbuffer/channel.c
    team/group/rtpjitterbuffer/channels/chan_alsa.c
    team/group/rtpjitterbuffer/channels/chan_iax2.c
    team/group/rtpjitterbuffer/channels/chan_oss.c
    team/group/rtpjitterbuffer/channels/chan_sip.c
    team/group/rtpjitterbuffer/channels/chan_zap.c
    team/group/rtpjitterbuffer/configs/oss.conf.sample
    team/group/rtpjitterbuffer/frame.c
    team/group/rtpjitterbuffer/include/asterisk/abstract_jb.h
    team/group/rtpjitterbuffer/include/asterisk/channel.h
    team/group/rtpjitterbuffer/include/asterisk/frame.h
    team/group/rtpjitterbuffer/rtp.c
    team/group/rtpjitterbuffer/translate.c

Modified: team/group/rtpjitterbuffer/abstract_jb.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/abstract_jb.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/abstract_jb.c (original)
+++ team/group/rtpjitterbuffer/abstract_jb.c Tue May 30 13:32:31 2006
@@ -40,8 +40,6 @@
 #include "asterisk/term.h"
 #include "asterisk/options.h"
 #include "asterisk/utils.h"
-
-#ifdef AST_JB
 
 #include "asterisk/abstract_jb.h"
 #include "scx_jitterbuf.h"
@@ -784,8 +782,3 @@
 static void jb_force_resynch_stevek(void *jb)
 {
 }
-
-
-#endif /* AST_JB */
-
-

Modified: team/group/rtpjitterbuffer/build_tools/cflags.xml
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/build_tools/cflags.xml?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/build_tools/cflags.xml (original)
+++ team/group/rtpjitterbuffer/build_tools/cflags.xml Tue May 30 13:32:31 2006
@@ -1,7 +1,4 @@
 	<category name="MENUSELECT_CFLAGS" displayname="Compiler Flags" positive_output="yes" force_clean_on_change="yes">
-		<member name="AST_JB" displayname="Generic Jitterbuffer">
-			<defaultenabled>yes</defaultenabled>
-		</member>
 		<member name="DEBUG_CHANNEL_LOCKS" displayname="Debug Channel Locking">
 		</member>
 		<member name="DEBUG_SCHEDULER" displayname="Enable Scheduler Debugging Output">

Modified: team/group/rtpjitterbuffer/channel.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channel.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channel.c (original)
+++ team/group/rtpjitterbuffer/channel.c Tue May 30 13:32:31 2006
@@ -1012,10 +1012,8 @@
 	while ((vardata = AST_LIST_REMOVE_HEAD(headp, entries)))
 		ast_var_delete(vardata);
 
-#ifdef AST_JB
 	/* Destroy the jitterbuffer */
 	ast_jb_destroy(chan);
-#endif /* AST_JB */
 
 	ast_string_field_free_all(chan);
 	free(chan);
@@ -3303,10 +3301,8 @@
 	int watch_c0_dtmf;
 	int watch_c1_dtmf;
 	void *pvt0, *pvt1;
-#ifdef AST_JB
 	/* Indicates whether a frame was queued into a jitterbuffer */
 	int frame_put_in_jb;
-#endif /* AST_JB */
 	int to;
 	
 	cs[0] = c0;
@@ -3318,10 +3314,8 @@
 	watch_c0_dtmf = config->flags & AST_BRIDGE_DTMF_CHANNEL_0;
 	watch_c1_dtmf = config->flags & AST_BRIDGE_DTMF_CHANNEL_1;
 
-#ifdef AST_JB
 	/* Check the need of a jitterbuffer for each channel */
 	ast_jb_do_usecheck(c0, c1);
-#endif /* AST_JB */
 
 	for (;;) {
 		struct ast_channel *who, *other;
@@ -3341,17 +3335,13 @@
 			}
 		} else
 			to = -1;
-#ifdef AST_JB
 		/* Calculate the appropriate max sleep interval - in general, this is the time,
 		   left to the closest jb delivery moment */
 		to = ast_jb_get_when_to_wakeup(c0, c1, to);
-#endif /* AST_JB */
 		who = ast_waitfor_n(cs, 2, &to);
 		if (!who) {
-#ifdef AST_JB
 			/* No frame received within the specified timeout - check if we have to deliver now */
 			ast_jb_get_and_deliver(c0, c1);
-#endif /* AST_JB */
 			if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE || c1->_softhangup == AST_SOFTHANGUP_UNBRIDGE) {
 				if (c0->_softhangup == AST_SOFTHANGUP_UNBRIDGE)
 					c0->_softhangup = 0;
@@ -3371,11 +3361,8 @@
 		}
 
 		other = (who == c0) ? c1 : c0; /* the 'other' channel */
-#ifdef AST_JB
 		/* Try add the frame info the who's bridged channel jitterbuff */
 		frame_put_in_jb = !ast_jb_put(other, f);
-#endif /* AST_JB */
-
 
 		if ((f->frametype == AST_FRAME_CONTROL) && !(config->flags & AST_BRIDGE_IGNORE_SIGS)) {
 			int bridge_exit = 0;
@@ -3411,24 +3398,13 @@
 					*fo = f;
 					ast_log(LOG_DEBUG, "Got DTMF on channel (%s)\n", who->name);
 					break;
-			} else {
-#if 0
-				ast_log(LOG_DEBUG, "Read from %s\n", who->name);
-				if (who == last)
-					ast_log(LOG_DEBUG, "Servicing channel %s twice in a row?\n", last->name);
-				last = who;
-#endif
-#ifdef AST_JB
-				/* Write immediately frames, not passed through jb */
-				if (!frame_put_in_jb)
-					ast_write(other, f);
+			}
+			/* Write immediately frames, not passed through jb */
+			if (!frame_put_in_jb)
+				ast_write(other, f);
 				
-				/* Check if we have to deliver now */
-				ast_jb_get_and_deliver(c0, c1);
-#else /* AST_JB */
-				ast_write(other, f);
-#endif /* AST_JB */
-			}
+			/* Check if we have to deliver now */
+			ast_jb_get_and_deliver(c0, c1);
 		}
 		/* XXX do we want to pass on also frames not matched above ? */
 		ast_frfree(f);

Modified: team/group/rtpjitterbuffer/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_alsa.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_alsa.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_alsa.c Tue May 30 13:32:31 2006
@@ -70,7 +70,6 @@
 #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 =
@@ -81,7 +80,6 @@
 	.impl = ""
 };
 static struct ast_jb_conf global_jbconf;
-#endif /* AST_JB */
 
 #define DEBUG 0
 /* Which device to use */
@@ -825,10 +823,8 @@
 				tmp = NULL;
 			}
 		}
-#ifdef AST_JB
 		if (tmp)
 			ast_jb_configure(tmp, &global_jbconf);
-#endif
 	}
 	return tmp;
 }
@@ -1069,21 +1065,17 @@
 	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"))

Modified: team/group/rtpjitterbuffer/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_iax2.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_iax2.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_iax2.c Tue May 30 13:32:31 2006
@@ -1543,9 +1543,7 @@
 	  the IAX thread with the iaxsl lock held. */
 	struct iax_frame *fr = data;
 	fr->retrans = -1;
-#ifdef AST_JB
 	fr->af.has_timing_info = 0;
-#endif /* AST_JB */
 	if (iaxs[fr->callno] && !ast_test_flag(iaxs[fr->callno], IAX_ALREADYGONE))
 		iax2_queue_frame(fr->callno, &fr->af);
 	/* Free our iax frame */

Modified: team/group/rtpjitterbuffer/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_oss.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_oss.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_oss.c Tue May 30 13:32:31 2006
@@ -82,7 +82,6 @@
 #include "ring10.h"
 #include "answer.h"
 
-#ifdef AST_JB
 #include "asterisk/abstract_jb.h"
 /* Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
@@ -93,7 +92,6 @@
 	.impl = ""
 };
 static struct ast_jb_conf global_jbconf;
-#endif /* AST_JB */
 
 /*
  * Basic mode of operation:
@@ -153,6 +151,33 @@
     ; unless you know what you are doing.
     ; queuesize = 10		; frames in device driver
     ; frags = 8			; argument to SETFRAGMENT
+
+    ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+    ; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of an
+                                  ; OSS channel. Defaults to "no". An enabled jitterbuffer will
+                                  ; be used only if the sending side can create and the receiving
+                                  ; side can not accept jitter. The ZAP channel can't accept jitter,
+                                  ; thus an enabled jitterbuffer on the receive ZAP side will always
+                                  ; be used if the sending side can create jitter or if ZAP jb is
+                                  ; forced.
+
+    ; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a ZAP
+                                  ; channel. Defaults to "no".
+
+    ; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
+
+    ; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
+                                  ; resynchronized. Useful to improve the quality of the voice, with
+                                  ; big jumps in/broken timestamps, usualy sent from exotic devices
+                                  ; and programs. Defaults to 1000.
+
+    ; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
+                                  ; channel. Two implementation are currenlty available - "fixed"
+                                  ; (with size always equals to jbmax-size) and "adaptive" (with
+                                  ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+    ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
+    ;-----------------------------------------------------------------------------------
 
 [card1]
     ; device = /dev/dsp1	; alternate device
@@ -994,10 +1019,8 @@
 			/* XXX what about usecnt ? */
 		}
 	}
-#ifdef AST_JB
 	if (c)
 		ast_jb_configure(c, &global_jbconf);
-#endif
 
 	return c;
 }
@@ -1425,11 +1448,9 @@
 	for (v = ast_variable_browse(cfg, ctg);v; v=v->next) {
 		M_START(v->name, v->value);
 
-#ifdef AST_JB
 		/* handle jb conf */
 		if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
 			continue;
-#endif /* AST_JB */
 
 		M_BOOL("autoanswer", o->autoanswer)
 		M_BOOL("autohangup", o->autohangup)
@@ -1496,10 +1517,8 @@
 	int i;
 	struct ast_config *cfg;
 
-#ifdef AST_JB
 	/* Copy the default jb config over global_jbconf */
 	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
-#endif /* AST_JB */
 
 	/* load config file */
 	cfg = ast_config_load(config);

Modified: team/group/rtpjitterbuffer/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_sip.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_sip.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_sip.c Tue May 30 13:32:31 2006
@@ -202,7 +202,6 @@
 
 #define	INITIAL_CSEQ		101	/*!< our initial sip sequence number */
 
-#ifdef AST_JB
 #include "asterisk/abstract_jb.h"
 /* Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
@@ -213,7 +212,6 @@
 	.impl = ""
 };
 static struct ast_jb_conf global_jbconf;
-#endif /* AST_JB */
 
 static const char tdesc[] = "Session Initiation Protocol (SIP)";
 static const char config[] = "sip.conf";
@@ -863,9 +861,7 @@
 	struct ast_variable *chanvars;		/*!< Channel variables to set for inbound call */
 	struct sip_pvt *next;			/*!< Next dialog in chain */
 	struct sip_invite_param *options;	/*!< Options for INVITE */
-#ifdef AST_JB
 	struct ast_jb_conf jbconf;
-#endif /* AST_JB */
 } *iflist = NULL;
 
 #define FLAG_RESPONSE (1 << 0)
@@ -1272,11 +1268,7 @@
 	.type = "SIP",
 	.description = "Session Initiation Protocol (SIP)",
 	.capabilities = ((AST_FORMAT_MAX_AUDIO << 1) - 1),
-#ifdef AST_JB
 	.properties = AST_CHAN_TP_WANTSJITTER | AST_CHAN_TP_CREATESJITTER,
-#else /* AST_JB */
-	.properties = AST_CHAN_TP_WANTSJITTER,
-#endif /* AST_JB */
 	.requester = sip_request_call,
 	.devicestate = sip_devicestate,
 	.call = sip_call,
@@ -3328,13 +3320,11 @@
 
 	if (recordhistory)
 		append_history(i, "NewChan", "Channel %s - from %s", tmp->name, i->callid);
-				
-#ifdef AST_JB
+
 	/* Configure the new channel jb */
 	if (tmp && i && i->rtp)
 		ast_jb_configure(tmp, &i->jbconf);
-#endif /* AST_JB */
-				
+
 	return tmp;
 }
 
@@ -3669,10 +3659,8 @@
 		p->noncodeccapability |= AST_RTP_DTMF;
 	ast_string_field_set(p, context, default_context);
 
-#ifdef AST_JB
 	/* Assign default jb conf to the new sip_pvt */
 	memcpy(&p->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
-#endif /* AST_JB */
 
 	/* Add to active dialog list */
 	ast_mutex_lock(&iflock);
@@ -13566,11 +13554,9 @@
 	global_relaxdtmf = FALSE;
 	global_callevents = FALSE;
 	global_t1min = DEFAULT_T1MIN;		
-	
-#ifdef AST_JB
+
 	/* Copy the default jb config over global_jbconf */
 	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
-#endif /* AST_JB */
 
 	ast_clear_flag(&global_flags[1], SIP_PAGE2_VIDEOSUPPORT);
 
@@ -13578,11 +13564,9 @@
 	for (v = ast_variable_browse(cfg, "general"); v; v = v->next) {
 		if (handle_common_options(&global_flags[0], &dummy[0], v))
 			continue;
-#ifdef AST_JB
 		/* handle jb conf */
 		if (!ast_jb_read_conf(&global_jbconf, v->name, v->value))
 			continue;
-#endif /* AST_JB */
 
 		/* Create the interface list */
 		if (!strcasecmp(v->name, "context")) {

Modified: team/group/rtpjitterbuffer/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/channels/chan_zap.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/channels/chan_zap.c (original)
+++ team/group/rtpjitterbuffer/channels/chan_zap.c Tue May 30 13:32:31 2006
@@ -109,7 +109,6 @@
 #define SMDI_MD_WAIT_TIMEOUT 1500 /* 1.5 seconds */
 #endif
 
-#ifdef AST_JB
 #include "asterisk/abstract_jb.h"
 /* Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
@@ -120,7 +119,6 @@
 	.impl = ""
 };
 static struct ast_jb_conf global_jbconf;
-#endif /* AST_JB */
 
 #if !defined(ZT_SIG_EM_E1) || (defined(HAVE_LIBPRI) && !defined(ZT_SIG_HARDHDLC))
 #error "Your zaptel is too old.  please update"
@@ -697,9 +695,7 @@
 #endif	
 	int polarity;
 	int dsp_features;
-#ifdef AST_JB
 	struct ast_jb_conf jbconf;
-#endif /* AST_JB */
 
 } *iflist = NULL, *ifend = NULL;
 
@@ -5211,11 +5207,9 @@
 		}
 	} else
 		ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
-#ifdef AST_JB
 	/* Configure the new channel jb */
 	if (tmp && i)
 		ast_jb_configure(tmp, &i->jbconf);
-#endif /* AST_JB */
 	return tmp;
 }
 
@@ -7009,10 +7003,8 @@
 		for (x=0;x<3;x++)
 			tmp->subs[x].zfd = -1;
 		tmp->channel = channel;
-#ifdef AST_JB
 		/* Assign default jb conf to the new zt_pvt */
 		memcpy(&tmp->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
-#endif /* AST_JB */
 	}
 
 	if (tmp) {
@@ -10225,9 +10217,7 @@
 {
 	struct ast_config *cfg;
 	struct ast_variable *v;
-#ifdef AST_JB
 	struct ast_variable *vjb;
-#endif /* AST_JB */
 	struct zt_pvt *tmp;
 	char *chan;
 	char *c;
@@ -10317,13 +10307,11 @@
 	}
 #endif
 	v = ast_variable_browse(cfg, "channels");
-#ifdef AST_JB
 	/* Copy the default jb config over global_jbconf */
 	memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
 	/* Traverse all variables to handle jb conf */
 	for (vjb = v; vjb; vjb = vjb->next)
 		ast_jb_read_conf(&global_jbconf, vjb->name, vjb->value);
-#endif /* AST_JB */
 	while(v) {
 		/* Create the interface list */
 		if (!strcasecmp(v->name, "channel")

Modified: team/group/rtpjitterbuffer/configs/oss.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/configs/oss.conf.sample?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/configs/oss.conf.sample (original)
+++ team/group/rtpjitterbuffer/configs/oss.conf.sample Tue May 30 13:32:31 2006
@@ -46,6 +46,34 @@
     ; queuesize = 10		; frames in device driver
     ; frags = 8			; argument to SETFRAGMENT
 
+    ;------------------------------ JITTER BUFFER CONFIGURATION --------------------------
+    ; jbenable = yes              ; Enables the use of a jitterbuffer on the receiving side of an
+                                  ; OSS channel. Defaults to "no". An enabled jitterbuffer will
+                                  ; be used only if the sending side can create and the receiving
+                                  ; side can not accept jitter. The ZAP channel can't accept jitter,
+                                  ; thus an enabled jitterbuffer on the receive ZAP side will always
+                                  ; be used if the sending side can create jitter or if ZAP jb is
+                                  ; forced.
+
+    ; jbforce = no                ; Forces the use of a jitterbuffer on the receive side of a ZAP
+                                  ; channel. Defaults to "no".
+
+    ; jbmaxsize = 200             ; Max length of the jitterbuffer in milliseconds.
+
+    ; jbresyncthreshold = 1000    ; Jump in the frame timestamps over which the jitterbuffer is
+                                  ; resynchronized. Useful to improve the quality of the voice, with
+                                  ; big jumps in/broken timestamps, usualy sent from exotic devices
+                                  ; and programs. Defaults to 1000.
+
+    ; jbimpl = fixed              ; Jitterbuffer implementation, used on the receiving side of a SIP
+                                  ; channel. Two implementation are currenlty available - "fixed"
+                                  ; (with size always equals to jbmax-size) and "adaptive" (with
+                                  ; variable size, actually the new jb of IAX2). Defaults to fixed.
+
+    ; jblog = no                  ; Enables jitterbuffer frame logging. Defaults to "no".
+    ;-----------------------------------------------------------------------------------
+
+
 [card1]
     ; device = /dev/dsp1	; alternate device
 

Modified: team/group/rtpjitterbuffer/frame.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/frame.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/frame.c (original)
+++ team/group/rtpjitterbuffer/frame.c Tue May 30 13:32:31 2006
@@ -316,7 +316,6 @@
 		out->samples = fr->samples;
 		out->offset = fr->offset;
 		out->data = fr->data;
-#ifdef AST_JB
 		/* Copy the timing data */
 		out->has_timing_info = fr->has_timing_info;
 		if (fr->has_timing_info) {
@@ -324,7 +323,6 @@
 			out->len = fr->len;
 			out->seqno = fr->seqno;
 		}
-#endif /* AST_JB */
 	} else
 		out = fr;
 	
@@ -389,14 +387,12 @@
 	out->prev = NULL;
 	out->next = NULL;
 	memcpy(out->data, f->data, out->datalen);	
-#ifdef AST_JB
 	out->has_timing_info = f->has_timing_info;
 	if (f->has_timing_info) {
 		out->ts = f->ts;
 		out->len = f->len;
 		out->seqno = f->seqno;
 	}
-#endif /* AST_JB */
 	return out;
 }
 

Modified: team/group/rtpjitterbuffer/include/asterisk/abstract_jb.h
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/include/asterisk/abstract_jb.h?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/include/asterisk/abstract_jb.h (original)
+++ team/group/rtpjitterbuffer/include/asterisk/abstract_jb.h Tue May 30 13:32:31 2006
@@ -41,9 +41,11 @@
 
 
 /* Configuration flags */
-#define AST_JB_ENABLED         (1 << 0)
-#define AST_JB_FORCED          (1 << 1)
-#define AST_JB_LOG             (1 << 2)
+enum {
+	AST_JB_ENABLED = (1 << 0),
+	AST_JB_FORCED =  (1 << 1),
+	AST_JB_LOG =     (1 << 2)
+};
 
 #define AST_JB_IMPL_NAME_SIZE 12
 

Modified: team/group/rtpjitterbuffer/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/include/asterisk/channel.h?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/include/asterisk/channel.h (original)
+++ team/group/rtpjitterbuffer/include/asterisk/channel.h Tue May 30 13:32:31 2006
@@ -86,9 +86,7 @@
 #ifndef _ASTERISK_CHANNEL_H
 #define _ASTERISK_CHANNEL_H
 
-#ifdef AST_JB
 #include "asterisk/abstract_jb.h"
-#endif /* AST_JB */
 
 #include <unistd.h>
 #ifdef POLLCOMPAT 
@@ -450,10 +448,8 @@
 	/*! For easy linking */
 	AST_LIST_ENTRY(ast_channel) chan_list;
 
-#ifdef AST_JB
 	/*! The jitterbuffer state  */
 	struct ast_jb jb;
-#endif /* AST_JB */
 };
 
 /* \defgroup chanprop Channel tech properties:
@@ -461,12 +457,10 @@
 /* @{ */
 #define AST_CHAN_TP_WANTSJITTER	(1 << 0)	
 
-#ifdef AST_JB
 /* \defgroup chanprop Channel tech properties:
 	\brief Channels have this property if they can create jitter; i.e. most VoIP channels */
 /* @{ */
 #define AST_CHAN_TP_CREATESJITTER (1 << 1)
-#endif /* AST_JB */
 
 /* This flag has been deprecated by the transfercapbilty data member in struct ast_channel */
 /* #define AST_FLAG_DIGITAL	(1 << 0) */	/* if the call is a digital ISDN call */

Modified: team/group/rtpjitterbuffer/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/include/asterisk/frame.h?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/include/asterisk/frame.h (original)
+++ team/group/rtpjitterbuffer/include/asterisk/frame.h Tue May 30 13:32:31 2006
@@ -109,7 +109,6 @@
 	struct ast_frame *prev;			
 	/*! Next/Prev for linking stand alone frames */
 	struct ast_frame *next;			
-#ifdef AST_JB
 	/*! Timing data flag */
 	int has_timing_info;
 	/*! Timestamp in milliseconds */
@@ -118,7 +117,6 @@
 	long len;
 	/*! Sequence number */
 	int seqno;
-#endif /* AST_JB */
 };
 
 /*!

Modified: team/group/rtpjitterbuffer/rtp.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/rtp.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/rtp.c (original)
+++ team/group/rtpjitterbuffer/rtp.c Tue May 30 13:32:31 2006
@@ -697,9 +697,7 @@
 	int mark;
 	int ext;
 	/* Remove the variable for the pointless loop */
-#ifndef AST_JB
 	int x;
-#endif /* AST_JB */
 	char iabuf[INET_ADDRSTRLEN];
 	unsigned int ssrc;
 	unsigned int timestamp;
@@ -838,20 +836,6 @@
 	if (!rtp->lastrxts)
 		rtp->lastrxts = timestamp;
 
-	/* Remove this pointless loop - it will generate unnecessary CPU load on a big jump in seqno. */
-#ifndef AST_JB
-	if (rtp->rxseqno) {
-		for (x=rtp->rxseqno + 1; x < seqno; x++) {
-			/* Queue empty frames */
-			rtp->f.mallocd = 0;
-			rtp->f.datalen = 0;
-			rtp->f.data = NULL;
-			rtp->f.offset = 0;
-			rtp->f.samples = 0;
-			rtp->f.src = "RTPMissedFrame";
-		}
-	}
-#endif /* AST_JB */
 	rtp->rxseqno = seqno;
 
 	if (rtp->dtmfcount) {
@@ -883,13 +867,11 @@
 		if (rtp->f.subclass == AST_FORMAT_SLINEAR) 
 			ast_frame_byteswap_be(&rtp->f);
 		calc_rxstamp(&rtp->f.delivery, rtp, timestamp, mark);
-#ifdef AST_JB
 		/* Add timing data to let ast_generic_bridge() put the frame into a jitterbuf */
 		rtp->f.has_timing_info = 1;
 		rtp->f.ts = timestamp / 8;
 		rtp->f.len = rtp->f.samples / 8;
 		rtp->f.seqno = seqno;
-#endif /* AST_JB */
 	} else {
 		/* Video -- samples is # of samples vs. 90000 */
 		if (!rtp->lastividtimestamp)

Modified: team/group/rtpjitterbuffer/translate.c
URL: http://svn.digium.com/view/asterisk/team/group/rtpjitterbuffer/translate.c?rev=30861&r1=30860&r2=30861&view=diff
==============================================================================
--- team/group/rtpjitterbuffer/translate.c (original)
+++ team/group/rtpjitterbuffer/translate.c Tue May 30 13:32:31 2006
@@ -155,13 +155,11 @@
 	int ret;
 	int samples = pvt->samples;	/* initial value */
 	
-#ifdef AST_JB
 	/* Copy the last in jb timing info to the pvt */
 	pvt->f.has_timing_info = f->has_timing_info;
 	pvt->f.ts = f->ts;
 	pvt->f.len = f->len;
 	pvt->f.seqno = f->seqno;
-#endif /* AST_JB */
 
 	if (f->samples == 0) {
 		ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
@@ -293,7 +291,6 @@
 	struct ast_trans_pvt *p = path;
 	struct ast_frame *out = f;
 	struct timeval delivery;
-#ifdef AST_JB
 	int has_timing_info;
 	long ts;
 	long len;
@@ -303,7 +300,6 @@
 	ts = f->ts;
 	len = f->len;
 	seqno = f->seqno;
-#endif /* AST_JB */
 
 	/* XXX hmmm... check this below */
 	if (!ast_tvzero(f->delivery)) {
@@ -350,14 +346,12 @@
 		path->nextout = ast_tvadd(path->nextout, ast_samp2tv( out->samples, 8000));
 	} else {
 		out->delivery = ast_tv(0, 0);
-#ifdef AST_JB
 		out->has_timing_info = has_timing_info;
-		if(has_timing_info) {
+		if (has_timing_info) {
 			out->ts = ts;
 			out->len = len;
 			out->seqno = seqno;
 		}
-#endif /* AST_JB */
 	}
 	/* Invalidate prediction if we're entering a silence period */
 	if (out->frametype == AST_FRAME_CNG)



More information about the asterisk-commits mailing list