Chromium Code Reviews

Side by Side Diff: webrtc/video/video_send_stream.cc

Issue 1947853002: Revert of Remove SendPacer from ViEEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « webrtc/video/encoder_state_feedback_unittest.cc ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...)
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 &overuse_detector_), 379 config.pre_encode_callback,
380 &overuse_detector_,
381 congestion_controller_->pacer()),
380 video_sender_(vie_encoder_.video_sender()), 382 video_sender_(vie_encoder_.video_sender()),
381 bandwidth_observer_(congestion_controller_->GetBitrateController() 383 bandwidth_observer_(congestion_controller_->GetBitrateController()
382 ->CreateRtcpBandwidthObserver()), 384 ->CreateRtcpBandwidthObserver()),
383 rtp_rtcp_modules_(CreateRtpRtcpModules( 385 rtp_rtcp_modules_(CreateRtpRtcpModules(
384 config.send_transport, 386 config.send_transport,
385 &encoder_feedback_, 387 &encoder_feedback_,
386 bandwidth_observer_.get(), 388 bandwidth_observer_.get(),
387 congestion_controller_->GetTransportFeedbackObserver(), 389 congestion_controller_->GetTransportFeedbackObserver(),
388 call_stats_->rtcp_rtt_stats(), 390 call_stats_->rtcp_rtt_stats(),
389 congestion_controller_->pacer(), 391 congestion_controller_->pacer(),
(...skipping 179 matching lines...)
569 bitrate_allocator_->EnforceMinBitrate(false); 571 bitrate_allocator_->EnforceMinBitrate(false);
570 } 572 }
571 // We might've gotten new settings while configuring the encoder settings, 573 // We might've gotten new settings while configuring the encoder settings,
572 // restart from the top to see if that's the case before trying to encode 574 // restart from the top to see if that's the case before trying to encode
573 // a frame (which might correspond to the last frame size). 575 // a frame (which might correspond to the last frame size).
574 encoder_wakeup_event_.Set(); 576 encoder_wakeup_event_.Set();
575 continue; 577 continue;
576 } 578 }
577 579
578 VideoFrame frame; 580 VideoFrame frame;
579 if (input_.GetVideoFrame(&frame)) { 581 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 }
585 vie_encoder_.EncodeVideoFrame(frame); 582 vie_encoder_.EncodeVideoFrame(frame);
586 }
587 } 583 }
588 vie_encoder_.DeRegisterExternalEncoder(config_.encoder_settings.payload_type); 584 vie_encoder_.DeRegisterExternalEncoder(config_.encoder_settings.payload_type);
589 } 585 }
590 586
591 void VideoSendStream::ReconfigureVideoEncoder( 587 void VideoSendStream::ReconfigureVideoEncoder(
592 const VideoEncoderConfig& config) { 588 const VideoEncoderConfig& config) {
593 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder"); 589 TRACE_EVENT0("webrtc", "VideoSendStream::(Re)configureVideoEncoder");
594 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString(); 590 LOG(LS_INFO) << "(Re)configureVideoEncoder: " << config.ToString();
595 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size()); 591 RTC_DCHECK_GE(config_.rtp.ssrcs.size(), config.streams.size());
596 VideoCodec video_codec = VideoEncoderConfigToVideoCodec( 592 VideoCodec video_codec = VideoEncoderConfigToVideoCodec(
(...skipping 174 matching lines...)
771 &module_nack_rate); 767 &module_nack_rate);
772 *sent_video_rate_bps += module_video_rate; 768 *sent_video_rate_bps += module_video_rate;
773 *sent_nack_rate_bps += module_nack_rate; 769 *sent_nack_rate_bps += module_nack_rate;
774 *sent_fec_rate_bps += module_fec_rate; 770 *sent_fec_rate_bps += module_fec_rate;
775 } 771 }
776 return 0; 772 return 0;
777 } 773 }
778 774
779 } // namespace internal 775 } // namespace internal
780 } // namespace webrtc 776 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/encoder_state_feedback_unittest.cc ('k') | webrtc/video/vie_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine