Sebastian Jansson | cabe383 | 2018-01-12 09:54:18 | [diff] [blame] | 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 | |
| 11 | #ifndef RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_ |
| 12 | #define RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_ |
| 13 | |
Yves Gerey | 988cc08 | 2018-10-23 10:03:01 | [diff] [blame] | 14 | #include <stdint.h> |
| 15 | |
Ali Tofigh | 2ab914c | 2022-04-13 10:55:15 | [diff] [blame] | 16 | #include "absl/strings/string_view.h" |
Danil Chapovalov | 0a1d189 | 2018-06-21 09:48:25 | [diff] [blame] | 17 | #include "absl/types/optional.h" |
Jonas Oreland | e62c2f2 | 2022-03-29 09:04:48 | [diff] [blame] | 18 | #include "api/field_trials_view.h" |
Sebastian Jansson | cabe383 | 2018-01-12 09:54:18 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | struct AlrExperimentSettings { |
| 22 | public: |
| 23 | float pacing_factor; |
| 24 | int64_t max_paced_queue_time; |
| 25 | int alr_bandwidth_usage_percent; |
| 26 | int alr_start_budget_level_percent; |
| 27 | int alr_stop_budget_level_percent; |
| 28 | // Will be sent to the receive side for stats slicing. |
| 29 | // Can be 0..6, because it's sent as a 3 bits value and there's also |
| 30 | // reserved value to indicate absence of experiment. |
| 31 | int group_id; |
| 32 | |
| 33 | static const char kScreenshareProbingBweExperimentName[]; |
| 34 | static const char kStrictPacingAndProbingExperimentName[]; |
Danil Chapovalov | 0a1d189 | 2018-06-21 09:48:25 | [diff] [blame] | 35 | static absl::optional<AlrExperimentSettings> CreateFromFieldTrial( |
Ali Tofigh | 2ab914c | 2022-04-13 10:55:15 | [diff] [blame] | 36 | absl::string_view experiment_name); |
Per Kjellander | 5b69873 | 2019-04-15 10:36:33 | [diff] [blame] | 37 | static absl::optional<AlrExperimentSettings> CreateFromFieldTrial( |
Jonas Oreland | e62c2f2 | 2022-03-29 09:04:48 | [diff] [blame] | 38 | const FieldTrialsView& key_value_config, |
Ali Tofigh | 2ab914c | 2022-04-13 10:55:15 | [diff] [blame] | 39 | absl::string_view experiment_name); |
Sebastian Jansson | cabe383 | 2018-01-12 09:54:18 | [diff] [blame] | 40 | static bool MaxOneFieldTrialEnabled(); |
Jonas Oreland | e62c2f2 | 2022-03-29 09:04:48 | [diff] [blame] | 41 | static bool MaxOneFieldTrialEnabled(const FieldTrialsView& key_value_config); |
Sebastian Jansson | cabe383 | 2018-01-12 09:54:18 | [diff] [blame] | 42 | |
| 43 | private: |
| 44 | AlrExperimentSettings() = default; |
| 45 | }; |
| 46 | } // namespace webrtc |
| 47 | |
| 48 | #endif // RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_ |