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

Unified Diff: content/common/gpu/media/rendering_helper.cc

Issue 562173003: rendering_helper - Drop frames if the decoder cannot catch up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « content/common/gpu/media/rendering_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/rendering_helper.cc
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc
index 00e85f9f0ecd0c44b1961175d1fc5ce248670712..d6621c92a56ae663e37736aa980587715562e953 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -75,7 +75,7 @@ VideoFrameTexture::~VideoFrameTexture() {
}
RenderingHelper::RenderedVideo::RenderedVideo()
- : last_frame_rendered(false), is_flushing(false) {
+ : last_frame_rendered(false), is_flushing(false), frames_to_drop(0) {
}
RenderingHelper::RenderedVideo::~RenderedVideo() {
@@ -398,6 +398,11 @@ void RenderingHelper::QueueVideoFrame(
RenderedVideo* video = &videos_[window_id];
DCHECK(!video->is_flushing);
+ if (video->frames_to_drop > 0) {
+ --video->frames_to_drop;
acolwell GONE FROM CHROMIUM 2014/09/16 19:10:39 Is this frame dropping visible outside this code i
Owen Lin 2014/09/17 02:48:35 The code is only used in the vda_unittest. It won'
+ return;
+ }
+
// Pop the last frame if it has been rendered.
if (video->last_frame_rendered) {
// When last_frame_rendered is true, we should have only one pending frame.
@@ -525,6 +530,9 @@ void RenderingHelper::RenderContent() {
GLSetViewPort(video->render_area);
RenderTexture(frame->texture_target(), frame->texture_id());
+ if (video->last_frame_rendered)
Pawel Osciak 2014/09/15 14:09:34 Please note here that we won't start dropping befo
Owen Lin 2014/09/16 01:38:34 That's the expected behavior, we always wait for t
+ ++video->frames_to_drop;
+
if (video->pending_frames.size() > 1 || video->is_flushing) {
frames_to_be_returned.push_back(video->pending_frames.front());
video->pending_frames.pop();
« no previous file with comments | « content/common/gpu/media/rendering_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698