From 6b88923d4c44042b5aa87402c52f23ece18730c4 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 11 Aug 2014 22:17:13 +0200 Subject: [PATCH] update ms2 for bugfixes, implement jitter buffer disablement --- coreapi/linphonecore.c | 29 +++++++++++++++++++++++++++++ mediastreamer2 | 2 +- oRTP | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 4a5a11554..6818b1415 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1763,24 +1763,53 @@ bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc){ return lc->rtp_conf.rtp_no_xmit_on_audio_mute; } +static void apply_jitter_value(LinphoneCore *lc, int value, MSFormatType stype){ + LinphoneCall *call; + MSList *it; + for (it=lc->calls;it!=NULL;it=it->next){ + MediaStream *ms; + call=(LinphoneCall*)it->data; + ms = stype==MSAudio ? (MediaStream*)call->audiostream : (MediaStream*)call->videostream; + if (ms){ + RtpSession *s=ms->sessions.rtp_session; + if (s){ + if (value>0){ + ms_message("Jitter buffer size set to [%i] ms on call [%p]",value,call); + rtp_session_set_jitter_compensation(s,value); + rtp_session_enable_jitter_buffer(s,TRUE); + }else if (value==0){ + ms_warning("Jitter buffer is disabled per application request on call [%p]",call); + rtp_session_enable_jitter_buffer(s,FALSE); + } + } + } + } +} + /** * Sets the nominal audio jitter buffer size in milliseconds. + * The value takes effect immediately for all running and pending calls, if any. + * A value of 0 disables the jitter buffer. * * @ingroup media_parameters **/ void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value) { lc->rtp_conf.audio_jitt_comp=value; + apply_jitter_value(lc, value, MSAudio); } /** * Sets the nominal video jitter buffer size in milliseconds. + * The value takes effect immediately for all running and pending calls, if any. + * A value of 0 disables the jitter buffer. * * @ingroup media_parameters **/ void linphone_core_set_video_jittcomp(LinphoneCore *lc, int value) { lc->rtp_conf.video_jitt_comp=value; + apply_jitter_value(lc, value, MSVideo); } void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc,bool_t rtp_no_xmit_on_audio_mute){ diff --git a/mediastreamer2 b/mediastreamer2 index 3b9fe1b8c..c82cc74f7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3b9fe1b8c405f1a148ec7b58f7d540c8946a9a05 +Subproject commit c82cc74f7341378ea3d21257448c427e4e7b91a1 diff --git a/oRTP b/oRTP index fc8d8457e..9d158c2da 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit fc8d8457eb630907eff50333ddf5243b448fe733 +Subproject commit 9d158c2daf289bd826b855903e913786f90d5bad