Quality reporting: avoid crash in rtcp processing function in case the config...

Quality reporting: avoid crash in rtcp processing function in case the config proxy is not available
parent 888f870a
......@@ -2884,7 +2884,7 @@ void linphone_call_notify_stats_updated(LinphoneCall *call, int stream_index){
LinphoneCallStats *stats=&call->stats[stream_index];
LinphoneCore *lc=call->core;
if (stats->updated){
linphone_reporting_on_rtcp_received(call, stream_index);
linphone_reporting_on_rtcp_update(call, stream_index);
if (lc->vtable.call_stats_updated)
lc->vtable.call_stats_updated(lc, call, stats);
stats->updated = 0;
......
......@@ -512,17 +512,18 @@ static float reporting_rand(float t){
return t * (.2f * (rand() / (RAND_MAX * 1.0f)) + 0.9f);
}
void linphone_reporting_on_rtcp_received(LinphoneCall *call, int stats_type) {
void linphone_reporting_on_rtcp_update(LinphoneCall *call, int stats_type) {
reporting_session_report_t * report = call->log->reporting.reports[stats_type];
reporting_content_metrics_t * metrics = NULL;
LinphoneCallStats stats = call->stats[stats_type];
mblk_t *block = NULL;
int report_interval = linphone_proxy_config_get_quality_reporting_interval(call->dest_proxy);
int report_interval;
if (! media_report_enabled(call,stats_type))
return;
report_interval = linphone_proxy_config_get_quality_reporting_interval(call->dest_proxy);
if (stats.updated == LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE) {
metrics = &report->remote_metrics;
block = stats.received_rtcp;
......@@ -599,10 +600,10 @@ int linphone_reporting_publish_interval_report(LinphoneCall* call) {
void linphone_reporting_call_state_updated(LinphoneCall *call){
LinphoneCallState state=linphone_call_get_state(call);
bool_t enabled=media_report_enabled(call, LINPHONE_CALL_STATS_VIDEO);
switch (state){
case LinphoneCallStreamsRunning:{
bool_t video_enabled=media_report_enabled(call, LINPHONE_CALL_STATS_VIDEO);
int i;
MediaStream *streams[2] = {(MediaStream*) call->audiostream, (MediaStream *) call->videostream};
MSQosAnalyzer *analyzer;
......@@ -621,10 +622,10 @@ void linphone_reporting_call_state_updated(LinphoneCall *call){
}
}
linphone_reporting_update_ip(call);
if (!enabled && call->log->reporting.was_video_running){
if (!video_enabled && call->log->reporting.was_video_running){
send_report(call, call->log->reporting.reports[LINPHONE_CALL_STATS_VIDEO], "VQSessionReport");
}
call->log->reporting.was_video_running=enabled;
call->log->reporting.was_video_running=video_enabled;
break;
}
case LinphoneCallEnd:{
......@@ -657,11 +658,9 @@ reporting_session_report_t * linphone_reporting_new() {
metrics[i]->session_description.packet_loss_concealment = -1;
metrics[i]->jitter_buffer.adaptive = -1;
/*metrics[i]->jitter_buffer.rate = -1;*/
metrics[i]->jitter_buffer.abs_max = -1;
metrics[i]->delay.end_system_delay = -1;
/*metrics[i]->delay.one_way_delay = -1;*/
metrics[i]->delay.interarrival_jitter = -1;
metrics[i]->delay.mean_abs_jitter = -1;
......
......@@ -179,12 +179,12 @@ int linphone_reporting_publish_session_report(LinphoneCall* call, bool_t call_te
int linphone_reporting_publish_interval_report(LinphoneCall* call);
/**
* Update publish reports with newly received RTCP-XR packets (if available).
* Update publish reports with newly sent/received RTCP-XR packets (if available).
* @param call #LinphoneCall object to consider
* @param stats_type the media type (LINPHONE_CALL_STATS_AUDIO or LINPHONE_CALL_STATS_VIDEO)
*
*/
void linphone_reporting_on_rtcp_received(LinphoneCall *call, int stats_type);
void linphone_reporting_on_rtcp_update(LinphoneCall *call, int stats_type);
/**
* Update publish reports on call state change.
......
mediastreamer2 @ 7a627f30
Subproject commit b1baa287e0dc18881ebd81fb9938ff89d20fb6a1
Subproject commit 7a627f30b0462574290e03e99983327e6ea987dc
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