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

Side by Side Diff: webrtc/modules/bitrate_controller/bitrate_controller_impl.cc

Issue 1411673003: Added protobuf message for loss-based BWE events, and wired it up to the send side bandwidth estima… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years, 1 month 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) { 124 void BitrateControllerImpl::SetReservedBitrate(uint32_t reserved_bitrate_bps) {
125 { 125 {
126 rtc::CritScope cs(&critsect_); 126 rtc::CritScope cs(&critsect_);
127 reserved_bitrate_bps_ = reserved_bitrate_bps; 127 reserved_bitrate_bps_ = reserved_bitrate_bps;
128 } 128 }
129 MaybeTriggerOnNetworkChanged(); 129 MaybeTriggerOnNetworkChanged();
130 } 130 }
131 131
132 void BitrateControllerImpl::SetEventLog(RtcEventLog* event_log) {
133 rtc::CritScope cs(&critsect_);
134 bandwidth_estimation_.SetEventLog(event_log);
135 }
136
132 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) { 137 void BitrateControllerImpl::OnReceivedEstimatedBitrate(uint32_t bitrate) {
133 { 138 {
134 rtc::CritScope cs(&critsect_); 139 rtc::CritScope cs(&critsect_);
135 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(), 140 bandwidth_estimation_.UpdateReceiverEstimate(clock_->TimeInMilliseconds(),
136 bitrate); 141 bitrate);
137 } 142 }
138 MaybeTriggerOnNetworkChanged(); 143 MaybeTriggerOnNetworkChanged();
139 } 144 }
140 145
141 int64_t BitrateControllerImpl::TimeUntilNextProcess() { 146 int64_t BitrateControllerImpl::TimeUntilNextProcess() {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt); 217 bandwidth_estimation_.CurrentEstimate(&bitrate, &fraction_loss, &rtt);
213 if (bitrate > 0) { 218 if (bitrate > 0) {
214 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_); 219 bitrate = bitrate - std::min<int>(bitrate, reserved_bitrate_bps_);
215 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate()); 220 bitrate = std::max(bitrate, bandwidth_estimation_.GetMinBitrate());
216 *bandwidth = bitrate; 221 *bandwidth = bitrate;
217 return true; 222 return true;
218 } 223 }
219 return false; 224 return false;
220 } 225 }
221 } // namespace webrtc 226 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698