tester: use H264 codec when using mire webcam because VP8 does not handle Mire properly, leading to failed tests on iOS

This commit is contained in:
Gautier Pelloux-Prayer 2016-06-10 16:45:01 +02:00
parent d8158669f3
commit e374b6505f
2 changed files with 78 additions and 27 deletions

View file

@ -840,12 +840,12 @@ end:
static void disable_all_codecs(const MSList* elem, LinphoneCoreManager* call){
PayloadType *pt;
PayloadType *pt;
for(;elem!=NULL;elem=elem->next){
pt=(PayloadType*)elem->data;
linphone_core_enable_payload_type(call->lc,pt,FALSE);
}
for(;elem!=NULL;elem=elem->next){
pt=(PayloadType*)elem->data;
linphone_core_enable_payload_type(call->lc,pt,FALSE);
}
}
/***
Disable all audio codecs , sends an INVITE with RTP port 0 and payload 0.
@ -3220,6 +3220,12 @@ void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video
LinphoneCoreManager* pauline = linphone_core_manager_new(pauline_rc);
bool_t call_ok;
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(pauline->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(pauline->lc,"h264");
disable_all_video_codecs_except_one(marie->lc,"h264");
}
linphone_core_set_video_device(pauline->lc,liblinphone_tester_mire_id);
linphone_core_set_video_device(marie->lc,liblinphone_tester_mire_id);
@ -4104,6 +4110,13 @@ static void accept_call_in_send_only_base(LinphoneCoreManager* pauline, Linphone
pol.automatically_accept=1;
pol.automatically_initiate=1;
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(pauline->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(pauline->lc,"h264");
disable_all_video_codecs_except_one(marie->lc,"h264");
}
linphone_core_enable_video_capture(pauline->lc, TRUE);
linphone_core_enable_video_display(pauline->lc, TRUE);
linphone_core_set_video_policy(pauline->lc,&pol);
@ -4223,6 +4236,13 @@ static void record_call(const char *filename, bool_t enableVideo, const char *vi
marie = linphone_core_manager_new("marie_h264_rc");
pauline = linphone_core_manager_new("pauline_h264_rc");
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(pauline->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(pauline->lc,"h264");
disable_all_video_codecs_except_one(marie->lc,"h264");
}
#if defined(HAVE_OPENH264) && defined(ANDROID)
libmsopenh264_init(linphone_core_get_ms_factory(marie->lc));
linphone_core_reload_ms_plugins(marie->lc, NULL);
@ -4877,7 +4897,15 @@ static void video_call_with_re_invite_inactive_followed_by_re_invite_base(Linpho
marie = linphone_core_manager_new( "marie_rc");
pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc");
linphone_core_set_avpf_mode(pauline->lc,TRUE);
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(pauline->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(pauline->lc,"h264");
disable_all_video_codecs_except_one(marie->lc,"h264");
}
linphone_core_set_video_device(pauline->lc,liblinphone_tester_mire_id);
linphone_core_set_video_device(marie->lc,liblinphone_tester_mire_id);
linphone_core_set_avpf_mode(marie->lc,TRUE);
@ -5030,6 +5058,14 @@ static void classic_video_entry_phone_setup(void) {
linphone_core_set_avpf_mode(callee_mgr->lc, LinphoneAVPFEnabled);
linphone_core_set_video_policy(caller_mgr->lc, &vpol);
linphone_core_set_video_policy(callee_mgr->lc, &vpol);
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(caller_mgr->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(caller_mgr->lc,"h264");
disable_all_video_codecs_except_one(callee_mgr->lc,"h264");
}
linphone_core_set_video_device(caller_mgr->lc, liblinphone_tester_mire_id);
linphone_core_set_video_device(callee_mgr->lc, liblinphone_tester_mire_id);
@ -5195,6 +5231,14 @@ static void call_with_complex_late_offering(void){
linphone_core_enable_video_display(marie->lc, TRUE);
linphone_core_set_video_policy(pauline->lc, &vpol);
linphone_core_set_video_policy(marie->lc, &vpol);
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(pauline->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(pauline->lc,"h264");
disable_all_video_codecs_except_one(marie->lc,"h264");
}
linphone_core_set_video_device(pauline->lc,liblinphone_tester_mire_id);
linphone_core_set_video_device(marie->lc,liblinphone_tester_mire_id);
@ -5700,8 +5744,8 @@ static void custom_rtp_modifier(bool_t pauseResumeTest, bool_t recordTest) {
rtp_stats_t pauline_rtp_stats = linphone_call_stats_get_rtp_stats(pauline_stats);
ms_message("Marie sent %i RTP packets and received %i (for real)", (int)marie_rtp_stats.packet_sent, (int)marie_rtp_stats.packet_recv);
ms_message("Pauline sent %i RTP packets and received %i (for real)", (int)pauline_rtp_stats.packet_sent, (int)pauline_rtp_stats.packet_recv);
BC_ASSERT_TRUE(data_marie->packetReceivedCount == marie_rtp_stats.packet_recv);
BC_ASSERT_TRUE(data_marie->packetSentCount == marie_rtp_stats.packet_sent);
BC_ASSERT_EQUAL(data_marie->packetReceivedCount, marie_rtp_stats.packet_recv, int, "%i");
BC_ASSERT_EQUAL(data_marie->packetSentCount, marie_rtp_stats.packet_sent, int, "%i");
// There can be a small difference between the number of packets received in the modifier and the number processed in reception because the processing is asynchronous
BC_ASSERT_TRUE(data_pauline->packetReceivedCount - pauline_rtp_stats.packet_recv < 20);
BC_ASSERT_TRUE(data_pauline->packetSentCount == pauline_rtp_stats.packet_sent);
@ -6407,21 +6451,20 @@ static void v6_call_over_nat_64(void){
}
static void call_with_ice_in_ipv4_with_v6_enabled(void) {
if (liblinphone_tester_ipv4_available() && liblinphone_tester_ipv6_available()){
bool_t liblinphonetester_ipv6_save=liblinphonetester_ipv6; /*this test nee v6*/
LinphoneCoreManager* marie = linphone_core_manager_new("marie_v4proxy_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_v4proxy_rc");
liblinphonetester_ipv6=TRUE;
_call_with_ice_base(pauline,marie,TRUE,TRUE,TRUE,FALSE);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
liblinphonetester_ipv6=liblinphonetester_ipv6_save; /*this test nee v6*/
if (liblinphone_tester_ipv4_available() && liblinphone_tester_ipv6_available()){
bool_t liblinphonetester_ipv6_save=liblinphonetester_ipv6; /*this test nee v6*/
LinphoneCoreManager* marie = linphone_core_manager_new("marie_v4proxy_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_v4proxy_rc");
} else ms_warning("Test skipped, need both ipv6 and v4 available");
liblinphonetester_ipv6=TRUE;
_call_with_ice_base(pauline,marie,TRUE,TRUE,TRUE,FALSE);
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
liblinphonetester_ipv6=liblinphonetester_ipv6_save; /*this test nee v6*/
} else ms_warning("Test skipped, need both ipv6 and v4 available");
}
test_t call_tests[] = {
TEST_NO_TAG("Early declined call", early_declined_call),
TEST_NO_TAG("Call declined", call_declined),
@ -6481,12 +6524,12 @@ test_t call_tests[] = {
TEST_ONE_TAG("Audio call with ICE no matching audio codecs", audio_call_with_ice_no_matching_audio_codecs, "ICE"),
#ifdef VIDEO_ENABLED
TEST_NO_TAG("Simple video call AVPF", video_call_avpf),
TEST_NO_TAG("Simple video call implicit AVPF both", video_call_using_policy_AVPF_implicit_caller_and_callee),
TEST_NO_TAG("Simple video call disable implicit AVPF on callee", video_call_disable_implicit_AVPF_on_callee),
TEST_NO_TAG("Simple video call disable implicit AVPF on caller", video_call_disable_implicit_AVPF_on_caller),
TEST_NO_TAG("Simple video call AVPF to implicit AVPF", video_call_AVPF_to_implicit_AVPF),
TEST_NO_TAG("Simple video call implicit AVPF to AVPF", video_call_implicit_AVPF_to_AVPF),
TEST_NO_TAG("Simple video call", video_call),
TEST_NO_TAG("Simple video call implicit AVPF both", video_call_using_policy_AVPF_implicit_caller_and_callee),
TEST_NO_TAG("Simple video call disable implicit AVPF on callee", video_call_disable_implicit_AVPF_on_callee),
TEST_NO_TAG("Simple video call disable implicit AVPF on caller", video_call_disable_implicit_AVPF_on_caller),
TEST_NO_TAG("Simple video call AVPF to implicit AVPF", video_call_AVPF_to_implicit_AVPF),
TEST_NO_TAG("Simple video call implicit AVPF to AVPF", video_call_implicit_AVPF_to_AVPF),
TEST_NO_TAG("Simple video call", video_call),
TEST_NO_TAG("Simple video call without rtcp",video_call_without_rtcp),
TEST_NO_TAG("Simple ZRTP video call", video_call_zrtp),
TEST_NO_TAG("Simple DTLS video call", video_call_dtls),

View file

@ -98,11 +98,19 @@ static void early_media_with_multicast_base(bool_t video) {
linphone_core_enable_video_display(pauline2->lc, TRUE);
linphone_core_enable_video_capture(marie->lc, TRUE);
linphone_core_enable_video_display(marie->lc, FALSE);
// important: VP8 has really poor performances with the mire camera, at least
// on iOS - so when ever h264 is available, let's use it instead
if (linphone_core_find_payload_type(pauline->lc,"h264", -1, -1)!=NULL) {
disable_all_video_codecs_except_one(pauline->lc,"h264");
disable_all_video_codecs_except_one(pauline2->lc,"h264");
disable_all_video_codecs_except_one(marie->lc,"h264");
}
linphone_core_set_video_device(pauline->lc, liblinphone_tester_mire_id);
linphone_core_set_video_device(pauline2->lc, liblinphone_tester_mire_id);
linphone_core_set_video_device(marie->lc, liblinphone_tester_mire_id);
linphone_core_set_avpf_mode(pauline->lc, LinphoneAVPFEnabled);
linphone_core_set_avpf_mode(pauline2->lc, LinphoneAVPFEnabled);
linphone_core_set_avpf_mode(marie->lc, LinphoneAVPFEnabled);