Changeset 242033 in webkit


Ignore:
Timestamp:
Feb 25, 2019 1:20:01 AM (5 years ago)
Author:
magomez@igalia.com
Message:

[WPE] Add support for holepunch using an external video player
https://bugs.webkit.org/show_bug.cgi?id=194899

Reviewed by Xabier Rodriguez-Calvar.

.:

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:

Source/WebCore:

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 browser to become visible.

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

  • PlatformWPE.cmake:
  • platform/HolePunch.cmake: Added.
  • platform/graphics/MediaPlayer.cpp:

(WebCore::buildMediaEnginesVector):

  • 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):

  • platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
  • platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:

(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):

Location:
trunk
Files:
5 added
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r242019 r242033  
     12019-02-25  Miguel Gomez  <magomez@igalia.com>
     2
     3        [WPE] Add support for holepunch using an external video player
     4        https://bugs.webkit.org/show_bug.cgi?id=194899
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Add EXTERNAL_HOLEPUNCH option to the WPE port. Add a manual test to check the
     9        feature. Rename and update the test for GStreamer holepunch to avoid confusion.
     10
     11        * ManualTests/wpe/video-player-holepunch-external.html: Added.
     12        * ManualTests/wpe/video-player-holepunch-gstreamer.html: Renamed from ManualTests/wpe/video-player-holepunch.html.
     13        * Source/cmake/OptionsWPE.cmake:
     14
    1152019-02-24  Devin Rousso  <drousso@apple.com>
    216
  • trunk/ManualTests/wpe/video-player-holepunch-gstreamer.html

    r242032 r242033  
    11<html>
    22  <head>
    3     <title>WPE holepunch test</title>
     3    <title>WPE GStreamer holepunch test</title>
    44    <style>
    55      video {
     
    1111  <body>
    1212    <p>
    13       <strong>WPE holepunch test</strong>
     13      <strong>WPE GStreamer holepunch test</strong>
    1414    </p>
    1515    <p>
    16       This test checks whether the holepunch feature is working on WPE.
     16      This test checks whether the GStreamer holepunch feature is working on WPE.
    1717    </p>
    1818    <p>
  • trunk/Source/WebCore/ChangeLog

    r242032 r242033  
     12019-02-25  Miguel Gomez  <magomez@igalia.com>
     2
     3        [WPE] Add support for holepunch using an external video player
     4        https://bugs.webkit.org/show_bug.cgi?id=194899
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Implement the holepunch feature to allow playback using an external player. This creates
     9        a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
     10        whose goal is to just draw a transparent rectangle in the position where the video should be.
     11        This can be used to allow a player placed on a lower plane than the browser to become visible.
     12
     13        Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
     14
     15        * PlatformWPE.cmake:
     16        * platform/HolePunch.cmake: Added.
     17        * platform/graphics/MediaPlayer.cpp:
     18        (WebCore::buildMediaEnginesVector):
     19        * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
     20        (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
     21        (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
     22        (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
     23        (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
     24        (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
     25        (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
     26        (WebCore::MediaPlayerPrivateHolePunch::proxy const):
     27        (WebCore::mimeTypeCache):
     28        (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
     29        (WebCore::MediaPlayerPrivateHolePunch::supportsType):
     30        (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
     31        (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
     32        * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
     33        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
     34        (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
     35
    1362019-02-24  Zalan Bujtas  <zalan@apple.com>
    237
  • trunk/Source/WebCore/PlatformWPE.cmake

    r238282 r242033  
    55include(platform/ImageDecoders.cmake)
    66include(platform/TextureMapper.cmake)
     7
     8if (USE_EXTERNAL_HOLEPUNCH)
     9    include(platform/HolePunch.cmake)
     10endif ()
    711
    812list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r241585 r242033  
    8585#endif
    8686
     87#if USE(EXTERNAL_HOLEPUNCH)
     88#include "MediaPlayerPrivateHolePunch.h"
     89#endif
     90
    8791namespace WebCore {
    8892
     
    254258    if (DeprecatedGlobalSettings::isGStreamerEnabled())
    255259        MediaPlayerPrivateGStreamerMSE::registerMediaEngine(addMediaEngine);
     260#endif
     261
     262#if USE(EXTERNAL_HOLEPUNCH)
     263    MediaPlayerPrivateHolePunch::registerMediaEngine(addMediaEngine);
    256264#endif
    257265
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp

    r241120 r242033  
    7979    }
    8080
    81     if (m_holePunchClient && m_extraFlags & TextureMapperGL::ShouldNotBlend) {
     81    if (m_extraFlags & TextureMapperGL::ShouldNotBlend) {
    8282        ASSERT(!m_texture);
    83         m_holePunchClient->setVideoRectangle(enclosingIntRect(modelViewMatrix.mapRect(targetRect)));
     83        if (m_holePunchClient)
     84            m_holePunchClient->setVideoRectangle(enclosingIntRect(modelViewMatrix.mapRect(targetRect)));
    8485        texmapGL.drawSolidColor(targetRect, modelViewMatrix, Color(0, 0, 0, 0), false);
    8586        return;
  • trunk/Source/cmake/OptionsWPE.cmake

    r241939 r242033  
    7171WEBKIT_OPTION_DEFINE(USE_OPENVR "Whether to use OpenVR as WebVR backend." PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
    7272WEBKIT_OPTION_DEFINE(USE_GSTREAMER_HOLEPUNCH "Whether to enable GStreamer holepunch" PRIVATE OFF)
     73WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH "Whether to enable external holepunch" PRIVATE OFF)
    7374
    7475if (CMAKE_SYSTEM_NAME MATCHES "Linux")
     
    9596
    9697WEBKIT_OPTION_DEPEND(USE_GSTREAMER_HOLEPUNCH ENABLE_VIDEO)
     98WEBKIT_OPTION_DEPEND(USE_EXTERNAL_HOLEPUNCH ENABLE_VIDEO)
    9799
    98100include(GStreamerDependencies)
Note: See TracChangeset for help on using the changeset viewer.