From: <jpg...@us...> - 2007-12-17 16:14:06
|
Revision: 1310 http://iaxclient.svn.sourceforge.net/iaxclient/?rev=1310&view=rev Author: jpgrayson Date: 2007-12-17 08:14:11 -0800 (Mon, 17 Dec 2007) Log Message: ----------- Patch from Lee Howard. http://sourceforge.net/tracker/index.php?func=detail&aid=1850454&group_id=72851&atid=535896 Add libiax api function to enable/disable the jitterbuffer. Modified Paths: -------------- trunk/lib/libiax2/src/iax.c Modified: trunk/lib/libiax2/src/iax.c =================================================================== --- trunk/lib/libiax2/src/iax.c 2007-12-17 16:10:00 UTC (rev 1309) +++ trunk/lib/libiax2/src/iax.c 2007-12-17 16:14:11 UTC (rev 1310) @@ -128,6 +128,9 @@ /* Video frames bypass jitterbuffer */ static int video_bypass_jitterbuffer = 0; +/* To use or not to use the jitterbuffer */ +static int iax_use_jitterbuffer = 1; + /* UDP Socket (file descriptor) */ static int netfd = -1; @@ -249,6 +252,16 @@ debug = 0; } +void iax_enable_jitterbuffer(void) +{ + iax_use_jitterbuffer = 1; +} + +void iax_disable_jitterbuffer(void) +{ + iax_use_jitterbuffer = 0; +} + void iax_set_private(struct iax_session *s, void *ptr) { s->pvt = ptr; @@ -2342,7 +2355,9 @@ /* insert into jitterbuffer */ /* TODO: Perhaps we could act immediately if it's not droppable and late */ - if ( e->etype == IAX_EVENT_VIDEO && video_bypass_jitterbuffer ) + if ( !iax_use_jitterbuffer || + (e->etype == IAX_EVENT_VIDEO && + video_bypass_jitterbuffer) ) { iax_sched_add(e, NULL, NULL, NULL, 0); return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |