From patchwork Sat Jul 29 13:58:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Perez de Castro X-Patchwork-Id: 795210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="NxtZLDMO"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xKS4P3Dgcz9s71 for ; Sat, 29 Jul 2017 23:59:00 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id ECA7389CB9; Sat, 29 Jul 2017 13:58:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Diyzn8VgCKKB; Sat, 29 Jul 2017 13:58:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D533689CBC; Sat, 29 Jul 2017 13:58:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 8F46A1C23D7 for ; Sat, 29 Jul 2017 13:58:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 84DEA89CBC for ; Sat, 29 Jul 2017 13:58:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3jLizQd8aTm7 for ; Sat, 29 Jul 2017 13:58:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from fanzine.igalia.com (fanzine.igalia.com [91.117.99.155]) by hemlock.osuosl.org (Postfix) with ESMTPS id 4B42089CB9 for ; Sat, 29 Jul 2017 13:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Message-Id:Date:Subject:Cc:To:From; bh=PD7qCNg53A7F8Cbyyu+GSe1AeAjJ73DW2ADX604R0Y4=; b=NxtZLDMO28uPk9CtjfuH5XZwWp5CzaOQaNBxEdo8MMsNzxU22UA3xbdGxJ0wxZwkMp2mXFZZDkCBlZMrVj0AU8uWBvvjLHdpezu2Nb9b4PHeEeiH1tsOv5jYlo4ucQpqk0J13fIAiIZNdjYgXu9cYffKpjTN+yNH4gtfkRpsc7MAJRBV37znnragnwfEEe61mQs93ugJ5NRstVTA3zzPmiRRq74tvLBz5gY+ybh88HCt220u3fM+CQ7oiBda4NFcMiX6CpDc3fwXS/JSh42PXphk8aBcT+8HKAoqCLDzR7vP6GqEW3oMiJFimfhSoSZPPQSuCul61b3/DbZ/LTEawA==; Received: from 82-181-186-227.bb.dnainternet.fi ([82.181.186.227] helo=momiji) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1dbSGW-0002iU-Ch; Sat, 29 Jul 2017 15:58:48 +0200 Received: from localhost (momiji [local]) by momiji (OpenSMTPD) with ESMTPA id 910ec354; Sat, 29 Jul 2017 13:58:38 +0000 (UTC) From: Adrian Perez de Castro To: buildroot@buildroot.org Date: Sat, 29 Jul 2017 16:58:37 +0300 Message-Id: <20170729135837.25668-1-aperez@igalia.com> X-Mailer: git-send-email 2.13.3 Cc: Adrian Perez de Castro Subject: [Buildroot] [PATCH v2 1/1] webkitgtk: Allow building with BR2_PACKAGE_WEBKITGTK_MULTIMEDIA disabled X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Explicitly pass "-DENABLE_MEDIA_STREAM=OFF" to CMake, to workaround a missing feature dependency in the WebKitGTK+ build files. Additionally, a patch for https://bugs.webkit.org/show_bug.cgi?id=174940 is needed. Related upstream bug: https://bugs.webkit.org/show_bug.cgi?id=174940 Signed-off-by: Adrian Perez de Castro --- Changes v1 -> v2: - Add patch for https://bugs.webkit.org/show_bug.cgi?id=174940 --- ...roken-build-when-ENABLE_VIDEO-is-disabled.patch | 220 +++++++++++++++++++++ package/webkitgtk/webkitgtk.mk | 6 +- 2 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 package/webkitgtk/0003-Fix-broken-build-when-ENABLE_VIDEO-is-disabled.patch diff --git a/package/webkitgtk/0003-Fix-broken-build-when-ENABLE_VIDEO-is-disabled.patch b/package/webkitgtk/0003-Fix-broken-build-when-ENABLE_VIDEO-is-disabled.patch new file mode 100644 index 0000000000..7aaa1f6980 --- /dev/null +++ b/package/webkitgtk/0003-Fix-broken-build-when-ENABLE_VIDEO-is-disabled.patch @@ -0,0 +1,220 @@ +From 3aea48fc5fa628e0956273eecadccceeadb1cfb0 Mon Sep 17 00:00:00 2001 +From: "timothy@hatcher.name" + +Date: Tue, 11 Jul 2017 18:07:24 +0000 +Subject: [PATCH] Fix broken build when ENABLE_VIDEO is disabled. + https://bugs.webkit.org/show_bug.cgi?id=174368 + +Reviewed by Alex Christensen. + +* dom/Document.cpp: +* html/canvas/WebGLRenderingContextBase.cpp: +(WebCore::WebGLRenderingContextBase::texSubImage2D): +(WebCore::WebGLRenderingContextBase::texImage2D): +* html/canvas/WebGLRenderingContextBase.h: +* html/canvas/WebGLRenderingContextBase.idl: +* testing/Internals.cpp: +(WebCore::Internals::mediaResponseSources): +(WebCore::Internals::mediaResponseContentRanges): +* testing/Internals.h: +* testing/Internals.idl: + +Signed-off-by: Adrian Perez de Castro + +git-svn-id: http://svn.webkit.org/repository/webkit/trunk@219343 268f45cc-cd09-0410-ab3c-d52691b4dbfc +--- + Source/WebCore/dom/Document.cpp | 1 + + .../html/canvas/WebGLRenderingContextBase.cpp | 16 +++++++++++---- + .../html/canvas/WebGLRenderingContextBase.h | 12 ++++++++++- + .../html/canvas/WebGLRenderingContextBase.idl | 4 ++++ + Source/WebCore/testing/Internals.cpp | 24 ++++++++++++++++++++++ + Source/WebCore/testing/Internals.h | 2 ++ + Source/WebCore/testing/Internals.idl | 2 ++ + 7 files changed, 56 insertions(+), 5 deletions(-) + +diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp +index f9e0bf2726e..1c95bcecb21 100644 +--- a/Source/WebCore/dom/Document.cpp ++++ b/Source/WebCore/dom/Document.cpp +@@ -182,6 +182,7 @@ + #include "TransformSource.h" + #include "TreeWalker.h" + #include "ValidationMessageClient.h" ++#include "VisibilityChangeClient.h" + #include "VisitedLinkState.h" + #include "WheelEvent.h" + #include "WindowFeatures.h" +diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp +index f8fd63f7d87..a76a44ff06b 100644 +--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp ++++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp +@@ -3597,7 +3597,9 @@ ExceptionOr WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3D + else + texSubImage2DImpl(target, level, xoffset, yoffset, format, type, canvas->copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha); + return { }; +- }, [&](const RefPtr& video) -> ExceptionOr { ++ } ++#if ENABLE(VIDEO) ++ , [&](const RefPtr& video) -> ExceptionOr { + ExceptionCode ec = 0; + if (isContextLostOrPending() || !validateHTMLVideoElement("texSubImage2D", video.get(), ec)) + return ec ? Exception { ec } : ExceptionOr { }; +@@ -3620,7 +3622,9 @@ ExceptionOr WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3D + return { }; + texSubImage2DImpl(target, level, xoffset, yoffset, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha); + return { }; +- }); ++ } ++#endif ++ ); + + return WTF::visit(visitor, source.value()); + } +@@ -4107,7 +4111,9 @@ ExceptionOr WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint + else + texImage2DImpl(target, level, internalformat, format, type, canvas->copiedImage(), GraphicsContext3D::HtmlDomCanvas, m_unpackFlipY, m_unpackPremultiplyAlpha); + return { }; +- }, [&](const RefPtr& video) -> ExceptionOr { ++ } ++#if ENABLE(VIDEO) ++ , [&](const RefPtr& video) -> ExceptionOr { + ExceptionCode ec = 0; + if (isContextLostOrPending() || !validateHTMLVideoElement("texImage2D", video.get(), ec) + || !validateTexFunc("texImage2D", TexImage, SourceHTMLVideoElement, target, level, internalformat, video->videoWidth(), video->videoHeight(), 0, format, type, 0, 0)) +@@ -4137,7 +4143,9 @@ ExceptionOr WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint + return { }; + texImage2DImpl(target, level, internalformat, format, type, image.get(), GraphicsContext3D::HtmlDomVideo, m_unpackFlipY, m_unpackPremultiplyAlpha); + return { }; +- }); ++ } ++#endif ++ ); + + return WTF::visit(visitor, source.value()); + } +diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h +index 31e5542e612..d4738e834a1 100644 +--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h ++++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h +@@ -57,7 +57,6 @@ class EXTShaderTextureLOD; + class EXTsRGB; + class EXTFragDepth; + class HTMLImageElement; +-class HTMLVideoElement; + class ImageData; + class IntSize; + class OESStandardDerivatives; +@@ -85,6 +84,10 @@ class WebGLSharedObject; + class WebGLShaderPrecisionFormat; + class WebGLUniformLocation; + ++#if ENABLE(VIDEO) ++class HTMLVideoElement; ++#endif ++ + inline void clip1D(GC3Dint start, GC3Dsizei range, GC3Dsizei sourceRange, GC3Dint* clippedStart, GC3Dsizei* clippedRange) + { + ASSERT(clippedStart && clippedRange); +@@ -244,7 +247,12 @@ public: + + void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr&&); + ++#if ENABLE(VIDEO) + using TexImageSource = WTF::Variant, RefPtr, RefPtr, RefPtr>; ++#else ++ using TexImageSource = WTF::Variant, RefPtr, RefPtr>; ++#endif ++ + ExceptionOr texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, std::optional); + + void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param); +@@ -677,7 +685,9 @@ protected: + SourceImageData, + SourceHTMLImageElement, + SourceHTMLCanvasElement, ++#if ENABLE(VIDEO) + SourceHTMLVideoElement, ++#endif + }; + + // Helper function for tex{Sub}Image2D to check if the input format/type/level/target/width/height/border/xoffset/yoffset are valid. +diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl b/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl +index 63b64cdebd2..3111e798a89 100644 +--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl ++++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.idl +@@ -42,7 +42,11 @@ typedef (Float32Array or sequence) Float32List; + typedef (Int32Array or sequence) Int32List; + + // FIXME: Should allow ImageBitmap too. ++#ifdef ENABLE_VIDEO + typedef (ImageData or HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) TexImageSource; ++#else ++typedef (ImageData or HTMLImageElement or HTMLCanvasElement) TexImageSource; ++#endif + + [ + Conditional=WEBGL, +diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp +index 6d26d556e33..6d64845fd27 100644 +--- a/Source/WebCore/testing/Internals.cpp ++++ b/Source/WebCore/testing/Internals.cpp +@@ -2765,6 +2765,30 @@ String Internals::getImageSourceURL(Element& element) + + #if ENABLE(VIDEO) + ++Vector Internals::mediaResponseSources(HTMLMediaElement& media) ++{ ++ auto* resourceLoader = media.lastMediaResourceLoaderForTesting(); ++ if (!resourceLoader) ++ return { }; ++ Vector result; ++ auto responses = resourceLoader->responsesForTesting(); ++ for (auto& response : responses) ++ result.append(responseSourceToString(response)); ++ return result; ++} ++ ++Vector Internals::mediaResponseContentRanges(HTMLMediaElement& media) ++{ ++ auto* resourceLoader = media.lastMediaResourceLoaderForTesting(); ++ if (!resourceLoader) ++ return { }; ++ Vector result; ++ auto responses = resourceLoader->responsesForTesting(); ++ for (auto& response : responses) ++ result.append(response.httpHeaderField(HTTPHeaderName::ContentRange)); ++ return result; ++} ++ + void Internals::simulateAudioInterruption(HTMLMediaElement& element) + { + #if USE(GSTREAMER) +diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h +index f5c08a87dfd..d35f651e452 100644 +--- a/Source/WebCore/testing/Internals.h ++++ b/Source/WebCore/testing/Internals.h +@@ -401,6 +401,8 @@ public: + String getImageSourceURL(Element&); + + #if ENABLE(VIDEO) ++ Vector mediaResponseSources(HTMLMediaElement&); ++ Vector mediaResponseContentRanges(HTMLMediaElement&); + void simulateAudioInterruption(HTMLMediaElement&); + ExceptionOr mediaElementHasCharacteristic(HTMLMediaElement&, const String&); + #endif +diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl +index 155b70b4abf..3fe6885d362 100644 +--- a/Source/WebCore/testing/Internals.idl ++++ b/Source/WebCore/testing/Internals.idl +@@ -386,6 +386,8 @@ enum EventThrottlingBehavior { + + void enableAutoSizeMode(boolean enabled, long minimumWidth, long minimumHeight, long maximumWidth, long maximumHeight); + ++ [Conditional=VIDEO] sequence mediaResponseSources(HTMLMediaElement media); ++ [Conditional=VIDEO] sequence mediaResponseContentRanges(HTMLMediaElement media); + [Conditional=VIDEO] void simulateAudioInterruption(HTMLMediaElement element); + [Conditional=VIDEO, MayThrowException] boolean mediaElementHasCharacteristic(HTMLMediaElement element, DOMString characteristic); + +-- +2.13.3 + diff --git a/package/webkitgtk/webkitgtk.mk b/package/webkitgtk/webkitgtk.mk index b200d23262..e30d07fc1d 100644 --- a/package/webkitgtk/webkitgtk.mk +++ b/package/webkitgtk/webkitgtk.mk @@ -40,9 +40,13 @@ WEBKITGTK_CONF_OPTS += \ -DENABLE_WEB_AUDIO=ON WEBKITGTK_DEPENDENCIES += gstreamer1 gst1-libav gst1-plugins-base gst1-plugins-good else +# ENABLE_MEDIA_STREAM has to be explicitly disabled because there is a missing +# feature dependency in the WebKitGTK+ CMake files. This can be removed once +# https://bugs.webkit.org/show_bug.cgi?id=174940 makes it into a release. WEBKITGTK_CONF_OPTS += \ -DENABLE_VIDEO=OFF \ - -DENABLE_WEB_AUDIO=OFF + -DENABLE_WEB_AUDIO=OFF \ + -DENABLE_MEDIA_STREAM=OFF endif # Only one target platform can be built, assume X11 > Wayland