Commit c5920062 authored by Mickaël Turnel's avatar Mickaël Turnel

Added parameters for the nack context object

parent 754241ed
......@@ -1883,6 +1883,8 @@ static void video_config_read(LinphoneCore *lc){
linphone_core_enable_self_view(lc, !!lp_config_get_int(lc->config,"video","self_view",1));
linphone_core_enable_video_source_reuse(lc, !!lp_config_get_int(lc->config,"video","reuse_source",0));
linphone_core_set_video_policy(lc,&vpol);
lc->video_conf.nack_context_enabled = !!lp_config_get_int(lc->config,"video","nack_context_enabled",0);
#endif
}
......@@ -3357,6 +3359,20 @@ void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val){
}
}
bool_t linphone_core_nack_context_enabled(LinphoneCore *lc) {
return lc->video_conf.nack_context_enabled;
}
void linphone_core_enable_nack_context(LinphoneCore *lc, bool_t val) {
if (lc->video_conf.nack_context_enabled != val) {
lc->video_conf.nack_context_enabled = val;
if (linphone_core_ready(lc)) {
lp_config_set_int(lc->config, "video", "nack_context_enabled", (int)val);
}
}
}
bool_t linphone_core_wifi_only_enabled(LinphoneCore *lc) {
return (bool_t)lp_config_get_int(lc->config, "net", "wifi_only", 0);
}
......
......@@ -353,6 +353,7 @@ struct video_config{
bool_t display;
bool_t selfview; /*during calls*/
bool_t reuse_preview_source;
bool_t nack_context_enabled;
};
struct text_config{
......
......@@ -1641,6 +1641,20 @@ LINPHONE_PUBLIC bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
**/
LINPHONE_PUBLIC void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);
/**
* Tells whether NACK context is enabled or not.
* @param[in] lc #LinphoneCore object
* @return A boolean value telling whether NACK context is enabled or not
**/
LINPHONE_PUBLIC bool_t linphone_core_nack_context_enabled(LinphoneCore *lc);
/**
* Turns NACK context on or off.
* @param[in] lc #LinphoneCore object
* @param[in] val A boolean value telling whether to enable NACK context
**/
LINPHONE_PUBLIC void linphone_core_enable_nack_context(LinphoneCore *lc, bool_t val);
/**
* Tells whether Wifi only mode is enabled or not
* @param[in] lc #LinphoneCore object
......
......@@ -1651,6 +1651,7 @@ void MediaSessionPrivate::setupRtcpFb (SalMediaDescription *md) {
if (!sal_stream_description_active(&md->streams[i]))
continue;
md->streams[i].rtcp_fb.generic_nack_enabled = !!lp_config_get_int(linphone_core_get_config(q->getCore()->getCCore()), "rtp", "rtcp_fb_generic_nack_enabled", 0);
md->streams[i].rtcp_fb.immediate_nack_enabled = !!lp_config_get_int(linphone_core_get_config(q->getCore()->getCCore()), "rtp", "rtcp_fb_immediate_nack_enabled", 0);
md->streams[i].rtcp_fb.tmmbr_enabled = !!lp_config_get_int(linphone_core_get_config(q->getCore()->getCCore()), "rtp", "rtcp_fb_tmmbr_enabled", 1);
md->streams[i].implicit_rtcp_fb = getParams()->getPrivate()->implicitRtcpFbEnabled();
for (const bctbx_list_t *it = md->streams[i].payloads; it != nullptr; it = bctbx_list_next(it)) {
......@@ -2218,6 +2219,10 @@ void MediaSessionPrivate::configureRtpSessionForRtcpFb (const SalStreamDescripti
rtp_session_enable_avpf_feature(session, ORTP_AVPF_FEATURE_GENERIC_NACK, true);
else
rtp_session_enable_avpf_feature(session, ORTP_AVPF_FEATURE_GENERIC_NACK, false);
if (stream->rtcp_fb.immediate_nack_enabled)
rtp_session_enable_avpf_feature(session, ORTP_AVPF_FEATURE_IMMEDIATE_NACK, true);
else
rtp_session_enable_avpf_feature(session, ORTP_AVPF_FEATURE_IMMEDIATE_NACK, false);
if (stream->rtcp_fb.tmmbr_enabled)
rtp_session_enable_avpf_feature(session, ORTP_AVPF_FEATURE_TMMBR, true);
else
......@@ -3194,6 +3199,10 @@ void MediaSessionPrivate::startVideoStream (CallSession::State targetState) {
}
}
}
if (linphone_core_nack_context_enabled(q->getCore()->getCCore())) {
video_stream_enable_nack_context(videoStream);
}
}
}
} else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment