webrtc/rtc_base/experiments/stable_target_rate_experiment.h
Erik Språng cf9cbf5edb Add support for stable bitrate target in SvcRateAllocator
Bug: webrtc:10126
Change-Id: I1362d183bb91510db4e2763a779bcdf681d855ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/149069
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29066}
2019-09-04 14:22:43 +00:00

44 lines
1.6 KiB
C++

/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_
#define RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_
#include "api/transport/webrtc_key_value_config.h"
#include "rtc_base/experiments/field_trial_parser.h"
namespace webrtc {
class StableTargetRateExperiment {
public:
StableTargetRateExperiment(const StableTargetRateExperiment&);
StableTargetRateExperiment(StableTargetRateExperiment&&);
static StableTargetRateExperiment ParseFromFieldTrials();
static StableTargetRateExperiment ParseFromKeyValueConfig(
const WebRtcKeyValueConfig* const key_value_config);
bool IsEnabled() const;
absl::optional<double> GetVideoHysteresisFactor() const;
absl::optional<double> GetScreenshareHysteresisFactor() const;
private:
explicit StableTargetRateExperiment(
const WebRtcKeyValueConfig* const key_value_config,
absl::optional<double> default_video_hysteresis,
absl::optional<double> default_screenshare_hysteresis);
FieldTrialParameter<bool> enabled_;
FieldTrialOptional<double> video_hysteresis_factor_;
FieldTrialOptional<double> screenshare_hysteresis_factor_;
};
} // namespace webrtc
#endif // RTC_BASE_EXPERIMENTS_STABLE_TARGET_RATE_EXPERIMENT_H_