Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: webrtc/video/vie_encoder.cc

Issue 1958053002: Revert "Reland of Remove SendPacer from ViEEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index ec20ad95fdede4ff6a26737542bdd3f98e8da05e..2a7c21adc9f3da0c5028e220b4853dec0386ebc8 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -48,7 +48,9 @@ class QMVideoSettingsCallback : public VCMQMSettingsCallback {
ViEEncoder::ViEEncoder(uint32_t number_of_cores,
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),
vp_(VideoProcessing::Create()),
qm_callback_(new QMVideoSettingsCallback(vp_.get())),
@@ -58,7 +60,9 @@ ViEEncoder::ViEEncoder(uint32_t number_of_cores,
qm_callback_.get(),
this),
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),
@@ -225,7 +229,8 @@ bool ViEEncoder::EncoderPaused() const {
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_;
@@ -274,6 +279,10 @@ void ViEEncoder::EncodeVideoFrame(const VideoFrame& video_frame) {
}
}
+ if (pre_encode_callback_) {
+ pre_encode_callback_->OnFrame(*frame_to_send);
+ }
+
if (codec_type == webrtc::kVideoCodecVP8) {
webrtc::CodecSpecificInfo codec_specific_info;
codec_specific_info.codecType = webrtc::kVideoCodecVP8;
@@ -368,7 +377,7 @@ void ViEEncoder::OnReceivedIntraFrameRequest(size_t stream_index) {
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,
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698