| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 remote_bitrate_observer, | 160 remote_bitrate_observer, |
| 161 event_log, | 161 event_log, |
| 162 packet_router, | 162 packet_router, |
| 163 std::unique_ptr<PacedSender>(new PacedSender(clock, packet_router))) { | 163 std::unique_ptr<PacedSender>(new PacedSender(clock, packet_router))) { |
| 164 } | 164 } |
| 165 | 165 |
| 166 CongestionController::CongestionController( | 166 CongestionController::CongestionController( |
| 167 Clock* clock, | 167 Clock* clock, |
| 168 Observer* observer, | 168 Observer* observer, |
| 169 RemoteBitrateObserver* remote_bitrate_observer, | 169 RemoteBitrateObserver* remote_bitrate_observer, |
| 170 RtcEventLog* event_log) | |
| 171 : CongestionController(clock, observer, remote_bitrate_observer, event_log, | |
| 172 new PacketRouter()) { | |
| 173 // Record ownership. | |
| 174 owned_packet_router_.reset(packet_router_); | |
| 175 } | |
| 176 | |
| 177 CongestionController::CongestionController( | |
| 178 Clock* clock, | |
| 179 Observer* observer, | |
| 180 RemoteBitrateObserver* remote_bitrate_observer, | |
| 181 RtcEventLog* event_log, | 170 RtcEventLog* event_log, |
| 182 PacketRouter* packet_router, | 171 PacketRouter* packet_router, |
| 183 std::unique_ptr<PacedSender> pacer) | 172 std::unique_ptr<PacedSender> pacer) |
| 184 : clock_(clock), | 173 : clock_(clock), |
| 185 observer_(observer), | 174 observer_(observer), |
| 186 packet_router_(packet_router), | 175 packet_router_(packet_router), |
| 187 pacer_(std::move(pacer)), | 176 pacer_(std::move(pacer)), |
| 188 remote_bitrate_estimator_( | 177 remote_bitrate_estimator_( |
| 189 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), | 178 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), |
| 190 // Constructed last as this object calls the provided callback on | 179 // Constructed last as this object calls the provided callback on |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 bool CongestionController::IsSendQueueFull() const { | 360 bool CongestionController::IsSendQueueFull() const { |
| 372 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 361 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
| 373 } | 362 } |
| 374 | 363 |
| 375 bool CongestionController::IsNetworkDown() const { | 364 bool CongestionController::IsNetworkDown() const { |
| 376 rtc::CritScope cs(&critsect_); | 365 rtc::CritScope cs(&critsect_); |
| 377 return network_state_ == kNetworkDown; | 366 return network_state_ == kNetworkDown; |
| 378 } | 367 } |
| 379 | 368 |
| 380 } // namespace webrtc | 369 } // namespace webrtc |
| OLD | NEW |