OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 module_process_thread_(module_process_thread), | 138 module_process_thread_(module_process_thread), |
139 call_stats_(call_stats), | 139 call_stats_(call_stats), |
140 congestion_controller_(congestion_controller), | 140 congestion_controller_(congestion_controller), |
141 remb_(remb), | 141 remb_(remb), |
142 overuse_detector_( | 142 overuse_detector_( |
143 Clock::GetRealTimeClock(), | 143 Clock::GetRealTimeClock(), |
144 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), | 144 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), |
145 this, | 145 this, |
146 config.post_encode_callback, | 146 config.post_encode_callback, |
147 &stats_proxy_), | 147 &stats_proxy_), |
148 vie_encoder_(num_cpu_cores, | |
149 module_process_thread_, | |
150 &stats_proxy_, | |
151 config.pre_encode_callback, | |
152 &overuse_detector_, | |
153 congestion_controller_->pacer(), | |
154 &payload_router_, | |
155 bitrate_allocator), | |
156 vcm_(vie_encoder_.vcm()), | |
157 vie_channel_(config.send_transport, | 148 vie_channel_(config.send_transport, |
158 module_process_thread_, | 149 module_process_thread_, |
159 &payload_router_, | 150 &payload_router_, |
160 nullptr, | 151 nullptr, |
161 encoder_feedback_.GetRtcpIntraFrameObserver(), | 152 encoder_feedback_.GetRtcpIntraFrameObserver(), |
162 congestion_controller_->GetBitrateController() | 153 congestion_controller_->GetBitrateController() |
163 ->CreateRtcpBandwidthObserver(), | 154 ->CreateRtcpBandwidthObserver(), |
164 congestion_controller_->GetTransportFeedbackObserver(), | 155 congestion_controller_->GetTransportFeedbackObserver(), |
165 nullptr, | 156 nullptr, |
166 call_stats_->rtcp_rtt_stats(), | 157 call_stats_->rtcp_rtt_stats(), |
167 congestion_controller_->pacer(), | 158 congestion_controller_->pacer(), |
168 congestion_controller_->packet_router(), | 159 congestion_controller_->packet_router(), |
169 config_.rtp.ssrcs.size(), | 160 config_.rtp.ssrcs.size(), |
170 true), | 161 true), |
171 vie_receiver_(vie_channel_.vie_receiver()), | 162 vie_receiver_(vie_channel_.vie_receiver()), |
| 163 vie_encoder_(num_cpu_cores, |
| 164 module_process_thread_, |
| 165 &stats_proxy_, |
| 166 config.pre_encode_callback, |
| 167 &overuse_detector_, |
| 168 congestion_controller_->pacer(), |
| 169 &payload_router_, |
| 170 bitrate_allocator), |
| 171 vcm_(vie_encoder_.vcm()), |
172 input_(&vie_encoder_, | 172 input_(&vie_encoder_, |
173 config_.local_renderer, | 173 config_.local_renderer, |
174 &stats_proxy_, | 174 &stats_proxy_, |
175 &overuse_detector_) { | 175 &overuse_detector_) { |
176 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); | 176 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); |
177 | 177 |
178 RTC_DCHECK(!config_.rtp.ssrcs.empty()); | 178 RTC_DCHECK(!config_.rtp.ssrcs.empty()); |
179 RTC_DCHECK(module_process_thread_); | 179 RTC_DCHECK(module_process_thread_); |
180 RTC_DCHECK(call_stats_); | 180 RTC_DCHECK(call_stats_); |
181 RTC_DCHECK(congestion_controller_); | 181 RTC_DCHECK(congestion_controller_); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 vie_channel_.RegisterSendFrameCountObserver(&stats_proxy_); | 258 vie_channel_.RegisterSendFrameCountObserver(&stats_proxy_); |
259 | 259 |
260 module_process_thread_->RegisterModule(&overuse_detector_); | 260 module_process_thread_->RegisterModule(&overuse_detector_); |
261 } | 261 } |
262 | 262 |
263 VideoSendStream::~VideoSendStream() { | 263 VideoSendStream::~VideoSendStream() { |
264 LOG(LS_INFO) << "~VideoSendStream: " << config_.ToString(); | 264 LOG(LS_INFO) << "~VideoSendStream: " << config_.ToString(); |
265 Stop(); | 265 Stop(); |
266 | 266 |
267 module_process_thread_->DeRegisterModule(&overuse_detector_); | 267 module_process_thread_->DeRegisterModule(&overuse_detector_); |
268 // Remove vcm_protection_callback (part of vie_channel_) before destroying | |
269 // ViEChannel. vcm_ is owned by ViEEncoder and the registered callback does | |
270 // not outlive it. | |
271 vcm_->RegisterProtectionCallback(nullptr); | |
272 vie_channel_.RegisterSendFrameCountObserver(nullptr); | 268 vie_channel_.RegisterSendFrameCountObserver(nullptr); |
273 vie_channel_.RegisterSendBitrateObserver(nullptr); | 269 vie_channel_.RegisterSendBitrateObserver(nullptr); |
274 vie_channel_.RegisterRtcpPacketTypeCounterObserver(nullptr); | 270 vie_channel_.RegisterRtcpPacketTypeCounterObserver(nullptr); |
275 vie_channel_.RegisterSendChannelRtpStatisticsCallback(nullptr); | 271 vie_channel_.RegisterSendChannelRtpStatisticsCallback(nullptr); |
276 vie_channel_.RegisterSendChannelRtcpStatisticsCallback(nullptr); | 272 vie_channel_.RegisterSendChannelRtcpStatisticsCallback(nullptr); |
277 | 273 |
278 vie_encoder_.DeRegisterExternalEncoder( | 274 vie_encoder_.DeRegisterExternalEncoder( |
279 config_.encoder_settings.payload_type); | 275 config_.encoder_settings.payload_type); |
280 | 276 |
281 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); | 277 call_stats_->DeregisterStatsObserver(vie_channel_.GetStatsObserver()); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); | 594 used_ssrcs.resize(static_cast<size_t>(video_codec.numberOfSimulcastStreams)); |
599 vie_encoder_.SetSsrcs(used_ssrcs); | 595 vie_encoder_.SetSsrcs(used_ssrcs); |
600 | 596 |
601 // Restart the media flow | 597 // Restart the media flow |
602 vie_encoder_.Restart(); | 598 vie_encoder_.Restart(); |
603 | 599 |
604 return true; | 600 return true; |
605 } | 601 } |
606 } // namespace internal | 602 } // namespace internal |
607 } // namespace webrtc | 603 } // namespace webrtc |
OLD | NEW |