Chromium Code Reviews| 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 |
| 11 #include "webrtc/modules/congestion_controller/include/send_side_congestion_cont roller.h" | 11 #include "webrtc/modules/congestion_controller/include/send_side_congestion_cont roller.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
| 18 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
| 19 #include "webrtc/base/ptr_util.h" | 19 #include "webrtc/base/ptr_util.h" |
| 20 #include "webrtc/base/rate_limiter.h" | 20 #include "webrtc/base/rate_limiter.h" |
| 21 #include "webrtc/base/socket.h" | 21 #include "webrtc/base/socket.h" |
| 22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 22 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
| 23 #include "webrtc/modules/congestion_controller/acknowledge_bitrate_estimator.h" | 23 #include "webrtc/modules/congestion_controller/acknowledged_bitrate_estimator.h" |
| 24 #include "webrtc/modules/congestion_controller/probe_controller.h" | 24 #include "webrtc/modules/congestion_controller/probe_controller.h" |
| 25 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" | 25 #include "webrtc/modules/remote_bitrate_estimator/include/bwe_defines.h" |
| 26 | 26 |
| 27 namespace webrtc { | 27 namespace webrtc { |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 static const int64_t kRetransmitWindowSizeMs = 500; | 30 static const int64_t kRetransmitWindowSizeMs = 500; |
| 31 | 31 |
| 32 // Makes sure that the bitrate and the min, max values are in valid range. | 32 // Makes sure that the bitrate and the min, max values are in valid range. |
| 33 static void ClampBitrates(int* bitrate_bps, | 33 static void ClampBitrates(int* bitrate_bps, |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 271 } | 271 } |
| 272 | 272 |
| 273 void SendSideCongestionController::OnTransportFeedback( | 273 void SendSideCongestionController::OnTransportFeedback( |
| 274 const rtcp::TransportFeedback& feedback) { | 274 const rtcp::TransportFeedback& feedback) { |
| 275 RTC_DCHECK_RUNS_SERIALIZED(&worker_race_); | 275 RTC_DCHECK_RUNS_SERIALIZED(&worker_race_); |
| 276 transport_feedback_adapter_.OnTransportFeedback(feedback); | 276 transport_feedback_adapter_.OnTransportFeedback(feedback); |
| 277 std::vector<PacketFeedback> feedback_vector = ReceivedPacketFeedbackVector( | 277 std::vector<PacketFeedback> feedback_vector = ReceivedPacketFeedbackVector( |
| 278 transport_feedback_adapter_.GetTransportFeedbackVector()); | 278 transport_feedback_adapter_.GetTransportFeedbackVector()); |
| 279 SortPacketFeedbackVector(&feedback_vector); | 279 SortPacketFeedbackVector(&feedback_vector); |
| 280 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector( | 280 acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector( |
| 281 feedback_vector); | 281 feedback_vector, |
| 282 static_cast<bool>(pacer_->GetApplicationLimitedRegionStartTime())); | |
|
stefan-webrtc
2017/07/06 15:28:37
I prefer:
pacer_->GetApplicationLimitedRegionStart
tschumi
2017/07/07 07:51:14
GetApplicationLimitedRegionStartTime returns a rtc
holmer
2017/07/07 07:53:06
Ah, my bad :)
Maybe you don't even need the cast
terelius
2017/07/07 08:01:19
I think the cast is needed, but there is a .has_va
tschumi
2017/07/07 09:07:59
Ok use has_value() now.
| |
| 282 DelayBasedBwe::Result result; | 283 DelayBasedBwe::Result result; |
| 283 { | 284 { |
| 284 rtc::CritScope cs(&bwe_lock_); | 285 rtc::CritScope cs(&bwe_lock_); |
| 285 result = delay_based_bwe_->IncomingPacketFeedbackVector( | 286 result = delay_based_bwe_->IncomingPacketFeedbackVector( |
| 286 feedback_vector, acknowledged_bitrate_estimator_->bitrate_bps()); | 287 feedback_vector, acknowledged_bitrate_estimator_->bitrate_bps()); |
| 287 } | 288 } |
| 288 if (result.updated) | 289 if (result.updated) |
| 289 bitrate_controller_->OnDelayBasedBweResult(result); | 290 bitrate_controller_->OnDelayBasedBweResult(result); |
| 290 } | 291 } |
| 291 | 292 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 347 bool SendSideCongestionController::IsSendQueueFull() const { | 348 bool SendSideCongestionController::IsSendQueueFull() const { |
| 348 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 349 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
| 349 } | 350 } |
| 350 | 351 |
| 351 bool SendSideCongestionController::IsNetworkDown() const { | 352 bool SendSideCongestionController::IsNetworkDown() const { |
| 352 rtc::CritScope cs(&network_state_lock_); | 353 rtc::CritScope cs(&network_state_lock_); |
| 353 return network_state_ == kNetworkDown; | 354 return network_state_ == kNetworkDown; |
| 354 } | 355 } |
| 355 | 356 |
| 356 } // namespace webrtc | 357 } // namespace webrtc |
| OLD | NEW |