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

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

Issue 465293002: rendering_helper - Wait for rendering before resetting the decoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
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 5f8ae749e1eef31f9e7972f3bbd8c075cb711452..9302b4afedcde3311dc44294e65113093b7b241e 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -490,6 +490,18 @@ void RenderingHelper::GetThumbnailsAsRGB(std::vector<unsigned char>* rgb,
done->Signal();
}
+void RenderingHelper::SetWaitRenderingCB(
+ size_t window_id,
+ const base::Closure& wait_rendering_cb) {
+ RenderingClient* client = &clients_[window_id];
+ if (client->pending_frames.empty() || client->last_frame_rendered) {
+ // The rendering has been completed.
+ wait_rendering_cb.Run();
+ return;
+ }
+ client->wait_rendering_cb = wait_rendering_cb;
+}
+
void RenderingHelper::RenderContent() {
CHECK_EQ(base::MessageLoop::current(), message_loop_);
glUniform1i(glGetUniformLocation(program_, "tex_flip"), 1);
@@ -524,6 +536,8 @@ void RenderingHelper::RenderContent() {
continue;
}
client->last_frame_rendered = true;
+ if (!client->wait_rendering_cb.is_null())
+ base::ResetAndReturn(&client->wait_rendering_cb).Run();
Pawel Osciak 2014/08/14 05:11:07 I think we have to pop the last frame here?
Owen Lin 2014/08/14 10:55:35 Done.
}
}
« no previous file with comments | « content/common/gpu/media/rendering_helper.h ('k') | content/common/gpu/media/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698