| Index: webrtc/video/vie_encoder.cc
|
| diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
|
| index e4e0fe3aab9200c0cf48038daf85038b0db7e7ba..89cbb5285f9c43030605705f80827001ce5d20a9 100644
|
| --- a/webrtc/video/vie_encoder.cc
|
| +++ b/webrtc/video/vie_encoder.cc
|
| @@ -57,14 +57,18 @@
|
| const std::vector<uint32_t>& ssrcs,
|
| ProcessThread* module_process_thread,
|
| SendStatisticsProxy* stats_proxy,
|
| - OveruseFrameDetector* overuse_detector)
|
| + rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback,
|
| + OveruseFrameDetector* overuse_detector,
|
| + PacedSender* pacer)
|
| : number_of_cores_(number_of_cores),
|
| ssrcs_(ssrcs),
|
| vp_(VideoProcessing::Create()),
|
| qm_callback_(new QMVideoSettingsCallback(vp_.get())),
|
| video_sender_(Clock::GetRealTimeClock(), this, this, qm_callback_.get()),
|
| stats_proxy_(stats_proxy),
|
| + pre_encode_callback_(pre_encode_callback),
|
| overuse_detector_(overuse_detector),
|
| + pacer_(pacer),
|
| time_of_last_frame_activity_ms_(0),
|
| encoder_config_(),
|
| min_transmit_bitrate_bps_(0),
|
| @@ -250,7 +254,8 @@
|
| if (encoder_paused_) {
|
| return true;
|
| }
|
| - if (video_suspended_ || last_observed_bitrate_bps_ == 0) {
|
| + if (pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs) {
|
| + // Too much data in pacer queue, drop frame.
|
| return true;
|
| }
|
| return !network_is_transmitting_;
|
| @@ -297,6 +302,10 @@
|
| // Drop this frame, or there was an error processing it.
|
| return;
|
| }
|
| + }
|
| +
|
| + if (pre_encode_callback_) {
|
| + pre_encode_callback_->OnFrame(*frame_to_send);
|
| }
|
|
|
| if (codec_type == webrtc::kVideoCodecVP8) {
|
| @@ -440,7 +449,7 @@
|
| void ViEEncoder::OnBitrateUpdated(uint32_t bitrate_bps,
|
| uint8_t fraction_lost,
|
| int64_t round_trip_time_ms) {
|
| - LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate " << bitrate_bps
|
| + LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate" << bitrate_bps
|
| << " packet loss " << static_cast<int>(fraction_lost)
|
| << " rtt " << round_trip_time_ms;
|
| video_sender_.SetChannelParameters(bitrate_bps, fraction_lost,
|
|
|