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; |
} |