From 42c59525b199ae05f31f69cc1729bb78f0ec6008 Mon Sep 17 00:00:00 2001 From: Andrey Logvin Date: Wed, 6 May 2020 12:18:26 +0000 Subject: [PATCH] Create default frame generator in the AddVideoConfig method. Bug: webrtc:11534 Change-Id: I5f8e6009ac48be99180574ab3ac835005f67cf58 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174540 Reviewed-by: Karl Wiberg Reviewed-by: Artem Titov Commit-Queue: Andrey Logvin Cr-Commit-Position: refs/heads/master@{#31176} --- .../peerconnection_quality_test_fixture.h | 1 + test/pc/e2e/peer_configurer.cc | 1 - test/pc/e2e/peer_configurer.h | 4 ++- test/pc/e2e/peer_connection_e2e_smoke_test.cc | 26 ++++++------------- video/pc_full_stack_tests.cc | 3 +-- 5 files changed, 13 insertions(+), 22 deletions(-) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index a5ccc4c0a3..64671bfa99 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -310,6 +310,7 @@ class PeerConnectionE2EQualityTestFixture { std::unique_ptr factory) = 0; // Add new video stream to the call that will be sent from this peer. + // Default implementation of video frames generator will be used. virtual PeerConfigurer* AddVideoConfig(VideoConfig config) = 0; // Add new video stream to the call that will be sent from this peer with // provided own implementation of video frames generator. diff --git a/test/pc/e2e/peer_configurer.cc b/test/pc/e2e/peer_configurer.cc index b9c04e3c7d..81f0fdb4f2 100644 --- a/test/pc/e2e/peer_configurer.cc +++ b/test/pc/e2e/peer_configurer.cc @@ -12,7 +12,6 @@ #include -#include "api/test/create_peer_connection_quality_test_frame_generator.h" #include "test/testsupport/file_utils.h" namespace webrtc { diff --git a/test/pc/e2e/peer_configurer.h b/test/pc/e2e/peer_configurer.h index bd6728a2be..3dd23c6a60 100644 --- a/test/pc/e2e/peer_configurer.h +++ b/test/pc/e2e/peer_configurer.h @@ -20,6 +20,7 @@ #include "api/fec_controller.h" #include "api/rtc_event_log/rtc_event_log_factory_interface.h" #include "api/task_queue/task_queue_factory.h" +#include "api/test/create_peer_connection_quality_test_frame_generator.h" #include "api/test/peerconnection_quality_test_fixture.h" #include "api/transport/media/media_transport_interface.h" #include "api/transport/network_control.h" @@ -116,8 +117,9 @@ class PeerConfigurerImpl final PeerConfigurer* AddVideoConfig( PeerConnectionE2EQualityTestFixture::VideoConfig config) override { + video_generators_.push_back( + CreateSquareFrameGenerator(config, /*type=*/absl::nullopt)); params_->video_configs.push_back(std::move(config)); - video_generators_.push_back(nullptr); return this; } PeerConfigurer* AddVideoConfig( diff --git a/test/pc/e2e/peer_connection_e2e_smoke_test.cc b/test/pc/e2e/peer_connection_e2e_smoke_test.cc index 7e88b2bcfd..c88f9059d5 100644 --- a/test/pc/e2e/peer_connection_e2e_smoke_test.cc +++ b/test/pc/e2e/peer_connection_e2e_smoke_test.cc @@ -150,8 +150,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) { VideoConfig video(640, 360, 30); video.stream_label = "alice-video"; video.sync_group = "alice-media"; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->AddVideoConfig(std::move(video)); AudioConfig audio; audio.stream_label = "alice-audio"; @@ -166,8 +165,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) { VideoConfig video(640, 360, 30); video.stream_label = "bob-video"; video.temporal_layers_count = 2; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - bob->AddVideoConfig(std::move(video), std::move(frame_generator)); + bob->AddVideoConfig(std::move(video)); VideoConfig screenshare(640, 360, 30); screenshare.stream_label = "bob-screenshare"; @@ -234,9 +232,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) { VideoConfig simulcast(1280, 720, 30); simulcast.stream_label = "alice-simulcast"; simulcast.simulcast_config = VideoSimulcastConfig(3, 0); - auto frame_generator = - CreateSquareFrameGenerator(simulcast, absl::nullopt); - alice->AddVideoConfig(std::move(simulcast), std::move(frame_generator)); + alice->AddVideoConfig(std::move(simulcast)); AudioConfig audio; audio.stream_label = "alice-audio"; @@ -248,8 +244,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) { [](PeerConfigurer* bob) { VideoConfig video(640, 360, 30); video.stream_label = "bob-video"; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - bob->AddVideoConfig(std::move(video), std::move(frame_generator)); + bob->AddVideoConfig(std::move(video)); AudioConfig audio; audio.stream_label = "bob-audio"; @@ -277,9 +272,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) { // Because we have network with packets loss we can analyze only the // highest spatial layer in SVC mode. simulcast.simulcast_config = VideoSimulcastConfig(3, 2); - auto frame_generator = - CreateSquareFrameGenerator(simulcast, absl::nullopt); - alice->AddVideoConfig(std::move(simulcast), std::move(frame_generator)); + alice->AddVideoConfig(std::move(simulcast)); AudioConfig audio; audio.stream_label = "alice-audio"; @@ -291,8 +284,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) { [](PeerConfigurer* bob) { VideoConfig video(640, 360, 30); video.stream_label = "bob-video"; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - bob->AddVideoConfig(std::move(video), std::move(frame_generator)); + bob->AddVideoConfig(std::move(video)); AudioConfig audio; audio.stream_label = "bob-audio"; @@ -325,8 +317,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_HighBitrate) { video.stream_label = "alice-video"; video.min_encode_bitrate_bps = 500'000; video.max_encode_bitrate_bps = 3'000'000; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->AddVideoConfig(std::move(video)); AudioConfig audio; audio.stream_label = "alice-audio"; @@ -345,8 +336,7 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_HighBitrate) { video.stream_label = "bob-video"; video.min_encode_bitrate_bps = 500'000; video.max_encode_bitrate_bps = 3'000'000; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - bob->AddVideoConfig(std::move(video), std::move(frame_generator)); + bob->AddVideoConfig(std::move(video)); AudioConfig audio; audio.stream_label = "bob-audio"; diff --git a/video/pc_full_stack_tests.cc b/video/pc_full_stack_tests.cc index d034b4effd..f86ac98cf4 100644 --- a/video/pc_full_stack_tests.cc +++ b/video/pc_full_stack_tests.cc @@ -1625,8 +1625,7 @@ TEST(PCFullStackTest, MAYBE_SimulcastFullHdOveruse) { video.simulcast_config = VideoSimulcastConfig(3, 2); video.temporal_layers_count = 3; video.stream_label = "alice-video"; - auto frame_generator = CreateSquareFrameGenerator(video, absl::nullopt); - alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->AddVideoConfig(std::move(video)); }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec));