Commit 0de51010 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed previous cherry-pick

parent 9dbf7e36
......@@ -198,6 +198,8 @@ LINPHONE_PUBLIC float linphone_call_stats_get_round_trip_delay (const LinphoneCa
*/
LINPHONE_PUBLIC float linphone_call_stats_get_estimated_download_bandwidth(const LinphoneCallStats *stats);
void linphone_call_stats_set_estimated_download_bandwidth(LinphoneCallStats *stats, float estimated_value);
/**
* @}
*/
......
......@@ -359,3 +359,7 @@ float linphone_call_stats_get_round_trip_delay (const LinphoneCallStats *stats)
float linphone_call_stats_get_estimated_download_bandwidth(const LinphoneCallStats *stats) {
return stats->estimated_download_bandwidth;
}
void linphone_call_stats_set_estimated_download_bandwidth(LinphoneCallStats *stats, float estimated_value) {
stats->estimated_download_bandwidth = estimated_value;
}
......@@ -2298,8 +2298,8 @@ void MediaSessionPrivate::handleStreamEvents (int streamIndex) {
} else if (evt == ORTP_EVENT_NEW_VIDEO_BANDWIDTH_ESTIMATION_AVAILABLE) {
lInfo() << "Video bandwidth estimation is " << (int)(evd->info.video_bandwidth_available / 1000.) << " kbit/s";
/* If this event happens then it should be a video stream */
if (stream_index == call->main_video_stream_index)
stats->estimated_download_bandwidth = (float)(evd->info.video_bandwidth_available)*1e-3;
if (streamIndex == mainVideoStreamIndex)
linphone_call_stats_set_estimated_download_bandwidth(stats, (float)(evd->info.video_bandwidth_available*1e-3));
}
ortp_event_destroy(ev);
}
......
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