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

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

Issue 2970653004: Reimplemeted "Test and fix for huge bwe drop after alr state" (Closed)
Patch Set: Fix uninitialized variable Created 3 years, 5 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
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::AlrState() : was_in_alr_(false) {}
107
108 void AlrState::Update(rtc::Optional<int64_t> alr_start_time_ms) {
109 if (was_in_alr_ && !alr_start_time_ms) {
110 alr_state_changed_to_.emplace(AlrState::State::kNotInAlr);
111 } else if (!was_in_alr_ && alr_start_time_ms) {
112 alr_state_changed_to_.emplace(AlrState::State::kInAlr);
113 } else {
114 alr_state_changed_to_.reset();
philipel 2017/07/14 13:56:23 Isn't |alr_state_changed_to_| just |current_state_
tschumi 2017/07/14 15:36:51 Removed AlrState
115 }
116 was_in_alr_ = alr_start_time_ms.has_value();
philipel 2017/07/14 13:56:23 |was_in_alr_| same as |in_alr_|?
tschumi 2017/07/14 15:36:51 Removed AlrState
117 }
118
119 bool AlrState::HasChangedTo(AlrState::State state) {
120 return alr_state_changed_to_ && *alr_state_changed_to_ == state;
121 }
122
106 } // namespace webrtc 123 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698