diff options
8 files changed, 652 insertions, 0 deletions
diff --git a/meta/recipes-rp/wpebackend-mesa/wpebackend-mesa_git.bb b/meta/recipes-rp/wpebackend-mesa/wpebackend-mesa_git.bb new file mode 100644 index 00000000000..4502c90d8d0 --- /dev/null +++ b/meta/recipes-rp/wpebackend-mesa/wpebackend-mesa_git.bb @@ -0,0 +1,29 @@ +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=6ae4db0d4b812334e1539cd5aa6e2f46" + +DEPENDS = "wpebackend glib-2.0 libxkbcommon wayland virtual/libgl" +PROVIDES += "virtual/wpebackend" +RPROVIDES_${PN} += "virtual/wpebackend" + +SRCREV = "3f9f87d5f42c27a22273d67db072bd7f2cba6135" +SRC_URI = "git://github.com/WebPlatformForEmbedded/WPEBackend-mesa.git;protocol=http;branch=master" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +PACKAGECONFIG ?= "gbm dma-buf" + +PACKAGECONFIG[gbm] = "-DWPE_MESA_GBM=ON,-DWPE_MESA_GBM=OFF," +PACKAGECONFIG[dma-buf] = "-DWPE_MESA_EXPORTABLE_DMA_BUF=ON,-DWPE_MESA_EXPORTABLE_DMA_BUF=OFF," +PACKAGECONFIG[experimental-wayland] = "-DWPE_MESA_EXPERIMENTAL_WAYLAND_EGL=ON,-DWPE_MESA_EXPERIMENTAL_WAYLAND_EGL=OFF," +PACKAGECONFIG[tegra] = "-DWPE_MESA_DRM_TEGRA_SUPPORT=ON,-DWPE_MESA_DRM_TEGRA_SUPPORT=OFF," + +do_install() { + install -d ${D}${libdir} + install -m 0755 ${B}/libWPEBackend-*.so ${D}${libdir}/ +} + +FILES_SOLIBSDEV = "" +FILES_${PN} += "${libdir}/libWPEBackend-default.so ${libdir}/libWPEBackend-mesa.so" +INSANE_SKIP ="dev-so" diff --git a/meta/recipes-rp/wpebackend/wpebackend.inc b/meta/recipes-rp/wpebackend/wpebackend.inc new file mode 100644 index 00000000000..24e0199a1ac --- /dev/null +++ b/meta/recipes-rp/wpebackend/wpebackend.inc @@ -0,0 +1,15 @@ +SUMMARY = "General-purpose library specifically developed for the WPE-flavored port of WebKit." +HOMEPAGE = "https://github.com/WebPlatformForEmbedded/WPEBackend" +BUGTRACKER = "https://github.com/WebPlatformForEmbedded/WPEBackend/issues" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=6ae4db0d4b812334e1539cd5aa6e2f46" +DEPENDS = "virtual/egl libxkbcommon" + +PROVIDES += "virtual/libwpe" +RPROVIDES_${PN} += "virtual/libwpe" + +# Workaround build issue with RPi userland EGL libraries. +CFLAGS_append_rpi = " ${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', '-D_GNU_SOURCE', d)}" + +inherit cmake diff --git a/meta/recipes-rp/wpebackend/wpebackend_0.2.0.bb b/meta/recipes-rp/wpebackend/wpebackend_0.2.0.bb new file mode 100644 index 00000000000..29fa544a6be --- /dev/null +++ b/meta/recipes-rp/wpebackend/wpebackend_0.2.0.bb @@ -0,0 +1,7 @@ +require wpebackend.inc + +SRC_URI = "https://wpewebkit.org/releases/${PN}-${PV}.tar.xz" +SRC_URI[md5sum] = "d04e44a32709dbb763ce1fcfc28bc6d8" +SRC_URI[sha256sum] = "ce33ff29b04175cb6fe6e6597a4b5e8ec9da0b8b5ae0745848902ac935d65823" + +S = "${WORKDIR}/${PN}-${PV}" diff --git a/meta/recipes-rp/wpewebkit/wpewebkit.inc b/meta/recipes-rp/wpewebkit/wpewebkit.inc new file mode 100644 index 00000000000..d60ea65be17 --- /dev/null +++ b/meta/recipes-rp/wpewebkit/wpewebkit.inc @@ -0,0 +1,107 @@ +SUMMARY = "WPE WebKit port pairs the WebKit engine with OpenGL-ES (OpenGL for Embedded Systems), \ + allowing embedders to create simple and performant systems based on Web platform technologies. \ + It is designed with hardware acceleration in mind, relying on EGL, and OpenGL ES." +HOMEPAGE = "https://trac.webkit.org/wiki/WPE" +BUGTRACKER = "https://bugs.webkit.org/" +LICENSE = "BSD & LGPLv2+" +LIC_FILES_CHKSUM = "file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 " + +DEPENDS = " \ + bison-native gperf-native harfbuzz-native libxml2-native ccache-native ninja-native ruby-native cairo \ + fontconfig freetype glib-2.0 gnutls harfbuzz icu jpeg pcre sqlite3 zlib libpng \ + libsoup-2.4 libwebp libxml2 libxslt virtual/egl virtual/libgles2 libepoxy libgcrypt \ +" + +inherit cmake pkgconfig perlnative python3native +inherit ${@'cmake_qt5' if 'qt5-layer' in d.getVar('BBFILE_COLLECTIONS').split() else ''} + +CCACHE_DISABLE[unexport] = "1" + +TOOLCHAIN = "gcc" + +PACKAGECONFIG = "" +PACKAGECONFIG ??= "fetchapi indexeddb mediasource video webaudio webcrypto gst_gl remote-inspector unified-builds" + +# WPE features +PACKAGECONFIG[accessibility] = "-DENABLE_ACCESSIBILITY=ON,-DENABLE_ACCESSIBILITY=OFF,atk at-spi2-atk" +PACKAGECONFIG[bubblewrap] = "-DENABLE_BUBBLEWRAP_SANDBOX=ON,-DENABLE_BUBBLEWRAP_SANDBOX=OFF,bubblewrap xdg-dbus-proxy bubblewrap-native xdg-dbus-proxy-native libseccomp" +PACKAGECONFIG[developer-mode] = "-DDEVELOPER_MODE=ON,-DDEVELOPER_MODE=OFF,wayland-native wayland-protocols wpebackend-fdo" +PACKAGECONFIG[deviceorientation] = "-DENABLE_DEVICE_ORIENTATION=ON,-DENABLE_DEVICE_ORIENTATION=OFF," +PACKAGECONFIG[encryptedmedia] = "-DENABLE_ENCRYPTED_MEDIA=ON,-DENABLE_ENCRYPTED_MEDIA=OFF,libgcrypt" +PACKAGECONFIG[fetchapi] = "-DENABLE_FETCH_API=ON,-DENABLE_FETCH_API=OFF," +PACKAGECONFIG[gamepad] = "-DENABLE_GAMEPAD=ON,-DENABLE_GAMEPAD=OFF," +PACKAGECONFIG[geolocation] = "-DENABLE_GEOLOCATION=ON,-DENABLE_GEOLOCATION=OFF,geoclue" +PACKAGECONFIG[gst_gl] = "-DUSE_GSTREAMER_GL=ON,-DUSE_GSTREAMER_GL=OFF,gstreamer1.0-plugins-base" +PACKAGECONFIG[indexeddb] = "-DENABLE_INDEXED_DATABASE=ON,-DENABLE_INDEXED_DATABASE=OFF," +PACKAGECONFIG[mediasource] = "-DENABLE_MEDIA_SOURCE=ON,-DENABLE_MEDIA_SOURCE=OFF,gstreamer1.0 gstreamer1.0-plugins-good" +PACKAGECONFIG[service-worker] = "-DENABLE_SERVICE_WORKER=ON,-DENABLE_SERVICE_WORKER=OFF," +PACKAGECONFIG[video] = "-DENABLE_VIDEO=ON -DENABLE_VIDEO_TRACK=ON,-DENABLE_VIDEO=OFF -DENABLE_VIDEO_TRACK=OFF,gstreamer1.0 gstreamer1.0-plugins-base" +PACKAGECONFIG[webaudio] = "-DENABLE_WEB_AUDIO=ON,-DENABLE_WEB_AUDIO=OFF,gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good" +PACKAGECONFIG[webcrypto] = "-DENABLE_WEB_CRYPTO=ON,-DENABLE_WEB_CRYPTO=OFF,libgcrypt libtasn1" +PACKAGECONFIG[webgl2] = "-DENABLE_WEBGL2=ON,-DENABLE_WEBGL2=OFF," +PACKAGECONFIG[woff2] = "-DUSE_WOFF2=ON,-DUSE_WOFF2=OFF,woff2" +# 2dcanvas requires cairo with opengl support. Try by setting in local.conf: PACKAGECONFIG_append_pn-cairo = " glesv2" +PACKAGECONFIG[2dcanvas] = "-DENABLE_ACCELERATED_2D_CANVAS=ON,-DENABLE_ACCELERATED_2D_CANVAS=OFF," +PACKAGECONFIG[remote-inspector] = "-DENABLE_REMOTE_INSPECTOR=ON,-DENABLE_REMOTE_INSPECTOR=OFF," +PACKAGECONFIG[webrtc] = "-DENABLE_WEB_RTC=ON,-DENABLE_WEB_RTC=OFF,libvpx libevent libopus" +PACKAGECONFIG[qtwpe] = "-DENABLE_WPE_QT_API=ON,-DENABLE_WPE_QT_API=OFF,qtbase-native qtbase qtdeclarative qtquickcontrols2 libepoxy wpebackend-fdo" +PACKAGECONFIG[openjpeg] = "-DUSE_OPENJPEG=ON,-DUSE_OPENJPEG=OFF,openjpeg" +PACKAGECONFIG[unified-builds] = "-DENABLE_UNIFIED_BUILDS=ON,-DENABLE_UNIFIED_BUILDS=OFF," + + +EXTRA_OECMAKE = " -DPORT=WPE -DCMAKE_BUILD_TYPE=Release -G Ninja" + +# If SSE code compiles, assume it runs successfully (it can't actually run +# because of cross compiling) +EXTRA_OECMAKE_append_x86 = " -DHAVE_SSE2_EXTENSIONS_EXITCODE=0" + +FULL_OPTIMIZATION_remove = "-g" + +LEAD_SONAME = "libWPEWebKit.so" +PACKAGES =+ "${PN}-web-inspector-plugin ${PN}-qtwpe-qml-plugin" +FILES_${PN} += "${libdir}/wpe-webkit*/injected-bundle/libWPEInjectedBundle.so" +FILES_${PN}-web-inspector-plugin += "${libdir}/libWPEWebInspectorResources.so ${libdir}/wpe-webkit-*/libWPEWebInspectorResources.so" +INSANE_SKIP_${PN}-web-inspector-plugin = "dev-so" + +FILES_${PN}-qtwpe-qml-plugin += "${libdir}/qml/org/wpewebkit/qtwpe/*" +INSANE_SKIP_${PN}-qtwpe-qml-plugin = "dev-so" + +# JSC JIT on ARMv7 is better supported with Thumb2 instruction set. +ARM_INSTRUCTION_SET_armv7a = "thumb" +ARM_INSTRUCTION_SET_armv7r = "thumb" +ARM_INSTRUCTION_SET_armv7m = "thumb" +ARM_INSTRUCTION_SET_armv7ve = "thumb" + +# Extra runtime depends +RDEPENDS_${PN} += " \ + virtual/wpebackend \ + ${@bb.utils.contains('PACKAGECONFIG', 'mediasource', 'gstreamer1.0-plugins-good-isomp4', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'webaudio', 'gstreamer1.0-plugins-good-wavparse', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'gst_gl', 'gstreamer1.0-plugins-base-opengl', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'video', 'gstreamer1.0-plugins-base-app \ + gstreamer1.0-plugins-base-playback \ + gstreamer1.0-plugins-base-audioconvert \ + gstreamer1.0-plugins-base-audioresample \ + gstreamer1.0-plugins-base-gio \ + gstreamer1.0-plugins-base-videoconvert \ + gstreamer1.0-plugins-base-videoscale \ + gstreamer1.0-plugins-base-volume \ + gstreamer1.0-plugins-base-typefindfunctions \ + gstreamer1.0-plugins-good-audiofx \ + gstreamer1.0-plugins-good-audioparsers \ + gstreamer1.0-plugins-good-autodetect \ + gstreamer1.0-plugins-good-avi \ + gstreamer1.0-plugins-good-deinterlace \ + gstreamer1.0-plugins-good-interleave \ + ', '', d)} \ +" + +# Extra runtime recommends +RRECOMMENDS_${PN} += " \ + ca-certificates \ + shared-mime-info \ + ttf-bitstream-vera \ + ${PN}-web-inspector-plugin \ + ${PN}-qtwpe-qml-plugin \ + ${@bb.utils.contains('PACKAGECONFIG', 'video', 'gstreamer1.0-plugins-base-meta gstreamer1.0-plugins-good-meta gstreamer1.0-plugins-bad-meta', '', d)} \ +" diff --git a/meta/recipes-rp/wpewebkit/wpewebkit/0001-REGRESSION-r217927-GTK-WPE-GSTREAMER_GL-Video-appear.patch b/meta/recipes-rp/wpewebkit/wpewebkit/0001-REGRESSION-r217927-GTK-WPE-GSTREAMER_GL-Video-appear.patch new file mode 100644 index 00000000000..b5af7f695cd --- /dev/null +++ b/meta/recipes-rp/wpewebkit/wpewebkit/0001-REGRESSION-r217927-GTK-WPE-GSTREAMER_GL-Video-appear.patch @@ -0,0 +1,189 @@ +From a3220229d0270ff702d0b136e2f87ec3701ebe75 Mon Sep 17 00:00:00 2001 +From: Carlos Alberto Lopez Perez <clopez@igalia.com> +Date: Wed, 9 May 2018 14:37:46 +0200 +Subject: [PATCH] REGRESSION(r217927): [GTK][WPE][GSTREAMER_GL] Video + appears as pink/green with gstreamer-imx (i.MX6) + + * r217927 <https://trac.webkit.org/r217927> causes issues (video + appears as pink/green) with gstreamer-imx plugin. + + * This patch reverts r217927 meanwhile a better solution is not + found. + +Issue tracked upstream at: https://webkit.org/b/185470 +--- + .../gstreamer/MediaPlayerPrivateGStreamerBase.cpp | 18 ++++-------------- + .../gstreamer/VideoTextureCopierGStreamer.cpp | 19 ++----------------- + .../graphics/gstreamer/VideoTextureCopierGStreamer.h | 9 +-------- + .../platform/graphics/texmap/TextureMapperGL.cpp | 2 -- + .../platform/graphics/texmap/TextureMapperGL.h | 3 +-- + 5 files changed, 8 insertions(+), 43 deletions(-) + +diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp +index b45726a062d..3ce3c532b4c 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp +@@ -55,16 +55,6 @@ + #endif + + #if USE(GSTREAMER_GL) +-#if G_BYTE_ORDER == G_LITTLE_ENDIAN +-#define GST_GL_CAPS_FORMAT "{ BGRx, BGRA }" +-#define TEXTURE_MAPPER_COLOR_CONVERT_FLAG TextureMapperGL::ShouldConvertTextureBGRAToRGBA +-#define TEXTURE_COPIER_COLOR_CONVERT_FLAG VideoTextureCopierGStreamer::ColorConversion::ConvertBGRAToRGBA +-#else +-#define GST_GL_CAPS_FORMAT "{ xRGB, ARGB }" +-#define TEXTURE_MAPPER_COLOR_CONVERT_FLAG TextureMapperGL::ShouldConvertTextureARGBToRGBA +-#define TEXTURE_COPIER_COLOR_CONVERT_FLAG VideoTextureCopierGStreamer::ColorConversion::ConvertARGBToRGBA +-#endif +- + #include <gst/app/gstappsink.h> + + #if USE(LIBEPOXY) +@@ -193,7 +183,7 @@ public: + return; + + m_size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)); +- m_flags = flags | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0) | TEXTURE_MAPPER_COLOR_CONVERT_FLAG; ++ m_flags = flags | (GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0); + + GstBuffer* buffer = gst_sample_get_buffer(sample); + if (UNLIKELY(!gst_video_frame_map(&m_videoFrame, &videoInfo, buffer, static_cast<GstMapFlags>(GST_MAP_READ | GST_MAP_GL)))) +@@ -940,7 +930,7 @@ bool MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture(Graphics + unsigned textureID = *reinterpret_cast<unsigned*>(videoFrame.data[0]); + + if (!m_videoTextureCopier) +- m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(TEXTURE_COPIER_COLOR_CONVERT_FLAG); ++ m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(); + + bool copied = m_videoTextureCopier->copyVideoTextureToPlatformTexture(textureID, size, outputTexture, outputTarget, level, internalFormat, format, type, flipY, m_videoSourceOrientation); + +@@ -974,7 +964,7 @@ NativeImagePtr MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime() + context->makeContextCurrent(); + + if (!m_videoTextureCopier) +- m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(TEXTURE_COPIER_COLOR_CONVERT_FLAG); ++ m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(); + + unsigned textureID = *reinterpret_cast<unsigned*>(videoFrame.data[0]); + bool copied = m_videoTextureCopier->copyVideoTextureToPlatformTexture(textureID, size, 0, GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, false, m_videoSourceOrientation); +@@ -1073,7 +1063,7 @@ GstElement* MediaPlayerPrivateGStreamerBase::createVideoSinkGL() + + gst_bin_add_many(GST_BIN(videoSink), upload, colorconvert, appsink, nullptr); + +- GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), format = (string) " GST_GL_CAPS_FORMAT)); ++ GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), format = (string) { RGBA }")); + + result &= gst_element_link_pads(upload, "src", colorconvert, "sink"); + result &= gst_element_link_pads_filtered(colorconvert, "src", appsink, "sink", caps.get()); +diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp +index b4d7832d737..a232e2df6ed 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp +@@ -29,7 +29,7 @@ + + namespace WebCore { + +-VideoTextureCopierGStreamer::VideoTextureCopierGStreamer(ColorConversion colorConversion) ++VideoTextureCopierGStreamer::VideoTextureCopierGStreamer() + { + GLContext* previousContext = GLContext::current(); + ASSERT(previousContext); +@@ -51,7 +51,6 @@ VideoTextureCopierGStreamer::VideoTextureCopierGStreamer(ColorConversion colorCo + glBindBuffer(GL_ARRAY_BUFFER, m_vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 8, vertices, GL_STATIC_DRAW); + +- updateColorConversionMatrix(colorConversion); + updateTextureSpaceMatrix(); + + previousContext->makeContextCurrent(); +@@ -75,20 +74,6 @@ VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer() + previousContext->makeContextCurrent(); + } + +-void VideoTextureCopierGStreamer::updateColorConversionMatrix(ColorConversion colorConversion) +-{ +- switch (colorConversion) { +- case ColorConversion::ConvertBGRAToRGBA: +- m_colorConversionMatrix.setMatrix(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); +- break; +- case ColorConversion::ConvertARGBToRGBA: +- m_colorConversionMatrix.setMatrix(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0); +- break; +- default: +- RELEASE_ASSERT_NOT_REACHED(); +- } +-} +- + void VideoTextureCopierGStreamer::updateTextureSpaceMatrix() + { + m_textureSpaceMatrix.makeIdentity(); +@@ -193,7 +178,7 @@ bool VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture(GLuint input + m_shaderProgram->setMatrix(m_shaderProgram->modelViewMatrixLocation(), m_modelViewMatrix); + m_shaderProgram->setMatrix(m_shaderProgram->projectionMatrixLocation(), m_projectionMatrix); + m_shaderProgram->setMatrix(m_shaderProgram->textureSpaceMatrixLocation(), m_textureSpaceMatrix); +- m_shaderProgram->setMatrix(m_shaderProgram->textureColorSpaceMatrixLocation(), m_colorConversionMatrix); ++ m_shaderProgram->setMatrix(m_shaderProgram->textureColorSpaceMatrixLocation(), TransformationMatrix()); + + // Perform the copy. + #if !USE(OPENGL_ES_2) +diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h +index f779537eccd..86cf235b2a3 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h ++++ b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h +@@ -34,16 +34,10 @@ class ImageOrientation; + + class VideoTextureCopierGStreamer { + public: +- enum class ColorConversion { +- ConvertBGRAToRGBA, +- ConvertARGBToRGBA +- }; +- +- VideoTextureCopierGStreamer(ColorConversion); ++ VideoTextureCopierGStreamer(); + ~VideoTextureCopierGStreamer(); + + bool copyVideoTextureToPlatformTexture(GLuint inputTexture, IntSize& frameSize, GLuint outputTexture, GLenum outputTarget, GLint level, GLenum internalFormat, GLenum format, GLenum type, bool flipY, ImageOrientation& sourceOrientation); +- void updateColorConversionMatrix(ColorConversion); + void updateTextureSpaceMatrix(); + void updateTransformationMatrix(); + GLuint resultTexture() { return m_resultTexture; } +@@ -61,7 +55,6 @@ private: + TransformationMatrix m_modelViewMatrix; + TransformationMatrix m_projectionMatrix; + TransformationMatrix m_textureSpaceMatrix; +- TransformationMatrix m_colorConversionMatrix; + GLuint m_resultTexture { 0 }; + }; + +diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +index 5eddaf34ab3..aa72edd708a 100644 +--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp ++++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +@@ -444,8 +444,6 @@ static TransformationMatrix colorSpaceMatrixForFlags(TextureMapperGL::Flags flag + TransformationMatrix matrix; + if (flags & TextureMapperGL::ShouldConvertTextureBGRAToRGBA) + matrix.setMatrix(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); +- else if (flags & TextureMapperGL::ShouldConvertTextureARGBToRGBA) +- matrix.setMatrix(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0); + + return matrix; + } +diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h +index 3691aaa9e0f..d7866cb1400 100644 +--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h ++++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h +@@ -51,8 +51,7 @@ public: + ShouldRotateTexture90 = 0x10, + ShouldRotateTexture180 = 0x20, + ShouldRotateTexture270 = 0x40, +- ShouldConvertTextureBGRAToRGBA = 0x80, +- ShouldConvertTextureARGBToRGBA = 0x100 ++ ShouldConvertTextureBGRAToRGBA = 0x80 + }; + + typedef int Flags; +-- +2.11.0 + diff --git a/meta/recipes-rp/wpewebkit/wpewebkit/0001-REGRESSION-r217927-WPE-2.22-GSTREAMER_GL-Video-appea.patch b/meta/recipes-rp/wpewebkit/wpewebkit/0001-REGRESSION-r217927-WPE-2.22-GSTREAMER_GL-Video-appea.patch new file mode 100644 index 00000000000..9c3ca612f24 --- /dev/null +++ b/meta/recipes-rp/wpewebkit/wpewebkit/0001-REGRESSION-r217927-WPE-2.22-GSTREAMER_GL-Video-appea.patch @@ -0,0 +1,189 @@ +From 4f91f0a3061cc45330f9d764cd8e6fd0af5fe116 Mon Sep 17 00:00:00 2001 +From: Carlos Alberto Lopez Perez <clopez@igalia.com> +Date: Wed, 9 May 2018 14:37:46 +0200 +Subject: [PATCH] REGRESSION(r217927): [WPE-2.22][GSTREAMER_GL] Video appears + as pink/green with gstreamer-imx (i.MX6) + +* r217927 <https://trac.webkit.org/r217927> causes issues (video + appears as pink/green) with gstreamer-imx plugin. + +* This patch reverts r217927 meanwhile a better solution is not + found. + +Issue tracked upstream at: https://webkit.org/b/185470 +--- + .../MediaPlayerPrivateGStreamerBase.cpp | 18 ++++-------------- + .../gstreamer/VideoTextureCopierGStreamer.cpp | 19 ++----------------- + .../gstreamer/VideoTextureCopierGStreamer.h | 9 +-------- + .../graphics/texmap/TextureMapperGL.cpp | 2 -- + .../graphics/texmap/TextureMapperGL.h | 3 +-- + 5 files changed, 8 insertions(+), 43 deletions(-) + +diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp +index 1dfb9696..deff6a32 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp +@@ -58,16 +58,6 @@ + #endif + + #if USE(GSTREAMER_GL) +-#if G_BYTE_ORDER == G_LITTLE_ENDIAN +-#define GST_GL_CAPS_FORMAT "{ BGRx, BGRA }" +-#define TEXTURE_MAPPER_COLOR_CONVERT_FLAG TextureMapperGL::ShouldConvertTextureBGRAToRGBA +-#define TEXTURE_COPIER_COLOR_CONVERT_FLAG VideoTextureCopierGStreamer::ColorConversion::ConvertBGRAToRGBA +-#else +-#define GST_GL_CAPS_FORMAT "{ xRGB, ARGB }" +-#define TEXTURE_MAPPER_COLOR_CONVERT_FLAG TextureMapperGL::ShouldConvertTextureARGBToRGBA +-#define TEXTURE_COPIER_COLOR_CONVERT_FLAG VideoTextureCopierGStreamer::ColorConversion::ConvertARGBToRGBA +-#endif +- + #include <gst/app/gstappsink.h> + + #if USE(LIBEPOXY) +@@ -215,7 +205,7 @@ public: + return; + + #if USE(GSTREAMER_GL) +- m_flags = flags | (m_hasAlphaChannel ? TextureMapperGL::ShouldBlend : 0) | TEXTURE_MAPPER_COLOR_CONVERT_FLAG; ++ m_flags = flags | (m_hasAlphaChannel ? TextureMapperGL::ShouldBlend : 0); + + if (gstGLEnabled) { + m_isMapped = gst_video_frame_map(&m_videoFrame, &videoInfo, m_buffer, static_cast<GstMapFlags>(GST_MAP_READ | GST_MAP_GL)); +@@ -1003,7 +993,7 @@ bool MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture(Graphics + size = size.transposedSize(); + + if (!m_videoTextureCopier) +- m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(TEXTURE_COPIER_COLOR_CONVERT_FLAG); ++ m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(); + + return m_videoTextureCopier->copyVideoTextureToPlatformTexture(textureID, size, outputTexture, outputTarget, level, internalFormat, format, type, flipY, m_videoSourceOrientation); + } +@@ -1033,7 +1023,7 @@ NativeImagePtr MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime() + context->makeContextCurrent(); + + if (!m_videoTextureCopier) +- m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(TEXTURE_COPIER_COLOR_CONVERT_FLAG); ++ m_videoTextureCopier = std::make_unique<VideoTextureCopierGStreamer>(); + + if (!m_videoTextureCopier->copyVideoTextureToPlatformTexture(textureID, size, 0, GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, false, m_videoSourceOrientation)) + return nullptr; +@@ -1132,7 +1122,7 @@ GstElement* MediaPlayerPrivateGStreamerBase::createVideoSinkGL() + + gst_bin_add_many(GST_BIN(videoSink), upload, colorconvert, appsink, nullptr); + +- GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), format = (string) " GST_GL_CAPS_FORMAT)); ++ GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw(" GST_CAPS_FEATURE_MEMORY_GL_MEMORY "), format = (string) { RGBA }")); + + result &= gst_element_link_pads(upload, "src", colorconvert, "sink"); + result &= gst_element_link_pads_filtered(colorconvert, "src", appsink, "sink", caps.get()); +diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp +index 135333ea..46354e9c 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp ++++ b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp +@@ -29,7 +29,7 @@ + + namespace WebCore { + +-VideoTextureCopierGStreamer::VideoTextureCopierGStreamer(ColorConversion colorConversion) ++VideoTextureCopierGStreamer::VideoTextureCopierGStreamer() + { + GLContext* previousContext = GLContext::current(); + ASSERT(previousContext); +@@ -51,7 +51,6 @@ VideoTextureCopierGStreamer::VideoTextureCopierGStreamer(ColorConversion colorCo + glBindBuffer(GL_ARRAY_BUFFER, m_vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 8, vertices, GL_STATIC_DRAW); + +- updateColorConversionMatrix(colorConversion); + updateTextureSpaceMatrix(); + + previousContext->makeContextCurrent(); +@@ -75,20 +74,6 @@ VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer() + previousContext->makeContextCurrent(); + } + +-void VideoTextureCopierGStreamer::updateColorConversionMatrix(ColorConversion colorConversion) +-{ +- switch (colorConversion) { +- case ColorConversion::ConvertBGRAToRGBA: +- m_colorConversionMatrix.setMatrix(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); +- break; +- case ColorConversion::ConvertARGBToRGBA: +- m_colorConversionMatrix.setMatrix(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0); +- break; +- default: +- RELEASE_ASSERT_NOT_REACHED(); +- } +-} +- + void VideoTextureCopierGStreamer::updateTextureSpaceMatrix() + { + m_textureSpaceMatrix.makeIdentity(); +@@ -193,7 +178,7 @@ bool VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture(GLuint input + m_shaderProgram->setMatrix(m_shaderProgram->modelViewMatrixLocation(), m_modelViewMatrix); + m_shaderProgram->setMatrix(m_shaderProgram->projectionMatrixLocation(), m_projectionMatrix); + m_shaderProgram->setMatrix(m_shaderProgram->textureSpaceMatrixLocation(), m_textureSpaceMatrix); +- m_shaderProgram->setMatrix(m_shaderProgram->textureColorSpaceMatrixLocation(), m_colorConversionMatrix); ++ m_shaderProgram->setMatrix(m_shaderProgram->textureColorSpaceMatrixLocation(), TransformationMatrix()); + + // Perform the copy. + #if !USE(OPENGL_ES) +diff --git a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h +index ed1d58f7..fa277b06 100644 +--- a/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h ++++ b/Source/WebCore/platform/graphics/gstreamer/VideoTextureCopierGStreamer.h +@@ -34,16 +34,10 @@ class ImageOrientation; + + class VideoTextureCopierGStreamer { + public: +- enum class ColorConversion { +- ConvertBGRAToRGBA, +- ConvertARGBToRGBA +- }; +- +- VideoTextureCopierGStreamer(ColorConversion); ++ VideoTextureCopierGStreamer(); + ~VideoTextureCopierGStreamer(); + + bool copyVideoTextureToPlatformTexture(GLuint inputTexture, IntSize& frameSize, GLuint outputTexture, GLenum outputTarget, GLint level, GLenum internalFormat, GLenum format, GLenum type, bool flipY, ImageOrientation& sourceOrientation); +- void updateColorConversionMatrix(ColorConversion); + void updateTextureSpaceMatrix(); + void updateTransformationMatrix(); + GLuint resultTexture() { return m_resultTexture; } +@@ -61,7 +55,6 @@ private: + TransformationMatrix m_modelViewMatrix; + TransformationMatrix m_projectionMatrix; + TransformationMatrix m_textureSpaceMatrix; +- TransformationMatrix m_colorConversionMatrix; + GLuint m_resultTexture { 0 }; + }; + +diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +index ad68f2bd..ae66e9af 100644 +--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp ++++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp +@@ -443,8 +443,6 @@ static TransformationMatrix colorSpaceMatrixForFlags(TextureMapperGL::Flags flag + TransformationMatrix matrix; + if (flags & TextureMapperGL::ShouldConvertTextureBGRAToRGBA) + matrix.setMatrix(0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0); +- else if (flags & TextureMapperGL::ShouldConvertTextureARGBToRGBA) +- matrix.setMatrix(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0); + + return matrix; + } +diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h +index e1e3905d..c753dff5 100644 +--- a/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h ++++ b/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h +@@ -52,8 +52,7 @@ public: + ShouldRotateTexture90 = 0x10, + ShouldRotateTexture180 = 0x20, + ShouldRotateTexture270 = 0x40, +- ShouldConvertTextureBGRAToRGBA = 0x80, +- ShouldConvertTextureARGBToRGBA = 0x100 ++ ShouldConvertTextureBGRAToRGBA = 0x80 + }; + + typedef int Flags; +-- +2.18.0 + diff --git a/meta/recipes-rp/wpewebkit/wpewebkit/Do-not-detect-the-stopped-animations.patch b/meta/recipes-rp/wpewebkit/wpewebkit/Do-not-detect-the-stopped-animations.patch new file mode 100644 index 00000000000..8ff2645ea21 --- /dev/null +++ b/meta/recipes-rp/wpewebkit/wpewebkit/Do-not-detect-the-stopped-animations.patch @@ -0,0 +1,98 @@ +Upstream-Status: Pending + +Patch from https://trac.webkit.org/changeset/254680/webkit + +diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.cpp b/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.cpp +index e44966440ea..7789eddc3cb 100644 +--- a/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.cpp ++++ b/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.cpp +@@ -223,8 +223,8 @@ Animation& Animation::operator=(const Animation& other) + + void Animation::apply(ApplicationResult& applicationResults, MonotonicTime time) + { +- if (!isActive()) +- return; ++ // Even when m_state == AnimationState::Stopped && !m_fillsForwards, we should calculate the last value to avoid a flash. ++ // CoordinatedGraphicsScene will soon remove the stopped animation and update the value instead of this function. + + Seconds totalRunningTime = computeTotalRunningTime(time); + double normalizedValue = normalizedAnimationValue(totalRunningTime.seconds(), m_duration, m_direction, m_iterationCount); +@@ -232,8 +232,7 @@ void Animation::apply(ApplicationResult& applicationResults, MonotonicTime time) + if (m_iterationCount != WebCore::Animation::IterationCountInfinite && totalRunningTime.seconds() >= m_duration * m_iterationCount) { + m_state = AnimationState::Stopped; + m_pauseTime = 0_s; +- if (m_fillsForwards) +- normalizedValue = normalizedAnimationValueForFillsForwards(m_iterationCount, m_direction); ++ normalizedValue = normalizedAnimationValueForFillsForwards(m_iterationCount, m_direction); + } + + applicationResults.hasRunningAnimations |= (m_state == AnimationState::Playing); +@@ -308,11 +307,6 @@ Seconds Animation::computeTotalRunningTime(MonotonicTime time) + return m_totalRunningTime; + } + +-bool Animation::isActive() const +-{ +- return m_state != AnimationState::Stopped || m_fillsForwards; +-} +- + void Animation::applyInternal(ApplicationResult& applicationResults, const AnimationValue& from, const AnimationValue& to, float progress) + { + switch (m_keyframes.property()) { +@@ -390,7 +384,7 @@ bool Animations::hasActiveAnimationsOfType(AnimatedPropertyID type) const + { + return std::any_of(m_animations.begin(), m_animations.end(), + [&type](const Animation& animation) { +- return animation.isActive() && animation.keyframes().property() == type; ++ return animation.keyframes().property() == type; + }); + } + +@@ -402,14 +396,4 @@ bool Animations::hasRunningAnimations() const + }); + } + +-Animations Animations::getActiveAnimations() const +-{ +- Animations active; +- for (auto& animation : m_animations) { +- if (animation.isActive()) +- active.add(animation); +- } +- return active; +-} +- + } // namespace Nicosia +diff --git a/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.h b/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.h +index 24ffe9dab5c..d8cd1dc1c10 100644 +--- a/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.h ++++ b/Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.h +@@ -53,7 +53,6 @@ public: + void applyKeepingInternalState(ApplicationResult&, MonotonicTime); + void pause(Seconds); + void resume(); +- bool isActive() const; + + const String& name() const { return m_name; } + const WebCore::KeyframeValueList& keyframes() const { return m_keyframes; } +@@ -101,7 +100,6 @@ public: + + bool hasRunningAnimations() const; + bool hasActiveAnimationsOfType(WebCore::AnimatedPropertyID type) const; +- Animations getActiveAnimations() const; + + private: + Vector<Animation> m_animations; +diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp +index bd690e5c351..b28a907173a 100644 +--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp ++++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp +@@ -874,7 +874,7 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly() + if (localDelta.filtersChanged) + state.filters = filters(); + if (localDelta.animationsChanged) +- state.animations = m_animations.getActiveAnimations(); ++ state.animations = m_animations; + + if (localDelta.childrenChanged) { + state.children = WTF::map(children(), diff --git a/meta/recipes-rp/wpewebkit/wpewebkit_2.26.4.bb b/meta/recipes-rp/wpewebkit/wpewebkit_2.26.4.bb new file mode 100644 index 00000000000..f73c9f65c8b --- /dev/null +++ b/meta/recipes-rp/wpewebkit/wpewebkit_2.26.4.bb @@ -0,0 +1,18 @@ +require wpewebkit.inc + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +SRC_URI = "\ + https://wpewebkit.org/releases/${BPN}-${PV}.tar.xz \ + file://Do-not-detect-the-stopped-animations.patch \ +" +SRC_URI[md5sum] = "4cd2883ec9da38a0ffe413bb75239874" +SRC_URI[sha256sum] = "0c292182864b63b725491f1a69b55c03e0e75f6db0875389caff31fe9c0d3ae9" + +DEPENDS += " libwpe" +RCONFLICTS_${PN} = "libwpe (< 1.2) wpebackend-fdo (< 1.2)" + +BBCLASSEXTEND += "devupstream:target" + +SRC_URI_class-devupstream = "git://git.webkit.org/WebKit.git;branch=master" +SRCREV_class-devupstream = "17577d925d7f2e1a858b6d0eec964517100f27b0" + |