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

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: Rebase 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
« no previous file with comments | « 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 3a646bfbb3b12ffebcc66a306ef1c019d55e3fc8..b9520834c63776375c388312f2dfca1d06230a9a 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;
}
« no previous file with comments | « media/cast/sender/video_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698