]> sjero.net Git - linphone/commitdiff
Add configuration of adaptive jitter compensation enabling.
authorGhislain MARY <ghislain.mary@belledonne-communications.com>
Mon, 27 Aug 2012 10:51:41 +0000 (12:51 +0200)
committerGhislain MARY <ghislain.mary@belledonne-communications.com>
Mon, 27 Aug 2012 10:53:10 +0000 (12:53 +0200)
coreapi/linphonecall.c
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/private.h

index 4ffb699b2648db4f100a1f2cf8e3d7bce38e1887..f1823165fb04fdf1de28767dfe32a859c5a04f38 100644 (file)
@@ -1203,7 +1203,6 @@ static int find_crypto_index_from_tag(const SalSrtpCryptoAlgo crypto[],unsigned
 }
 static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cname, bool_t muted, bool_t send_ringbacktone, bool_t use_arc){
        LinphoneCore *lc=call->core;
-       int jitt_comp=lc->rtp_conf.audio_jitt_comp;
        int used_pt=-1;
        /* look for savp stream first */
        const SalStreamDescription *stream=sal_media_description_find_stream(call->resultdesc,
@@ -1263,6 +1262,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
                        if (playcard &&  stream->max_rate>0) ms_snd_card_set_preferred_sample_rate(playcard, stream->max_rate);
                        if (captcard &&  stream->max_rate>0) ms_snd_card_set_preferred_sample_rate(captcard, stream->max_rate);
                        audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc);
+                       audio_stream_enable_adaptive_jittcomp(call->audiostream, linphone_core_audio_adaptive_jittcomp_enabled(lc));
                        audio_stream_start_full(
                                call->audiostream,
                                call->audio_profile,
@@ -1271,7 +1271,7 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
                                stream->rtcp_addr[0]!='\0' ? stream->rtcp_addr : call->resultdesc->addr,
                                linphone_core_rtcp_enabled(lc) ? (stream->rtcp_port) : 0,
                                used_pt,
-                               jitt_comp,
+                               linphone_core_get_audio_jittcomp(lc),
                                playfile,
                                recfile,
                                playcard,
@@ -1351,6 +1351,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
 
                        video_stream_enable_adaptive_bitrate_control(call->videostream,
                                                                  linphone_core_adaptive_rate_control_enabled(lc));
+                       video_stream_enable_adaptive_jittcomp(call->videostream, linphone_core_video_adaptive_jittcomp_enabled(lc));
                        video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
                        video_stream_enable_self_view(call->videostream,lc->video_conf.selfview);
                        if (lc->video_window_id!=0)
@@ -1387,7 +1388,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
                                video_stream_start(call->videostream,
                                        call->video_profile, rtp_addr, vstream->rtp_port,
                                        rtcp_addr, linphone_core_rtcp_enabled(lc) ? (vstream->rtcp_port) : 0,
-                                       used_pt, lc->rtp_conf.audio_jitt_comp, cam);
+                                       used_pt, linphone_core_get_video_jittcomp(lc), cam);
                                video_stream_set_rtcp_information(call->videostream, cname,LINPHONE_RTCP_SDES_TOOL);
                        }
                        
index 46c8b11c08d49aae8997751c9e6884c19a01b6f8..3d05816ca4a9b4d85026325bd8f3d7f7d077657a 100644 (file)
@@ -623,6 +623,7 @@ static void rtp_config_read(LinphoneCore *lc)
        int jitt_comp;
        int nortp_timeout;
        bool_t rtp_no_xmit_on_audio_mute;
+       bool_t adaptive_jitt_comp_enabled;
 
        port=lp_config_get_int(lc->config,"rtp","audio_rtp_port",7078);
        linphone_core_set_audio_port(lc,port);
@@ -635,11 +636,15 @@ static void rtp_config_read(LinphoneCore *lc)
        linphone_core_set_audio_jittcomp(lc,jitt_comp);
        jitt_comp=lp_config_get_int(lc->config,"rtp","video_jitt_comp",60);
        if (jitt_comp==0) jitt_comp=60;
-       lc->rtp_conf.video_jitt_comp=jitt_comp;
+       linphone_core_set_video_jittcomp(lc,jitt_comp);
        nortp_timeout=lp_config_get_int(lc->config,"rtp","nortp_timeout",30);
        linphone_core_set_nortp_timeout(lc,nortp_timeout);
        rtp_no_xmit_on_audio_mute=lp_config_get_int(lc->config,"rtp","rtp_no_xmit_on_audio_mute",FALSE);
        linphone_core_set_rtp_no_xmit_on_audio_mute(lc,rtp_no_xmit_on_audio_mute);
+       adaptive_jitt_comp_enabled = lp_config_get_int(lc->config, "rtp", "audio_adaptive_jitt_comp_enabled", TRUE);
+       linphone_core_enable_audio_adaptive_jittcomp(lc, adaptive_jitt_comp_enabled);
+       adaptive_jitt_comp_enabled = lp_config_get_int(lc->config, "rtp", "video_adaptive_jitt_comp_enabled", TRUE);
+       linphone_core_enable_video_adaptive_jittcomp(lc, adaptive_jitt_comp_enabled);
 }
 
 static PayloadType * find_payload(RtpProfile *prof, const char *mime_type, int clock_rate, const char *recv_fmtp){
@@ -1376,8 +1381,18 @@ const MSList * linphone_core_get_friend_list(const LinphoneCore *lc)
        return lc->friends;
 }
 
