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 <ilnik@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28078}
This commit is contained in:
Artem Titov
2019-05-27 15:28:30 +02:00
committed by Commit Bot
parent 36bc4f810d
commit 2370242acf
3 changed files with 26 additions and 0 deletions

View File

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

View File

@ -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<test::ScopedFieldTrials>(
field_trial::GetFieldTrialString() + field_trials);
}
}
void PeerConnectionE2EQualityTest::OnTrackCallback(
rtc::scoped_refptr<RtpTransceiverInterface> transceiver,
std::vector<VideoConfig> remote_video_configs) {

View File

@ -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*> 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<RtpTransceiverInterface> transceiver,
std::vector<VideoConfig> remote_video_configs);
// Have to be run on the signaling thread.
@ -244,6 +248,8 @@ class PeerConnectionE2EQualityTest
std::vector<std::unique_ptr<PeerConfigurerImpl>> peer_configurations_;
std::unique_ptr<test::ScopedFieldTrials> override_field_trials_ = nullptr;
std::unique_ptr<TestPeer> alice_;
std::unique_ptr<TestPeer> bob_;
std::vector<std::unique_ptr<QualityMetricsReporter>>