blob: 299299ce875e89605bd572c97494c60c51e5498e [file] [log] [blame]
Erik Språngadfb4f72019-08-23 20:02:13 +02001/*
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
17namespace webrtc {
18
19class StableTargetRateExperiment {
20 public:
Erik Språngcf9cbf52019-09-04 14:30:57 +020021 StableTargetRateExperiment(const StableTargetRateExperiment&);
Erik Språngadfb4f72019-08-23 20:02:13 +020022 StableTargetRateExperiment(StableTargetRateExperiment&&);
23 static StableTargetRateExperiment ParseFromFieldTrials();
24 static StableTargetRateExperiment ParseFromKeyValueConfig(
25 const WebRtcKeyValueConfig* const key_value_config);
26
27 bool IsEnabled() const;
Erik Språng2b9dba32019-09-04 16:30:47 +020028 double GetVideoHysteresisFactor() const;
29 double GetScreenshareHysteresisFactor() const;
Erik Språngadfb4f72019-08-23 20:02:13 +020030
31 private:
32 explicit StableTargetRateExperiment(
33 const WebRtcKeyValueConfig* const key_value_config,
Erik Språng2b9dba32019-09-04 16:30:47 +020034 double default_video_hysteresis,
35 double default_screenshare_hysteresis);
Erik Språngadfb4f72019-08-23 20:02:13 +020036
37 FieldTrialParameter<bool> enabled_;
Erik Språng2b9dba32019-09-04 16:30:47 +020038 FieldTrialParameter<double> video_hysteresis_factor_;
39 FieldTrialParameter<double> screenshare_hysteresis_factor_;
Erik Språngadfb4f72019-08-23 20:02:13 +020040};
41
42} // namespace webrtc
43
44#endif // RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_