+void linphone_core_enable_audio_adaptive_jittcomp(LinphoneCore* lc, bool_t val)
+{
+       lc->rtp_conf.audio_adaptive_jitt_comp_enabled = val;
+}
+
+bool_t linphone_core_audio_adaptive_jittcomp_enabled(LinphoneCore* lc)
+{
+       return lc->rtp_conf.audio_adaptive_jitt_comp_enabled;
+}
+
 /**
- * Returns the nominal jitter buffer size in milliseconds.
+ * Returns the nominal audio jitter buffer size in milliseconds.
  *
  * @ingroup media_parameters
 **/
@@ -1386,6 +1401,26 @@ int linphone_core_get_audio_jittcomp(LinphoneCore *lc)
        return lc->rtp_conf.audio_jitt_comp;
 }
 
+void linphone_core_enable_video_adaptive_jittcomp(LinphoneCore* lc, bool_t val)
+{
+       lc->rtp_conf.video_adaptive_jitt_comp_enabled = val;
+}
+
+bool_t linphone_core_video_adaptive_jittcomp_enabled(LinphoneCore* lc)
+{
+       return lc->rtp_conf.video_adaptive_jitt_comp_enabled;
+}
+
+/**
+ * Returns the nominal video jitter buffer size in milliseconds.
+ *
+ * @ingroup media_parameters
+**/
+int linphone_core_get_video_jittcomp(LinphoneCore *lc)
+{
+       return lc->rtp_conf.video_jitt_comp;
+}
+
 /**
  * Returns the UDP port used for audio streaming.
  *
@@ -1433,6 +1468,16 @@ void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value)
        lc->rtp_conf.audio_jitt_comp=value;
 }
 
+/**
+ * Sets the nominal video jitter buffer size in milliseconds.
+ *
+ * @ingroup media_parameters
+**/
+void linphone_core_set_video_jittcomp(LinphoneCore *lc, int value)
+{
+       lc->rtp_conf.video_jitt_comp=value;
+}
+
 void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc,bool_t rtp_no_xmit_on_audio_mute){
        lc->rtp_conf.rtp_no_xmit_on_audio_mute=rtp_no_xmit_on_audio_mute;
 }
@@ -4474,6 +4519,8 @@ void rtp_config_uninit(LinphoneCore *lc)
        lp_config_set_int(lc->config,"rtp","audio_jitt_comp",config->audio_jitt_comp);
        lp_config_set_int(lc->config,"rtp","video_jitt_comp",config->video_jitt_comp);
        lp_config_set_int(lc->config,"rtp","nortp_timeout",config->nortp_timeout);
+       lp_config_set_int(lc->config,"rtp","audio_jitt_comp_enabled",config->audio_adaptive_jitt_comp_enabled);
+       lp_config_set_int(lc->config,"rtp","video_jitt_comp_enabled",config->video_adaptive_jitt_comp_enabled);
 }
 
 void sound_config_uninit(LinphoneCore *lc)
index 984b09d56a907e5a0a5d95da0763758b9e39f572..98bb03d46f2bb714fcf9baad218f5b771a57ee83 100644 (file)
@@ -903,10 +903,22 @@ void linphone_core_abort_authentication(LinphoneCore *lc,  LinphoneAuthInfo *inf
 
 void linphone_core_clear_all_auth_info(LinphoneCore *lc);
 
+void linphone_core_enable_audio_adaptive_jittcomp(LinphoneCore *lc, bool_t enable);
+
+bool_t linphone_core_audio_adaptive_jittcomp_enabled(LinphoneCore *lc);
+
 int linphone_core_get_audio_jittcomp(LinphoneCore *lc);
 
 void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value);
 
+void linphone_core_enable_video_adaptive_jittcomp(LinphoneCore *lc, bool_t enable);
+
+bool_t linphone_core_video_adaptive_jittcomp_enabled(LinphoneCore *lc);
+
+int linphone_core_get_video_jittcomp(LinphoneCore *lc);
+
+void linphone_core_set_video_jittcomp(LinphoneCore *lc, int value);
+
 int linphone_core_get_audio_port(const LinphoneCore *lc);
 
 int linphone_core_get_video_port(const LinphoneCore *lc);
index b102dc7b53f10ae13bda1cec5b995f079d5b9a0f..d1c15e41cddd9214a1b4c46efdfd0c8c0acd154e 100644 (file)
@@ -369,6 +369,8 @@ typedef struct rtp_config
        int nortp_timeout;
        bool_t rtp_no_xmit_on_audio_mute;
                               /* stop rtp xmit when audio muted */
+       bool_t audio_adaptive_jitt_comp_enabled;
+       bool_t video_adaptive_jitt_comp_enabled;
 }rtp_config_t;