OLD | NEW |
---|---|
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 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 alr_started_time_ms_.emplace(rtc::TimeMillis()); | 60 alr_started_time_ms_.emplace(rtc::TimeMillis()); |
61 } else if (alr_budget_.budget_level_percent() < | 61 } else if (alr_budget_.budget_level_percent() < |
62 alr_stop_budget_level_percent_ && | 62 alr_stop_budget_level_percent_ && |
63 alr_started_time_ms_) { | 63 alr_started_time_ms_) { |
64 alr_started_time_ms_.reset(); | 64 alr_started_time_ms_.reset(); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 void AlrDetector::SetEstimatedBitrate(int bitrate_bps) { | 68 void AlrDetector::SetEstimatedBitrate(int bitrate_bps) { |
69 RTC_DCHECK(bitrate_bps); | 69 RTC_DCHECK(bitrate_bps); |
70 alr_budget_.set_target_rate_kbps(bitrate_bps * bandwidth_usage_percent_ / | 70 int64_t target_rate_kbps = int64_t{bitrate_bps} * bandwidth_usage_percent_ / |
kwiberg-webrtc
2017/09/04 08:53:59
Consider replacing the first "int64_t" with "auto"
oprypin_webrtc
2017/09/04 09:09:21
Done.
| |
71 (1000 * 100)); | 71 (1000 * 100); |
72 alr_budget_.set_target_rate_kbps(rtc::dchecked_cast<int>(target_rate_kbps)); | |
72 } | 73 } |
73 | 74 |
74 rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime() | 75 rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime() |
75 const { | 76 const { |
76 return alr_started_time_ms_; | 77 return alr_started_time_ms_; |
77 } | 78 } |
78 | 79 |
79 rtc::Optional<AlrDetector::AlrExperimentSettings> | 80 rtc::Optional<AlrDetector::AlrExperimentSettings> |
80 AlrDetector::ParseAlrSettingsFromFieldTrial(const char* experiment_name) { | 81 AlrDetector::ParseAlrSettingsFromFieldTrial(const char* experiment_name) { |
81 rtc::Optional<AlrExperimentSettings> ret; | 82 rtc::Optional<AlrExperimentSettings> ret; |
(...skipping 28 matching lines...) Expand all Loading... | |
110 << settings.alr_stop_budget_level_percent | 111 << settings.alr_stop_budget_level_percent |
111 << ", ALR experiment group ID: " << settings.group_id; | 112 << ", ALR experiment group ID: " << settings.group_id; |
112 } else { | 113 } else { |
113 LOG(LS_INFO) << "Failed to parse ALR experiment: " << experiment_name; | 114 LOG(LS_INFO) << "Failed to parse ALR experiment: " << experiment_name; |
114 } | 115 } |
115 | 116 |
116 return ret; | 117 return ret; |
117 } | 118 } |
118 | 119 |
119 } // namespace webrtc | 120 } // namespace webrtc |
OLD | NEW |