| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 pacer_thread_(ProcessThread::Create("PacerThread")), | 164 pacer_thread_(ProcessThread::Create("PacerThread")), |
| 165 // Constructed last as this object calls the provided callback on | 165 // Constructed last as this object calls the provided callback on |
| 166 // construction. | 166 // construction. |
| 167 bitrate_controller_( | 167 bitrate_controller_( |
| 168 BitrateController::CreateBitrateController(Clock::GetRealTimeClock(), | 168 BitrateController::CreateBitrateController(Clock::GetRealTimeClock(), |
| 169 bitrate_observer)), | 169 bitrate_observer)), |
| 170 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps) { | 170 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps) { |
| 171 call_stats_->RegisterStatsObserver(remote_bitrate_estimator_.get()); | 171 call_stats_->RegisterStatsObserver(remote_bitrate_estimator_.get()); |
| 172 | 172 |
| 173 pacer_thread_->RegisterModule(pacer_.get()); | 173 pacer_thread_->RegisterModule(pacer_.get()); |
| 174 pacer_thread_->RegisterModule(remote_estimator_proxy_.get()); |
| 174 pacer_thread_->Start(); | 175 pacer_thread_->Start(); |
| 175 | 176 |
| 176 process_thread->RegisterModule(remote_estimator_proxy_.get()); | |
| 177 process_thread->RegisterModule(remote_bitrate_estimator_.get()); | 177 process_thread->RegisterModule(remote_bitrate_estimator_.get()); |
| 178 process_thread->RegisterModule(bitrate_controller_.get()); | 178 process_thread->RegisterModule(bitrate_controller_.get()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 CongestionController::~CongestionController() { | 181 CongestionController::~CongestionController() { |
| 182 pacer_thread_->Stop(); | 182 pacer_thread_->Stop(); |
| 183 pacer_thread_->DeRegisterModule(pacer_.get()); | 183 pacer_thread_->DeRegisterModule(pacer_.get()); |
| 184 pacer_thread_->DeRegisterModule(remote_estimator_proxy_.get()); |
| 184 process_thread_->DeRegisterModule(bitrate_controller_.get()); | 185 process_thread_->DeRegisterModule(bitrate_controller_.get()); |
| 185 process_thread_->DeRegisterModule(remote_bitrate_estimator_.get()); | 186 process_thread_->DeRegisterModule(remote_bitrate_estimator_.get()); |
| 186 process_thread_->DeRegisterModule(remote_estimator_proxy_.get()); | |
| 187 call_stats_->DeregisterStatsObserver(remote_bitrate_estimator_.get()); | 187 call_stats_->DeregisterStatsObserver(remote_bitrate_estimator_.get()); |
| 188 if (transport_feedback_adapter_.get()) | 188 if (transport_feedback_adapter_.get()) |
| 189 call_stats_->DeregisterStatsObserver(transport_feedback_adapter_.get()); | 189 call_stats_->DeregisterStatsObserver(transport_feedback_adapter_.get()); |
| 190 RTC_DCHECK(!remb_->InUse()); | 190 RTC_DCHECK(!remb_->InUse()); |
| 191 RTC_DCHECK(encoders_.empty()); | 191 RTC_DCHECK(encoders_.empty()); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void CongestionController::AddEncoder(ViEEncoder* encoder) { | 194 void CongestionController::AddEncoder(ViEEncoder* encoder) { |
| 195 rtc::CritScope lock(&encoder_crit_); | 195 rtc::CritScope lock(&encoder_crit_); |
| 196 encoders_.push_back(encoder); | 196 encoders_.push_back(encoder); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 void CongestionController::OnSentPacket(const rtc::SentPacket& sent_packet) { | 286 void CongestionController::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| 287 if (transport_feedback_adapter_) { | 287 if (transport_feedback_adapter_) { |
| 288 transport_feedback_adapter_->OnSentPacket(sent_packet.packet_id, | 288 transport_feedback_adapter_->OnSentPacket(sent_packet.packet_id, |
| 289 sent_packet.send_time_ms); | 289 sent_packet.send_time_ms); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 } // namespace webrtc | 292 } // namespace webrtc |
| OLD | NEW |