Moved ALR experiment settings to new experiments folder.

This replaces most of the existing dependencies on the application
limited region(ALR) detector. This is to achieve a greater separation of
concerns and will make further refactoring regarding the ALR Detector
less invasive on other parts of the code base.

Bug: webrtc:8415
Change-Id: I92912254c6d02285cce6a88f6789f0ac94794c88
Reviewed-on: https://webrtc-review.googlesource.com/37560
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21598}
This commit is contained in:
Sebastian Jansson 2018-01-12 10:54:18 +01:00 committed by Commit Bot
parent 0a52f1def6
commit cabe3838bb
17 changed files with 187 additions and 110 deletions

View File

@ -40,6 +40,7 @@ rtc_static_library("pacing") {
"../../logging:rtc_event_log_api", "../../logging:rtc_event_log_api",
"../../rtc_base:checks", "../../rtc_base:checks",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base/experiments:alr_experiment",
"../../system_wrappers", "../../system_wrappers",
"../../system_wrappers:field_trial_api", "../../system_wrappers:field_trial_api",
"../remote_bitrate_estimator", "../remote_bitrate_estimator",
@ -65,6 +66,7 @@ if (rtc_include_tests) {
"../../rtc_base:checks", "../../rtc_base:checks",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_base_tests_utils", "../../rtc_base:rtc_base_tests_utils",
"../../rtc_base/experiments:alr_experiment",
"../../system_wrappers", "../../system_wrappers",
"../../system_wrappers:field_trial_api", "../../system_wrappers:field_trial_api",
"../../test:field_trial", "../../test:field_trial",

View File

@ -10,11 +10,13 @@
#include "modules/pacing/alr_detector.h" #include "modules/pacing/alr_detector.h"
#include <algorithm>
#include <string> #include <string>
#include "logging/rtc_event_log/events/rtc_event_alr_state.h" #include "logging/rtc_event_log/events/rtc_event_alr_state.h"
#include "logging/rtc_event_log/rtc_event_log.h" #include "logging/rtc_event_log/rtc_event_log.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "rtc_base/format_macros.h" #include "rtc_base/format_macros.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/ptr_util.h" #include "rtc_base/ptr_util.h"
@ -22,13 +24,6 @@
#include "system_wrappers/include/field_trial.h" #include "system_wrappers/include/field_trial.h"
namespace webrtc { namespace webrtc {
const char AlrDetector::kScreenshareProbingBweExperimentName[] =
"WebRTC-ProbingScreenshareBwe";
const char AlrDetector::kStrictPacingAndProbingExperimentName[] =
"WebRTC-StrictPacingAndProbing";
const char kDefaultProbingScreenshareBweSettings[] = "1.0,2875,80,40,-60,3";
AlrDetector::AlrDetector() : AlrDetector(nullptr) {} AlrDetector::AlrDetector() : AlrDetector(nullptr) {}
AlrDetector::AlrDetector(RtcEventLog* event_log) AlrDetector::AlrDetector(RtcEventLog* event_log)
@ -37,15 +32,13 @@ AlrDetector::AlrDetector(RtcEventLog* event_log)
alr_stop_budget_level_percent_(kDefaultAlrStopBudgetLevelPercent), alr_stop_budget_level_percent_(kDefaultAlrStopBudgetLevelPercent),
alr_budget_(0, true), alr_budget_(0, true),
event_log_(event_log) { event_log_(event_log) {
RTC_CHECK( RTC_CHECK(AlrExperimentSettings::MaxOneFieldTrialEnabled());
field_trial::FindFullName(kStrictPacingAndProbingExperimentName)
.empty() ||
field_trial::FindFullName(kScreenshareProbingBweExperimentName).empty());
rtc::Optional<AlrExperimentSettings> experiment_settings = rtc::Optional<AlrExperimentSettings> experiment_settings =
ParseAlrSettingsFromFieldTrial(kScreenshareProbingBweExperimentName); AlrExperimentSettings::CreateFromFieldTrial(
AlrExperimentSettings::kScreenshareProbingBweExperimentName);
if (!experiment_settings) { if (!experiment_settings) {
experiment_settings = experiment_settings = AlrExperimentSettings::CreateFromFieldTrial(
ParseAlrSettingsFromFieldTrial(kStrictPacingAndProbingExperimentName); AlrExperimentSettings::kStrictPacingAndProbingExperimentName);
} }
if (experiment_settings) { if (experiment_settings) {
alr_stop_budget_level_percent_ = alr_stop_budget_level_percent_ =
@ -80,7 +73,7 @@ void AlrDetector::OnBytesSent(size_t bytes_sent, int64_t delta_time_ms) {
void AlrDetector::SetEstimatedBitrate(int bitrate_bps) { void AlrDetector::SetEstimatedBitrate(int bitrate_bps) {
RTC_DCHECK(bitrate_bps); RTC_DCHECK(bitrate_bps);
const auto target_rate_kbps = int64_t{bitrate_bps} * const auto target_rate_kbps = static_cast<int64_t>(bitrate_bps) *
bandwidth_usage_percent_ / (1000 * 100); bandwidth_usage_percent_ / (1000 * 100);
alr_budget_.set_target_rate_kbps(rtc::dchecked_cast<int>(target_rate_kbps)); alr_budget_.set_target_rate_kbps(rtc::dchecked_cast<int>(target_rate_kbps));
} }
@ -89,54 +82,4 @@ rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime()
const { const {
return alr_started_time_ms_; return alr_started_time_ms_;
} }
rtc::Optional<AlrDetector::AlrExperimentSettings>
AlrDetector::ParseAlrSettingsFromFieldTrial(const char* experiment_name) {
rtc::Optional<AlrExperimentSettings> ret;
std::string group_name = field_trial::FindFullName(experiment_name);
const std::string kIgnoredSuffix = "_Dogfood";
std::string::size_type suffix_pos = group_name.rfind(kIgnoredSuffix);
if (suffix_pos != std::string::npos &&
suffix_pos == group_name.length() - kIgnoredSuffix.length()) {
group_name.resize(group_name.length() - kIgnoredSuffix.length());
}
if (experiment_name == kScreenshareProbingBweExperimentName) {
// This experiment is now default-on with fixed settings.
// TODO(sprang): Remove this kill-switch and clean up experiment code.
if (group_name != "Disabled") {
group_name = kDefaultProbingScreenshareBweSettings;
}
}
if (group_name.empty())
return ret;
AlrExperimentSettings settings;
if (sscanf(group_name.c_str(), "%f,%" PRId64 ",%d,%d,%d,%d",
&settings.pacing_factor, &settings.max_paced_queue_time,
&settings.alr_bandwidth_usage_percent,
&settings.alr_start_budget_level_percent,
&settings.alr_stop_budget_level_percent,
&settings.group_id) == 6) {
ret.emplace(settings);
RTC_LOG(LS_INFO) << "Using ALR experiment settings: "
"pacing factor: "
<< settings.pacing_factor << ", max pacer queue length: "
<< settings.max_paced_queue_time
<< ", ALR start bandwidth usage percent: "
<< settings.alr_bandwidth_usage_percent
<< ", ALR end budget level percent: "
<< settings.alr_start_budget_level_percent
<< ", ALR end budget level percent: "
<< settings.alr_stop_budget_level_percent
<< ", ALR experiment group ID: " << settings.group_id;
} else {
RTC_LOG(LS_INFO) << "Failed to parse ALR experiment: " << experiment_name;
}
return ret;
}
} // namespace webrtc } // namespace webrtc

View File

@ -44,20 +44,6 @@ class AlrDetector {
// started or empty result if the sender is currently not application-limited. // started or empty result if the sender is currently not application-limited.
rtc::Optional<int64_t> GetApplicationLimitedRegionStartTime() const; rtc::Optional<int64_t> GetApplicationLimitedRegionStartTime() const;
struct AlrExperimentSettings {
float pacing_factor = PacedSender::kDefaultPaceMultiplier;
int64_t max_paced_queue_time = PacedSender::kMaxQueueLengthMs;
int alr_bandwidth_usage_percent = kDefaultAlrBandwidthUsagePercent;
int alr_start_budget_level_percent = kDefaultAlrStartBudgetLevelPercent;
int alr_stop_budget_level_percent = kDefaultAlrStopBudgetLevelPercent;
// Will be sent to the receive side for stats slicing.
// Can be 0..6, because it's sent as a 3 bits value and there's also
// reserved value to indicate absence of experiment.
int group_id = 0;
};
static rtc::Optional<AlrExperimentSettings> ParseAlrSettingsFromFieldTrial(
const char* experiment_name);
// Sent traffic percentage as a function of network capacity used to determine // Sent traffic percentage as a function of network capacity used to determine
// application-limited region. ALR region start when bandwidth usage drops // application-limited region. ALR region start when bandwidth usage drops
// below kAlrStartUsagePercent and ends when it raises above // below kAlrStartUsagePercent and ends when it raises above
@ -66,8 +52,6 @@ class AlrDetector {
static constexpr int kDefaultAlrBandwidthUsagePercent = 65; static constexpr int kDefaultAlrBandwidthUsagePercent = 65;
static constexpr int kDefaultAlrStartBudgetLevelPercent = 80; static constexpr int kDefaultAlrStartBudgetLevelPercent = 80;
static constexpr int kDefaultAlrStopBudgetLevelPercent = 50; static constexpr int kDefaultAlrStopBudgetLevelPercent = 50;
static const char kScreenshareProbingBweExperimentName[];
static const char kStrictPacingAndProbingExperimentName[];
void UpdateBudgetWithElapsedTime(int64_t delta_time_ms); void UpdateBudgetWithElapsedTime(int64_t delta_time_ms);
void UpdateBudgetWithBytesSent(size_t bytes_sent); void UpdateBudgetWithBytesSent(size_t bytes_sent);

View File

@ -10,6 +10,7 @@
#include "modules/pacing/alr_detector.h" #include "modules/pacing/alr_detector.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "test/field_trial.h" #include "test/field_trial.h"
#include "test/gtest.h" #include "test/gtest.h"
@ -145,8 +146,8 @@ TEST_F(AlrDetectorTest, BandwidthEstimateChanges) {
TEST_F(AlrDetectorTest, ParseControlFieldTrial) { TEST_F(AlrDetectorTest, ParseControlFieldTrial) {
webrtc::test::ScopedFieldTrials field_trial( webrtc::test::ScopedFieldTrials field_trial(
"WebRTC-ProbingScreenshareBwe/Control/"); "WebRTC-ProbingScreenshareBwe/Control/");
rtc::Optional<AlrDetector::AlrExperimentSettings> parsed_params = rtc::Optional<AlrExperimentSettings> parsed_params =
AlrDetector::ParseAlrSettingsFromFieldTrial( AlrExperimentSettings::CreateFromFieldTrial(
"WebRTC-ProbingScreenshareBwe"); "WebRTC-ProbingScreenshareBwe");
EXPECT_FALSE(static_cast<bool>(parsed_params)); EXPECT_FALSE(static_cast<bool>(parsed_params));
} }
@ -154,8 +155,8 @@ TEST_F(AlrDetectorTest, ParseControlFieldTrial) {
TEST_F(AlrDetectorTest, ParseActiveFieldTrial) { TEST_F(AlrDetectorTest, ParseActiveFieldTrial) {
webrtc::test::ScopedFieldTrials field_trial( webrtc::test::ScopedFieldTrials field_trial(
"WebRTC-ProbingScreenshareBwe/1.1,2875,85,20,-20,1/"); "WebRTC-ProbingScreenshareBwe/1.1,2875,85,20,-20,1/");
rtc::Optional<AlrDetector::AlrExperimentSettings> parsed_params = rtc::Optional<AlrExperimentSettings> parsed_params =
AlrDetector::ParseAlrSettingsFromFieldTrial( AlrExperimentSettings::CreateFromFieldTrial(
"WebRTC-ProbingScreenshareBwe"); "WebRTC-ProbingScreenshareBwe");
ASSERT_TRUE(static_cast<bool>(parsed_params)); ASSERT_TRUE(static_cast<bool>(parsed_params));
EXPECT_EQ(1.1f, parsed_params->pacing_factor); EXPECT_EQ(1.1f, parsed_params->pacing_factor);

View File

@ -150,6 +150,7 @@ if (rtc_include_tests) {
"../../rtc_base:rtc_base", "../../rtc_base:rtc_base",
"../../rtc_base:rtc_base_approved", "../../rtc_base:rtc_base_approved",
"../../rtc_base:rtc_numerics", "../../rtc_base:rtc_numerics",
"../../rtc_base/experiments:alr_experiment",
"../../system_wrappers", "../../system_wrappers",
"../../system_wrappers:field_trial_api", "../../system_wrappers:field_trial_api",
"../../test:perf_test", "../../test:perf_test",

View File

@ -118,10 +118,10 @@ rtc_static_library("video_coding") {
"../../rtc_base:rtc_numerics", "../../rtc_base:rtc_numerics",
"../../rtc_base:rtc_task_queue", "../../rtc_base:rtc_task_queue",
"../../rtc_base:sequenced_task_checker", "../../rtc_base:sequenced_task_checker",
"../../rtc_base/experiments:alr_experiment",
"../../system_wrappers", "../../system_wrappers",
"../../system_wrappers:field_trial_api", "../../system_wrappers:field_trial_api",
"../../system_wrappers:metrics_api", "../../system_wrappers:metrics_api",
"../pacing",
"../rtp_rtcp:rtp_rtcp_format", "../rtp_rtcp:rtp_rtcp_format",
"../utility:utility", "../utility:utility",
] ]

View File

@ -2,6 +2,7 @@ include_rules = [
"+vpx", "+vpx",
"+call", "+call",
"+common_video", "+common_video",
"+experiments",
"+system_wrappers", "+system_wrappers",
"+rtc_tools", "+rtc_tools",
"+third_party/libyuv", "+third_party/libyuv",

View File

@ -15,10 +15,10 @@
#include "api/optional.h" #include "api/optional.h"
#include "api/video/i420_buffer.h" #include "api/video/i420_buffer.h"
#include "modules/include/module_common_types_public.h" #include "modules/include/module_common_types_public.h"
#include "modules/pacing/alr_detector.h"
#include "modules/video_coding/encoded_frame.h" #include "modules/video_coding/encoded_frame.h"
#include "modules/video_coding/media_optimization.h" #include "modules/video_coding/media_optimization.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/timeutils.h" #include "rtc_base/timeutils.h"
#include "rtc_base/trace_event.h" #include "rtc_base/trace_event.h"
@ -194,16 +194,16 @@ VCMEncodedFrameCallback::VCMEncodedFrameCallback(
incorrect_capture_time_logged_messages_(0), incorrect_capture_time_logged_messages_(0),
reordered_frames_logged_messages_(0), reordered_frames_logged_messages_(0),
stalled_encoder_logged_messages_(0) { stalled_encoder_logged_messages_(0) {
rtc::Optional<AlrDetector::AlrExperimentSettings> experiment_settings = rtc::Optional<AlrExperimentSettings> experiment_settings =
AlrDetector::ParseAlrSettingsFromFieldTrial( AlrExperimentSettings::CreateFromFieldTrial(
AlrDetector::kStrictPacingAndProbingExperimentName); AlrExperimentSettings::kStrictPacingAndProbingExperimentName);
if (experiment_settings) { if (experiment_settings) {
experiment_groups_[0] = experiment_settings->group_id + 1; experiment_groups_[0] = experiment_settings->group_id + 1;
} else { } else {
experiment_groups_[0] = 0; experiment_groups_[0] = 0;
} }
experiment_settings = AlrDetector::ParseAlrSettingsFromFieldTrial( experiment_settings = AlrExperimentSettings::CreateFromFieldTrial(
AlrDetector::kScreenshareProbingBweExperimentName); AlrExperimentSettings::kScreenshareProbingBweExperimentName);
if (experiment_settings) { if (experiment_settings) {
experiment_groups_[1] = experiment_settings->group_id + 1; experiment_groups_[1] = experiment_settings->group_id + 1;
} else { } else {

View File

@ -0,0 +1,21 @@
# Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
import("../../webrtc.gni")
rtc_static_library("alr_experiment") {
sources = [
"alr_experiment.cc",
"alr_experiment.h",
]
deps = [
"../:rtc_base_approved",
"../../api:optional",
"../../system_wrappers:field_trial_api",
]
}

View File

@ -0,0 +1,3 @@
include_rules = [
"+system_wrappers",
]

View File

@ -0,0 +1,83 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "rtc_base/experiments/alr_experiment.h"
#include <string>
#include "rtc_base/format_macros.h"
#include "rtc_base/logging.h"
#include "system_wrappers/include/field_trial.h"
namespace webrtc {
const char AlrExperimentSettings::kScreenshareProbingBweExperimentName[] =
"WebRTC-ProbingScreenshareBwe";
const char AlrExperimentSettings::kStrictPacingAndProbingExperimentName[] =
"WebRTC-StrictPacingAndProbing";
const char kDefaultProbingScreenshareBweSettings[] = "1.0,2875,80,40,-60,3";
bool AlrExperimentSettings::MaxOneFieldTrialEnabled() {
return field_trial::FindFullName(kStrictPacingAndProbingExperimentName)
.empty() ||
field_trial::FindFullName(kScreenshareProbingBweExperimentName)
.empty();
}
rtc::Optional<AlrExperimentSettings>
AlrExperimentSettings::CreateFromFieldTrial(const char* experiment_name) {
rtc::Optional<AlrExperimentSettings> ret;
std::string group_name = field_trial::FindFullName(experiment_name);
const std::string kIgnoredSuffix = "_Dogfood";
std::string::size_type suffix_pos = group_name.rfind(kIgnoredSuffix);
if (suffix_pos != std::string::npos &&
suffix_pos == group_name.length() - kIgnoredSuffix.length()) {
group_name.resize(group_name.length() - kIgnoredSuffix.length());
}
if (experiment_name == kScreenshareProbingBweExperimentName) {
// This experiment is now default-on with fixed settings.
// TODO(sprang): Remove this kill-switch and clean up experiment code.
if (group_name != "Disabled") {
group_name = kDefaultProbingScreenshareBweSettings;
}
}
if (group_name.empty())
return ret;
AlrExperimentSettings settings;
if (sscanf(group_name.c_str(), "%f,%" PRId64 ",%d,%d,%d,%d",
&settings.pacing_factor, &settings.max_paced_queue_time,
&settings.alr_bandwidth_usage_percent,
&settings.alr_start_budget_level_percent,
&settings.alr_stop_budget_level_percent,
&settings.group_id) == 6) {
ret.emplace(settings);
RTC_LOG(LS_INFO) << "Using ALR experiment settings: "
"pacing factor: "
<< settings.pacing_factor << ", max pacer queue length: "
<< settings.max_paced_queue_time
<< ", ALR start bandwidth usage percent: "
<< settings.alr_bandwidth_usage_percent
<< ", ALR end budget level percent: "
<< settings.alr_start_budget_level_percent
<< ", ALR end budget level percent: "
<< settings.alr_stop_budget_level_percent
<< ", ALR experiment group ID: " << settings.group_id;
} else {
RTC_LOG(LS_INFO) << "Failed to parse ALR experiment: " << experiment_name;
}
return ret;
}
} // namespace webrtc

View File

@ -0,0 +1,40 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_
#define RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_
#include "api/optional.h"
namespace webrtc {
struct AlrExperimentSettings {
public:
float pacing_factor;
int64_t max_paced_queue_time;
int alr_bandwidth_usage_percent;
int alr_start_budget_level_percent;
int alr_stop_budget_level_percent;
// Will be sent to the receive side for stats slicing.
// Can be 0..6, because it's sent as a 3 bits value and there's also
// reserved value to indicate absence of experiment.
int group_id;
static const char kScreenshareProbingBweExperimentName[];
static const char kStrictPacingAndProbingExperimentName[];
static rtc::Optional<AlrExperimentSettings> CreateFromFieldTrial(
const char* experiment_name);
static bool MaxOneFieldTrialEnabled();
private:
AlrExperimentSettings() = default;
};
} // namespace webrtc
#endif // RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_

View File

@ -69,6 +69,7 @@ rtc_static_library("video") {
"../modules/rtp_rtcp:rtp_rtcp_format", "../modules/rtp_rtcp:rtp_rtcp_format",
"../modules/video_coding:video_codec_interface", "../modules/video_coding:video_codec_interface",
"../rtc_base:checks", "../rtc_base:checks",
"../rtc_base/experiments:alr_experiment",
"../system_wrappers:field_trial_api", "../system_wrappers:field_trial_api",
"../system_wrappers:metrics_api", "../system_wrappers:metrics_api",
@ -143,6 +144,7 @@ if (rtc_include_tests) {
deps = [ deps = [
":video_quality_test", ":video_quality_test",
"../modules/pacing:pacing", "../modules/pacing:pacing",
"../rtc_base/experiments:alr_experiment",
"../test:field_trial", "../test:field_trial",
"../test:test_common", "../test:test_common",
"../test:test_support", "../test:test_support",
@ -322,6 +324,7 @@ if (rtc_include_tests) {
"../rtc_base:rtc_base_approved", "../rtc_base:rtc_base_approved",
"../rtc_base:rtc_base_tests_utils", "../rtc_base:rtc_base_tests_utils",
"../rtc_base:rtc_numerics", "../rtc_base:rtc_numerics",
"../rtc_base/experiments:alr_experiment",
"../system_wrappers", "../system_wrappers",
"../system_wrappers:field_trial_default", "../system_wrappers:field_trial_default",
"../system_wrappers:metrics_api", "../system_wrappers:metrics_api",

View File

@ -9,7 +9,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include "modules/pacing/alr_detector.h" #include "rtc_base/experiments/alr_experiment.h"
#include "test/field_trial.h" #include "test/field_trial.h"
#include "test/gtest.h" #include "test/gtest.h"
#include "video/video_quality_test.h" #include "video/video_quality_test.h"
@ -30,7 +30,7 @@ class FullStackTest : public VideoQualityTest {
const std::string kScreenshareSimulcastExperiment = const std::string kScreenshareSimulcastExperiment =
"WebRTC-SimulcastScreenshare/Enabled/"; "WebRTC-SimulcastScreenshare/Enabled/";
const std::string kAlrProbingExperiment = const std::string kAlrProbingExperiment =
std::string(AlrDetector::kScreenshareProbingBweExperimentName) + std::string(AlrExperimentSettings::kScreenshareProbingBweExperimentName) +
"/1.1,2875,85,20,-20,0/"; "/1.1,2875,85,20,-20,0/";
const std::string kRoundRobinPacingQueueExperiment = const std::string kRoundRobinPacingQueueExperiment =
"WebRTC-RoundRobinPacing/Enabled/"; "WebRTC-RoundRobinPacing/Enabled/";

View File

@ -15,7 +15,6 @@
#include <sstream> #include <sstream>
#include <utility> #include <utility>
#include "modules/pacing/alr_detector.h"
#include "modules/video_coding/include/video_codec_interface.h" #include "modules/video_coding/include/video_codec_interface.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"

View File

@ -17,17 +17,18 @@
#include <vector> #include <vector>
#include "call/rtp_transport_controller_send_interface.h" #include "call/rtp_transport_controller_send_interface.h"
#include "call/video_send_stream.h"
#include "common_types.h" // NOLINT(build/include) #include "common_types.h" // NOLINT(build/include)
#include "common_video/include/video_bitrate_allocator.h" #include "common_video/include/video_bitrate_allocator.h"
#include "modules/bitrate_controller/include/bitrate_controller.h" #include "modules/bitrate_controller/include/bitrate_controller.h"
#include "modules/congestion_controller/include/send_side_congestion_controller.h" #include "modules/congestion_controller/include/send_side_congestion_controller.h"
#include "modules/pacing/alr_detector.h"
#include "modules/pacing/packet_router.h" #include "modules/pacing/packet_router.h"
#include "modules/rtp_rtcp/include/rtp_rtcp.h" #include "modules/rtp_rtcp/include/rtp_rtcp.h"
#include "modules/rtp_rtcp/source/rtp_sender.h" #include "modules/rtp_rtcp/source/rtp_sender.h"
#include "modules/utility/include/process_thread.h" #include "modules/utility/include/process_thread.h"
#include "modules/video_coding/utility/ivf_file_writer.h" #include "modules/video_coding/utility/ivf_file_writer.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "rtc_base/file.h" #include "rtc_base/file.h"
#include "rtc_base/location.h" #include "rtc_base/location.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
@ -36,7 +37,6 @@
#include "system_wrappers/include/field_trial.h" #include "system_wrappers/include/field_trial.h"
#include "video/call_stats.h" #include "video/call_stats.h"
#include "video/payload_router.h" #include "video/payload_router.h"
#include "call/video_send_stream.h"
namespace webrtc { namespace webrtc {
@ -754,22 +754,18 @@ VideoSendStreamImpl::VideoSendStreamImpl(
RTC_DCHECK(transport_); RTC_DCHECK(transport_);
RTC_DCHECK(transport_->send_side_cc()); RTC_DCHECK(transport_->send_side_cc());
RTC_DCHECK_GT(encoder_max_bitrate_bps_, 0); RTC_DCHECK_GT(encoder_max_bitrate_bps_, 0);
RTC_CHECK(field_trial::FindFullName(
AlrDetector::kStrictPacingAndProbingExperimentName) RTC_CHECK(AlrExperimentSettings::MaxOneFieldTrialEnabled());
.empty() ||
field_trial::FindFullName(
AlrDetector::kScreenshareProbingBweExperimentName)
.empty());
// If send-side BWE is enabled, check if we should apply updated probing and // If send-side BWE is enabled, check if we should apply updated probing and
// pacing settings. // pacing settings.
if (TransportSeqNumExtensionConfigured(*config_)) { if (TransportSeqNumExtensionConfigured(*config_)) {
rtc::Optional<AlrDetector::AlrExperimentSettings> alr_settings; rtc::Optional<AlrExperimentSettings> alr_settings;
if (content_type == VideoEncoderConfig::ContentType::kScreen) { if (content_type == VideoEncoderConfig::ContentType::kScreen) {
alr_settings = AlrDetector::ParseAlrSettingsFromFieldTrial( alr_settings = AlrExperimentSettings::CreateFromFieldTrial(
AlrDetector::kScreenshareProbingBweExperimentName); AlrExperimentSettings::kScreenshareProbingBweExperimentName);
} else { } else {
alr_settings = AlrDetector::ParseAlrSettingsFromFieldTrial( alr_settings = AlrExperimentSettings::CreateFromFieldTrial(
AlrDetector::kStrictPacingAndProbingExperimentName); AlrExperimentSettings::kStrictPacingAndProbingExperimentName);
} }
if (alr_settings) { if (alr_settings) {
transport->send_side_cc()->EnablePeriodicAlrProbing(true); transport->send_side_cc()->EnablePeriodicAlrProbing(true);

View File

@ -15,7 +15,6 @@
#include "call/rtp_transport_controller_send.h" #include "call/rtp_transport_controller_send.h"
#include "common_video/include/frame_callback.h" #include "common_video/include/frame_callback.h"
#include "common_video/include/video_frame.h" #include "common_video/include/video_frame.h"
#include "modules/pacing/alr_detector.h"
#include "modules/rtp_rtcp/include/rtp_header_parser.h" #include "modules/rtp_rtcp/include/rtp_header_parser.h"
#include "modules/rtp_rtcp/include/rtp_rtcp.h" #include "modules/rtp_rtcp/include/rtp_rtcp.h"
#include "modules/rtp_rtcp/source/rtcp_sender.h" #include "modules/rtp_rtcp/source/rtcp_sender.h"
@ -26,6 +25,7 @@
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/criticalsection.h" #include "rtc_base/criticalsection.h"
#include "rtc_base/event.h" #include "rtc_base/event.h"
#include "rtc_base/experiments/alr_experiment.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/platform_thread.h" #include "rtc_base/platform_thread.h"
#include "rtc_base/rate_limiter.h" #include "rtc_base/rate_limiter.h"
@ -3541,7 +3541,7 @@ TEST_F(VideoSendStreamTest, SendsKeepAlive) {
TEST_F(VideoSendStreamTest, ConfiguresAlrWhenSendSideOn) { TEST_F(VideoSendStreamTest, ConfiguresAlrWhenSendSideOn) {
const std::string kAlrProbingExperiment = const std::string kAlrProbingExperiment =
std::string(AlrDetector::kScreenshareProbingBweExperimentName) + std::string(AlrExperimentSettings::kScreenshareProbingBweExperimentName) +
"/1.0,2875,80,40,-60,3/"; "/1.0,2875,80,40,-60,3/";
test::ScopedFieldTrials alr_experiment(kAlrProbingExperiment); test::ScopedFieldTrials alr_experiment(kAlrProbingExperiment);
class PacingFactorObserver : public test::SendTest { class PacingFactorObserver : public test::SendTest {