Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: webrtc/modules/pacing/alr_detector.cc

Issue 2986893002: Piggybacking simulcast id and ALR experiment id into video content type extension. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "webrtc/modules/pacing/alr_detector.h" 11 #include "webrtc/modules/pacing/alr_detector.h"
12 12
13 #include <string> 13 #include <string>
14 14
15 #include "webrtc/rtc_base/checks.h" 15 #include "webrtc/rtc_base/checks.h"
16 #include "webrtc/rtc_base/format_macros.h" 16 #include "webrtc/rtc_base/format_macros.h"
17 #include "webrtc/rtc_base/logging.h" 17 #include "webrtc/rtc_base/logging.h"
18 #include "webrtc/rtc_base/timeutils.h" 18 #include "webrtc/rtc_base/timeutils.h"
19 #include "webrtc/system_wrappers/include/field_trial.h" 19 #include "webrtc/system_wrappers/include/field_trial.h"
20 20
21 namespace webrtc { 21 namespace webrtc {
22 22
23 const char* AlrDetector::kScreenshareProbingBweExperimentName = 23 const char* AlrDetector::kScreenshareProbingBweExperimentName =
24 "WebRTC-ProbingScreenshareBwe"; 24 "WebRTC-ProbingScreenshareBwe";
25 25
26 const char* AlrDetector::kScreenshareProbingBweExperimentNameOnReceiveSide =
27 "WebRTC-ProbingScreenshareBwe-Receive";
28
26 AlrDetector::AlrDetector() 29 AlrDetector::AlrDetector()
27 : bandwidth_usage_percent_(kDefaultAlrBandwidthUsagePercent), 30 : bandwidth_usage_percent_(kDefaultAlrBandwidthUsagePercent),
28 alr_start_budget_level_percent_(kDefaultAlrStartBudgetLevelPercent), 31 alr_start_budget_level_percent_(kDefaultAlrStartBudgetLevelPercent),
29 alr_stop_budget_level_percent_(kDefaultAlrStopBudgetLevelPercent), 32 alr_stop_budget_level_percent_(kDefaultAlrStopBudgetLevelPercent),
30 alr_budget_(0, true) { 33 alr_budget_(0, true) {
31 rtc::Optional<AlrExperimentSettings> experiment_settings = 34 rtc::Optional<AlrExperimentSettings> experiment_settings =
32 ParseAlrSettingsFromFieldTrial(); 35 ParseAlrSettingsFromFieldTrial();
33 if (experiment_settings) { 36 if (experiment_settings) {
34 alr_stop_budget_level_percent_ = 37 alr_stop_budget_level_percent_ =
35 experiment_settings->alr_stop_budget_level_percent; 38 experiment_settings->alr_stop_budget_level_percent;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const std::string kIgnoredSuffix = "_Dogfood"; 78 const std::string kIgnoredSuffix = "_Dogfood";
76 if (group_name.rfind(kIgnoredSuffix) == 79 if (group_name.rfind(kIgnoredSuffix) ==
77 group_name.length() - kIgnoredSuffix.length()) { 80 group_name.length() - kIgnoredSuffix.length()) {
78 group_name.resize(group_name.length() - kIgnoredSuffix.length()); 81 group_name.resize(group_name.length() - kIgnoredSuffix.length());
79 } 82 }
80 83
81 if (group_name.empty()) 84 if (group_name.empty())
82 return ret; 85 return ret;
83 86
84 AlrExperimentSettings settings; 87 AlrExperimentSettings settings;
85 if (sscanf(group_name.c_str(), "%f,%" PRId64 ",%d,%d,%d", 88 if (sscanf(group_name.c_str(), "%f,%" PRId64 ",%d,%d,%d,%d",
86 &settings.pacing_factor, &settings.max_paced_queue_time, 89 &settings.pacing_factor, &settings.max_paced_queue_time,
87 &settings.alr_bandwidth_usage_percent, 90 &settings.alr_bandwidth_usage_percent,
88 &settings.alr_start_budget_level_percent, 91 &settings.alr_start_budget_level_percent,
89 &settings.alr_stop_budget_level_percent) == 5) { 92 &settings.alr_stop_budget_level_percent,
93 &settings.group_id) == 6) {
90 ret.emplace(settings); 94 ret.emplace(settings);
91 LOG(LS_INFO) << "Using screenshare ALR experiment settings: " 95 LOG(LS_INFO) << "Using screenshare ALR experiment settings: "
92 "pacing factor: " 96 "pacing factor: "
93 << settings.pacing_factor << ", max pacer queue length: " 97 << settings.pacing_factor << ", max pacer queue length: "
94 << settings.max_paced_queue_time 98 << settings.max_paced_queue_time
95 << ", ALR start bandwidth usage percent: " 99 << ", ALR start bandwidth usage percent: "
96 << settings.alr_bandwidth_usage_percent 100 << settings.alr_bandwidth_usage_percent
97 << ", ALR end budget level percent: " 101 << ", ALR end budget level percent: "
98 << settings.alr_start_budget_level_percent 102 << settings.alr_start_budget_level_percent
99 << ", ALR end budget level percent: " 103 << ", ALR end budget level percent: "
100 << settings.alr_stop_budget_level_percent; 104 << settings.alr_stop_budget_level_percent
105 << ", ALR experiment group ID: " << settings.group_id;
101 } 106 }
102 107
103 return ret; 108 return ret;
104 } 109 }
105 110
106 } // namespace webrtc 111 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698