WebKit Bugzilla
Attachment 362608 Details for
Bug 194899
: [WPE] Add support for holepunch using an external video player
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194899-20190221171801.patch (text/plain), 26.58 KB, created by
Miguel Gomez
on 2019-02-21 08:18:03 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Miguel Gomez
Created:
2019-02-21 08:18:03 PST
Size:
26.58 KB
patch
obsolete
>Subversion Revision: 241789 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 05648c595cecd326d58fd43629ca20f5e29c7e5b..4f34c77093f1ebbcfbbd1ee55b9c1b9dc31714d4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,53 @@ >+2019-02-21 Miguel Gomez <magomez@igalia.com> >+ >+ [WPE] Add support for holepunch using an external video player >+ https://bugs.webkit.org/show_bug.cgi?id=194899 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implement the holepunch feature to allow playback using an external player. This creates >+ a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and >+ whose goal is to just draw a transparent rectangle in the position where the video should be. >+ This can be used to allow a player placed on a lower plane than the broser to become visible. >+ >+ When this MediaPlayerPrivateHolePunch is used, it doesn't make sense to show the media >+ controls, so they are disabled during the lifetime of the player private. >+ >+ Added ManualTest wpe/video-player-holepunch-external.html to test the feature. >+ >+ * PlatformWPE.cmake: >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::parseAttribute): >+ * html/HTMLMediaElement.h: >+ * platform/HolePunch.cmake: Added. >+ * platform/graphics/MediaPlayer.cpp: >+ (WebCore::buildMediaEnginesVector): >+ (WebCore::MediaPlayer::controlsConfigurationChanged): >+ * platform/graphics/MediaPlayer.h: >+ (WebCore::MediaPlayerClient::mediaPlayerControlsEnabled const): >+ (WebCore::MediaPlayerClient::mediaPlayerSetControlsEnabled): >+ (WebCore::MediaPlayer::controlsEnabled const): >+ (WebCore::MediaPlayer::setControlsEnabled): >+ * platform/graphics/MediaPlayerPrivate.h: >+ (WebCore::MediaPlayerPrivateInterface::controlsConfigurationChanged): >+ * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added. >+ (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch): >+ (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch): >+ (WebCore::MediaPlayerPrivateHolePunch::platformLayer const): >+ (WebCore::MediaPlayerPrivateHolePunch::naturalSize const): >+ (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer): >+ (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded): >+ (WebCore::MediaPlayerPrivateHolePunch::proxy const): >+ (WebCore::mimeTypeCache): >+ (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes): >+ (WebCore::MediaPlayerPrivateHolePunch::supportsType): >+ (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState): >+ (WebCore::MediaPlayerPrivateHolePunch::controlsConfigurationChanged): >+ * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added. >+ * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: >+ (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper): >+ > 2019-02-19 Simon Fraser <simon.fraser@apple.com> > > REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view >diff --git a/Source/WebCore/PlatformWPE.cmake b/Source/WebCore/PlatformWPE.cmake >index 54b12e9fa0f9689c5c3386e49afc557fe5c22edb..143d1348bcd5517add906af741f4cde84e068c75 100644 >--- a/Source/WebCore/PlatformWPE.cmake >+++ b/Source/WebCore/PlatformWPE.cmake >@@ -5,6 +5,10 @@ include(platform/GStreamer.cmake) > include(platform/ImageDecoders.cmake) > include(platform/TextureMapper.cmake) > >+if (USE_EXTERNAL_HOLEPUNCH) >+ include(platform/HolePunch.cmake) >+endif () >+ > list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES > "SourcesWPE.txt" > >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 88eae188a0ea032508a5700663601d0397a960c9..0e5cd92fd68efee54b5c258a1a5a8639320972fc 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -834,9 +834,11 @@ void HTMLMediaElement::parseAttribute(const QualifiedName& name, const AtomicStr > // agent must invoke the media element's media element load algorithm. > if (!value.isNull()) > prepareForLoad(); >- } else if (name == controlsAttr) >+ } else if (name == controlsAttr) { >+ if (m_player) >+ m_player->controlsConfigurationChanged(); > configureMediaControls(); >- else if (name == loopAttr) >+ } else if (name == loopAttr) > updateSleepDisabling(); > else if (name == preloadAttr) { > if (equalLettersIgnoringASCIICase(value, "none")) >diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h >index a678d94ec89b7b74478a84536556be4dae972934..3479da03331f192bad3dd23f92e3ca1b1790b832 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -946,6 +946,9 @@ private: > const Logger& mediaPlayerLogger() final { return logger(); } > #endif > >+ bool mediaPlayerControlsEnabled() const final { return controls(); } >+ void mediaPlayerSetControlsEnabled(bool enabled) final { setControls(enabled); } >+ > Timer m_progressEventTimer; > Timer m_playbackProgressTimer; > Timer m_scanTimer; >diff --git a/Source/WebCore/platform/HolePunch.cmake b/Source/WebCore/platform/HolePunch.cmake >new file mode 100644 >index 0000000000000000000000000000000000000000..4ac1631435f86d1738032189797629b7d3698859 >--- /dev/null >+++ b/Source/WebCore/platform/HolePunch.cmake >@@ -0,0 +1,6 @@ >+list(APPEND WebCore_INCLUDE_DIRECTORIES >+ "${WEBCORE_DIR}/platform/graphics/holepunch" >+) >+list(APPEND WebCore_SOURCES >+ platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp >+) >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp >index bda0711f6b55c26d48af638cc8b2f9a578eb778e..574fe7c285c27ba809d521e4e8d318b3fa1e5984 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp >+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp >@@ -84,6 +84,10 @@ > #include "MediaPlayerPrivateAVFoundationCF.h" > #endif > >+#if USE(EXTERNAL_HOLEPUNCH) >+#include "MediaPlayerPrivateHolePunch.h" >+#endif >+ > namespace WebCore { > > #if !RELEASE_LOG_DISABLED >@@ -255,6 +259,10 @@ static void buildMediaEnginesVector() > MediaPlayerPrivateGStreamerMSE::registerMediaEngine(addMediaEngine); > #endif > >+#if USE(EXTERNAL_HOLEPUNCH) >+ MediaPlayerPrivateHolePunch::registerMediaEngine(addMediaEngine); >+#endif >+ > haveMediaEnginesVector() = true; > } > >@@ -1557,6 +1565,11 @@ bool MediaPlayer::shouldIgnoreIntrinsicSize() > return m_private->shouldIgnoreIntrinsicSize(); > } > >+void MediaPlayer::controlsConfigurationChanged() >+{ >+ return m_private->controlsConfigurationChanged(); >+} >+ > #if !RELEASE_LOG_DISABLED > const Logger& MediaPlayer::mediaPlayerLogger() > { >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h >index efc15ba1cb6586e2606a93b041330b9bd7fdd22f..6fedbcf57466f30be2c1f0b793833aec05b706d0 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -242,6 +242,9 @@ public: > virtual const void* mediaPlayerLogIdentifier() { return nullptr; } > virtual const Logger& mediaPlayerLogger() = 0; > #endif >+ >+ virtual bool mediaPlayerControlsEnabled() const { return false; } >+ virtual void mediaPlayerSetControlsEnabled(bool) { } > }; > > class MediaPlayer : public MediaPlayerEnums, public RefCounted<MediaPlayer> { >@@ -578,6 +581,10 @@ public: > > bool shouldIgnoreIntrinsicSize(); > >+ bool controlsEnabled() const { return client().mediaPlayerControlsEnabled(); } >+ void setControlsEnabled(bool enabled) { client().mediaPlayerSetControlsEnabled(enabled); } >+ void controlsConfigurationChanged(); >+ > private: > MediaPlayer(MediaPlayerClient&); > >diff --git a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >index 9700c0565098571c5903ef3ea342d8edb82e37c1..c2218ec182a89c1d5beba8b6ee88cf017b063b26 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >+++ b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >@@ -286,6 +286,8 @@ public: > virtual bool performTaskAtMediaTime(WTF::Function<void()>&&, MediaTime) { return false; } > > virtual bool shouldIgnoreIntrinsicSize() { return false; } >+ >+ virtual void controlsConfigurationChanged() { } > }; > > } >diff --git a/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..de571077931005f29e8dc53f218c4ab7285ff3dd >--- /dev/null >+++ b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp >@@ -0,0 +1,172 @@ >+/* >+ * Copyright (C) 2019 Igalia S.L >+ * Copyright (C) 2019 Metrological Group B.V. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * aint with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "MediaPlayerPrivateHolePunch.h" >+ >+#if USE(EXTERNAL_HOLEPUNCH) >+#include "MediaPlayer.h" >+#include "TextureMapperPlatformLayerBuffer.h" >+#include "TextureMapperPlatformLayerProxy.h" >+ >+namespace WebCore { >+using namespace std; >+ >+static const FloatSize s_holePunchDefaultFrameSize(1280, 720); >+ >+MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch(MediaPlayer* player) >+ : m_player(player) >+ , m_readyTimer(RunLoop::main(), this, &MediaPlayerPrivateHolePunch::notifyReadyState) >+#if USE(NICOSIA) >+ , m_nicosiaLayer(Nicosia::ContentLayer::create(Nicosia::ContentLayerTextureMapperImpl::createFactory(*this))) >+#else >+ , m_platformLayerProxy(adoptRef(new TextureMapperPlatformLayerProxy())) >+#endif >+{ >+ pushNextHolePunchBuffer(); >+ >+ // Store the current value for the controls visibility and disable them. >+ m_previousControlsEnabled = m_player->controlsEnabled(); >+ m_player->setControlsEnabled(false); >+ >+ // Delay the configuration of the HTMLMediaElement, as during this stage this is not >+ // the MediaPlayer private yet and calls from HTMLMediaElement won't reach this. >+ m_readyTimer.startOneShot(0_s); >+} >+ >+MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch() >+{ >+ // Restore the controls visibility to the previous value once this player is destroyed. >+ m_player->setControlsEnabled(m_previousControlsEnabled); >+ >+#if USE(NICOSIA) >+ downcast<Nicosia::ContentLayerTextureMapperImpl>(m_nicosiaLayer->impl()).invalidateClient(); >+#endif >+} >+ >+PlatformLayer* MediaPlayerPrivateHolePunch::platformLayer() const >+{ >+#if USE(NICOSIA) >+ return m_nicosiaLayer.ptr(); >+#else >+ return const_cast<MediaPlayerPrivateGStreamerBase*>(this); >+#endif >+} >+ >+FloatSize MediaPlayerPrivateHolePunch::naturalSize() const >+{ >+ // When using the holepuch we may not be able to get the video frames size, so we can't use >+ // it. But we need to report some non empty naturalSize for the player's GraphicsLayer >+ // to be properly created. >+ return s_holePunchDefaultFrameSize; >+} >+ >+void MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer() >+{ >+ auto proxyOperation = >+ [this](TextureMapperPlatformLayerProxy& proxy) >+ { >+ LockHolder holder(proxy.lock()); >+ std::unique_ptr<TextureMapperPlatformLayerBuffer> layerBuffer = std::make_unique<TextureMapperPlatformLayerBuffer>(0, m_size, TextureMapperGL::ShouldNotBlend, GL_DONT_CARE); >+ proxy.pushNextBuffer(WTFMove(layerBuffer)); >+ }; >+ >+#if USE(NICOSIA) >+ proxyOperation(downcast<Nicosia::ContentLayerTextureMapperImpl>(m_nicosiaLayer->impl()).proxy()); >+#else >+ proxyOperation(*m_platformLayerProxy); >+#endif >+} >+ >+void MediaPlayerPrivateHolePunch::swapBuffersIfNeeded() >+{ >+ pushNextHolePunchBuffer(); >+} >+ >+#if !USE(NICOSIA) >+RefPtr<TextureMapperPlatformLayerProxy> MediaPlayerPrivateHolePunch::proxy() const >+{ >+ return m_platformLayerProxy.copyRef(); >+} >+#endif >+ >+static HashSet<String, ASCIICaseInsensitiveHash>& mimeTypeCache() >+{ >+ static NeverDestroyed<HashSet<String, ASCIICaseInsensitiveHash>> cache; >+ static bool typeListInitialized = false; >+ >+ if (typeListInitialized) >+ return cache; >+ >+ const char* mimeTypes[] = { >+ "video/holepunch" >+ }; >+ >+ for (unsigned i = 0; i < (sizeof(mimeTypes) / sizeof(*mimeTypes)); ++i) >+ cache.get().add(String(mimeTypes[i])); >+ >+ typeListInitialized = true; >+ >+ return cache; >+} >+ >+void MediaPlayerPrivateHolePunch::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) >+{ >+ types = mimeTypeCache(); >+} >+ >+MediaPlayer::SupportsType MediaPlayerPrivateHolePunch::supportsType(const MediaEngineSupportParameters& parameters) >+{ >+ auto containerType = parameters.type.containerType(); >+ >+ // Spec says we should not return "probably" if the codecs string is empty. >+ if (!containerType.isEmpty() && mimeTypeCache().contains(containerType)) { >+ if (parameters.type.codecs().isEmpty()) >+ return MediaPlayer::MayBeSupported; >+ >+ return MediaPlayer::IsSupported; >+ } >+ >+ return MediaPlayer::IsNotSupported; >+} >+ >+void MediaPlayerPrivateHolePunch::registerMediaEngine(MediaEngineRegistrar registrar) >+{ >+ registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateHolePunch>(player); }, >+ getSupportedTypes, supportsType, nullptr, nullptr, nullptr, [](const String&, const String&) { return false; }); >+} >+ >+void MediaPlayerPrivateHolePunch::notifyReadyState() >+{ >+ // Notify the ready state so the GraphicsLayer gets created. >+ m_player->readyStateChanged(); >+} >+ >+void MediaPlayerPrivateHolePunch::controlsConfigurationChanged() >+{ >+ // Keep track of the controls visibility changes to restore them after this player is destroyed. If they have >+ // been enabled, disable them again. >+ m_previousControlsEnabled = m_player->controlsEnabled(); >+ if (m_previousControlsEnabled) >+ m_player->setControlsEnabled(false); >+} >+ >+} >+#endif // USE(EXTERNAL_HOLEPUNCH) >diff --git a/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h >new file mode 100644 >index 0000000000000000000000000000000000000000..534c7d0a269379e7c8b6aaa324906deca1252027 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h >@@ -0,0 +1,122 @@ >+/* >+ * Copyright (C) 2019 Igalia S.L >+ * Copyright (C) 2019 Metrological Group B.V. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * aint with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#pragma once >+ >+#if USE(EXTERNAL_HOLEPUNCH) >+ >+#include "MediaPlayerPrivate.h" >+#include "PlatformLayer.h" >+#include <wtf/RunLoop.h> >+#include <wtf/WeakPtr.h> >+ >+#if USE(NICOSIA) >+#include "NicosiaContentLayerTextureMapperImpl.h" >+#else >+#include "TextureMapperPlatformLayerProxyProvider.h" >+#endif >+ >+namespace WebCore { >+ >+class TextureMapperPlatformLayerProxy; >+ >+class MediaPlayerPrivateHolePunch : public MediaPlayerPrivateInterface, public CanMakeWeakPtr<MediaPlayerPrivateHolePunch> >+#if USE(NICOSIA) >+ , public Nicosia::ContentLayerTextureMapperImpl::Client >+#else >+ , public PlatformLayer >+#endif >+{ >+ >+public: >+ MediaPlayerPrivateHolePunch(MediaPlayer*); >+ ~MediaPlayerPrivateHolePunch(); >+ >+ static void registerMediaEngine(MediaEngineRegistrar); >+ >+ void load(const String&) override { }; >+#if ENABLE(MEDIA_SOURCE) >+ void load(const String&, MediaSourcePrivateClient*) override { }; >+#endif >+#if ENABLE(MEDIA_STREAM) >+ void load(MediaStreamPrivate&) override { }; >+#endif >+ void cancelLoad() override { }; >+ >+ void play() override { }; >+ void pause() override { }; >+ >+ PlatformLayer* platformLayer() const override; >+ >+ FloatSize naturalSize() const override; >+ >+ bool hasVideo() const override { return false; }; >+ bool hasAudio() const override { return false; }; >+ >+ void setVisible(bool) override { }; >+ >+ bool seeking() const override { return false; } >+ >+ bool paused() const override { return false; }; >+ >+ MediaPlayer::NetworkState networkState() const override { return MediaPlayer::Empty; }; >+ MediaPlayer::ReadyState readyState() const override { return MediaPlayer::HaveMetadata; }; >+ >+ std::unique_ptr<PlatformTimeRanges> buffered() const override { return std::make_unique<PlatformTimeRanges>(); }; >+ >+ bool didLoadingProgress() const override { return false; }; >+ >+ void setSize(const IntSize& size) override { m_size = size; }; >+ >+ void paint(GraphicsContext&, const FloatRect&) override { }; >+ >+ bool supportsAcceleratedRendering() const final { return true; } >+ >+ bool shouldIgnoreIntrinsicSize() final { return true; } >+ >+ void controlsConfigurationChanged() final; >+ >+ void pushNextHolePunchBuffer(); >+ void swapBuffersIfNeeded() override; >+#if !USE(NICOSIA) >+ RefPtr<TextureMapperPlatformLayerProxy> proxy() const override; >+#endif >+ >+private: >+ static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&); >+ static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); >+ >+ void notifyReadyState(); >+ >+ MediaPlayer* m_player; >+ IntSize m_size; >+ RunLoop::Timer<MediaPlayerPrivateHolePunch> m_readyTimer; >+ bool m_previousControlsEnabled { false }; >+#if USE(TEXTURE_MAPPER_GL) >+#if USE(NICOSIA) >+ Ref<Nicosia::ContentLayer> m_nicosiaLayer; >+#else >+ RefPtr<TextureMapperPlatformLayerProxy> m_platformLayerProxy; >+#endif >+#endif >+ >+}; >+} >+#endif // USE(EXTERNAL_HOLEPUNCH) >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp >index 963bdc4864a7c661608e2a419b514588062654f1..01f0d2897338f4ad37f5bc18641fea2883729331 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp >@@ -78,9 +78,10 @@ void TextureMapperPlatformLayerBuffer::paintToTextureMapper(TextureMapper& textu > return; > } > >- if (m_holePunchClient && m_extraFlags & TextureMapperGL::ShouldNotBlend) { >+ if (m_extraFlags & TextureMapperGL::ShouldNotBlend) { > ASSERT(!m_texture); >- m_holePunchClient->setVideoRectangle(enclosingIntRect(modelViewMatrix.mapRect(targetRect))); >+ if (m_holePunchClient) >+ m_holePunchClient->setVideoRectangle(enclosingIntRect(modelViewMatrix.mapRect(targetRect))); > texmapGL.drawSolidColor(targetRect, modelViewMatrix, Color(0, 0, 0, 0), false); > return; > } >diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake >index 5829ee23e551c36613cc426b4abd6a800df0d6fa..914d0e21399f9d6a8581fbb9e75204412428526a 100644 >--- a/Source/cmake/OptionsWPE.cmake >+++ b/Source/cmake/OptionsWPE.cmake >@@ -70,6 +70,7 @@ WEBKIT_OPTION_DEFINE(ENABLE_WPE_QT_API "Whether to enable support for the Qt5/QM > # Private options specific to the WPE port. > WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) > WEBKIT_OPTION_DEFINE(USE_GSTREAMER_HOLEPUNCH "Whether to enable GStreamer holepunch" PRIVATE OFF) >+WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH "Whether to enable external holepunch" PRIVATE OFF) > > if (CMAKE_SYSTEM_NAME MATCHES "Linux") > WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON) >@@ -94,6 +95,7 @@ if (("${PC_CAIRO_VERSION}" VERSION_GREATER "1.16.0" OR "${PC_CAIRO_VERSION}" STR > endif () > > WEBKIT_OPTION_DEPEND(USE_GSTREAMER_HOLEPUNCH ENABLE_VIDEO) >+WEBKIT_OPTION_DEPEND(USE_EXTERNAL_HOLEPUNCH ENABLE_VIDEO) > > include(GStreamerDependencies) > >diff --git a/ChangeLog b/ChangeLog >index 031b5e2547a3f4b7c2eb4382b9159f0e977fd18a..d0b75f3108d62789ad01d8189959099e733ce59c 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,17 @@ >+2019-02-21 Miguel Gomez <magomez@igalia.com> >+ >+ [WPE] Add support for holepunch using an external video player >+ https://bugs.webkit.org/show_bug.cgi?id=194899 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add EXTERNAL_HOLEPUNCH option to the WPE port. Add a manual test to check the >+ feature. Rename and update the test for GStreamer holepunch to avoid confusion. >+ >+ * ManualTests/wpe/video-player-holepunch-external.html: Added. >+ * ManualTests/wpe/video-player-holepunch-gstreamer.html: Renamed from ManualTests/wpe/video-player-holepunch.html. >+ * Source/cmake/OptionsWPE.cmake: >+ > 2019-02-11 Adrian Perez de Castro <aperez@igalia.com> > > [GTK][WPE] Add content extensions support in WKTR and unskip layout tests >diff --git a/ManualTests/wpe/video-player-holepunch-external.html b/ManualTests/wpe/video-player-holepunch-external.html >new file mode 100644 >index 0000000000000000000000000000000000000000..eca1618f20a7dd351249431bd6b3a969ec6a6c4a >--- /dev/null >+++ b/ManualTests/wpe/video-player-holepunch-external.html >@@ -0,0 +1,57 @@ >+<html> >+ <head> >+ <title>WPE external holepunch test</title> >+ <style> >+ video { >+ width: 400px; >+ height: 400px; >+ } >+ </style> >+ </head> >+ <body> >+ <p> >+ <strong>WPE external holepunch test</strong> >+ </p> >+ <p> >+ This test checks whether the external holepunch feature is working on WPE. >+ </p> >+ <p> >+ There is a video player of 400x400 below this text. It will have controls enabled and play a valid >+ video for 5 seconds, then an invalid one for another 5 seconds and then the first one again. >+ </p> >+ <p> >+ If everything is working fine, there should be the valid video for 5 seconds showing the controls, then >+ a transparent rectangle of 400x400 without the controls for 5 seconds, and then again the valid video >+ with the controls. >+ </p> >+ <p> >+ If GStreamer holepunch is enabled when running this test, the first and third video will show a transparent >+ rectangle with the controls, instead of the video content. >+ </p> >+ <video id="video" controls> >+ <source id="source" src="../../LayoutTests/media/content/long-test.mp4" type="video/mp4"> >+ </video> >+ <div id="log"></div> >+ <script type="text/javascript"> >+ var v = document.getElementById("video"); >+ var s = document.getElementById("source"); >+ var l = document.getElementById("log"); >+ log.innerHTML = "Playing first video. The video (or a transparent rectangle if GStreamer holepunch is enabled) with controls should be visible"; >+ v.play(); >+ >+ setTimeout(function() { >+ s.type = "video/holepunch"; >+ v.load(); >+ v.play(); >+ log.innerHTML = "Playing second video. A transparent rectangle without controls should be visible"; >+ }, 5000); >+ >+ setTimeout(function() { >+ s.type = "video/mp4"; >+ v.load(); >+ v.play(); >+ log.innerHTML = "Playing third video. The video (or a transparent rectangle if GStreamer holepunch is enabled) with controls should be visible"; >+ }, 10000); >+ </script> >+ </body> >+</html> >diff --git a/ManualTests/wpe/video-player-holepunch-gstreamer.html b/ManualTests/wpe/video-player-holepunch-gstreamer.html >new file mode 100644 >index 0000000000000000000000000000000000000000..a684cea0a2aacb6599a298206211bfc7577a50bb >--- /dev/null >+++ b/ManualTests/wpe/video-player-holepunch-gstreamer.html >@@ -0,0 +1,33 @@ >+<html> >+ <head> >+ <title>WPE GStreamer holepunch test</title> >+ <style> >+ video { >+ width: 400px; >+ height: 400px; >+ } >+ </style> >+ </head> >+ <body> >+ <p> >+ <strong>WPE GStreamer holepunch test</strong> >+ </p> >+ <p> >+ This test checks whether the GStreamer holepunch feature is working on WPE. >+ </p> >+ <p> >+ There is a video player of 400x400 placed below this text. If the video playback is visible, >+ then the holepunch option is disabled or it's not working properly. >+ </p> >+ <p> >+ If everything is working fine, there should be a transparent rectangle of 400x400 just >+ below this, and the video controls should be visible. >+ </p> >+ <video id="video" controls></video> >+ <script type="text/javascript"> >+ var v = document.getElementById("video"); >+ v.src = "../../LayoutTests/media/content/long-test.mp4"; >+ v.play(); >+ </script> >+ </body> >+</html> >diff --git a/ManualTests/wpe/video-player-holepunch.html b/ManualTests/wpe/video-player-holepunch.html >deleted file mode 100644 >index f69d08d4c80c7f910cd6416818e0bba3da83e6ad..0000000000000000000000000000000000000000 >--- a/ManualTests/wpe/video-player-holepunch.html >+++ /dev/null >@@ -1,33 +0,0 @@ >-<html> >- <head> >- <title>WPE holepunch test</title> >- <style> >- video { >- width: 400px; >- height: 400px; >- } >- </style> >- </head> >- <body> >- <p> >- <strong>WPE holepunch test</strong> >- </p> >- <p> >- This test checks whether the holepunch feature is working on WPE. >- </p> >- <p> >- There is a video player of 400x400 placed below this text. If the video playback is visible, >- then the holepunch option is disabled or it's not working properly. >- </p> >- <p> >- If everything is working fine, there should be a transparent rectangle of 400x400 just >- below this. >- </p> >- <video id="video"></video> >- <script type="text/javascript"> >- var v = document.getElementById("video"); >- v.src = "../../LayoutTests/media/content/long-test.mp4"; >- v.play(); >- </script> >- </body> >-</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194899
:
362608
|
362721