blob: b56108d7978441ff1f7c373e8b5363a9be9df80c [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:
21 StableTargetRateExperiment(StableTargetRateExperiment&&);
22 static StableTargetRateExperiment ParseFromFieldTrials();
23 static StableTargetRateExperiment ParseFromKeyValueConfig(
24 const WebRtcKeyValueConfig* const key_value_config);
25
26 bool IsEnabled() const;
27 absl::optional<double> GetVideoHysteresisFactor() const;
28 absl::optional<double> GetScreenshareHysteresisFactor() const;
29
30 private:
31 explicit StableTargetRateExperiment(
32 const WebRtcKeyValueConfig* const key_value_config,
33 absl::optional<double> default_video_hysteresis,
34 absl::optional<double> default_screenshare_hysteresis);
35
36 FieldTrialParameter<bool> enabled_;
37 FieldTrialOptional<double> video_hysteresis_factor_;
38 FieldTrialOptional<double> screenshare_hysteresis_factor_;
39};
40
41} // namespace webrtc
42
43#endif // RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_