From b3d29104daadb231f59837a918f540659c1ee7d2 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Wed, 4 Aug 2021 15:33:23 +0200 Subject: [PATCH] Add ctor with stream label for audio and video configs in PCLF Bug: None Change-Id: I8354c53232ee6c4479316a928f657abecbf95b48 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227640 Reviewed-by: Mirko Bonadei Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#34644} --- api/test/peerconnection_quality_test_fixture.h | 13 +++++++++++++ test/pc/e2e/peer_connection_e2e_smoke_test.cc | 6 ++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index 7aedd2def4..031b795971 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -179,6 +179,14 @@ class PeerConnectionE2EQualityTestFixture { struct VideoConfig { VideoConfig(size_t width, size_t height, int32_t fps) : width(width), height(height), fps(fps) {} + VideoConfig(std::string stream_label, + size_t width, + size_t height, + int32_t fps) + : width(width), + height(height), + fps(fps), + stream_label(std::move(stream_label)) {} // Video stream width. const size_t width; @@ -247,6 +255,11 @@ class PeerConnectionE2EQualityTestFixture { kGenerated, kFile, }; + + AudioConfig() = default; + explicit AudioConfig(std::string stream_label) + : stream_label(std::move(stream_label)) {} + // Have to be unique among all specified configs for all peers in the call. // Will be auto generated if omitted. absl::optional stream_label; diff --git a/test/pc/e2e/peer_connection_e2e_smoke_test.cc b/test/pc/e2e/peer_connection_e2e_smoke_test.cc index 92104c7395..2c9df0cf2a 100644 --- a/test/pc/e2e/peer_connection_e2e_smoke_test.cc +++ b/test/pc/e2e/peer_connection_e2e_smoke_test.cc @@ -341,15 +341,13 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) { std::pair network_links = CreateNetwork(); AddPeer(network_links.first, [](PeerConfigurer* alice) { - VideoConfig simulcast(1280, 720, 15); - simulcast.stream_label = "alice-svc"; + VideoConfig simulcast("alice-svc", 1280, 720, 15); // Because we have network with packets loss we can analyze only the // highest spatial layer in SVC mode. simulcast.simulcast_config = VideoSimulcastConfig(2, 1); alice->AddVideoConfig(std::move(simulcast)); - AudioConfig audio; - audio.stream_label = "alice-audio"; + AudioConfig audio("alice-audio"); audio.mode = AudioConfig::Mode::kFile; audio.input_file_name = test::ResourcePath("pc_quality_smoke_test_alice_source", "wav");