diff --git a/mediastreamer2 b/mediastreamer2 index 3cb6bc0d7..7f95bec29 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 3cb6bc0d706fe4b8471a1a5a0cc5c99053efea09 +Subproject commit 7f95bec294daa60e3ee727302fbc0bfe9fcf8a6d diff --git a/tester/call_tester.c b/tester/call_tester.c index 48ec21e3f..c6eba9c69 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -3449,7 +3449,7 @@ static char *create_filepath(const char *dir, const char *filename, const char * return ms_strdup_printf("%s/%s.%s",dir,filename,ext); } -static void record_call(const char *filename, bool_t enableVideo) { +static void record_call(const char *filename, bool_t enableVideo, const char *video_codec) { LinphoneCoreManager *marie = NULL; LinphoneCoreManager *pauline = NULL; LinphoneCallParams *marieParams = NULL; @@ -3472,13 +3472,14 @@ static void record_call(const char *filename, bool_t enableVideo) { paulineParams = linphone_core_create_default_call_parameters(pauline->lc); #ifdef VIDEO_ENABLED + linphone_core_set_video_device(pauline->lc, liblinphone_tester_mire_id); if(enableVideo) { - if((linphone_core_find_payload_type(marie->lc, "H264", -1, -1) != NULL) - && (linphone_core_find_payload_type(pauline->lc, "H264", -1, -1) != NULL)) { + if(linphone_core_find_payload_type(marie->lc, video_codec, -1, -1) + && linphone_core_find_payload_type(pauline->lc, video_codec, -1, -1)) { linphone_call_params_enable_video(marieParams, TRUE); linphone_call_params_enable_video(paulineParams, TRUE); - disable_all_video_codecs_except_one(marie->lc, "H264"); - disable_all_video_codecs_except_one(pauline->lc, "H264"); + disable_all_video_codecs_except_one(marie->lc, video_codec); + disable_all_video_codecs_except_one(pauline->lc, video_codec); } else { ms_warning("call_recording(): the H264 payload has not been found. Only sound will be recorded"); } @@ -3512,12 +3513,16 @@ static void record_call(const char *filename, bool_t enableVideo) { } static void audio_call_recording_test(void) { - record_call("recording", FALSE); + record_call("recording", FALSE, NULL); } #ifdef VIDEO_ENABLED -static void video_call_recording_test(void) { - record_call("recording", TRUE); +static void video_call_recording_h264_test(void) { + record_call("recording", TRUE, "H264"); +} + +static void video_call_recording_vp8_test(void) { + record_call("recording", TRUE, "VP8"); } static void video_call_snapshot(void) { @@ -5015,7 +5020,8 @@ test_t call_tests[] = { { "Call with ICE and video added 3", call_with_ice_video_added_3 }, { "Call with ICE and video added and refused", call_with_ice_video_added_and_refused }, { "Video call with ICE accepted using call params",video_call_ice_params}, - { "Video call recording", video_call_recording_test }, + { "Video call recording (H264)", video_call_recording_h264_test }, + { "Video call recording (VP8)", video_call_recording_vp8_test }, { "Snapshot", video_call_snapshot }, { "Video call with early media and no matching audio codecs", video_call_with_early_media_no_matching_audio_codecs }, { "DTLS SRTP video call",dtls_srtp_video_call}, diff --git a/tester/player_tester.c b/tester/player_tester.c index 4edc2290b..e78488d47 100644 --- a/tester/player_tester.c +++ b/tester/player_tester.c @@ -61,7 +61,7 @@ static void play_file(const char *filename, bool_t unsupported_format, const cha BC_ASSERT_EQUAL(res, 0, int, "%d"); if(res == -1) goto fail; - BC_ASSERT_TRUE(wait_for_eof(&eof, &time, 100, 13000)); + BC_ASSERT_TRUE(wait_for_eof(&eof, &time, 100, linphone_player_get_duration(player) * 1.05)); linphone_player_close(player); @@ -70,16 +70,34 @@ static void play_file(const char *filename, bool_t unsupported_format, const cha if(lc_manager) linphone_core_manager_destroy(lc_manager); } -static void playing_test(void) { - char *filename = bc_tester_res("sounds/hello_opus_h264.mkv"); +static void sintel_trailer_opus_h264_test(void) { + char *filename = bc_tester_res("sounds/sintel_trailer_opus_h264.mkv"); const char *audio_mime = "opus"; - const char *video_mime = "h264"; + const char *video_mime = "H264"; + play_file(filename, !linphone_local_player_matroska_supported(), audio_mime, video_mime); + ms_free(filename); +} + +static void sintel_trailer_pcmu_h264_test(void) { + char *filename = bc_tester_res("sounds/sintel_trailer_pcmu_h264.mkv"); + const char *audio_mime = "pcmu"; + const char *video_mime = "H264"; + play_file(filename, !linphone_local_player_matroska_supported(), audio_mime, video_mime); + ms_free(filename); +} + +static void sintel_trailer_opus_vp8_test(void) { + char *filename = bc_tester_res("sounds/sintel_trailer_opus_vp8.mkv"); + const char *audio_mime = "opus"; + const char *video_mime = "VP8"; play_file(filename, !linphone_local_player_matroska_supported(), audio_mime, video_mime); ms_free(filename); } test_t player_tests[] = { - { "Local MKV file" , playing_test } + { "Sintel trailer opus/h264" , sintel_trailer_opus_h264_test }, + { "Sintel trailer pcmu/h264" , sintel_trailer_pcmu_h264_test }, + { "Sintel trailer opus/VP8" , sintel_trailer_opus_vp8_test } }; test_suite_t player_test_suite = {"Player", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, diff --git a/tester/sounds/hello_opus_h264.mkv b/tester/sounds/hello_opus_h264.mkv deleted file mode 100644 index 4aa5d338b..000000000 Binary files a/tester/sounds/hello_opus_h264.mkv and /dev/null differ diff --git a/tester/sounds/sintel_trailer_opus_h264.mkv b/tester/sounds/sintel_trailer_opus_h264.mkv new file mode 100644 index 000000000..420f5c291 Binary files /dev/null and b/tester/sounds/sintel_trailer_opus_h264.mkv differ diff --git a/tester/sounds/sintel_trailer_opus_vp8.mkv b/tester/sounds/sintel_trailer_opus_vp8.mkv new file mode 100644 index 000000000..de7b37a3c Binary files /dev/null and b/tester/sounds/sintel_trailer_opus_vp8.mkv differ diff --git a/tester/sounds/sintel_trailer_pcmu_h264.mkv b/tester/sounds/sintel_trailer_pcmu_h264.mkv new file mode 100644 index 000000000..84b9bfa24 Binary files /dev/null and b/tester/sounds/sintel_trailer_pcmu_h264.mkv differ