From 310273459dcdaeb0596031286c94113bafaaa88c Mon Sep 17 00:00:00 2001 From: Rasmus Brandt Date: Fri, 29 Sep 2017 13:48:12 +0000 Subject: [PATCH] Revert "Reland of Add full stack tests for MediaCodec encoder (moved from Rietveld)." This reverts commit 2666cf7eba4bdd697d59d0451a8f74a05d4d207e. Reason for revert: On Lollipop Nexus 4, the 240p tests fail too. Original change's description: > Reland of Add full stack tests for MediaCodec encoder (moved from Rietveld). > > * Add audio_ prefix to CallTest::{en,de}coder_factory_. > * Let VideoQualityTest only instantiate encoders using encoder factories. > * Add HW encoder factories to VideoQualityTest. > * Add full stack tests: > - sqcif7 at 30 kbps: libvpx. > - 240p10 at 100 kbps: MediaCodec, libvpx, and MediaCodec+libvpx. > > BUG=webrtc:8219 > TBR=asapersson@webrtc.org,kjellander@webrtc.org,stefan@webrtc.org,sprang@webrtc.org > > Change-Id: I464409ac0d5276defa78c1bf66034c6cca717d74 > Reviewed-on: https://webrtc-review.googlesource.com/4740 > Commit-Queue: Rasmus Brandt > Reviewed-by: Rasmus Brandt > Cr-Commit-Position: refs/heads/master@{#20041} TBR=kjellander@webrtc.org,brandtr@webrtc.org,asapersson@webrtc.org,sprang@webrtc.org,stefan@webrtc.org Change-Id: If558b7fb86740658e50a6897d1eeeb72103a54ec No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:8219 Reviewed-on: https://webrtc-review.googlesource.com/4900 Reviewed-by: Rasmus Brandt Commit-Queue: Rasmus Brandt Cr-Commit-Position: refs/heads/master@{#20044} --- BUILD.gn | 10 +- call/call_perf_tests.cc | 4 +- modules/video_coding/BUILD.gn | 29 +- test/call_test.cc | 12 +- test/call_test.h | 4 +- video/BUILD.gn | 9 - video/DEPS | 1 - video/full_stack_tests.cc | 496 +++++++++------------------------- video/screenshare_loopback.cc | 2 - video/video_loopback.cc | 2 - video/video_quality_test.cc | 90 +++--- video/video_quality_test.h | 5 +- 12 files changed, 187 insertions(+), 477 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 209a3fb4b1..e590644526 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -477,8 +477,6 @@ if (rtc_include_tests) { "resources/audio_coding/testfile32kHz.pcm", "resources/ConferenceMotion_1280_720_50.yuv", "resources/difficult_photo_1850_1110.yuv", - "resources/foreman_128x96.yuv", - "resources/foreman_320x240.yuv", "resources/foreman_cif.yuv", "resources/google-wifi-3mbps.rx", "resources/paris_qcif.yuv", @@ -515,13 +513,7 @@ if (rtc_include_tests) { data = webrtc_perf_tests_resources if (is_android) { - deps += [ - # Including Java classes seems only to be possible from rtc_test - # targets. Therefore we include this target here, instead of - # in video_full_stack_tests, where it is actually used. - "sdk/android:libjingle_peerconnection_java", - "//testing/android/native_test:native_test_native_code", - ] + deps += [ "//testing/android/native_test:native_test_native_code" ] shard_timeout = 2700 } if (is_ios) { diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index 2bd5e22193..98ebe8b657 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -177,7 +177,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec, FakeAudioDevice::CreatePulsedNoiseCapturer(256, 48000), FakeAudioDevice::CreateDiscardRenderer(48000), audio_rtp_speed); EXPECT_EQ(0, voe_base->Init(fake_audio_device.get(), audio_processing.get(), - audio_decoder_factory_)); + decoder_factory_)); VoEBase::ChannelConfig config; config.enable_voice_pacing = true; send_channel_id = voe_base->CreateChannel(config); @@ -250,7 +250,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec, audio_recv_config.rtp.local_ssrc = kAudioRecvSsrc; audio_recv_config.voe_channel_id = recv_channel_id; audio_recv_config.sync_group = kSyncGroup; - audio_recv_config.decoder_factory = audio_decoder_factory_; + audio_recv_config.decoder_factory = decoder_factory_; audio_recv_config.decoder_map = { {kAudioSendPayloadType, {"ISAC", 16000, 1}}}; diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 463665f352..785533ace7 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -394,23 +394,6 @@ if (rtc_include_tests) { ] } - if (is_android) { - rtc_source_set("codecs_test_android_test_initializer") { - testonly = true - - sources = [ - "codecs/test/android_test_initializer.cc", - "codecs/test/android_test_initializer.h", - ] - - deps = [ - "../../rtc_base:rtc_base_approved", - "../../sdk/android:libjingle_peerconnection_jni", - "//base", - ] - } - } - video_coding_modules_tests_resources = [ "../../resources/foreman_128x96.yuv", "../../resources/foreman_160x120.yuv", @@ -472,9 +455,15 @@ if (rtc_include_tests) { data = video_coding_modules_tests_resources if (is_android) { + sources += [ + "codecs/test/android_test_initializer.cc", + "codecs/test/android_test_initializer.h", + "codecs/test/videoprocessor_integrationtest_mediacodec.cc", + ] + deps += [ - ":codecs_test_android_test_initializer", - "../../sdk/android:video_jni", + "../../sdk/android:libjingle_peerconnection_jni", + "//base", ] } @@ -482,6 +471,8 @@ if (rtc_include_tests) { deps += [ ":codec_test_objc", ":video_coding_modules_tests_resources_bundle_data", + "../../media:rtc_media_base", + "../../sdk:videotoolbox_objc", ] } diff --git a/test/call_test.cc b/test/call_test.cc index 4d75ef918f..f4b387774a 100644 --- a/test/call_test.cc +++ b/test/call_test.cc @@ -42,8 +42,8 @@ CallTest::CallTest() num_video_streams_(1), num_audio_streams_(0), num_flexfec_streams_(0), - audio_decoder_factory_(CreateBuiltinAudioDecoderFactory()), - audio_encoder_factory_(CreateBuiltinAudioEncoderFactory()), + decoder_factory_(CreateBuiltinAudioDecoderFactory()), + encoder_factory_(CreateBuiltinAudioEncoderFactory()), task_queue_("CallTestTaskQueue"), fake_send_audio_device_(nullptr), fake_recv_audio_device_(nullptr) {} @@ -223,7 +223,7 @@ void CallTest::CreateSendConfig(size_t num_video_streams, audio_send_config_.send_codec_spec = rtc::Optional( {kAudioSendPayloadType, {"opus", 48000, 2, {{"stereo", "1"}}}}); - audio_send_config_.encoder_factory = audio_encoder_factory_; + audio_send_config_.encoder_factory = encoder_factory_; } // TODO(brandtr): Update this when we support multistream protection. @@ -268,7 +268,7 @@ void CallTest::CreateMatchingReceiveConfigs(Transport* rtcp_send_transport) { audio_config.rtcp_send_transport = rtcp_send_transport; audio_config.voe_channel_id = voe_recv_.channel_id; audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; - audio_config.decoder_factory = audio_decoder_factory_; + audio_config.decoder_factory = decoder_factory_; audio_config.decoder_map = {{kAudioSendPayloadType, {"opus", 48000, 2}}}; audio_receive_configs_.push_back(audio_config); } @@ -428,7 +428,7 @@ void CallTest::CreateVoiceEngines() { voe_send_.voice_engine = VoiceEngine::Create(); voe_send_.base = VoEBase::GetInterface(voe_send_.voice_engine); EXPECT_EQ(0, voe_send_.base->Init(fake_send_audio_device_.get(), - apm_send_.get(), audio_decoder_factory_)); + apm_send_.get(), decoder_factory_)); VoEBase::ChannelConfig config; config.enable_voice_pacing = true; voe_send_.channel_id = voe_send_.base->CreateChannel(config); @@ -437,7 +437,7 @@ void CallTest::CreateVoiceEngines() { voe_recv_.voice_engine = VoiceEngine::Create(); voe_recv_.base = VoEBase::GetInterface(voe_recv_.voice_engine); EXPECT_EQ(0, voe_recv_.base->Init(fake_recv_audio_device_.get(), - apm_recv_.get(), audio_decoder_factory_)); + apm_recv_.get(), decoder_factory_)); voe_recv_.channel_id = voe_recv_.base->CreateChannel(); EXPECT_GE(voe_recv_.channel_id, 0); } diff --git a/test/call_test.h b/test/call_test.h index 238539c6ad..cf15aacf11 100644 --- a/test/call_test.h +++ b/test/call_test.h @@ -133,8 +133,8 @@ class CallTest : public ::testing::Test { size_t num_video_streams_; size_t num_audio_streams_; size_t num_flexfec_streams_; - rtc::scoped_refptr audio_decoder_factory_; - rtc::scoped_refptr audio_encoder_factory_; + rtc::scoped_refptr decoder_factory_; + rtc::scoped_refptr encoder_factory_; test::FakeVideoRenderer fake_renderer_; SingleThreadedTaskQueueForTesting task_queue_; diff --git a/video/BUILD.gn b/video/BUILD.gn index cab04210f2..202a7066cb 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -124,15 +124,6 @@ if (rtc_include_tests) { "../voice_engine", "//testing/gtest", ] - if (is_android) { - deps += [ - "../modules/video_coding:codecs_test_android_test_initializer", - "../sdk/android:video_jni", - ] - } - if (is_ios || is_mac) { - deps += [ "../modules/video_coding:codec_test_objc" ] - } if (!build_with_chromium && is_clang) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] diff --git a/video/DEPS b/video/DEPS index 03bb0999d4..b94455edd0 100644 --- a/video/DEPS +++ b/video/DEPS @@ -14,7 +14,6 @@ include_rules = [ "+modules/video_coding", "+modules/video_capture", "+modules/video_processing", - "+sdk", "+system_wrappers", "+voice_engine", ] diff --git a/video/full_stack_tests.cc b/video/full_stack_tests.cc index 836b8c3b30..ea1e37f9f0 100644 --- a/video/full_stack_tests.cc +++ b/video/full_stack_tests.cc @@ -9,8 +9,6 @@ */ #include -#include - #include "modules/pacing/alr_detector.h" #include "test/field_trial.h" #include "test/gtest.h" @@ -51,9 +49,8 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) { // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 700000, 700000, - 700000, false, "VP9", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false, + "VP9", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_VP9", 0.0, 0.0, kFullStackTestDurationSecs}; RunTest(foreman_cif); @@ -62,9 +59,8 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketLossVp9) { TEST_F(FullStackTest, ForemanCifPlr5Vp9) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP9", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP9", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_VP9", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 5; @@ -76,9 +72,8 @@ TEST_F(FullStackTest, ForemanCifPlr5Vp9) { TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { VideoQualityTest::Params paris_qcif; paris_qcif.call.send_side_bwe = true; - paris_qcif.video = {true, 176, 144, 30, 300000, 300000, - 300000, false, "VP8", false, false, 1, - 0, 0, false, false, "paris_qcif"}; + paris_qcif.video = {true, 176, 144, 30, 300000, 300000, 300000, false, + "VP8", 1, 0, 0, false, false, "paris_qcif"}; paris_qcif.analyzer = {"net_delay_0_0_plr_0", 36.0, 0.96, kFullStackTestDurationSecs}; RunTest(paris_qcif); @@ -88,9 +83,8 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 700000, 700000, - 700000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 700000, 700000, 700000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs}; RunTest(foreman_cif); @@ -99,9 +93,8 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { TEST_F(FullStackTest, ForemanCif30kbpsWithoutPacketLoss) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 10, 30000, 30000, - 30000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 10, 30000, 30000, 30000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_30kbps_net_delay_0_0_plr_0", 0.0, 0.0, kFullStackTestDurationSecs}; RunTest(foreman_cif); @@ -110,9 +103,8 @@ TEST_F(FullStackTest, ForemanCif30kbpsWithoutPacketLoss) { TEST_F(FullStackTest, ForemanCifPlr5) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 5; @@ -123,9 +115,8 @@ TEST_F(FullStackTest, ForemanCifPlr5) { TEST_F(FullStackTest, ForemanCifPlr5Ulpfec) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, true, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, true, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_ulpfec", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 5; @@ -136,9 +127,8 @@ TEST_F(FullStackTest, ForemanCifPlr5Ulpfec) { TEST_F(FullStackTest, ForemanCifPlr5Flexfec) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, true, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, true, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_flexfec", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 5; @@ -149,9 +139,8 @@ TEST_F(FullStackTest, ForemanCifPlr5Flexfec) { TEST_F(FullStackTest, ForemanCif500kbpsPlr3Flexfec) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, true, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, true, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps_delay_50_0_plr_3_flexfec", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 3; @@ -163,9 +152,8 @@ TEST_F(FullStackTest, ForemanCif500kbpsPlr3Flexfec) { TEST_F(FullStackTest, ForemanCif500kbpsPlr3Ulpfec) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, true, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, true, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps_delay_50_0_plr_3_ulpfec", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 3; @@ -179,9 +167,9 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketlossH264) { // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 700000, 700000, - 700000, false, "H264", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 700000, + 700000, 700000, false, "H264", 1, + 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_net_delay_0_0_plr_0_H264", 0.0, 0.0, kFullStackTestDurationSecs}; RunTest(foreman_cif); @@ -190,9 +178,8 @@ TEST_F(FullStackTest, ForemanCifWithoutPacketlossH264) { TEST_F(FullStackTest, ForemanCif30kbpsWithoutPacketlossH264) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 10, 30000, 30000, - 30000, false, "H264", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 10, 30000, 30000, 30000, false, + "H264", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_30kbps_net_delay_0_0_plr_0_H264", 0.0, 0.0, kFullStackTestDurationSecs}; RunTest(foreman_cif); @@ -201,9 +188,8 @@ TEST_F(FullStackTest, ForemanCif30kbpsWithoutPacketlossH264) { TEST_F(FullStackTest, ForemanCifPlr5H264) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "H264", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "H264", 1, 0, 0, false, false, "foreman_cif"}; std::string fec_description; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -216,9 +202,8 @@ TEST_F(FullStackTest, ForemanCifPlr5H264) { TEST_F(FullStackTest, ForemanCifPlr5H264Flexfec) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "H264", false, false, 1, - 0, 0, false, true, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "H264", 1, 0, 0, false, true, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_flexfec", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 5; @@ -231,9 +216,8 @@ TEST_F(FullStackTest, ForemanCifPlr5H264Flexfec) { TEST_F(FullStackTest, DISABLED_ForemanCifPlr5H264Ulpfec) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "H264", false, false, 1, - 0, 0, true, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "H264", 1, 0, 0, true, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_delay_50_0_plr_5_H264_ulpfec", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.loss_percent = 5; @@ -245,9 +229,8 @@ TEST_F(FullStackTest, DISABLED_ForemanCifPlr5H264Ulpfec) { TEST_F(FullStackTest, ForemanCif500kbps) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.queue_length_packets = 0; @@ -256,81 +239,11 @@ TEST_F(FullStackTest, ForemanCif500kbps) { RunTest(foreman_cif); } -TEST_F(FullStackTest, ForemanSqcif30kbpsLibvpx) { - VideoQualityTest::Params foreman_sqcif; - foreman_sqcif.call.send_side_bwe = true; - foreman_sqcif.video = {true, 128, 96, 7, 30000, 30000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_128x96"}; - foreman_sqcif.analyzer = {"foreman_sqcif_30kbps_libvpx", 0.0, 0.0, - kFullStackTestDurationSecs}; - foreman_sqcif.pipe.link_capacity_kbps = 30; - RunTest(foreman_sqcif); -} - -TEST_F(FullStackTest, Foreman240p100kbpsLibvpx) { - VideoQualityTest::Params foreman_240p; - foreman_240p.call.send_side_bwe = true; - foreman_240p.video = { - true, 320, 240, 10, 30000, 100000, 2000000, false, "VP8", false, - false, 1, 0, 0, false, false, "foreman_320x240"}; - foreman_240p.analyzer = {"foreman_240p_100kbps_libvpx", 0.0, 0.0, - kFullStackTestDurationSecs}; - foreman_240p.pipe.link_capacity_kbps = 100; - RunTest(foreman_240p); -} - -#if defined(WEBRTC_ANDROID) -// TODO(brandtr): Enable when the test is more robust against failing encoders, -// or when the perf waterfall Android bots all support sqcif. -TEST_F(FullStackTest, DISABLED_ForemanSqcif30kbpsMediaCodec) { - VideoQualityTest::Params foreman_sqcif; - foreman_sqcif.call.send_side_bwe = true; - foreman_sqcif.video = {true, 128, 96, 7, 30000, 30000, - 2000000, false, "VP8", true, false, 1, - 0, 0, false, false, "foreman_128x96"}; - foreman_sqcif.analyzer = {"foreman_sqcif_30kbps_mediacodec", 0.0, 0.0, - kFullStackTestDurationSecs}; - foreman_sqcif.pipe.link_capacity_kbps = 30; - RunTest(foreman_sqcif); -} - -TEST_F(FullStackTest, Foreman240p100kbpsMediaCodec) { - VideoQualityTest::Params foreman_240p; - foreman_240p.call.send_side_bwe = true; - foreman_240p.video = { - true, 320, 240, 10, 30000, 100000, 2000000, false, "VP8", true, - false, 1, 0, 0, false, false, "foreman_320x240"}; - foreman_240p.analyzer = {"foreman_240p_100kbps_mediacodec", 0.0, 0.0, - kFullStackTestDurationSecs}; - foreman_240p.pipe.link_capacity_kbps = 100; - RunTest(foreman_240p); -} - -TEST_F(FullStackTest, Foreman240p100kbpsMediaCodecWithForcedSwFallback) { - std::string field_trial = - "WebRTC-VP8-Forced-Fallback-Encoder/Enabled-150,175," + - std::to_string(1000 * kFullStackTestDurationSecs / 2) + ",19200/"; - test::ScopedFieldTrials override_field_trials(field_trial); - - VideoQualityTest::Params foreman_240p; - foreman_240p.call.send_side_bwe = true; - foreman_240p.video = { - true, 320, 240, 10, 30000, 100000, 2000000, false, "VP8", true, - true, 1, 0, 0, false, false, "foreman_320x240"}; - foreman_240p.analyzer = {"foreman_240p_100kbps_mediacodec_sw_fallback", 0.0, - 0.0, kFullStackTestDurationSecs}; - foreman_240p.pipe.link_capacity_kbps = 100; - RunTest(foreman_240p); -} -#endif // defined(WEBRTC_ANDROID) - TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.queue_length_packets = 32; @@ -342,9 +255,8 @@ TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { TEST_F(FullStackTest, ForemanCif500kbps100ms) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps_100ms", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.queue_length_packets = 0; @@ -356,9 +268,8 @@ TEST_F(FullStackTest, ForemanCif500kbps100ms) { TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.queue_length_packets = 32; @@ -370,9 +281,8 @@ TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = false; - foreman_cif.video = {true, 352, 288, 30, 30000, 500000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 500000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_500kbps_100ms_32pkts_queue_recv_bwe", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.queue_length_packets = 32; @@ -384,9 +294,8 @@ TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueueRecvBwe) { TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { VideoQualityTest::Params foreman_cif; foreman_cif.call.send_side_bwe = true; - foreman_cif.video = {true, 352, 288, 30, 30000, 2000000, - 2000000, false, "VP8", false, false, 1, - 0, 0, false, false, "foreman_cif"}; + foreman_cif.video = {true, 352, 288, 30, 30000, 2000000, 2000000, false, + "VP8", 1, 0, 0, false, false, "foreman_cif"}; foreman_cif.analyzer = {"foreman_cif_1000kbps_100ms_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}; foreman_cif.pipe.queue_length_packets = 32; @@ -399,23 +308,10 @@ TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) { VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP8", - false, - false, - 1, - 0, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP8", 1, + 0, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = {"conference_motion_hd_2000kbps_100ms_32pkts_queue", 0.0, 0.0, kFullStackTestDurationSecs}; conf_motion_hd.pipe.queue_length_packets = 32; @@ -427,23 +323,10 @@ TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueue) { TEST_F(FullStackTest, ConferenceMotionHd1TLModerateLimits) { VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP8", - false, - false, - 1, - -1, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP8", 1, + -1, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = {"conference_motion_hd_1tl_moderate_limits", 0.0, 0.0, kFullStackTestDurationSecs}; conf_motion_hd.pipe.queue_length_packets = 50; @@ -456,23 +339,10 @@ TEST_F(FullStackTest, ConferenceMotionHd1TLModerateLimits) { TEST_F(FullStackTest, ConferenceMotionHd2TLModerateLimits) { VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP8", - false, - false, - 2, - -1, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP8", 2, + -1, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = {"conference_motion_hd_2tl_moderate_limits", 0.0, 0.0, kFullStackTestDurationSecs}; conf_motion_hd.pipe.queue_length_packets = 50; @@ -485,23 +355,10 @@ TEST_F(FullStackTest, ConferenceMotionHd2TLModerateLimits) { TEST_F(FullStackTest, ConferenceMotionHd3TLModerateLimits) { VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP8", - false, - false, - 3, - -1, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP8", 3, + -1, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = {"conference_motion_hd_3tl_moderate_limits", 0.0, 0.0, kFullStackTestDurationSecs}; conf_motion_hd.pipe.queue_length_packets = 50; @@ -514,23 +371,10 @@ TEST_F(FullStackTest, ConferenceMotionHd3TLModerateLimits) { TEST_F(FullStackTest, ConferenceMotionHd4TLModerateLimits) { VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP8", - false, - false, - 4, - -1, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP8", 4, + -1, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = {"conference_motion_hd_4tl_moderate_limits", 0.0, 0.0, kFullStackTestDurationSecs}; conf_motion_hd.pipe.queue_length_packets = 50; @@ -544,23 +388,10 @@ TEST_F(FullStackTest, ConferenceMotionHd3TLModerateLimitsAltTLPattern) { test::ScopedFieldTrials field_trial("WebRTC-UseShortVP8TL3Pattern/Enabled/"); VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP8", - false, - false, - 3, - -1, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP8", 3, + -1, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = {"conference_motion_hd_3tl_alt_moderate_limits", 0.0, 0.0, kFullStackTestDurationSecs}; conf_motion_hd.pipe.queue_length_packets = 50; @@ -574,23 +405,10 @@ TEST_F(FullStackTest, ConferenceMotionHd3TLModerateLimitsAltTLPattern) { TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueueVP9) { VideoQualityTest::Params conf_motion_hd; conf_motion_hd.call.send_side_bwe = true; - conf_motion_hd.video = {true, - 1280, - 720, - 50, - 30000, - 3000000, - 3000000, - false, - "VP9", - false, - false, - 1, - 0, - 0, - false, - false, - "ConferenceMotion_1280_720_50"}; + conf_motion_hd.video = { + true, 1280, 720, 50, 30000, + 3000000, 3000000, false, "VP9", 1, + 0, 0, false, false, "ConferenceMotion_1280_720_50"}; conf_motion_hd.analyzer = { "conference_motion_hd_2000kbps_100ms_32pkts_queue_vp9", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -604,9 +422,8 @@ TEST_F(FullStackTest, ConferenceMotionHd2000kbps100msLimitedQueueVP9) { TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -618,19 +435,19 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_3TL_Simulcast) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; screenshare.screenshare = {true, false, 10}; - screenshare.video = {true, 1850, 1110, 5, 800000, 2500000, - 2500000, false, "VP8", false, false, 3, - 2, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 800000, + 2500000, 2500000, false, "VP8", 3, + 2, 400000, false, false, ""}; screenshare.analyzer = {"screenshare_slides_simulcast", 0.0, 0.0, kFullStackTestDurationSecs}; VideoQualityTest::Params screenshare_params_high; - screenshare_params_high.video = { - true, 1850, 1110, 5, 800000, 2500000, 2500000, false, "VP8", - false, false, 3, 0, 400000, false, false, ""}; + screenshare_params_high.video = {true, 1850, 1110, 5, 800000, + 2500000, 2500000, false, "VP8", 3, + 0, 400000, false, false, ""}; VideoQualityTest::Params screenshare_params_low; - screenshare_params_low.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 0, 400000, false, false, ""}; + screenshare_params_low.video = {true, 1850, 1110, 5, 50000, + 200000, 2000000, false, "VP8", 2, + 0, 400000, false, false, ""}; std::vector streams = { DefaultVideoStream(screenshare_params_low), @@ -642,9 +459,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_3TL_Simulcast) { TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) { VideoQualityTest::Params config; config.call.send_side_bwe = true; - config.video = {true, 1850, 1110 / 2, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + config.video = {true, 1850, 1110 / 2, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; config.screenshare = {true, false, 10, 2}; config.analyzer = {"screenshare_slides_scrolling", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -654,9 +470,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_Scroll) { TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_lossy_net", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -669,9 +484,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNet) { TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_very_lossy", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -684,9 +498,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_VeryLossyNet) { TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_lossy_limited", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -700,9 +513,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue) { TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_ModeratelyRestricted) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_moderately_restricted", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -718,9 +530,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_LossyNetRestrictedQueue_ALR) { test::ScopedFieldTrials field_trial(kAlrProbingExperiment); VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_lossy_limited_ALR", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -735,9 +546,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_ALR) { test::ScopedFieldTrials field_trial(kAlrProbingExperiment); VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_ALR", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -748,9 +558,8 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_2TL_ModeratelyRestricted_ALR) { test::ScopedFieldTrials field_trial(kAlrProbingExperiment); VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 1, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP8", 2, 1, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_moderately_restricted_ALR", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -767,19 +576,19 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_3TL_Simulcast_ALR) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; screenshare.screenshare = {true, false, 10}; - screenshare.video = {true, 1850, 1110, 5, 800000, 2500000, - 2500000, false, "VP8", false, false, 3, - 2, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 800000, + 2500000, 2500000, false, "VP8", 3, + 2, 400000, false, false, ""}; screenshare.analyzer = {"screenshare_slides_simulcast_alr", 0.0, 0.0, kFullStackTestDurationSecs}; VideoQualityTest::Params screenshare_params_high; - screenshare_params_high.video = { - true, 1850, 1110, 5, 800000, 2500000, 2500000, false, "VP8", - false, false, 3, 0, 400000, false, false, ""}; + screenshare_params_high.video = {true, 1850, 1110, 5, 800000, + 2500000, 2500000, false, "VP8", 3, + 0, 400000, false, false, ""}; VideoQualityTest::Params screenshare_params_low; - screenshare_params_low.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP8", false, false, 2, - 0, 400000, false, false, ""}; + screenshare_params_low.video = {true, 1850, 1110, 5, 50000, + 200000, 2000000, false, "VP8", 2, + 0, 400000, false, false, ""}; std::vector streams = { DefaultVideoStream(screenshare_params_low), @@ -789,88 +598,31 @@ TEST_F(FullStackTest, ScreenshareSlidesVP8_3TL_Simulcast_ALR) { } const VideoQualityTest::Params::Video kSvcVp9Video = { - true, - 1280, - 720, - 30, - 800000, - 2500000, - 2500000, - false, - "VP9", - false, - false, - 3, - 2, - 400000, - false, - false, - "ConferenceMotion_1280_720_50"}; + true, 1280, 720, 30, 800000, + 2500000, 2500000, false, "VP9", 3, + 2, 400000, false, false, "ConferenceMotion_1280_720_50"}; const VideoQualityTest::Params::Video kSimulcastVp8VideoHigh = { - true, - 1280, - 720, - 30, - 800000, - 2500000, - 2500000, - false, - "VP8", - false, - false, - 3, - 2, - 400000, - false, - false, - "ConferenceMotion_1280_720_50"}; + true, 1280, 720, 30, 800000, + 2500000, 2500000, false, "VP8", 3, + 2, 400000, false, false, "ConferenceMotion_1280_720_50"}; const VideoQualityTest::Params::Video kSimulcastVp8VideoMedium = { - true, - 640, - 360, - 30, - 150000, - 500000, - 700000, - false, - "VP8", - false, - false, - 3, - 2, - 400000, - false, - false, - "ConferenceMotion_1280_720_50"}; + true, 640, 360, 30, 150000, + 500000, 700000, false, "VP8", 3, + 2, 400000, false, false, "ConferenceMotion_1280_720_50"}; const VideoQualityTest::Params::Video kSimulcastVp8VideoLow = { - true, - 320, - 180, - 30, - 30000, - 150000, - 200000, - false, - "VP8", - false, - false, - 3, - 2, - 400000, - false, - false, - "ConferenceMotion_1280_720_50"}; + true, 320, 180, 30, 30000, + 150000, 200000, false, "VP8", 3, + 2, 400000, false, false, "ConferenceMotion_1280_720_50"}; #if !defined(RTC_DISABLE_VP9) TEST_F(FullStackTest, ScreenshareSlidesVP9_2SL) { VideoQualityTest::Params screenshare; screenshare.call.send_side_bwe = true; - screenshare.video = {true, 1850, 1110, 5, 50000, 200000, - 2000000, false, "VP9", false, false, 1, - 0, 400000, false, false, ""}; + screenshare.video = {true, 1850, 1110, 5, 50000, 200000, 2000000, false, + "VP9", 1, 0, 400000, false, false, ""}; screenshare.screenshare = {true, false, 10}; screenshare.analyzer = {"screenshare_slides_vp9_2sl", 0.0, 0.0, kFullStackTestDurationSecs}; @@ -922,9 +674,9 @@ TEST_F(FullStackTest, VP9SVC_3SL_Low) { TEST_F(FullStackTest, MAYBE_SimulcastFullHdOveruse) { VideoQualityTest::Params simulcast; simulcast.call.send_side_bwe = true; - simulcast.video = {true, 1920, 1080, 30, 800000, 2500000, - 2500000, false, "VP8", false, false, 3, - 2, 400000, false, false, "Generator"}; + simulcast.video = {true, 1920, 1080, 30, 800000, + 2500000, 2500000, false, "VP8", 3, + 2, 400000, false, false, "Generator"}; simulcast.analyzer = {"simulcast_HD_high", 0.0, 0.0, kFullStackTestDurationSecs}; simulcast.pipe.loss_percent = 0; diff --git a/video/screenshare_loopback.cc b/video/screenshare_loopback.cc index 6d26762cd5..8cb81937e2 100644 --- a/video/screenshare_loopback.cc +++ b/video/screenshare_loopback.cc @@ -279,8 +279,6 @@ void Loopback() { flags::MaxBitrateKbps() * 1000, false, flags::Codec(), - false, // No HW encoder. - false, // No SW fallback encoder. flags::NumTemporalLayers(), flags::SelectedTL(), flags::MinTransmitBitrateKbps() * 1000, diff --git a/video/video_loopback.cc b/video/video_loopback.cc index 5ade6f11eb..d5d525aa12 100644 --- a/video/video_loopback.cc +++ b/video/video_loopback.cc @@ -276,8 +276,6 @@ void Loopback() { flags::MaxBitrateKbps() * 1000, flags::FLAG_suspend_below_min_bitrate, flags::Codec(), - false, // No HW encoder. - false, // No SW fallback encoder. flags::NumTemporalLayers(), flags::SelectedTL(), 0, // No min transmit bitrate. diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc index 32df77d2e8..2bfe0e3d8f 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -18,20 +18,10 @@ #include #include -#if defined(WEBRTC_ANDROID) -#include "modules/video_coding/codecs/test/android_test_initializer.h" -#include "sdk/android/src/jni/androidmediadecoder_jni.h" -#include "sdk/android/src/jni/androidmediaencoder_jni.h" -#elif defined(WEBRTC_IOS) -#include "modules/video_coding/codecs/test/objc_codec_h264_test.h" -#endif - #include "api/optional.h" #include "call/call.h" #include "common_video/libyuv/include/webrtc_libyuv.h" #include "logging/rtc_event_log/rtc_event_log.h" -#include "media/engine/internalencoderfactory.h" -#include "media/engine/videoencodersoftwarefallbackwrapper.h" #include "media/engine/webrtcvideoengine.h" #include "modules/audio_mixer/audio_mixer_impl.h" #include "modules/rtp_rtcp/include/rtp_header_parser.h" @@ -1138,6 +1128,35 @@ class VideoAnalyzer : public PacketReceiver, const int64_t start_ms_; }; +class Vp8EncoderFactory : public cricket::WebRtcVideoEncoderFactory { + public: + Vp8EncoderFactory() { + supported_codecs_.push_back(cricket::VideoCodec("VP8")); + } + ~Vp8EncoderFactory() override { RTC_CHECK(live_encoders_.empty()); } + + const std::vector& supported_codecs() const override { + return supported_codecs_; + } + + VideoEncoder* CreateVideoEncoder(const cricket::VideoCodec& codec) override { + VideoEncoder* encoder = VP8Encoder::Create(); + live_encoders_.insert(encoder); + return encoder; + } + + void DestroyVideoEncoder(VideoEncoder* encoder) override { + auto it = live_encoders_.find(encoder); + RTC_CHECK(it != live_encoders_.end()); + live_encoders_.erase(it); + delete encoder; + } + + private: + std::vector supported_codecs_; + std::set live_encoders_; +}; + VideoQualityTest::VideoQualityTest() : clock_(Clock::GetRealTimeClock()), receive_logs_(0), send_logs_(0) { payload_type_map_ = test::CallTest::payload_type_map_; @@ -1150,16 +1169,12 @@ VideoQualityTest::VideoQualityTest() payload_type_map_[kPayloadTypeH264] = webrtc::MediaType::VIDEO; payload_type_map_[kPayloadTypeVP8] = webrtc::MediaType::VIDEO; payload_type_map_[kPayloadTypeVP9] = webrtc::MediaType::VIDEO; - -#if defined(WEBRTC_ANDROID) - InitializeAndroidObjects(); -#endif } VideoQualityTest::Params::Params() : call({false, Call::Config::BitrateConfig(), 0}), - video({false, 640, 480, 30, 50, 800, 800, false, "VP8", false, false, 1, - -1, 0, false, false, ""}), + video({false, 640, 480, 30, 50, 800, 800, false, "VP8", 1, -1, 0, false, + false, ""}), audio({false, false, false}), screenshare({false, false, 10, 0}), analyzer({"", 0.0, 0.0, 0, "", ""}), @@ -1398,51 +1413,28 @@ void VideoQualityTest::SetupVideo(Transport* send_transport, size_t num_flexfec_streams = params_.video.flexfec ? 1 : 0; CreateSendConfig(num_video_streams, 0, num_flexfec_streams, send_transport); - if (params_.video.hw_encoder) { -#if defined(WEBRTC_ANDROID) - video_encoder_factory_.reset(new jni::MediaCodecVideoEncoderFactory()); -#elif defined(WEBRTC_IOS) - video_encoder_factory_ = CreateObjCEncoderFactory(); -#else - RTC_NOTREACHED() << "Only support HW encoder on Android and iOS."; -#endif - } else { - video_encoder_factory_.reset(new cricket::InternalEncoderFactory()); - } - - cricket::VideoCodec codec; int payload_type; if (params_.video.codec == "H264") { - // TODO(brandtr): Add support for high profile here. - codec = cricket::VideoCodec(cricket::kH264CodecName); - video_encoder_.reset(video_encoder_factory_->CreateVideoEncoder(codec)); + video_encoder_.reset(H264Encoder::Create(cricket::VideoCodec("H264"))); payload_type = kPayloadTypeH264; } else if (params_.video.codec == "VP8") { - codec = cricket::VideoCodec(cricket::kVp8CodecName); if (params_.screenshare.enabled && params_.ss.streams.size() > 1) { - // Simulcast screenshare needs a simulcast encoder adapter to work, - // since encoders usually can't natively do simulcast with - // different frame rates for the different layers. + // Simulcast screenshare needs a simulcast encoder adapter to work, since + // encoders usually can't natively do simulcast with different frame rates + // for the different layers. video_encoder_.reset( - new SimulcastEncoderAdapter(video_encoder_factory_.get())); + new SimulcastEncoderAdapter(new Vp8EncoderFactory())); } else { - video_encoder_.reset(video_encoder_factory_->CreateVideoEncoder(codec)); + video_encoder_.reset(VP8Encoder::Create()); } payload_type = kPayloadTypeVP8; } else if (params_.video.codec == "VP9") { - codec = cricket::VideoCodec(cricket::kVp9CodecName); - video_encoder_.reset(video_encoder_factory_->CreateVideoEncoder(codec)); + video_encoder_.reset(VP9Encoder::Create()); payload_type = kPayloadTypeVP9; } else { RTC_NOTREACHED() << "Codec not supported!"; return; } - - if (params_.video.sw_fallback_encoder) { - video_encoder_ = rtc::MakeUnique( - codec, std::move(video_encoder_)); - } - video_send_config_.encoder_settings.encoder = video_encoder_.get(); video_send_config_.encoder_settings.payload_name = params_.video.codec; video_send_config_.encoder_settings.payload_type = payload_type; @@ -1973,7 +1965,7 @@ void VideoQualityTest::SetupAudio(int send_channel_id, {"OPUS", 48000, 2, {{"usedtx", (params_.audio.dtx ? "1" : "0")}, {"stereo", "1"}}}}); - audio_send_config_.encoder_factory = audio_encoder_factory_; + audio_send_config_.encoder_factory = encoder_factory_; audio_send_stream_ = sender_call_->CreateAudioSendStream(audio_send_config_); AudioReceiveStream::Config audio_config; @@ -1983,7 +1975,7 @@ void VideoQualityTest::SetupAudio(int send_channel_id, audio_config.rtp.remote_ssrc = audio_send_config_.rtp.ssrc; audio_config.rtp.transport_cc = params_.call.send_side_bwe; audio_config.rtp.extensions = audio_send_config_.rtp.extensions; - audio_config.decoder_factory = audio_decoder_factory_; + audio_config.decoder_factory = decoder_factory_; audio_config.decoder_map = {{kAudioSendPayloadType, {"OPUS", 48000, 2}}}; if (params_.video.enabled && params_.audio.sync_video) audio_config.sync_group = kSyncGroup; @@ -2013,7 +2005,7 @@ void VideoQualityTest::RunWithRenderers(const Params& params) { webrtc::AudioProcessing::Create()); if (params_.audio.enabled) { - CreateVoiceEngine(&voe, audio_processing.get(), audio_decoder_factory_); + CreateVoiceEngine(&voe, audio_processing.get(), decoder_factory_); AudioState::Config audio_state_config; audio_state_config.voice_engine = voe.voice_engine; audio_state_config.audio_mixer = AudioMixerImpl::Create(); diff --git a/video/video_quality_test.h b/video/video_quality_test.h index bbbd0c8b32..c16105c3cb 100644 --- a/video/video_quality_test.h +++ b/video/video_quality_test.h @@ -16,7 +16,6 @@ #include #include "media/engine/simulcast_encoder_adapter.h" -#include "media/engine/webrtcvideoencoderfactory.h" #include "test/call_test.h" #include "test/frame_generator.h" #include "test/testsupport/trace_to_stderr.h" @@ -47,8 +46,6 @@ class VideoQualityTest : public test::CallTest { int max_bitrate_bps; bool suspend_below_min_bitrate; std::string codec; - bool hw_encoder; - bool sw_fallback_encoder; int num_temporal_layers; int selected_tl; int min_transmit_bps; @@ -145,8 +142,8 @@ class VideoQualityTest : public test::CallTest { std::vector> thumbnail_capturers_; std::unique_ptr trace_to_stderr_; std::unique_ptr frame_generator_; - std::unique_ptr video_encoder_factory_; std::unique_ptr video_encoder_; + std::unique_ptr vp8_encoder_factory_; std::vector> thumbnail_encoders_; std::vector thumbnail_send_configs_;