alr_experiment.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2018 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_ALR_EXPERIMENT_H_
  11. #define RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_
  12. #include <stdint.h>
  13. #include "absl/types/optional.h"
  14. #include "api/transport/webrtc_key_value_config.h"
  15. namespace webrtc {
  16. struct AlrExperimentSettings {
  17. public:
  18. float pacing_factor;
  19. int64_t max_paced_queue_time;
  20. int alr_bandwidth_usage_percent;
  21. int alr_start_budget_level_percent;
  22. int alr_stop_budget_level_percent;
  23. // Will be sent to the receive side for stats slicing.
  24. // Can be 0..6, because it's sent as a 3 bits value and there's also
  25. // reserved value to indicate absence of experiment.
  26. int group_id;
  27. static const char kScreenshareProbingBweExperimentName[];
  28. static const char kStrictPacingAndProbingExperimentName[];
  29. static absl::optional<AlrExperimentSettings> CreateFromFieldTrial(
  30. const char* experiment_name);
  31. static absl::optional<AlrExperimentSettings> CreateFromFieldTrial(
  32. const WebRtcKeyValueConfig& key_value_config,
  33. const char* experiment_name);
  34. static bool MaxOneFieldTrialEnabled();
  35. static bool MaxOneFieldTrialEnabled(
  36. const WebRtcKeyValueConfig& key_value_config);
  37. private:
  38. AlrExperimentSettings() = default;
  39. };
  40. } // namespace webrtc
  41. #endif // RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_