| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 last_reported_rtt_(0), | 76 last_reported_rtt_(0), |
| 77 network_state_(kNetworkUp), | 77 network_state_(kNetworkUp), |
| 78 min_bitrate_bps_(congestion_controller::GetMinBitrateBps()), | 78 min_bitrate_bps_(congestion_controller::GetMinBitrateBps()), |
| 79 delay_based_bwe_(new DelayBasedBwe(event_log_, clock_)) { | 79 delay_based_bwe_(new DelayBasedBwe(event_log_, clock_)) { |
| 80 delay_based_bwe_->SetMinBitrate(min_bitrate_bps_); | 80 delay_based_bwe_->SetMinBitrate(min_bitrate_bps_); |
| 81 worker_thread_checker_.DetachFromThread(); | 81 worker_thread_checker_.DetachFromThread(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 SendSideCongestionController::~SendSideCongestionController() {} | 84 SendSideCongestionController::~SendSideCongestionController() {} |
| 85 | 85 |
| 86 void SendSideCongestionController::RegisterPacketFeedbackObserver( |
| 87 PacketFeedbackObserver* observer) { |
| 88 transport_feedback_adapter_.RegisterPacketFeedbackObserver(observer); |
| 89 } |
| 90 |
| 91 void SendSideCongestionController::DeRegisterPacketFeedbackObserver( |
| 92 PacketFeedbackObserver* observer) { |
| 93 transport_feedback_adapter_.DeRegisterPacketFeedbackObserver(observer); |
| 94 } |
| 95 |
| 86 void SendSideCongestionController::SetBweBitrates(int min_bitrate_bps, | 96 void SendSideCongestionController::SetBweBitrates(int min_bitrate_bps, |
| 87 int start_bitrate_bps, | 97 int start_bitrate_bps, |
| 88 int max_bitrate_bps) { | 98 int max_bitrate_bps) { |
| 89 ClampBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); | 99 ClampBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); |
| 90 bitrate_controller_->SetBitrates(start_bitrate_bps, min_bitrate_bps, | 100 bitrate_controller_->SetBitrates(start_bitrate_bps, min_bitrate_bps, |
| 91 max_bitrate_bps); | 101 max_bitrate_bps); |
| 92 | 102 |
| 93 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps, | 103 probe_controller_->SetBitrates(min_bitrate_bps, start_bitrate_bps, |
| 94 max_bitrate_bps); | 104 max_bitrate_bps); |
| 95 | 105 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 return bitrate_controller_->TimeUntilNextProcess(); | 206 return bitrate_controller_->TimeUntilNextProcess(); |
| 197 } | 207 } |
| 198 | 208 |
| 199 void SendSideCongestionController::Process() { | 209 void SendSideCongestionController::Process() { |
| 200 bitrate_controller_->Process(); | 210 bitrate_controller_->Process(); |
| 201 probe_controller_->Process(); | 211 probe_controller_->Process(); |
| 202 MaybeTriggerOnNetworkChanged(); | 212 MaybeTriggerOnNetworkChanged(); |
| 203 } | 213 } |
| 204 | 214 |
| 205 void SendSideCongestionController::AddPacket( | 215 void SendSideCongestionController::AddPacket( |
| 216 uint32_t ssrc, |
| 206 uint16_t sequence_number, | 217 uint16_t sequence_number, |
| 207 size_t length, | 218 size_t length, |
| 208 const PacedPacketInfo& pacing_info) { | 219 const PacedPacketInfo& pacing_info) { |
| 209 transport_feedback_adapter_.AddPacket(sequence_number, length, pacing_info); | 220 transport_feedback_adapter_.AddPacket(ssrc, sequence_number, length, |
| 221 pacing_info); |
| 210 } | 222 } |
| 211 | 223 |
| 212 void SendSideCongestionController::OnTransportFeedback( | 224 void SendSideCongestionController::OnTransportFeedback( |
| 213 const rtcp::TransportFeedback& feedback) { | 225 const rtcp::TransportFeedback& feedback) { |
| 214 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 226 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 215 transport_feedback_adapter_.OnTransportFeedback(feedback); | 227 transport_feedback_adapter_.OnTransportFeedback(feedback); |
| 216 std::vector<PacketFeedback> feedback_vector = | 228 std::vector<PacketFeedback> feedback_vector = |
| 217 transport_feedback_adapter_.GetTransportFeedbackVector(); | 229 transport_feedback_adapter_.GetTransportFeedbackVector(); |
| 218 if (feedback_vector.empty()) | 230 if (feedback_vector.empty()) |
| 219 return; | 231 return; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 bool SendSideCongestionController::IsSendQueueFull() const { | 296 bool SendSideCongestionController::IsSendQueueFull() const { |
| 285 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 297 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
| 286 } | 298 } |
| 287 | 299 |
| 288 bool SendSideCongestionController::IsNetworkDown() const { | 300 bool SendSideCongestionController::IsNetworkDown() const { |
| 289 rtc::CritScope cs(&network_state_lock_); | 301 rtc::CritScope cs(&network_state_lock_); |
| 290 return network_state_ == kNetworkDown; | 302 return network_state_ == kNetworkDown; |
| 291 } | 303 } |
| 292 | 304 |
| 293 } // namespace webrtc | 305 } // namespace webrtc |
| OLD | NEW |