1 /*
2  *  Copyright 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_STABLE_TARGET_RATE_EXPERIMENT_H_
12 #define RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_
13 
14 #include "api/transport/webrtc_key_value_config.h"
15 #include "rtc_base/experiments/field_trial_parser.h"
16 
17 namespace webrtc {
18 
19 class StableTargetRateExperiment {
20  public:
21   StableTargetRateExperiment(const StableTargetRateExperiment&);
22   StableTargetRateExperiment(StableTargetRateExperiment&&);
23   static StableTargetRateExperiment ParseFromFieldTrials();
24   static StableTargetRateExperiment ParseFromKeyValueConfig(
25       const WebRtcKeyValueConfig* const key_value_config);
26 
27   bool IsEnabled() const;
28   double GetVideoHysteresisFactor() const;
29   double GetScreenshareHysteresisFactor() const;
30 
31  private:
32   explicit StableTargetRateExperiment(
33       const WebRtcKeyValueConfig* const key_value_config,
34       double default_video_hysteresis,
35       double default_screenshare_hysteresis);
36 
37   FieldTrialParameter<bool> enabled_;
38   FieldTrialParameter<double> video_hysteresis_factor_;
39   FieldTrialParameter<double> screenshare_hysteresis_factor_;
40 };
41 
42 }  // namespace webrtc
43 
44 #endif  // RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_
45