Quality reporting: compute average values for instaneous parameters and added...

Quality reporting: compute average values for instaneous parameters and added custom extension for qos analyzer to get its input/output on each RTCP packet received
parent e10667c4
......@@ -871,7 +871,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
if (cstate==LinphoneCallEnd){
if (call->log->status == LinphoneCallSuccess)
linphone_reporting_publish(call);
linphone_reporting_publish_on_call_term(call);
}
if (cstate==LinphoneCallReleased){
......@@ -1778,7 +1778,7 @@ static int get_ideal_audio_bw(LinphoneCall *call, const SalMediaDescription *md,
const LinphoneCallParams *params=&call->params;
bool_t will_use_video=linphone_core_media_description_contains_video_stream(md);
bool_t forced=FALSE;
if (desc->bandwidth>0) remote_bw=desc->bandwidth;
else if (md->bandwidth>0) {
/*case where b=AS is given globally, not per stream*/
......@@ -1790,7 +1790,7 @@ static int get_ideal_audio_bw(LinphoneCall *call, const SalMediaDescription *md,
}else upload_bw=total_upload_bw;
upload_bw=get_min_bandwidth(upload_bw,remote_bw);
if (!will_use_video || forced) return upload_bw;
if (bandwidth_is_greater(upload_bw,512)){
upload_bw=100;
}else if (bandwidth_is_greater(upload_bw,256)){
......@@ -1823,13 +1823,13 @@ static RtpProfile *make_profile(LinphoneCall *call, const SalMediaDescription *m
LinphoneCore *lc=call->core;
int up_ptime=0;
const LinphoneCallParams *params=&call->params;
*used_pt=-1;
if (desc->type==SalAudio)
bw=get_ideal_audio_bw(call,md,desc);
else if (desc->type==SalVideo)
bw=get_video_bw(call,md,desc);
for(elem=desc->payloads;elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
int number;
......@@ -2293,7 +2293,7 @@ static void linphone_call_log_fill_stats(LinphoneCallLog *log, MediaStream *st){
void linphone_call_stop_audio_stream(LinphoneCall *call) {
if (call->audiostream!=NULL) {
linphone_reporting_update(call, LINPHONE_CALL_STATS_AUDIO);
linphone_reporting_update_media_info(call, LINPHONE_CALL_STATS_AUDIO);
media_stream_reclaim_sessions(&call->audiostream->ms,&call->sessions[0]);
rtp_session_unregister_event_queue(call->audiostream->ms.sessions.rtp_session,call->audiostream_app_evq);
ortp_ev_queue_flush(call->audiostream_app_evq);
......@@ -2322,7 +2322,7 @@ void linphone_call_stop_audio_stream(LinphoneCall *call) {
void linphone_call_stop_video_stream(LinphoneCall *call) {
#ifdef VIDEO_ENABLED
if (call->videostream!=NULL){
linphone_reporting_update(call, LINPHONE_CALL_STATS_VIDEO);
linphone_reporting_update_media_info(call, LINPHONE_CALL_STATS_VIDEO);
media_stream_reclaim_sessions(&call->videostream->ms,&call->sessions[1]);
rtp_session_unregister_event_queue(call->videostream->ms.sessions.rtp_session,call->videostream_app_evq);
ortp_ev_queue_flush(call->videostream_app_evq);
......@@ -2712,7 +2712,7 @@ static void linphone_core_disconnected(LinphoneCore *lc, LinphoneCall *call){
from = linphone_call_get_remote_address_as_string(call);
snprintf(temp,sizeof(temp)-1,"Remote end %s seems to have disconnected, the call is going to be closed.",from ? from : "");
if (from) ms_free(from);
ms_message("On call [%p]: %s",call,temp);
if (lc->vtable.display_warning!=NULL)
lc->vtable.display_warning(lc,temp);
......@@ -2836,7 +2836,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_call_stats_updated(call, stream_index);
linphone_reporting_on_rtcp_received(call, stream_index);
if (lc->vtable.call_stats_updated)
lc->vtable.call_stats_updated(lc, call, stats);
stats->updated = 0;
......
This diff is collapsed.
......@@ -28,7 +28,7 @@ extern "C"{
/**
* Linphone quality report sub object storing address related information (ip / port / MAC).
* Linphone quality report sub object storing address related information (IP/port/MAC).
*/
typedef struct reporting_addr {
char * ip;
......@@ -60,15 +60,15 @@ typedef struct reporting_content_metrics {
// jitter buffet - optional
struct {
int adaptive; // constant
int nominal; // no may vary during the call <- average? worst score?
int max; // no may vary during the call <- average?
int nominal; // average
int max; // average
int abs_max; // constant
} jitter_buffer;
// packet loss - optional
struct {
float network_packet_loss_rate;
float jitter_buffer_discard_rate;
float network_packet_loss_rate; // average
float jitter_buffer_discard_rate; // average
} packet_loss;
// delay - optional
......@@ -93,6 +93,16 @@ typedef struct reporting_content_metrics {
float moslq; // no - vary or avg - voip metrics - in [0..4.9]
float moscq; // no - vary or avg - voip metrics - in [0..4.9]
} quality_estimates;
// adaptive algorithm - custom extension
struct {
char* input;
char* output;
} adaptive_algorithm;
// for internal processing
uint8_t rtcp_xr_count; // number of RTCP XR packets received since last report, used to compute average of instantaneous parameters as stated in the RFC 6035 (4.5)
} reporting_content_metrics_t;
......@@ -131,7 +141,7 @@ void linphone_reporting_destroy(reporting_session_report_t * report);
* @param stats_type the media type (LINPHONE_CALL_STATS_AUDIO or LINPHONE_CALL_STATS_VIDEO)
*
*/
void linphone_reporting_update(LinphoneCall * call, int stats_type);
void linphone_reporting_update_media_info(LinphoneCall * call, int stats_type);
/**
* Fill IP information about a given call. This function must be called each
......@@ -148,7 +158,7 @@ void linphone_reporting_update_ip(LinphoneCall * call);
* @param call #LinphoneCall object to consider
*
*/
void linphone_reporting_publish(LinphoneCall* call);
void linphone_reporting_publish_on_call_term(LinphoneCall* call);
/**
* Update publish report data with fresh RTCP stats, if needed.
......@@ -156,7 +166,7 @@ void linphone_reporting_publish(LinphoneCall* call);
* @param stats_type the media type (LINPHONE_CALL_STATS_AUDIO or LINPHONE_CALL_STATS_VIDEO)
*
*/
void linphone_reporting_call_stats_updated(LinphoneCall *call, int stats_type);
void linphone_reporting_on_rtcp_received(LinphoneCall *call, int stats_type);
#ifdef __cplusplus
}
......
mediastreamer2 @ 8ea457fa
Subproject commit 9c3d936356fe4d4c8a1fa8ca57a47598ece44f81
Subproject commit 8ea457fa65e32c3c943e0bedea6fbdbdc18f7156
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