mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00

rename WebRtcKeyValueConfig to FieldTrialsView Bug: webrtc:10335 Change-Id: If725bd498c4c3daf144bee638230fa089fdde833 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256965 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Jonas Oreland <jonaso@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36365}
43 lines
1.5 KiB
C++
43 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) 2021 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/bandwidth_quality_scaler_settings.h"
|
|
|
|
#include "api/transport/field_trial_based_config.h"
|
|
#include "rtc_base/logging.h"
|
|
|
|
namespace webrtc {
|
|
|
|
BandwidthQualityScalerSettings::BandwidthQualityScalerSettings(
|
|
const FieldTrialsView* const key_value_config)
|
|
: bitrate_state_update_interval_s_("bitrate_state_update_interval_s_") {
|
|
ParseFieldTrial(
|
|
{&bitrate_state_update_interval_s_},
|
|
key_value_config->Lookup("WebRTC-Video-BandwidthQualityScalerSettings"));
|
|
}
|
|
|
|
BandwidthQualityScalerSettings
|
|
BandwidthQualityScalerSettings::ParseFromFieldTrials() {
|
|
FieldTrialBasedConfig field_trial_config;
|
|
return BandwidthQualityScalerSettings(&field_trial_config);
|
|
}
|
|
|
|
absl::optional<uint32_t>
|
|
BandwidthQualityScalerSettings::BitrateStateUpdateInterval() const {
|
|
if (bitrate_state_update_interval_s_ &&
|
|
bitrate_state_update_interval_s_.Value() <= 0) {
|
|
RTC_LOG(LS_WARNING)
|
|
<< "Unsupported bitrate_state_update_interval_s_ value, ignored.";
|
|
return absl::nullopt;
|
|
}
|
|
return bitrate_state_update_interval_s_.GetOptional();
|
|
}
|
|
|
|
} // namespace webrtc
|