quality_scaler_settings.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 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_QUALITY_SCALER_SETTINGS_H_
  11. #define RTC_BASE_EXPERIMENTS_QUALITY_SCALER_SETTINGS_H_
  12. #include "absl/types/optional.h"
  13. #include "api/transport/webrtc_key_value_config.h"
  14. #include "rtc_base/experiments/field_trial_parser.h"
  15. namespace webrtc {
  16. class QualityScalerSettings final {
  17. public:
  18. static QualityScalerSettings ParseFromFieldTrials();
  19. absl::optional<int> SamplingPeriodMs() const;
  20. absl::optional<int> AverageQpWindow() const;
  21. absl::optional<int> MinFrames() const;
  22. absl::optional<double> InitialScaleFactor() const;
  23. absl::optional<double> ScaleFactor() const;
  24. absl::optional<int> InitialBitrateIntervalMs() const;
  25. absl::optional<double> InitialBitrateFactor() const;
  26. private:
  27. explicit QualityScalerSettings(
  28. const WebRtcKeyValueConfig* const key_value_config);
  29. FieldTrialOptional<int> sampling_period_ms_;
  30. FieldTrialOptional<int> average_qp_window_;
  31. FieldTrialOptional<int> min_frames_;
  32. FieldTrialOptional<double> initial_scale_factor_;
  33. FieldTrialOptional<double> scale_factor_;
  34. FieldTrialOptional<int> initial_bitrate_interval_ms_;
  35. FieldTrialOptional<double> initial_bitrate_factor_;
  36. };
  37. } // namespace webrtc
  38. #endif // RTC_BASE_EXPERIMENTS_QUALITY_SCALER_SETTINGS_H_