From 55f168413573741a2e458d8cc1ed1d25a7a2e5b5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 23 May 2018 12:04:41 +0200 Subject: [PATCH] Robustize tmmbr tests --- tester/call_video_tester.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index 7489a0d8d..c0d64e100 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -2171,13 +2171,23 @@ static void video_call_expected_fps_for_specified_bandwidth(int bandwidth, int f if (BC_ASSERT_TRUE(call(marie, pauline))){ LinphoneCall *call = linphone_core_get_current_call(marie->lc); - - /*wait for the first TMMBR*/ - BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &marie->stat.last_tmmbr_value_received, 1, 10000)); - VideoStream *vstream = (VideoStream *)linphone_call_get_stream(call, LinphoneStreamTypeVideo); + int count; + /*wait some time until the target fps is reached. Indeed the bandwidth measurement may take several iterations to converge + to a value big enough to allow mediastreamer2 to switch to the high fps profile*/ + + for (count = 0 ; count < 3; count++){ + /*wait for at least the first TMMBR to arrive*/ + BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &marie->stat.last_tmmbr_value_received, 1, 10000)); + + if ((int)vstream->configured_fps == fps){ + break; + }else{ + /*target fps not reached yet, wait more time*/ + wait_for_until(marie->lc, pauline->lc, NULL, 0, 2000); + } + } BC_ASSERT_EQUAL((int)vstream->configured_fps, fps, int, "%d"); - end_call(marie, pauline); } } else {