mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-14 14:20:45 +01:00
Read WebRTC-BweLossExperiment from propagated instead of global field trial
Bug: webrtc:42220378 Change-Id: I4ddb0719aabe89997ba4f2e663515c1b227938ad Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/350301 Reviewed-by: Ying Wang <yinwa@google.com> Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42268}
This commit is contained in:
parent
dbdf36c437
commit
2cdf840b53
2 changed files with 9 additions and 14 deletions
|
@ -209,7 +209,6 @@ rtc_library("send_side_bwe") {
|
||||||
"../../../rtc_base:checks",
|
"../../../rtc_base:checks",
|
||||||
"../../../rtc_base:logging",
|
"../../../rtc_base:logging",
|
||||||
"../../../rtc_base/experiments:field_trial_parser",
|
"../../../rtc_base/experiments:field_trial_parser",
|
||||||
"../../../system_wrappers:field_trial",
|
|
||||||
"../../../system_wrappers:metrics",
|
"../../../system_wrappers:metrics",
|
||||||
"../../remote_bitrate_estimator",
|
"../../remote_bitrate_estimator",
|
||||||
]
|
]
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include "rtc_base/checks.h"
|
#include "rtc_base/checks.h"
|
||||||
#include "rtc_base/experiments/field_trial_parser.h"
|
#include "rtc_base/experiments/field_trial_parser.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "system_wrappers/include/field_trial.h"
|
|
||||||
#include "system_wrappers/include/metrics.h"
|
#include "system_wrappers/include/metrics.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
@ -67,21 +66,18 @@ const size_t kNumUmaRampupMetrics =
|
||||||
|
|
||||||
const char kBweLosExperiment[] = "WebRTC-BweLossExperiment";
|
const char kBweLosExperiment[] = "WebRTC-BweLossExperiment";
|
||||||
|
|
||||||
bool BweLossExperimentIsEnabled() {
|
bool BweLossExperimentIsEnabled(const FieldTrialsView& field_trials) {
|
||||||
std::string experiment_string =
|
return field_trials.IsEnabled(kBweLosExperiment);
|
||||||
webrtc::field_trial::FindFullName(kBweLosExperiment);
|
|
||||||
// The experiment is enabled iff the field trial string begins with "Enabled".
|
|
||||||
return absl::StartsWith(experiment_string, "Enabled");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ReadBweLossExperimentParameters(float* low_loss_threshold,
|
bool ReadBweLossExperimentParameters(const FieldTrialsView& field_trials,
|
||||||
|
float* low_loss_threshold,
|
||||||
float* high_loss_threshold,
|
float* high_loss_threshold,
|
||||||
uint32_t* bitrate_threshold_kbps) {
|
uint32_t* bitrate_threshold_kbps) {
|
||||||
RTC_DCHECK(low_loss_threshold);
|
RTC_DCHECK(low_loss_threshold);
|
||||||
RTC_DCHECK(high_loss_threshold);
|
RTC_DCHECK(high_loss_threshold);
|
||||||
RTC_DCHECK(bitrate_threshold_kbps);
|
RTC_DCHECK(bitrate_threshold_kbps);
|
||||||
std::string experiment_string =
|
std::string experiment_string = field_trials.Lookup(kBweLosExperiment);
|
||||||
webrtc::field_trial::FindFullName(kBweLosExperiment);
|
|
||||||
int parsed_values =
|
int parsed_values =
|
||||||
sscanf(experiment_string.c_str(), "Enabled-%f,%f,%u", low_loss_threshold,
|
sscanf(experiment_string.c_str(), "Enabled-%f,%f,%u", low_loss_threshold,
|
||||||
high_loss_threshold, bitrate_threshold_kbps);
|
high_loss_threshold, bitrate_threshold_kbps);
|
||||||
|
@ -231,10 +227,10 @@ SendSideBandwidthEstimation::SendSideBandwidthEstimation(
|
||||||
loss_based_state_(LossBasedState::kDelayBasedEstimate),
|
loss_based_state_(LossBasedState::kDelayBasedEstimate),
|
||||||
disable_receiver_limit_caps_only_("Disabled") {
|
disable_receiver_limit_caps_only_("Disabled") {
|
||||||
RTC_DCHECK(event_log);
|
RTC_DCHECK(event_log);
|
||||||
if (BweLossExperimentIsEnabled()) {
|
if (BweLossExperimentIsEnabled(*key_value_config_)) {
|
||||||
uint32_t bitrate_threshold_kbps;
|
uint32_t bitrate_threshold_kbps;
|
||||||
if (ReadBweLossExperimentParameters(&low_loss_threshold_,
|
if (ReadBweLossExperimentParameters(
|
||||||
&high_loss_threshold_,
|
*key_value_config_, &low_loss_threshold_, &high_loss_threshold_,
|
||||||
&bitrate_threshold_kbps)) {
|
&bitrate_threshold_kbps)) {
|
||||||
RTC_LOG(LS_INFO) << "Enabled BweLossExperiment with parameters "
|
RTC_LOG(LS_INFO) << "Enabled BweLossExperiment with parameters "
|
||||||
<< low_loss_threshold_ << ", " << high_loss_threshold_
|
<< low_loss_threshold_ << ", " << high_loss_threshold_
|
||||||
|
|
Loading…
Reference in a new issue