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