Commit 91f63591 authored by Sandrine Avakian's avatar Sandrine Avakian
Browse files

Added boolean parameter implicit_rtcp_fb in LinphoneCallParams and...

Added boolean parameter implicit_rtcp_fb in LinphoneCallParams and SalStreamDescription  to enable or disable the forcing of AVPF messages feature in AVP.
By default, the feature is enabled and RTCP feedback messages PLI, SLI, RPSI and FIR are supported.
parent 2295b9e5
......@@ -335,7 +335,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
}
}
if ((rtp_port != 0) && sal_stream_description_has_avpf(stream)) {
if ((rtp_port != 0) && (sal_stream_description_has_avpf(stream) || sal_stream_description_has_implicit_avpf(stream))) {
add_rtcp_fb_attributes(media_desc, md, stream);
}
......
......@@ -528,14 +528,18 @@ static void setup_rtcp_fb(LinphoneCall *call, SalMediaDescription *md) {
md->streams[i].rtcp_fb.tmmbr_enabled = lp_config_get_int(lc->config, "rtp", "rtcp_fb_tmmbr_enabled", 0);
for (pt_it = md->streams[i].payloads; pt_it != NULL; pt_it = pt_it->next) {
pt = (PayloadType *)pt_it->data;
if (call->params->avpf_enabled == TRUE) {
payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
avpf_params = payload_type_get_avpf_params(pt);
avpf_params.trr_interval = call->params->avpf_rr_interval;
} else {
payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
memset(&avpf_params, 0, sizeof(avpf_params));
}
if (call->params->avpf_enabled == FALSE && call->params->implicit_rtcp_fb == FALSE) {
payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
memset(&avpf_params, 0, sizeof(avpf_params));
}
else {
payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED);
avpf_params = payload_type_get_avpf_params(pt);
avpf_params.trr_interval = call->params->avpf_rr_interval;
}
payload_type_set_avpf_params(pt, avpf_params);
}
}
......@@ -820,6 +824,8 @@ void linphone_call_make_local_media_description(LinphoneCall *call) {
}
setup_encryption_keys(call,md);
setup_dtls_keys(call,md);
if (params->implicit_rtcp_fb) md->streams[call->main_video_stream_index].implicit_rtcp_fb = TRUE;
setup_rtcp_fb(call, md);
setup_rtcp_xr(call, md);
......
......@@ -7023,6 +7023,7 @@ void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *para
params->realtimetext_enabled = linphone_core_realtime_text_enabled(lc);
params->privacy=LinphonePrivacyDefault;
params->avpf_enabled=linphone_core_get_avpf_mode(lc);
params->implicit_rtcp_fb = lp_config_get_int(lc->config,"rtp","rtcp_fb_implicit_rtcp_fb",TRUE);
params->audio_dir=LinphoneMediaDirectionSendRecv;
params->video_dir=LinphoneMediaDirectionSendRecv;
params->real_early_media=lp_config_get_int(lc->config,"misc","real_early_media",FALSE);
......
......@@ -138,6 +138,7 @@ struct _LinphoneCallParams{
bool_t has_audio;
bool_t has_video;
bool_t avpf_enabled; /* RTCP feedback messages are enabled */
bool_t implicit_rtcp_fb;
bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/
bool_t in_conference; /*in conference mode */
......
......@@ -219,6 +219,12 @@ bool_t sal_stream_description_has_avpf(const SalStreamDescription *sd) {
return FALSE;
}
bool_t sal_stream_description_has_implicit_avpf(const SalStreamDescription *sd){
if (sd->implicit_rtcp_fb){
return TRUE;
}
return FALSE;
}
/*these are switch case, so that when a new proto is added we can't forget to modify this function*/
bool_t sal_stream_description_has_srtp(const SalStreamDescription *sd) {
switch (sd->proto){
......
......@@ -236,7 +236,8 @@ typedef struct SalStreamDescription{
SalSrtpCryptoAlgo crypto[SAL_CRYPTO_ALGO_MAX];
unsigned int crypto_local_tag;
int max_rate;
OrtpRtcpFbConfiguration rtcp_fb;
bool_t implicit_rtcp_fb;
OrtpRtcpFbConfiguration rtcp_fb;
OrtpRtcpXrConfiguration rtcp_xr;
SalCustomSdpAttribute *custom_sdp_attributes;
SalIceCandidate ice_candidates[SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES];
......@@ -309,6 +310,7 @@ SalStreamDescription * sal_media_description_find_best_stream(SalMediaDescriptio
void sal_media_description_set_dir(SalMediaDescription *md, SalStreamDir stream_dir);
bool_t sal_stream_description_active(const SalStreamDescription *sd);
bool_t sal_stream_description_has_avpf(const SalStreamDescription *sd);
bool_t sal_stream_description_has_implicit_avpf(const SalStreamDescription *sd);
bool_t sal_stream_description_has_srtp(const SalStreamDescription *sd);
bool_t sal_stream_description_has_dtls(const SalStreamDescription *sd);
bool_t sal_media_description_has_avpf(const SalMediaDescription *md);
......
......@@ -2041,7 +2041,6 @@ void video_call_base_3(LinphoneCoreManager* pauline,LinphoneCoreManager* marie,
LinphoneCall* pauline_call;
LinphoneVideoPolicy marie_policy, pauline_policy;
if (using_policy) {
marie_policy.automatically_initiate=FALSE;
marie_policy.automatically_accept=TRUE;
......@@ -2070,7 +2069,7 @@ void video_call_base_3(LinphoneCoreManager* pauline,LinphoneCoreManager* marie,
/* Create call params */
caller_test_params.base=linphone_core_create_call_params(pauline->lc, NULL);
if (!using_policy)
linphone_call_params_enable_video(caller_test_params.base,TRUE);
......@@ -2140,6 +2139,20 @@ static void video_call(void) {
linphone_core_manager_destroy(pauline);
}
static void video_call_disable_implicit_AVPF_on_rcv(void) {
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
LpConfig *pauline_lp;
pauline_lp = linphone_core_get_config(pauline->lc);
lp_config_set_int(pauline_lp,"rtp","rtcp_fb_implicit_rtcp_fb",0);
video_call_base_3(marie,pauline,FALSE,LinphoneMediaEncryptionNone,TRUE,TRUE);
end_call(pauline, marie);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
static void video_call_base_avpf(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy,LinphoneMediaEncryption mode, bool_t callee_video_enabled, bool_t caller_video_enabled) {
linphone_core_set_avpf_mode(pauline->lc,LinphoneAVPFEnabled);
linphone_core_set_avpf_mode(marie->lc,LinphoneAVPFEnabled);
......@@ -5699,6 +5712,7 @@ test_t call_tests[] = {
{ "Audio call with ICE no matching audio codecs", audio_call_with_ice_no_matching_audio_codecs },
#ifdef VIDEO_ENABLED
{ "Simple video call AVPF",video_call_avpf},
{ "Simple video call disable implicit",video_call_disable_implicit_AVPF_on_rcv},
{ "Simple video call",video_call},
{ "Simple ZRTP video call",video_call_zrtp},
{ "Simple DTLS video call",video_call_dtls},
......
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