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

Unified Diff: media/cast/sender/video_sender.cc

Issue 863083002: [cast] Add optional VideoEncoder method to flush frames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add documentation for VideoConfig::max_number_of_video_buffers_used Created 5 years, 11 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
« media/cast/sender/video_encoder.h ('K') | « media/cast/sender/video_encoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/video_sender.cc
diff --git a/media/cast/sender/video_sender.cc b/media/cast/sender/video_sender.cc
index 0e9b72fed19b0f58003951d66073053c53d36b24..096e0421607b946aad99cd1e50df30bdd1d54c3e 100644
--- a/media/cast/sender/video_sender.cc
+++ b/media/cast/sender/video_sender.cc
@@ -186,6 +186,14 @@ void VideoSender::InsertRawVideoFrame(
VLOG(1) << "New target delay: " << new_target_delay.InMilliseconds();
playout_delay_change_cb_.Run(new_target_delay);
}
+
+ // Some encoder implementations have a frame window for analysis. Since we
+ // are dropping this frame, unless we instruct the encoder to flush all the
+ // frames that have been enqueued for encoding, frames_in_encoder_ and
+ // last_enqueued_frame_reference_time_ will never be updated and we will
+ // drop every subsequent frame for the rest of the session.
+ video_encoder_->EmitFrames();
+
return;
}
« media/cast/sender/video_encoder.h ('K') | « media/cast/sender/video_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698