Commit 09770762 authored by jehan's avatar jehan
Browse files

improve reliability of tests measuring bandwidth

parent 327f29b1
mediastreamer2 @ cd2857a3
Subproject commit 160ed0a5c49e9067eda87544523a8d1bdb2b5155
Subproject commit cd2857a373e865135f2bbc49d1108da7c6b17521
......@@ -90,6 +90,11 @@ void call_stats_updated(LinphoneCore *lc, LinphoneCall *call, const LinphoneCall
} else if (lstats->updated == LINPHONE_CALL_STATS_SENT_RTCP_UPDATE) {
counters->number_of_rtcp_sent++;
}
counters->audio_download_bandwidth = linphone_call_get_audio_stats(call)->download_bandwidth;
counters->audio_upload_bandwidth = linphone_call_get_audio_stats(call)->upload_bandwidth;
counters->video_download_bandwidth = linphone_call_get_video_stats(call)->download_bandwidth;
counters->video_upload_bandwidth = linphone_call_get_video_stats(call)->upload_bandwidth;
}
void linphone_call_encryption_changed(LinphoneCore *lc, LinphoneCall *call, bool_t on, const char *authentication_token) {
......@@ -2856,7 +2861,7 @@ static void check_media_direction(LinphoneCoreManager* mgr, LinphoneCall *call,
linphone_call_set_next_video_frame_decoded_callback(call,linphone_call_cb,mgr->lc);
linphone_call_send_vfu_request(call);
wait_for_list(lcs,&dummy,1,2000);
wait_for_list(lcs,&dummy,1,2000); /*on some device, it may take 3 to 4s to get audio from mic*/
switch (video_dir) {
case LinphoneMediaDirectionInactive:
......@@ -2879,13 +2884,13 @@ static void check_media_direction(LinphoneCoreManager* mgr, LinphoneCall *call,
CU_ASSERT_TRUE(linphone_call_get_audio_stats(call)->upload_bandwidth<5);
case LinphoneMediaDirectionSendOnly:
CU_ASSERT_TRUE(linphone_call_get_video_stats(call)->download_bandwidth<5);
if (audio_dir == LinphoneMediaDirectionSendOnly) CU_ASSERT_TRUE(linphone_call_get_audio_stats(call)->upload_bandwidth>70);
if (audio_dir == LinphoneMediaDirectionSendOnly) CU_ASSERT_TRUE(wait_for_list(lcs,&mgr->stat.audio_upload_bandwidth,70,4000));
break;
case LinphoneMediaDirectionRecvOnly:
CU_ASSERT_TRUE(linphone_call_get_audio_stats(call)->upload_bandwidth<5);
case LinphoneMediaDirectionSendRecv:
CU_ASSERT_TRUE(linphone_call_get_audio_stats(call)->download_bandwidth>70);
if (audio_dir == LinphoneMediaDirectionSendRecv) CU_ASSERT_TRUE(linphone_call_get_audio_stats(call)->upload_bandwidth>70);
CU_ASSERT_TRUE(wait_for_list(lcs,&mgr->stat.audio_download_bandwidth,70,4000));
if (audio_dir == LinphoneMediaDirectionSendRecv) CU_ASSERT_TRUE(wait_for_list(lcs,&mgr->stat.audio_upload_bandwidth,70,4000));
break;
}
}
......
......@@ -212,6 +212,10 @@ typedef struct _stats {
int number_of_LinphoneCoreLogCollectionUploadStateDelivered;
int number_of_LinphoneCoreLogCollectionUploadStateNotDelivered;
int number_of_LinphoneCoreLogCollectionUploadStateInProgress;
int audio_download_bandwidth;
int audio_upload_bandwidth;
int video_download_bandwidth;
int video_upload_bandwidth;
}stats;
......
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