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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 remb_(remb), | 222 remb_(remb), |
223 encoder_thread_(EncoderThreadFunction, this, "EncoderThread"), | 223 encoder_thread_(EncoderThreadFunction, this, "EncoderThread"), |
224 encoder_wakeup_event_(false, false), | 224 encoder_wakeup_event_(false, false), |
225 stop_encoder_thread_(0), | 225 stop_encoder_thread_(0), |
226 overuse_detector_( | 226 overuse_detector_( |
227 Clock::GetRealTimeClock(), | 227 Clock::GetRealTimeClock(), |
228 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), | 228 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), |
229 this, | 229 this, |
230 config.post_encode_callback, | 230 config.post_encode_callback, |
231 &stats_proxy_), | 231 &stats_proxy_), |
232 vie_encoder_( | 232 vie_encoder_(num_cpu_cores, |
233 num_cpu_cores, | 233 config_.rtp.ssrcs, |
234 config_.rtp.ssrcs, | 234 module_process_thread_, |
235 module_process_thread_, | 235 &stats_proxy_, |
236 &stats_proxy_, | 236 config.pre_encode_callback, |
237 config.pre_encode_callback, | 237 &overuse_detector_, |
238 &overuse_detector_, | 238 congestion_controller_->pacer(), |
239 congestion_controller_->pacer(), | 239 &payload_router_), |
240 &payload_router_, | |
241 config.post_encode_callback ? &encoded_frame_proxy_ : nullptr), | |
242 vcm_(vie_encoder_.vcm()), | 240 vcm_(vie_encoder_.vcm()), |
243 bandwidth_observer_(congestion_controller_->GetBitrateController() | 241 bandwidth_observer_(congestion_controller_->GetBitrateController() |
244 ->CreateRtcpBandwidthObserver()), | 242 ->CreateRtcpBandwidthObserver()), |
245 rtp_rtcp_modules_(CreateRtpRtcpModules( | 243 rtp_rtcp_modules_(CreateRtpRtcpModules( |
246 config.send_transport, | 244 config.send_transport, |
247 &encoder_feedback_, | 245 &encoder_feedback_, |
248 bandwidth_observer_.get(), | 246 bandwidth_observer_.get(), |
249 congestion_controller_->GetTransportFeedbackObserver(), | 247 congestion_controller_->GetTransportFeedbackObserver(), |
250 call_stats_->rtcp_rtt_stats(), | 248 call_stats_->rtcp_rtt_stats(), |
251 congestion_controller_->pacer(), | 249 congestion_controller_->pacer(), |
252 congestion_controller_->packet_router(), | 250 congestion_controller_->packet_router(), |
253 &stats_proxy_, | 251 &stats_proxy_, |
254 config_.rtp.ssrcs.size())), | 252 config_.rtp.ssrcs.size())), |
255 payload_router_(rtp_rtcp_modules_, config.encoder_settings.payload_type), | 253 payload_router_(rtp_rtcp_modules_), |
256 input_(&encoder_wakeup_event_, | 254 input_(&encoder_wakeup_event_, |
257 config_.local_renderer, | 255 config_.local_renderer, |
258 &stats_proxy_, | 256 &stats_proxy_, |
259 &overuse_detector_) { | 257 &overuse_detector_) { |
260 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); | 258 LOG(LS_INFO) << "VideoSendStream: " << config_.ToString(); |
261 | 259 |
262 RTC_DCHECK(!config_.rtp.ssrcs.empty()); | 260 RTC_DCHECK(!config_.rtp.ssrcs.empty()); |
263 RTC_DCHECK(module_process_thread_); | 261 RTC_DCHECK(module_process_thread_); |
264 RTC_DCHECK(call_stats_); | 262 RTC_DCHECK(call_stats_); |
265 RTC_DCHECK(congestion_controller_); | 263 RTC_DCHECK(congestion_controller_); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 RTC_DCHECK(config.encoder_settings.encoder); | 312 RTC_DCHECK(config.encoder_settings.encoder); |
315 RTC_DCHECK_GE(config.encoder_settings.payload_type, 0); | 313 RTC_DCHECK_GE(config.encoder_settings.payload_type, 0); |
316 RTC_DCHECK_LE(config.encoder_settings.payload_type, 127); | 314 RTC_DCHECK_LE(config.encoder_settings.payload_type, 127); |
317 RTC_CHECK_EQ(0, vie_encoder_.RegisterExternalEncoder( | 315 RTC_CHECK_EQ(0, vie_encoder_.RegisterExternalEncoder( |
318 config.encoder_settings.encoder, | 316 config.encoder_settings.encoder, |
319 config.encoder_settings.payload_type, | 317 config.encoder_settings.payload_type, |
320 config.encoder_settings.internal_source)); | 318 config.encoder_settings.internal_source)); |
321 | 319 |
322 ReconfigureVideoEncoder(encoder_config); | 320 ReconfigureVideoEncoder(encoder_config); |
323 | 321 |
| 322 if (config_.post_encode_callback) |
| 323 vie_encoder_.RegisterPostEncodeImageCallback(&encoded_frame_proxy_); |
| 324 |
324 if (config_.suspend_below_min_bitrate) { | 325 if (config_.suspend_below_min_bitrate) { |
325 vcm_->SuspendBelowMinBitrate(); | 326 vcm_->SuspendBelowMinBitrate(); |
326 bitrate_allocator_->EnforceMinBitrate(false); | 327 bitrate_allocator_->EnforceMinBitrate(false); |
327 } | 328 } |
328 | 329 |
329 module_process_thread_->RegisterModule(&overuse_detector_); | 330 module_process_thread_->RegisterModule(&overuse_detector_); |
330 | 331 |
331 encoder_thread_.Start(); | 332 encoder_thread_.Start(); |
332 encoder_thread_.SetPriority(rtc::kHighPriority); | 333 encoder_thread_.SetPriority(rtc::kHighPriority); |
333 } | 334 } |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 &module_nack_rate); | 722 &module_nack_rate); |
722 *sent_video_rate_bps += module_video_rate; | 723 *sent_video_rate_bps += module_video_rate; |
723 *sent_nack_rate_bps += module_nack_rate; | 724 *sent_nack_rate_bps += module_nack_rate; |
724 *sent_fec_rate_bps += module_fec_rate; | 725 *sent_fec_rate_bps += module_fec_rate; |
725 } | 726 } |
726 return 0; | 727 return 0; |
727 } | 728 } |
728 | 729 |
729 } // namespace internal | 730 } // namespace internal |
730 } // namespace webrtc | 731 } // namespace webrtc |
OLD | NEW |