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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 overuse_detector_( | 372 overuse_detector_( |
373 Clock::GetRealTimeClock(), | 373 Clock::GetRealTimeClock(), |
374 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), | 374 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), |
375 this, | 375 this, |
376 config.post_encode_callback, | 376 config.post_encode_callback, |
377 &stats_proxy_), | 377 &stats_proxy_), |
378 vie_encoder_(num_cpu_cores, | 378 vie_encoder_(num_cpu_cores, |
379 config_.rtp.ssrcs, | 379 config_.rtp.ssrcs, |
380 module_process_thread_, | 380 module_process_thread_, |
381 &stats_proxy_, | 381 &stats_proxy_, |
382 config.pre_encode_callback, | 382 &overuse_detector_), |
383 &overuse_detector_, | |
384 congestion_controller_->pacer()), | |
385 video_sender_(vie_encoder_.video_sender()), | 383 video_sender_(vie_encoder_.video_sender()), |
386 bandwidth_observer_(congestion_controller_->GetBitrateController() | 384 bandwidth_observer_(congestion_controller_->GetBitrateController() |
387 ->CreateRtcpBandwidthObserver()), | 385 ->CreateRtcpBandwidthObserver()), |
388 rtp_rtcp_modules_(CreateRtpRtcpModules( | 386 rtp_rtcp_modules_(CreateRtpRtcpModules( |
389 config.send_transport, | 387 config.send_transport, |
390 &encoder_feedback_, | 388 &encoder_feedback_, |
391 bandwidth_observer_.get(), | 389 bandwidth_observer_.get(), |
392 congestion_controller_->GetTransportFeedbackObserver(), | 390 congestion_controller_->GetTransportFeedbackObserver(), |
393 call_stats_->rtcp_rtt_stats(), | 391 call_stats_->rtcp_rtt_stats(), |
394 congestion_controller_->pacer(), | 392 congestion_controller_->pacer(), |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 bitrate_allocator_->EnforceMinBitrate(false); | 572 bitrate_allocator_->EnforceMinBitrate(false); |
575 } | 573 } |
576 // We might've gotten new settings while configuring the encoder settings, | 574 // We might've gotten new settings while configuring the encoder settings, |
577 // restart from the top to see if that's the case before trying to encode | 575 // restart from the top to see if that's the case before trying to encode |
578 // a frame (which might correspond to the last frame size). | 576 // a frame (which might correspond to the last frame size). |
579 encoder_wakeup_event_.Set(); | 577 encoder_wakeup_event_.Set(); |
580 continue; | 578 continue; |
581 } | 579 } |
582 | 580 |
583 VideoFrame frame; | 581 VideoFrame frame; |
584 if (input_.GetVideoFrame(&frame)) | 582 if (input_.GetVideoFrame(&frame)) { |
| 583 // TODO(perkj): |pre_encode_callback| is only used by tests. Tests should |
| 584 // register as a sink to the VideoSource instead. |
| 585 if (config_.pre_encode_callback) { |
| 586 config_.pre_encode_callback->OnFrame(frame); |
| 587 } |
585 vie_encoder_.EncodeVideoFrame(frame); | 588 vie_encoder_.EncodeVideoFrame(frame); |
| 589 } |
586 } | 590 } |
587 vie_encoder_.DeRegisterExternalEncoder(config_.encoder_settings.payload_type); | 591 vie_encoder_.DeRegisterExternalEncoder(config_.encoder_settings.payload_type); |
588 } | 592 } |
589 | 593 |
590 void VideoSendStream::ReconfigureVideoEncoder( | 594 void VideoSendStream::ReconfigureVideoEncoder( |
591 const VideoEncoderConfig& config) { | 595 const VideoEncoderConfig& config) { |
592 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); | 596 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); |
593 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); | 597 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); |
594 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size()); | 598 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size()); |
595 VideoCodec video_codec = VideoEncoderConfigToVideoCodec( | 599 VideoCodec video_codec = VideoEncoderConfigToVideoCodec( |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 &module_nack_rate); | 774 &module_nack_rate); |
771 *sent_video_rate_bps += module_video_rate; | 775 *sent_video_rate_bps += module_video_rate; |
772 *sent_nack_rate_bps += module_nack_rate; | 776 *sent_nack_rate_bps += module_nack_rate; |
773 *sent_fec_rate_bps += module_fec_rate; | 777 *sent_fec_rate_bps += module_fec_rate; |
774 } | 778 } |
775 return 0; | 779 return 0; |
776 } | 780 } |
777 | 781 |
778 } // namespace internal | 782 } // namespace internal |
779 } // namespace webrtc | 783 } // namespace webrtc |
OLD | NEW |