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/transport/webrtc_key_value_config.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> MinFrames() const;
25   absl::optional<double> InitialScaleFactor() const;
26   absl::optional<double> ScaleFactor() const;
27   absl::optional<int> InitialBitrateIntervalMs() const;
28   absl::optional<double> InitialBitrateFactor() const;
29 
30  private:
31   explicit QualityScalerSettings(
32       const WebRtcKeyValueConfig* const key_value_config);
33 
34   FieldTrialOptional<int> min_frames_;
35   FieldTrialOptional<double> initial_scale_factor_;
36   FieldTrialOptional<double> scale_factor_;
37   FieldTrialOptional<int> initial_bitrate_interval_ms_;
38   FieldTrialOptional<double> initial_bitrate_factor_;
39 };
40 
41 }  // namespace webrtc
42 
43 #endif  // RTC_BASE_EXPERIMENTS_QUALITY_SCALER_SETTINGS_H_
44