Fixed previous cherry-pick

This commit is contained in:
Sylvain Berfini 2018-01-09 16:30:48 +01:00
parent 9dbf7e36de
commit 0de510100c
3 changed files with 8 additions and 2 deletions

View file

@ -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);
/**
* @}
*/

View file

@ -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;
}

View file

@ -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);
}