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 <kwiberg@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31176}
This commit is contained in:
Andrey Logvin 2020-05-06 12:18:26 +00:00 committed by Commit Bot
parent f00ed5be2a
commit 42c59525b1
5 changed files with 13 additions and 22 deletions

View File

@ -310,6 +310,7 @@ class PeerConnectionE2EQualityTestFixture {
std::unique_ptr<IceTransportFactory> 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.

View File

@ -12,7 +12,6 @@
#include <set>
#include "api/test/create_peer_connection_quality_test_frame_generator.h"
#include "test/testsupport/file_utils.h"
namespace webrtc {

View File

@ -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(

View File

@ -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";

View File

@ -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));