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