From 2370242acf4ccacccf554137bd735d21aae3e53f Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Mon, 27 May 2019 15:28:30 +0200 Subject: [PATCH] Enable flex fec support in PC quality test framework Bug: webrtc:10138, webrtc:10683 Change-Id: I9235fef99d3ea857f10234fdd82e8468480f71a1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/138822 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#28078} --- test/pc/e2e/BUILD.gn | 2 ++ test/pc/e2e/peer_connection_quality_test.cc | 18 ++++++++++++++++++ test/pc/e2e/peer_connection_quality_test.h | 6 ++++++ 3 files changed, 26 insertions(+) diff --git a/test/pc/e2e/BUILD.gn b/test/pc/e2e/BUILD.gn index 0c5f36e37e..b0d72a9252 100644 --- a/test/pc/e2e/BUILD.gn +++ b/test/pc/e2e/BUILD.gn @@ -239,6 +239,7 @@ if (rtc_include_tests) { ":stats_poller", ":test_peer", ":video_quality_analyzer_injection_helper", + "../..:field_trial", "../../../api:audio_quality_analyzer_api", "../../../api:libjingle_peerconnection_api", "../../../api:peer_connection_quality_test_fixture_api", @@ -260,6 +261,7 @@ if (rtc_include_tests) { "../../../rtc_base:task_queue_for_test", "../../../rtc_base/task_utils:repeating_task", "../../../system_wrappers", + "../../../system_wrappers:field_trial", "../../../test:fileutils", "../../../test:video_test_support", "//third_party/abseil-cpp/absl/memory", diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index 5541f13bda..7e7a47c59b 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -28,6 +28,7 @@ #include "rtc_base/gunit.h" #include "rtc_base/numerics/safe_conversions.h" #include "system_wrappers/include/cpu_info.h" +#include "system_wrappers/include/field_trial.h" #include "test/pc/e2e/analyzer/audio/default_audio_quality_analyzer.h" #include "test/pc/e2e/analyzer/video/default_video_quality_analyzer.h" #include "test/pc/e2e/sdp/sdp_changer.h" @@ -54,6 +55,10 @@ constexpr TimeDelta kStatsPollingStopTimeout = TimeDelta::Seconds<1>(); constexpr TimeDelta kAliveMessageLogInterval = TimeDelta::Seconds<30>(); +// Field trials to enable Flex FEC advertising and receiving. +constexpr char kFlexFecEnabledFieldTrials[] = + "WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/"; + std::string VideoConfigSourcePresenceToString(const VideoConfig& video_config) { char buf[1024]; rtc::SimpleStringBuilder builder(buf); @@ -231,6 +236,7 @@ void PeerConnectionE2EQualityTest::Run( SetDefaultValuesForMissingParams({alice_params.get(), bob_params.get()}); ValidateParams(run_params, {alice_params.get(), bob_params.get()}); + SetupRequiredFieldTrials(run_params); // Print test summary RTC_LOG(INFO) @@ -533,6 +539,18 @@ void PeerConnectionE2EQualityTest::ValidateParams(const RunParams& run_params, RTC_CHECK_GT(media_streams_count, 0) << "No media in the call."; } +void PeerConnectionE2EQualityTest::SetupRequiredFieldTrials( + const RunParams& run_params) { + std::string field_trials = ""; + if (run_params.use_flex_fec) { + field_trials += kFlexFecEnabledFieldTrials; + } + if (!field_trials.empty()) { + override_field_trials_ = absl::make_unique( + field_trial::GetFieldTrialString() + field_trials); + } +} + void PeerConnectionE2EQualityTest::OnTrackCallback( rtc::scoped_refptr transceiver, std::vector remote_video_configs) { diff --git a/test/pc/e2e/peer_connection_quality_test.h b/test/pc/e2e/peer_connection_quality_test.h index 5db8f036d4..cc00a9a04c 100644 --- a/test/pc/e2e/peer_connection_quality_test.h +++ b/test/pc/e2e/peer_connection_quality_test.h @@ -27,6 +27,7 @@ #include "rtc_base/thread.h" #include "rtc_base/thread_annotations.h" #include "system_wrappers/include/clock.h" +#include "test/field_trial.h" #include "test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h" #include "test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h" #include "test/pc/e2e/analyzer_helper.h" @@ -208,6 +209,9 @@ class PeerConnectionE2EQualityTest // Validate peer's parameters, also ensure uniqueness of all video stream // labels. void ValidateParams(const RunParams& run_params, std::vector params); + // For some functionality some field trials have to be enabled, so we will + // enable them here. + void SetupRequiredFieldTrials(const RunParams& run_params); void OnTrackCallback(rtc::scoped_refptr transceiver, std::vector remote_video_configs); // Have to be run on the signaling thread. @@ -244,6 +248,8 @@ class PeerConnectionE2EQualityTest std::vector> peer_configurations_; + std::unique_ptr override_field_trials_ = nullptr; + std::unique_ptr alice_; std::unique_ptr bob_; std::vector>