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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 << settings.alr_bandwidth_usage_percent | 96 << settings.alr_bandwidth_usage_percent |
97 << ", ALR end budget level percent: " | 97 << ", ALR end budget level percent: " |
98 << settings.alr_start_budget_level_percent | 98 << settings.alr_start_budget_level_percent |
99 << ", ALR end budget level percent: " | 99 << ", ALR end budget level percent: " |
100 << settings.alr_stop_budget_level_percent; | 100 << settings.alr_stop_budget_level_percent; |
101 } | 101 } |
102 | 102 |
103 return ret; | 103 return ret; |
104 } | 104 } |
105 | 105 |
| 106 AlrState::Change AlrState::ChangeWhenAlrStartTimeIs( |
| 107 rtc::Optional<int64_t> alr_start_time_ms) { |
| 108 AlrState::Change state_change = AlrState::Change::kNoChange; |
| 109 |
| 110 if (was_in_alr_ && !alr_start_time_ms) |
| 111 state_change = AlrState::Change::kEnded; |
| 112 |
| 113 if (!was_in_alr_ && alr_start_time_ms) |
| 114 state_change = AlrState::Change::kStarted; |
| 115 |
| 116 was_in_alr_ = alr_start_time_ms.has_value(); |
| 117 |
| 118 return state_change; |
| 119 } |
| 120 |
106 } // namespace webrtc | 121 } // namespace webrtc |
OLD | NEW |