1 /* 2 * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef RTC_BASE_EXPERIMENTS_QUALITY_SCALER_SETTINGS_H_ 12 #define RTC_BASE_EXPERIMENTS_QUALITY_SCALER_SETTINGS_H_ 13 14 #include "absl/types/optional.h" 15 #include "api/field_trials_view.h" 16 #include "rtc_base/experiments/field_trial_parser.h" 17 18 namespace webrtc { 19 20 class QualityScalerSettings final { 21 public: 22 static QualityScalerSettings ParseFromFieldTrials(); 23 24 absl::optional<int> SamplingPeriodMs() const; 25 absl::optional<int> AverageQpWindow() const; 26 absl::optional<int> MinFrames() const; 27 absl::optional<double> InitialScaleFactor() const; 28 absl::optional<double> ScaleFactor() const; 29 absl::optional<int> InitialBitrateIntervalMs() const; 30 absl::optional<double> InitialBitrateFactor() const; 31 32 private: 33 explicit QualityScalerSettings(const FieldTrialsView* const key_value_config); 34 35 FieldTrialOptional<int> sampling_period_ms_; 36 FieldTrialOptional<int> average_qp_window_; 37 FieldTrialOptional<int> min_frames_; 38 FieldTrialOptional<double> initial_scale_factor_; 39 FieldTrialOptional<double> scale_factor_; 40 FieldTrialOptional<int> initial_bitrate_interval_ms_; 41 FieldTrialOptional<double> initial_bitrate_factor_; 42 }; 43 44 } // namespace webrtc 45 46 #endif // RTC_BASE_EXPERIMENTS_QUALITY_SCALER_SETTINGS_H_ 47