blob: bf6aa34062c4f206ede3d5fbe688eaafd5242419 [file] [log] [blame]
Sebastian Janssoncabe3832018-01-12 10:54:18 +01001/*
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 Gerey988cc082018-10-23 12:03:01 +020014#include <stdint.h>
15
Danil Chapovalov0a1d1892018-06-21 11:48:25 +020016#include "absl/types/optional.h"
Jonas Orelande62c2f22022-03-29 11:04:48 +020017#include "api/field_trials_view.h"
Sebastian Janssoncabe3832018-01-12 10:54:18 +010018
19namespace webrtc {
20struct AlrExperimentSettings {
21 public:
22 float pacing_factor;
23 int64_t max_paced_queue_time;
24 int alr_bandwidth_usage_percent;
25 int alr_start_budget_level_percent;
26 int alr_stop_budget_level_percent;
27 // Will be sent to the receive side for stats slicing.
28 // Can be 0..6, because it's sent as a 3 bits value and there's also
29 // reserved value to indicate absence of experiment.
30 int group_id;
31
32 static const char kScreenshareProbingBweExperimentName[];
33 static const char kStrictPacingAndProbingExperimentName[];
Danil Chapovalov0a1d1892018-06-21 11:48:25 +020034 static absl::optional<AlrExperimentSettings> CreateFromFieldTrial(
Sebastian Janssoncabe3832018-01-12 10:54:18 +010035 const char* experiment_name);
Per Kjellander5b698732019-04-15 12:36:33 +020036 static absl::optional<AlrExperimentSettings> CreateFromFieldTrial(
Jonas Orelande62c2f22022-03-29 11:04:48 +020037 const FieldTrialsView& key_value_config,
Per Kjellander5b698732019-04-15 12:36:33 +020038 const char* experiment_name);
Sebastian Janssoncabe3832018-01-12 10:54:18 +010039 static bool MaxOneFieldTrialEnabled();
Jonas Orelande62c2f22022-03-29 11:04:48 +020040 static bool MaxOneFieldTrialEnabled(const FieldTrialsView& key_value_config);
Sebastian Janssoncabe3832018-01-12 10:54:18 +010041
42 private:
43 AlrExperimentSettings() = default;
44};
45} // namespace webrtc
46
47#endif // RTC_BASE_EXPERIMENTS_ALR_EXPERIMENT_H_