stable_target_rate_experiment.h 1.5 KB

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