[GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accelerated...
authormagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 13:02:47 +0000 (13:02 +0000)
committermagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 30 May 2017 13:02:47 +0000 (13:02 +0000)
commitd6bd7e1c2bb4ec0ae4165a7a4169fe5dfd34d305
tree2975c64b7565aeb1fc4ee8ece8d304ded025b858
parent2ac2cf71a28e6817a7f386651863de61139dc402
[GTK][WPE][GSTREAMER_GL] Do not use cairo to copy video textures to an accelerated canvas
https://bugs.webkit.org/show_bug.cgi?id=172542

Reviewed by Žan Doberšek.

When drawing gstreamer-gl video frames into an accelerated canvas, we are currently using cairo to copy
the video textures into a new texture that will be painted into de destination canvas. While this eases
the code, it doesn't allow us to control the copy process. This is a problem because in order to use
gstreamer-gl properly, we will need to perform colorspace transformations during the copy. So, remove
this cairo copy and use VideoTextureCopierGStreamer instead.

The usage of VideoTextureCopierGStreamer is pretty much the same than in the webgl case, except that
no destination texture is provided. For that case, add a custom texture to hold the result that can
be requested after the copy.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
(WebCore::MediaPlayerPrivateGStreamerBase::prepareContextForCairoPaint): Deleted.
(WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
(WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
(WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
* platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
(WebCore::VideoTextureCopierGStreamer::resultTexture):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217551 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h