mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Use propagated instead of global field trials for alr expriment
Bug: webrtc:10335 Change-Id: I52a286d38dadaac79afd55ebbe3c06e44a7e881b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330360 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41333}
This commit is contained in:
parent
33c7edd58a
commit
f8e67ba680
4 changed files with 19 additions and 27 deletions
|
@ -16,10 +16,9 @@ rtc_library("alr_experiment") {
|
|||
deps = [
|
||||
"..:logging",
|
||||
"../../api:field_trials_view",
|
||||
"../../api/transport:field_trial_based_config",
|
||||
]
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/strings:strings",
|
||||
"//third_party/abseil-cpp/absl/strings:string_view",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -16,21 +16,16 @@
|
|||
#include <string>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#include "api/field_trials_view.h"
|
||||
#include "rtc_base/logging.h"
|
||||
|
||||
namespace webrtc {
|
||||
namespace {
|
||||
|
||||
const char AlrExperimentSettings::kScreenshareProbingBweExperimentName[] =
|
||||
"WebRTC-ProbingScreenshareBwe";
|
||||
const char AlrExperimentSettings::kStrictPacingAndProbingExperimentName[] =
|
||||
"WebRTC-StrictPacingAndProbing";
|
||||
const char kDefaultProbingScreenshareBweSettings[] = "1.0,2875,80,40,-60,3";
|
||||
constexpr absl::string_view kDefaultProbingScreenshareBweSettings =
|
||||
"1.0,2875,80,40,-60,3";
|
||||
|
||||
bool AlrExperimentSettings::MaxOneFieldTrialEnabled() {
|
||||
return AlrExperimentSettings::MaxOneFieldTrialEnabled(
|
||||
FieldTrialBasedConfig());
|
||||
}
|
||||
} // namespace
|
||||
|
||||
bool AlrExperimentSettings::MaxOneFieldTrialEnabled(
|
||||
const FieldTrialsView& key_value_config) {
|
||||
|
@ -39,12 +34,6 @@ bool AlrExperimentSettings::MaxOneFieldTrialEnabled(
|
|||
key_value_config.Lookup(kScreenshareProbingBweExperimentName).empty();
|
||||
}
|
||||
|
||||
absl::optional<AlrExperimentSettings>
|
||||
AlrExperimentSettings::CreateFromFieldTrial(absl::string_view experiment_name) {
|
||||
return AlrExperimentSettings::CreateFromFieldTrial(FieldTrialBasedConfig(),
|
||||
experiment_name);
|
||||
}
|
||||
|
||||
absl::optional<AlrExperimentSettings>
|
||||
AlrExperimentSettings::CreateFromFieldTrial(
|
||||
const FieldTrialsView& key_value_config,
|
||||
|
|
|
@ -30,14 +30,14 @@ struct AlrExperimentSettings {
|
|||
// reserved value to indicate absence of experiment.
|
||||
int group_id;
|
||||
|
||||
static const char kScreenshareProbingBweExperimentName[];
|
||||
static const char kStrictPacingAndProbingExperimentName[];
|
||||
static absl::optional<AlrExperimentSettings> CreateFromFieldTrial(
|
||||
absl::string_view experiment_name);
|
||||
static constexpr absl::string_view kScreenshareProbingBweExperimentName =
|
||||
"WebRTC-ProbingScreenshareBwe";
|
||||
static constexpr absl::string_view kStrictPacingAndProbingExperimentName =
|
||||
"WebRTC-StrictPacingAndProbing";
|
||||
|
||||
static absl::optional<AlrExperimentSettings> CreateFromFieldTrial(
|
||||
const FieldTrialsView& key_value_config,
|
||||
absl::string_view experiment_name);
|
||||
static bool MaxOneFieldTrialEnabled();
|
||||
static bool MaxOneFieldTrialEnabled(const FieldTrialsView& key_value_config);
|
||||
|
||||
private:
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/field_trials_view.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/scoped_refptr.h"
|
||||
#include "api/sequence_checker.h"
|
||||
|
@ -139,12 +140,15 @@ int CalculateMaxPadBitrateBps(const std::vector<VideoStream>& streams,
|
|||
}
|
||||
|
||||
absl::optional<AlrExperimentSettings> GetAlrSettings(
|
||||
const FieldTrialsView& field_trials,
|
||||
VideoEncoderConfig::ContentType content_type) {
|
||||
if (content_type == VideoEncoderConfig::ContentType::kScreen) {
|
||||
return AlrExperimentSettings::CreateFromFieldTrial(
|
||||
field_trials,
|
||||
AlrExperimentSettings::kScreenshareProbingBweExperimentName);
|
||||
}
|
||||
return AlrExperimentSettings::CreateFromFieldTrial(
|
||||
field_trials,
|
||||
AlrExperimentSettings::kStrictPacingAndProbingExperimentName);
|
||||
}
|
||||
|
||||
|
@ -171,7 +175,7 @@ absl::optional<float> GetConfiguredPacingFactor(
|
|||
return absl::nullopt;
|
||||
|
||||
absl::optional<AlrExperimentSettings> alr_settings =
|
||||
GetAlrSettings(content_type);
|
||||
GetAlrSettings(field_trials, content_type);
|
||||
if (alr_settings)
|
||||
return alr_settings->pacing_factor;
|
||||
|
||||
|
@ -230,7 +234,7 @@ VideoSendStreamImpl::VideoSendStreamImpl(
|
|||
const FieldTrialsView& field_trials)
|
||||
: clock_(clock),
|
||||
has_alr_probing_(config->periodic_alr_bandwidth_probing ||
|
||||
GetAlrSettings(content_type)),
|
||||
GetAlrSettings(field_trials, content_type)),
|
||||
pacing_config_(PacingConfig(field_trials)),
|
||||
stats_proxy_(stats_proxy),
|
||||
config_(config),
|
||||
|
@ -258,7 +262,7 @@ VideoSendStreamImpl::VideoSendStreamImpl(
|
|||
RTC_DCHECK_NE(initial_encoder_max_bitrate, 0);
|
||||
RTC_LOG(LS_INFO) << "VideoSendStreamImpl: " << config_->ToString();
|
||||
|
||||
RTC_CHECK(AlrExperimentSettings::MaxOneFieldTrialEnabled());
|
||||
RTC_CHECK(AlrExperimentSettings::MaxOneFieldTrialEnabled(field_trials));
|
||||
|
||||
// Only request rotation at the source when we positively know that the remote
|
||||
// side doesn't support the rotation extension. This allows us to prepare the
|
||||
|
@ -277,7 +281,7 @@ VideoSendStreamImpl::VideoSendStreamImpl(
|
|||
// pacing settings.
|
||||
if (configured_pacing_factor_) {
|
||||
absl::optional<AlrExperimentSettings> alr_settings =
|
||||
GetAlrSettings(content_type);
|
||||
GetAlrSettings(field_trials, content_type);
|
||||
int queue_time_limit_ms;
|
||||
if (alr_settings) {
|
||||
enable_alr_bw_probing = true;
|
||||
|
|
Loading…
Reference in a new issue