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

Side by Side Diff: webrtc/modules/congestion_controller/congestion_controller.cc

Issue 2553863003: Parse FlexFEC RTP headers in Call and add integration with BWE. (Closed)
Patch Set: Add basic CongestionController unit test, based on nisse's suggestion. Created 4 years 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 last_reported_bitrate_bps_(0), 190 last_reported_bitrate_bps_(0),
191 last_reported_fraction_loss_(0), 191 last_reported_fraction_loss_(0),
192 last_reported_rtt_(0), 192 last_reported_rtt_(0),
193 network_state_(kNetworkUp) { 193 network_state_(kNetworkUp) {
194 transport_feedback_adapter_.InitBwe(); 194 transport_feedback_adapter_.InitBwe();
195 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_); 195 transport_feedback_adapter_.SetMinBitrate(min_bitrate_bps_);
196 } 196 }
197 197
198 CongestionController::~CongestionController() {} 198 CongestionController::~CongestionController() {}
199 199
200 void CongestionController::OnReceivedPacket(int64_t arrival_time_ms,
201 size_t payload_size,
202 const RTPHeader& header) {
203 // Send-side BWE.
204 if (header.extension.hasTransportSequenceNumber) {
205 remote_estimator_proxy_.IncomingPacket(arrival_time_ms, payload_size,
206 header);
207 return;
208 }
209
210 // Receive-side BWE.
211 if (remote_bitrate_estimator_) {
212 remote_bitrate_estimator_->IncomingPacket(arrival_time_ms, payload_size,
213 header);
214 }
215 }
216
200 void CongestionController::SetBweBitrates(int min_bitrate_bps, 217 void CongestionController::SetBweBitrates(int min_bitrate_bps,
201 int start_bitrate_bps, 218 int start_bitrate_bps,
202 int max_bitrate_bps) { 219 int max_bitrate_bps) {
203 ClampBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); 220 ClampBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps);
204 bitrate_controller_->SetBitrates(start_bitrate_bps, 221 bitrate_controller_->SetBitrates(start_bitrate_bps,
205 min_bitrate_bps, 222 min_bitrate_bps,
206 max_bitrate_bps); 223 max_bitrate_bps);
207 224
208 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps, 225 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps,
209 max_bitrate_bps); 226 max_bitrate_bps);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 bool CongestionController::IsSendQueueFull() const { 381 bool CongestionController::IsSendQueueFull() const {
365 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; 382 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs;
366 } 383 }
367 384
368 bool CongestionController::IsNetworkDown() const { 385 bool CongestionController::IsNetworkDown() const {
369 rtc::CritScope cs(&critsect_); 386 rtc::CritScope cs(&critsect_);
370 return network_state_ == kNetworkDown; 387 return network_state_ == kNetworkDown;
371 } 388 }
372 389
373 } // namespace webrtc 390 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.cc ('k') | webrtc/modules/congestion_controller/congestion_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698