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

Unified Diff: content/renderer/media/webmediaplayer_impl.cc

Issue 175223003: HW Video: Make media::VideoFrame handle the sync point of the compositor as well as webgl (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: build fix cast_unittests Created 6 years, 10 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/renderer/media/renderer_gpu_video_accelerator_factories.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webmediaplayer_impl.cc
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index 411b814757cd4c0f737f2fb995bd249ecee8962f..aeb6908c56f27b0f3c8b1f762a02379b9c437882 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -537,6 +537,11 @@ void WebMediaPlayerImpl::paint(WebCanvas* canvas,
scoped_refptr<media::VideoFrame> video_frame = painter_.GetCurrentFrame(true);
gfx::Rect gfx_rect(rect);
skcanvas_video_renderer_.Paint(video_frame.get(), canvas, gfx_rect, alpha);
danakj 2014/02/28 17:49:30 Should someone be waiting on the video frame's syn
dshwang 2014/02/28 18:01:48 we don't need to wait for the sync point. It's why
danakj 2014/02/28 18:41:19 All GL is actually run on the gpu process so I'm n
+ if (video_frame &&
+ video_frame->format() == media::VideoFrame::NATIVE_TEXTURE) {
+ DCHECK(gpu_factories_);
+ video_frame->SetReleaseSyncPoint(gpu_factories_->InsertSyncPoint());
+ }
}
bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const {
@@ -651,7 +656,6 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
uint32 source_texture = web_graphics_context->createTexture();
- web_graphics_context->waitSyncPoint(mailbox_holder->sync_point);
danakj 2014/02/28 17:49:30 Why is this gone? This sync point ensures the mail
web_graphics_context->bindTexture(GL_TEXTURE_2D, source_texture);
web_graphics_context->consumeTextureCHROMIUM(GL_TEXTURE_2D,
mailbox_holder->mailbox.name);
@@ -683,6 +687,12 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
// The flush() operation is not necessary here. It is kept since the
// performance will be better when it is added than not.
web_graphics_context->flush();
+ // WebGL doesn't need to wait for the sync point of |video_frame| like
+ // paint(...) because |video_frame| is updated by the gpu process.
+ // However, it's necessary to insert a sync point because gpu video decoder
+ // in the render process must make sure executing all pending commands of
+ // WebGL before notifying reusable mailboxes to the gpu process.
+ video_frame->SetReleaseSyncPoint(web_graphics_context->insertSyncPoint());
danakj 2014/02/28 17:49:30 While this solves the problem of two threads writi
dshwang 2014/02/28 18:01:48 you're right. GpuVideoDecoder will wait for only o
danakj 2014/02/28 18:41:19 That will work if and only if the person doing the
return true;
}
« no previous file with comments | « content/renderer/media/renderer_gpu_video_accelerator_factories.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698