[WPE] Implement GStreamer based holepunch
authormagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 14:42:32 +0000 (14:42 +0000)
committermagomez@igalia.com <magomez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2019 14:42:32 +0000 (14:42 +0000)
commitf9eec4f06fec640c4179666e8cd0238d048dc735
tree90b3065f39928992d5253a7d2458de8ede33ae84
parentf4c3ef7a813fa77c9ecf368919130df498adc094
[WPE] Implement GStreamer based holepunch
https://bugs.webkit.org/show_bug.cgi?id=193715

Reviewed by Xabier Rodriguez-Calvar.

.:

Add GSTREAMER_HOLEPUNCH option to the WPE port with a manual test to
check the feature.

* ManualTests/wpe/video-player-holepunch.html: Added.
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
video sink and drawing then, the player just draws a transparent rectangle on the position where
the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
sink which will be in charge of displaying the video frames in some way (usually on a plane below
the browser), and will push empty frames to the compositor indicating that the rectangle to draw
should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
to tell the video sink where to position the video so it's set below the browser transparent hole.

Added ManualTest wpe/video-player-holepunch.html to test the feature.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
(WebCore::setRectangleToVideoSink):
(WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
(WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawSolidColor):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::videoBox const):

Source/WebKit:

Add a new parameter to the calls of TextureMapper::drawSolidColor().

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
ChangeLog
ManualTests/wpe/video-player-holepunch.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/rendering/RenderVideo.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Source/cmake/OptionsWPE.cmake