| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |