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 stop_encoder_thread_(0), | 372 stop_encoder_thread_(0), |
373 overuse_detector_( | 373 overuse_detector_( |
374 Clock::GetRealTimeClock(), | 374 Clock::GetRealTimeClock(), |
375 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), | 375 GetCpuOveruseOptions(config.encoder_settings.full_overuse_time), |
376 this, | 376 this, |
377 config.post_encode_callback, | 377 config.post_encode_callback, |
378 &stats_proxy_), | 378 &stats_proxy_), |
379 vie_encoder_(num_cpu_cores, | 379 vie_encoder_(num_cpu_cores, |
380 module_process_thread_, | 380 module_process_thread_, |
381 &stats_proxy_, | 381 &stats_proxy_, |
382 &overuse_detector_), | 382 config.pre_encode_callback, |
| 383 &overuse_detector_, |
| 384 congestion_controller_->pacer()), |
383 encoder_feedback_(Clock::GetRealTimeClock(), | 385 encoder_feedback_(Clock::GetRealTimeClock(), |
384 config.rtp.ssrcs, | 386 config.rtp.ssrcs, |
385 &vie_encoder_), | 387 &vie_encoder_), |
386 video_sender_(vie_encoder_.video_sender()), | 388 video_sender_(vie_encoder_.video_sender()), |
387 bandwidth_observer_(congestion_controller_->GetBitrateController() | 389 bandwidth_observer_(congestion_controller_->GetBitrateController() |
388 ->CreateRtcpBandwidthObserver()), | 390 ->CreateRtcpBandwidthObserver()), |
389 rtp_rtcp_modules_(CreateRtpRtcpModules( | 391 rtp_rtcp_modules_(CreateRtpRtcpModules( |
390 config.send_transport, | 392 config.send_transport, |
391 &encoder_feedback_, | 393 &encoder_feedback_, |
392 bandwidth_observer_.get(), | 394 bandwidth_observer_.get(), |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 bitrate_allocator_->EnforceMinBitrate(false); | 583 bitrate_allocator_->EnforceMinBitrate(false); |
582 } | 584 } |
583 // We might've gotten new settings while configuring the encoder settings, | 585 // We might've gotten new settings while configuring the encoder settings, |
584 // restart from the top to see if that's the case before trying to encode | 586 // restart from the top to see if that's the case before trying to encode |
585 // a frame (which might correspond to the last frame size). | 587 // a frame (which might correspond to the last frame size). |
586 encoder_wakeup_event_.Set(); | 588 encoder_wakeup_event_.Set(); |
587 continue; | 589 continue; |
588 } | 590 } |
589 | 591 |
590 VideoFrame frame; | 592 VideoFrame frame; |
591 if (input_.GetVideoFrame(&frame)) { | 593 if (input_.GetVideoFrame(&frame)) |
592 // TODO(perkj): |pre_encode_callback| is only used by tests. Tests should | |
593 // register as a sink to the VideoSource instead. | |
594 if (config_.pre_encode_callback) { | |
595 config_.pre_encode_callback->OnFrame(frame); | |
596 } | |
597 vie_encoder_.EncodeVideoFrame(frame); | 594 vie_encoder_.EncodeVideoFrame(frame); |
598 } | |
599 } | 595 } |
600 vie_encoder_.DeRegisterExternalEncoder(config_.encoder_settings.payload_type); | 596 vie_encoder_.DeRegisterExternalEncoder(config_.encoder_settings.payload_type); |
601 } | 597 } |
602 | 598 |
603 void VideoSendStream::ReconfigureVideoEncoder( | 599 void VideoSendStream::ReconfigureVideoEncoder( |
604 const VideoEncoderConfig& config) { | 600 const VideoEncoderConfig& config) { |
605 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); | 601 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); |
606 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); | 602 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); |
607 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size()); | 603 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size()); |
608 VideoCodec video_codec = VideoEncoderConfigToVideoCodec( | 604 VideoCodec video_codec = VideoEncoderConfigToVideoCodec( |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 &module_nack_rate); | 804 &module_nack_rate); |
809 *sent_video_rate_bps += module_video_rate; | 805 *sent_video_rate_bps += module_video_rate; |
810 *sent_nack_rate_bps += module_nack_rate; | 806 *sent_nack_rate_bps += module_nack_rate; |
811 *sent_fec_rate_bps += module_fec_rate; | 807 *sent_fec_rate_bps += module_fec_rate; |
812 } | 808 } |
813 return 0; | 809 return 0; |
814 } | 810 } |
815 | 811 |
816 } // namespace internal | 812 } // namespace internal |
817 } // namespace webrtc | 813 } // namespace webrtc |
OLD | NEW |