Compare commits

...

No commits in common. "c8" and "c8-beta" have entirely different histories.
c8 ... c8-beta

18 changed files with 628 additions and 2808 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/webkitgtk-2.48.1.tar.xz SOURCES/webkitgtk-2.42.5.tar.xz
SOURCES/webkitgtk-keys.gpg SOURCES/webkitgtk-keys.gpg

View File

@ -1,2 +1,2 @@
f7939f920f92f6b1395b8573f069d3fb9c085b3f SOURCES/webkitgtk-2.48.1.tar.xz c3ffb2beaac56f1089029f2254482f48d9e3db37 SOURCES/webkitgtk-2.42.5.tar.xz
04b10b8a486542c4551269c20b18b5c1c6cb4f94 SOURCES/webkitgtk-keys.gpg cf57cbbadf2a07c6ede1c886f9742b7d352460c0 SOURCES/webkitgtk-keys.gpg

View File

@ -1,22 +1,36 @@
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
index 44ab9b35c6c9..f9c576764f43 100644 index 526fe7cfe0cf..7650ea1bade2 100644
--- a/Source/cmake/OptionsGTK.cmake --- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake +++ b/Source/cmake/OptionsGTK.cmake
@@ -8,7 +8,7 @@ SET_PROJECT_VERSION(2 48 1) @@ -13,7 +13,7 @@ endif ()
set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
find_package(GLIB 2.70.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
-find_package(Cairo 1.16.0 REQUIRED) -find_package(Cairo 1.16.0 REQUIRED)
+find_package(Cairo 1.14.0 REQUIRED) +find_package(Cairo 1.14.0 REQUIRED)
find_package(LibGcrypt 1.7.0 REQUIRED) find_package(Fontconfig 2.13.0 REQUIRED)
find_package(Libtasn1 REQUIRED) find_package(Freetype 2.9.0 REQUIRED)
find_package(HarfBuzz 2.7.4 REQUIRED COMPONENTS ICU) find_package(LibGcrypt 1.6.0 REQUIRED)
@@ -133,7 +133,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_THUNDER PRIVATE ${ENABLE_DEVELOPER_MODE} @@ -91,6 +91,14 @@ else ()
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PERIODIC_MEMORY_MONITOR PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOURCE_USAGE PRIVATE OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE ON) endif ()
+# Enable variation fonts when cairo >= 1.16, fontconfig >= 2.13.0, freetype >= 2.9.0 and harfbuzz >= 1.4.2.
+if (("${PC_CAIRO_VERSION}" VERSION_GREATER "1.16.0" OR "${PC_CAIRO_VERSION}" STREQUAL "1.16.0")
+ AND ("${PC_FONTCONFIG_VERSION}" VERSION_GREATER "2.13.0" OR "${PC_FONTCONFIG_VERSION}" STREQUAL "2.13.0")
+ AND ("${FREETYPE_VERSION_STRING}" VERSION_GREATER "2.9.0" OR "${FREETYPE_VERSION_STRING}" STREQUAL "2.9.0")
+ AND ("${PC_HARFBUZZ_VERSION}" VERSION_GREATER "1.4.2" OR "${PC_HARFBUZZ_VERSION}" STREQUAL "1.4.2"))
+ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON)
+endif ()
+
# Public options shared with other WebKit ports. Do not add any options here
# without approval from a GTK reviewer. There must be strong reason to support
# changing the value of the option.
@@ -149,7 +157,6 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_POINTER_LOCK PRIVATE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SERVICE_WORKER PRIVATE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHAREABLE_RESOURCE PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHAREABLE_RESOURCE PRIVATE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPEECH_SYNTHESIS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON) -WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_VARIATION_FONTS PRIVATE OFF)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_API_STATISTICS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_API_STATISTICS PRIVATE ON)
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CODECS PRIVATE ON) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_CODECS PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES}) WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})

View File

@ -1,26 +0,0 @@
diff --git a/Source/ThirdParty/libsysprof-capture/CMakeLists.txt b/Source/ThirdParty/libsysprof-capture/CMakeLists.txt
index 7ea8f0469ad7..13a9e390643a 100644
--- a/Source/ThirdParty/libsysprof-capture/CMakeLists.txt
+++ b/Source/ThirdParty/libsysprof-capture/CMakeLists.txt
@@ -46,6 +46,7 @@ target_link_libraries(SysProfCapture
WEBKIT_ADD_TARGET_C_FLAGS(SysProfCapture
-Wno-implicit-function-declaration
+ -Wno-int-conversion
-Wno-sign-compare
-Wno-unused-parameter
)
diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake
index f5ec0a55919b..cf307eac2775 100644
--- a/Source/cmake/WebKitCompilerFlags.cmake
+++ b/Source/cmake/WebKitCompilerFlags.cmake
@@ -184,8 +184,7 @@ if (COMPILER_IS_GCC_OR_CLANG)
-Wno-misleading-indentation
-Wno-psabi)
- # GCC < 12.0 gives false warnings for mismatched-new-delete <https://webkit.org/b/241516>
- if ((CMAKE_CXX_COMPILER_ID MATCHES "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0.0"))
+ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-mismatched-new-delete)
WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-uninitialized)
endif ()

View File

@ -1,12 +0,0 @@
diff --git a/Source/WebCore/platform/audio/DenormalDisabler.cpp b/Source/WebCore/platform/audio/DenormalDisabler.cpp
index 35715e663ce7..44ba08a33d5d 100644
--- a/Source/WebCore/platform/audio/DenormalDisabler.cpp
+++ b/Source/WebCore/platform/audio/DenormalDisabler.cpp
@@ -91,7 +91,7 @@ DenormalDisabler::~DenormalDisabler()
}
}
#else
-DenormalDisabler::DenormalDisabler() = default
+DenormalDisabler::DenormalDisabler() = default;
DenormalDisabler::~DenormalDisabler() = default;
#endif

View File

@ -1,14 +0,0 @@
diff --git a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp
index a2f3b582dcc5..1faf219c2adb 100644
--- a/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp
+++ b/Source/WebKit/UIProcess/glib/WebProcessPoolGLib.cpp
@@ -91,7 +91,8 @@ void WebProcessPool::platformInitialize(NeedsGlobalStaticInitialization)
else {
static bool once = false;
if (!once) {
- g_warning("WEBKIT_FORCE_SANDBOX no longer allows disabling the sandbox. Use WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 instead.");
+ if (g_strcmp0(g_get_prgname(), "evolution"))
+ g_warning("WEBKIT_FORCE_SANDBOX no longer allows disabling the sandbox. Use WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 instead.");
once = true;
}
}

View File

@ -1,10 +1,10 @@
diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
index 65cf0eb2b99a..518cc953edca 100644 index a30f5b13be26..72ad006cde21 100644
--- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp --- a/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp +++ b/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp
@@ -450,6 +450,9 @@ static void webkitWebContextConstructed(GObject* object) @@ -438,6 +438,9 @@ static void webkitWebContextConstructed(GObject* object)
} }
configuration.setTimeZoneOverride(String::fromUTF8(priv->timeZoneOverride.span())); configuration.setTimeZoneOverride(String::fromUTF8(priv->timeZoneOverride.data(), priv->timeZoneOverride.length()));
+ if (!g_strcmp0(g_get_prgname(), "evolution")) + if (!g_strcmp0(g_get_prgname(), "evolution"))
+ configuration.setUsesSingleWebProcess(true); + configuration.setUsesSingleWebProcess(true);

View File

@ -37,446 +37,3 @@ index 8be643a54151..ae82b41400b5 100644
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
From 4e525b9192df17a80b07188af6b6e7cf6476ff10 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Fri, 4 Apr 2025 13:20:59 -0500
Subject: [PATCH] Revert "[GLib] Remove all GLIB_CHECK_VERSION conditionals"
This reverts commit 85b637b69f1c3a6242420b198d1c173477ce0f22.
---
Source/WTF/wtf/URL.h | 4 ++--
Source/WTF/wtf/glib/GRefPtr.cpp | 2 ++
Source/WTF/wtf/glib/GRefPtr.h | 3 +++
Source/WTF/wtf/glib/SocketConnection.cpp | 13 +++++++++++++
Source/WTF/wtf/glib/URLGLib.cpp | 2 ++
Source/WebCore/platform/LowPowerModeNotifier.h | 2 ++
.../platform/glib/LowPowerModeNotifierGLib.cpp | 8 ++++++++
.../platform/network/soup/CertificateInfoSoup.cpp | 8 ++++++++
Source/WebKit/NetworkProcess/glib/DNSCache.cpp | 12 ++++++++++++
Source/WebKit/NetworkProcess/glib/DNSCache.h | 2 ++
.../NetworkProcess/glib/WebKitCachedResolver.cpp | 6 ++++++
.../glib/WebKitOverridingResolver.cpp | 4 ++++
Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp | 6 ++++++
Source/cmake/OptionsGTK.cmake | 13 ++++++++++++-
Source/cmake/OptionsWPE.cmake | 13 ++++++++++++-
15 files changed, 94 insertions(+), 4 deletions(-)
diff --git a/Source/WTF/wtf/URL.h b/Source/WTF/wtf/URL.h
index 8a7864508a8e..f065677c68ad 100644
--- a/Source/WTF/wtf/URL.h
+++ b/Source/WTF/wtf/URL.h
@@ -27,7 +27,7 @@
#include <wtf/text/WTFString.h>
-#if USE(GLIB)
+#if USE(GLIB) && HAVE(GURI)
#include <wtf/glib/GRefPtr.h>
#endif
@@ -237,7 +237,7 @@ public:
WTF_EXPORT_PRIVATE operator NSURL *() const;
#endif
-#if USE(GLIB)
+#if USE(GLIB) && HAVE(GURI)
WTF_EXPORT_PRIVATE URL(GUri*);
WTF_EXPORT_PRIVATE GRefPtr<GUri> createGUri() const;
#endif
diff --git a/Source/WTF/wtf/glib/GRefPtr.cpp b/Source/WTF/wtf/glib/GRefPtr.cpp
index 4c15aa9866c0..6faa98b7eab2 100644
--- a/Source/WTF/wtf/glib/GRefPtr.cpp
+++ b/Source/WTF/wtf/glib/GRefPtr.cpp
@@ -207,6 +207,7 @@ template <> void derefGPtr(GDBusNodeInfo* ptr)
g_dbus_node_info_unref(ptr);
}
+#if HAVE(GURI)
template <> GUri* refGPtr(GUri* ptr)
{
if (ptr)
@@ -219,6 +220,7 @@ template <> void derefGPtr(GUri* ptr)
if (ptr)
g_uri_unref(ptr);
}
+#endif
template <>
GArray* refGPtr(GArray* ptr)
diff --git a/Source/WTF/wtf/glib/GRefPtr.h b/Source/WTF/wtf/glib/GRefPtr.h
index 87a9ef9760bf..d6c71c14a981 100644
--- a/Source/WTF/wtf/glib/GRefPtr.h
+++ b/Source/WTF/wtf/glib/GRefPtr.h
@@ -264,8 +264,11 @@ template <> WTF_EXPORT_PRIVATE GArray* refGPtr(GArray*);
template <> WTF_EXPORT_PRIVATE void derefGPtr(GArray*);
template <> WTF_EXPORT_PRIVATE GResource* refGPtr(GResource*);
template <> WTF_EXPORT_PRIVATE void derefGPtr(GResource*);
+
+#if HAVE(GURI)
template <> WTF_EXPORT_PRIVATE GUri* refGPtr(GUri*);
template <> WTF_EXPORT_PRIVATE void derefGPtr(GUri*);
+#endif
template <typename T> inline T* refGPtr(T* ptr)
{
diff --git a/Source/WTF/wtf/glib/SocketConnection.cpp b/Source/WTF/wtf/glib/SocketConnection.cpp
index d1185aeb2d47..80a622b83eba 100644
--- a/Source/WTF/wtf/glib/SocketConnection.cpp
+++ b/Source/WTF/wtf/glib/SocketConnection.cpp
@@ -145,7 +145,20 @@ bool SocketConnection::readMessage()
if (!it->value.first.isNull()) {
GUniquePtr<GVariantType> variantType(g_variant_type_new(it->value.first.data()));
size_t parametersSize = bodySize.value() - messageNameLength.value();
+ // g_variant_new_from_data() requires the memory to be properly aligned for the type being loaded,
+ // but it's not possible to know the alignment because g_variant_type_info_query() is not public API.
+ // Since GLib 2.60 g_variant_new_from_data() already checks the alignment and reallocates the buffer
+ // in aligned memory only if needed. For older versions we can simply ensure the memory is 8 aligned.
+#if GLIB_CHECK_VERSION(2, 60, 0)
parameters = g_variant_new_from_data(variantType.get(), messageData, parametersSize, FALSE, nullptr, nullptr);
+#else
+ auto* alignedMemory = fastAlignedMalloc(8, parametersSize);
+ memcpy(alignedMemory, messageData, parametersSize);
+ GRefPtr<GBytes> bytes = g_bytes_new_with_free_func(alignedMemory, parametersSize, [](gpointer data) {
+ fastAlignedFree(data);
+ }, alignedMemory);
+ parameters = g_variant_new_from_bytes(variantType.get(), bytes.get(), FALSE);
+#endif
if (messageIsByteSwapped(flags))
parameters = adoptGRef(g_variant_byteswap(parameters.get()));
}
diff --git a/Source/WTF/wtf/glib/URLGLib.cpp b/Source/WTF/wtf/glib/URLGLib.cpp
index 589dc1b52f8f..f67fe780f333 100644
--- a/Source/WTF/wtf/glib/URLGLib.cpp
+++ b/Source/WTF/wtf/glib/URLGLib.cpp
@@ -35,6 +35,7 @@
namespace WTF {
+#if HAVE(GURI)
URL::URL(GUri* uri)
{
if (!uri) {
@@ -56,6 +57,7 @@ GRefPtr<GUri> URL::createGUri() const
static_cast<GUriFlags>(G_URI_FLAGS_HAS_PASSWORD | G_URI_FLAGS_ENCODED_PATH | G_URI_FLAGS_ENCODED_QUERY | G_URI_FLAGS_ENCODED_FRAGMENT | G_URI_FLAGS_SCHEME_NORMALIZE | G_URI_FLAGS_PARSE_RELAXED),
nullptr));
}
+#endif
bool URL::hostIsIPAddress(StringView host)
{
diff --git a/Source/WebCore/platform/LowPowerModeNotifier.h b/Source/WebCore/platform/LowPowerModeNotifier.h
index c8f2051d77f6..e2ea0dae3292 100644
--- a/Source/WebCore/platform/LowPowerModeNotifier.h
+++ b/Source/WebCore/platform/LowPowerModeNotifier.h
@@ -61,8 +61,10 @@ private:
RetainPtr<WebLowPowerModeObserver> m_observer;
LowPowerModeChangeCallback m_callback;
#elif USE(GLIB)
+#if GLIB_CHECK_VERSION(2, 69, 1)
LowPowerModeChangeCallback m_callback;
GRefPtr<GPowerProfileMonitor> m_powerProfileMonitor;
+#endif
bool m_lowPowerModeEnabled { false };
#endif
};
diff --git a/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp b/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp
index e083cc66934e..7c0f55d089e6 100644
--- a/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp
+++ b/Source/WebCore/platform/glib/LowPowerModeNotifierGLib.cpp
@@ -28,10 +28,13 @@ namespace WebCore {
LowPowerModeNotifier::LowPowerModeNotifier(LowPowerModeChangeCallback&& callback)
+#if GLIB_CHECK_VERSION(2, 69, 1)
: m_callback(WTFMove(callback))
, m_powerProfileMonitor(adoptGRef(g_power_profile_monitor_dup_default()))
, m_lowPowerModeEnabled(g_power_profile_monitor_get_power_saver_enabled(m_powerProfileMonitor.get()))
+#endif
{
+#if GLIB_CHECK_VERSION(2, 69, 1)
g_signal_connect_swapped(m_powerProfileMonitor.get(), "notify::power-saver-enabled", G_CALLBACK(+[] (LowPowerModeNotifier* self, GParamSpec*, GPowerProfileMonitor* monitor) {
bool powerSaverEnabled = g_power_profile_monitor_get_power_saver_enabled(monitor);
if (self->m_lowPowerModeEnabled != powerSaverEnabled) {
@@ -39,11 +42,16 @@ LowPowerModeNotifier::LowPowerModeNotifier(LowPowerModeChangeCallback&& callback
self->m_callback(self->m_lowPowerModeEnabled);
}
}), this);
+#else
+ UNUSED_PARAM(callback);
+#endif
}
LowPowerModeNotifier::~LowPowerModeNotifier()
{
+#if GLIB_CHECK_VERSION(2, 69, 1)
g_signal_handlers_disconnect_by_data(m_powerProfileMonitor.get(), this);
+#endif
}
bool LowPowerModeNotifier::isLowPowerModeEnabled() const
diff --git a/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp b/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp
index f32ecca7a300..e81a5433709d 100644
--- a/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp
+++ b/Source/WebCore/platform/network/soup/CertificateInfoSoup.cpp
@@ -73,9 +73,11 @@ CertificateInfo CertificateInfo::isolatedCopy() const
certificatesDataList.append(certificateData.release());
}
+#if GLIB_CHECK_VERSION(2, 69, 0)
GUniqueOutPtr<char> privateKey;
GUniqueOutPtr<char> privateKeyPKCS11Uri;
g_object_get(m_certificate.get(), "private-key-pem", &privateKey.outPtr(), "private-key-pkcs11-uri", &privateKeyPKCS11Uri.outPtr(), nullptr);
+#endif
GType certificateType = g_tls_backend_get_certificate_type(g_tls_backend_get_default());
GRefPtr<GTlsCertificate> certificate;
@@ -86,8 +88,10 @@ CertificateInfo CertificateInfo::isolatedCopy() const
certificateType, nullptr, nullptr,
"certificate-pem", certificateData.get(),
"issuer", issuer,
+#if GLIB_CHECK_VERSION(2, 69, 0)
"private-key-pem", certificatesDataList.isEmpty() ? privateKey.get() : nullptr,
"private-key-pkcs11-uri", certificatesDataList.isEmpty() ? privateKeyPKCS11Uri.get() : nullptr,
+#endif
nullptr)));
RELEASE_ASSERT(certificate);
issuer = certificate.get();
@@ -101,6 +105,7 @@ std::optional<CertificateSummary> CertificateInfo::summary() const
if (!m_certificate)
return std::nullopt;
+#if GLIB_CHECK_VERSION(2, 69, 0)
CertificateSummary summaryInfo;
GRefPtr<GDateTime> validNotBefore;
@@ -125,6 +130,9 @@ std::optional<CertificateSummary> CertificateInfo::summary() const
}
return summaryInfo;
+#else
+ return std::nullopt;
+#endif
}
} // namespace WebCore
diff --git a/Source/WebKit/NetworkProcess/glib/DNSCache.cpp b/Source/WebKit/NetworkProcess/glib/DNSCache.cpp
index db92010baabf..b717b734e8e8 100644
--- a/Source/WebKit/NetworkProcess/glib/DNSCache.cpp
+++ b/Source/WebKit/NetworkProcess/glib/DNSCache.cpp
@@ -50,9 +50,17 @@ DNSCache::DNSCacheMap& DNSCache::mapForType(Type type)
case Type::Default:
return m_dnsMap;
case Type::IPv4Only:
+#if GLIB_CHECK_VERSION(2, 59, 0)
return m_ipv4Map;
+#else
+ return m_dnsMap;
+#endif
case Type::IPv6Only:
+#if GLIB_CHECK_VERSION(2, 59, 0)
return m_ipv6Map;
+#else
+ return m_dnsMap;
+#endif
}
RELEASE_ASSERT_NOT_REACHED();
@@ -118,16 +126,20 @@ void DNSCache::removeExpiredResponsesFired()
{
Locker locker { m_lock };
removeExpiredResponsesInMap(m_dnsMap);
+#if GLIB_CHECK_VERSION(2, 59, 0)
removeExpiredResponsesInMap(m_ipv4Map);
removeExpiredResponsesInMap(m_ipv6Map);
+#endif
}
void DNSCache::clear()
{
Locker locker { m_lock };
m_dnsMap.clear();
+#if GLIB_CHECK_VERSION(2, 59, 0)
m_ipv4Map.clear();
m_ipv6Map.clear();
+#endif
}
} // namespace WebKit
diff --git a/Source/WebKit/NetworkProcess/glib/DNSCache.h b/Source/WebKit/NetworkProcess/glib/DNSCache.h
index 6aa530f44321..49aded549588 100644
--- a/Source/WebKit/NetworkProcess/glib/DNSCache.h
+++ b/Source/WebKit/NetworkProcess/glib/DNSCache.h
@@ -65,8 +65,10 @@ private:
Lock m_lock;
DNSCacheMap m_dnsMap WTF_GUARDED_BY_LOCK(m_lock);
+#if GLIB_CHECK_VERSION(2, 59, 0)
DNSCacheMap m_ipv4Map;
DNSCacheMap m_ipv6Map;
+#endif
RunLoop::Timer m_expiredTimer;
};
diff --git a/Source/WebKit/NetworkProcess/glib/WebKitCachedResolver.cpp b/Source/WebKit/NetworkProcess/glib/WebKitCachedResolver.cpp
index 2752ff9cfc2c..7804e8b7a588 100644
--- a/Source/WebKit/NetworkProcess/glib/WebKitCachedResolver.cpp
+++ b/Source/WebKit/NetworkProcess/glib/WebKitCachedResolver.cpp
@@ -67,7 +67,9 @@ static Vector<GRefPtr<GInetAddress>> addressListGListToVector(GList* addressList
struct LookupAsyncData {
CString hostname;
+#if GLIB_CHECK_VERSION(2, 59, 0)
DNSCache::Type dnsCacheType { DNSCache::Type::Default };
+#endif
};
WEBKIT_DEFINE_ASYNC_DATA_STRUCT(LookupAsyncData)
@@ -117,6 +119,7 @@ static GList* webkitCachedResolverLookupByNameFinish(GResolver* resolver, GAsync
return static_cast<GList*>(g_task_propagate_pointer(G_TASK(result), error));
}
+#if GLIB_CHECK_VERSION(2, 59, 0)
static inline DNSCache::Type dnsCacheType(GResolverNameLookupFlags flags)
{
// A cache is kept for each type of response to avoid the overcomplication of combining or filtering results.
@@ -177,6 +180,7 @@ static GList* webkitCachedResolverLookupByNameWithFlagsFinish(GResolver* resolve
return static_cast<GList*>(g_task_propagate_pointer(G_TASK(result), error));
}
+#endif // GLIB_CHECK_VERSION(2, 59, 0)
static char* webkitCachedResolverLookupByAddress(GResolver* resolver, GInetAddress* address, GCancellable* cancellable, GError** error)
{
@@ -219,9 +223,11 @@ static void webkit_cached_resolver_class_init(WebKitCachedResolverClass* klass)
resolverClass->lookup_by_name = webkitCachedResolverLookupByName;
resolverClass->lookup_by_name_async = webkitCachedResolverLookupByNameAsync;
resolverClass->lookup_by_name_finish = webkitCachedResolverLookupByNameFinish;
+#if GLIB_CHECK_VERSION(2, 59, 0)
resolverClass->lookup_by_name_with_flags = webkitCachedResolverLookupByNameWithFlags;
resolverClass->lookup_by_name_with_flags_async = webkitCachedResolverLookupByNameWithFlagsAsync;
resolverClass->lookup_by_name_with_flags_finish = webkitCachedResolverLookupByNameWithFlagsFinish;
+#endif
resolverClass->lookup_by_address = webkitCachedResolverLookupByAddress;
resolverClass->lookup_by_address_async = webkitCachedResolverLookupByAddressAsync;
resolverClass->lookup_by_address_finish = webkitCachedResolverLookupByAddressFinish;
diff --git a/Source/WebKit/NetworkProcess/glib/WebKitOverridingResolver.cpp b/Source/WebKit/NetworkProcess/glib/WebKitOverridingResolver.cpp
index 150d74ed0296..f461e3c695fe 100644
--- a/Source/WebKit/NetworkProcess/glib/WebKitOverridingResolver.cpp
+++ b/Source/WebKit/NetworkProcess/glib/WebKitOverridingResolver.cpp
@@ -90,6 +90,7 @@ static GList* webkitOverridingResolverLookupByNameFinish(GResolver* resolver, GA
return static_cast<GList*>(g_task_propagate_pointer(G_TASK(result), error));
}
+#if GLIB_CHECK_VERSION(2, 59, 0)
static GList* createLoobackAddressList(WebKitOverridingResolver* resolver, GResolverNameLookupFlags flags)
{
GList* list = nullptr;
@@ -129,6 +130,7 @@ static GList* webkitOverridingResolverLookupByNameWithFlagsFinish(GResolver* res
return static_cast<GList*>(g_task_propagate_pointer(G_TASK(result), error));
}
+#endif // GLIB_CHECK_VERSION(2, 59, 0)
static char* webkitOverridingResolverLookupByAddress(GResolver* resolver, GInetAddress* address, GCancellable* cancellable, GError** error)
{
@@ -166,9 +168,11 @@ static void webkit_overriding_resolver_class_init(WebKitOverridingResolverClass*
resolverClass->lookup_by_name = webkitOverridingResolverLookupByName;
resolverClass->lookup_by_name_async = webkitOverridingResolverLookupByNameAsync;
resolverClass->lookup_by_name_finish = webkitOverridingResolverLookupByNameFinish;
+#if GLIB_CHECK_VERSION(2, 59, 0)
resolverClass->lookup_by_name_with_flags = webkitOverridingResolverLookupByNameWithFlags;
resolverClass->lookup_by_name_with_flags_async = webkitOverridingResolverLookupByNameWithFlagsAsync;
resolverClass->lookup_by_name_with_flags_finish = webkitOverridingResolverLookupByNameWithFlagsFinish;
+#endif
resolverClass->lookup_by_address = webkitOverridingResolverLookupByAddress;
resolverClass->lookup_by_address_async = webkitOverridingResolverLookupByAddressAsync;
resolverClass->lookup_by_address_finish = webkitOverridingResolverLookupByAddressFinish;
diff --git a/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp b/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp
index a73466be12f1..9ab0cfb6f440 100644
--- a/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp
+++ b/Source/WebKit/Shared/glib/ArgumentCodersGLib.cpp
@@ -121,11 +121,13 @@ void ArgumentCoder<GRefPtr<GTlsCertificate>>::encode(Encoder& encoder, const GRe
encoder << certificatesData;
+#if GLIB_CHECK_VERSION(2, 69, 0)
GRefPtr<GByteArray> privateKey;
GUniqueOutPtr<char> privateKeyPKCS11Uri;
g_object_get(certificate.get(), "private-key", &privateKey.outPtr(), "private-key-pkcs11-uri", &privateKeyPKCS11Uri.outPtr(), nullptr);
encoder << privateKey;
encoder << CString(privateKeyPKCS11Uri.get());
+#endif
}
std::optional<GRefPtr<GTlsCertificate>> ArgumentCoder<GRefPtr<GTlsCertificate>>::decode(Decoder& decoder)
@@ -138,6 +140,7 @@ std::optional<GRefPtr<GTlsCertificate>> ArgumentCoder<GRefPtr<GTlsCertificate>>:
if (!certificatesData->size())
return GRefPtr<GTlsCertificate>();
+#if GLIB_CHECK_VERSION(2, 69, 0)
std::optional<GRefPtr<GByteArray>> privateKey;
decoder >> privateKey;
if (UNLIKELY(!privateKey))
@@ -147,6 +150,7 @@ std::optional<GRefPtr<GTlsCertificate>> ArgumentCoder<GRefPtr<GTlsCertificate>>:
decoder >> privateKeyPKCS11Uri;
if (UNLIKELY(!privateKeyPKCS11Uri))
return std::nullopt;
+#endif
GType certificateType = g_tls_backend_get_certificate_type(g_tls_backend_get_default());
GRefPtr<GTlsCertificate> certificate;
@@ -156,8 +160,10 @@ std::optional<GRefPtr<GTlsCertificate>> ArgumentCoder<GRefPtr<GTlsCertificate>>:
certificateType, nullptr, nullptr,
"certificate", certificateData.get(),
"issuer", issuer,
+#if GLIB_CHECK_VERSION(2, 69, 0)
"private-key", i == certificatesData->size() - 1 ? privateKey->get() : nullptr,
"private-key-pkcs11-uri", i == certificatesData->size() - 1 ? privateKeyPKCS11Uri->data() : nullptr,
+#endif
nullptr)));
issuer = certificate.get();
}
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
index 4a285e849cfd..0aca16c1d25f 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -205,6 +204,13 @@ else ()
SET_AND_EXPOSE_TO_BUILD(ENABLE_2022_GLIB_API OFF)
endif ()
+if (ENABLE_2022_GLIB_API)
+ set(GLIB_MINIMUM_VERSION 2.70.0)
+else ()
+ set(GLIB_MINIMUM_VERSION 2.56.4)
+endif ()
+find_package(GLIB ${GLIB_MINIMUM_VERSION} REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
+
EXPOSE_STRING_VARIABLE_TO_BUILD(WEBKITGTK_API_INFIX)
EXPOSE_STRING_VARIABLE_TO_BUILD(WEBKITGTK_API_VERSION)
@@ -277,6 +283,11 @@ if (ENABLED_COMPILER_SANITIZERS)
set(ENABLE_DOCUMENTATION OFF)
endif ()
+# GUri is available in GLib since version 2.66, but we only want to use it if version is >= 2.67.1.
+if (PC_GLIB_VERSION VERSION_GREATER "2.67.1" OR PC_GLIB_VERSION STREQUAL "2.67.1")
+ SET_AND_EXPOSE_TO_BUILD(HAVE_GURI 1)
+endif ()
+
if (ENABLE_GAMEPAD)
find_package(Manette 0.2.4)
if (NOT Manette_FOUND)
--
2.49.0
diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
index 6c39538ba6fc..0a30e0c4c7c1 100644
--- a/Source/cmake/OptionsGTK.cmake
+++ b/Source/cmake/OptionsGTK.cmake
@@ -7,7 +7,6 @@ SET_PROJECT_VERSION(2 48 1)
set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
-find_package(GLIB 2.70.0 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
find_package(Cairo 1.14.0 REQUIRED)
find_package(LibGcrypt 1.7.0 REQUIRED)
find_package(Libtasn1 REQUIRED)

19
SOURCES/glib-dep.patch Normal file
View File

@ -0,0 +1,19 @@
diff --git a/glib-dep.patch b/glib-dep.patch
new file mode 100644
index 0000000..dbc0ab6
--- /dev/null
+++ b/glib-dep.patch
@@ -0,0 +1,13 @@
+diff --git a/Source/WTF/wtf/glib/Sandbox.cpp b/Source/WTF/wtf/glib/Sandbox.cpp
+index 9b07bb8cb5a9b..a8169511fe851 100644
+--- a/Source/WTF/wtf/glib/Sandbox.cpp
++++ b/Source/WTF/wtf/glib/Sandbox.cpp
+@@ -58,7 +58,7 @@ bool isInsideUnsupportedContainer()
+ int waitStatus = 0;
+ gboolean spawnSucceeded = g_spawn_sync(nullptr, const_cast<char**>(bwrapArgs), nullptr,
+ G_SPAWN_STDERR_TO_DEV_NULL, nullptr, nullptr, nullptr, nullptr, &waitStatus, nullptr);
+- supportedContainer = spawnSucceeded && g_spawn_check_wait_status(waitStatus, nullptr);
++ supportedContainer = spawnSucceeded && g_spawn_check_exit_status(waitStatus, nullptr);
+ if (!supportedContainer)
+ WTFLogAlways("Bubblewrap does not work inside of this container, sandboxing will be disabled.");
+ }

View File

@ -0,0 +1,483 @@
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 77a0d6507240..353fb87900ba 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -479,7 +479,6 @@ bool MediaPlayerPrivateGStreamer::doSeek(const MediaTime& position, float rate)
auto seekStart = toGstClockTime(startTime);
auto seekStop = toGstClockTime(endTime);
- GST_DEBUG_OBJECT(pipeline(), "[Seek] Performing actual seek to %" GST_TIMEP_FORMAT " (endTime: %" GST_TIMEP_FORMAT ") at rate %f", &seekStart, &seekStop, rate);
return gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, m_seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop);
}
@@ -3296,9 +3295,6 @@ static uint32_t fourccValue(GstVideoFormat format)
case GST_VIDEO_FORMAT_P010_10LE:
case GST_VIDEO_FORMAT_P010_10BE:
return uint32_t(DMABufFormat::FourCC::P010);
- case GST_VIDEO_FORMAT_P016_LE:
- case GST_VIDEO_FORMAT_P016_BE:
- return uint32_t(DMABufFormat::FourCC::P016);
default:
break;
}
From bbc469a2b43531275243850693af65f5f7d11bc6 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Wed, 20 Sep 2023 13:07:44 -0500
Subject: [PATCH 1/2] Revert GStreamer 1.18 dependency
This reverts https://commits.webkit.org/263218@main
---
.../AudioSourceProviderGStreamer.cpp | 5 +-
.../gstreamer/GLVideoSinkGStreamer.cpp | 11 ++--
.../gstreamer/GStreamerAudioMixer.cpp | 2 +-
.../graphics/gstreamer/GStreamerCommon.cpp | 52 +++++++++++++++++++
.../graphics/gstreamer/GStreamerCommon.h | 16 ++++++
.../gstreamer/GStreamerRegistryScanner.cpp | 9 +++-
.../gstreamer/MediaPlayerPrivateGStreamer.cpp | 46 +++++++++++++---
.../gstreamer/MediaPlayerPrivateGStreamer.h | 1 +
Source/cmake/GStreamerChecks.cmake | 2 +-
9 files changed, 127 insertions(+), 17 deletions(-)
diff --git a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
index a97e6431802c..d8b1a1f4bd8b 100644
--- a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
+++ b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
@@ -122,7 +122,10 @@ AudioSourceProviderGStreamer::AudioSourceProviderGStreamer(MediaStreamTrackPriva
g_signal_connect_swapped(decodebin, "pad-added", G_CALLBACK(+[](AudioSourceProviderGStreamer* provider, GstPad* pad) {
auto padCaps = adoptGRef(gst_pad_query_caps(pad, nullptr));
bool isAudio = doCapsHaveType(padCaps.get(), "audio");
- RELEASE_ASSERT(isAudio);
+ if (webkitGstCheckVersion(1, 18, 0))
+ RELEASE_ASSERT(isAudio);
+ else if (!isAudio)
+ return;
auto sinkPad = adoptGRef(gst_element_get_static_pad(provider->m_audioSinkBin.get(), "sink"));
gst_pad_link(pad, sinkPad.get());
diff --git a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
index 1a7480828861..f3a51be68534 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
@@ -186,12 +186,13 @@ static void webKitGLVideoSinkGetProperty(GObject* object, guint propertyId, GVal
WebKitGLVideoSink* sink = WEBKIT_GL_VIDEO_SINK(object);
switch (propertyId) {
- case PROP_STATS: {
- GUniqueOutPtr<GstStructure> stats;
- g_object_get(sink->priv->appSink.get(), "stats", &stats.outPtr(), nullptr);
- gst_value_set_structure(value, stats.get());
+ case PROP_STATS:
+ if (webkitGstCheckVersion(1, 18, 0)) {
+ GUniqueOutPtr<GstStructure> stats;
+ g_object_get(sink->priv->appSink.get(), "stats", &stats.outPtr(), nullptr);
+ gst_value_set_structure(value, stats.get());
+ }
break;
- }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, paramSpec);
RELEASE_ASSERT_NOT_REACHED();
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
index ad4b1ae3f77e..fb7e617b5d56 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
@@ -32,7 +32,7 @@ GST_DEBUG_CATEGORY_STATIC(webkit_media_gst_audio_mixer_debug);
bool GStreamerAudioMixer::isAvailable()
{
- return isGStreamerPluginAvailable("inter") && isGStreamerPluginAvailable("audiomixer");
+ return webkitGstCheckVersion(1, 18, 0) && isGStreamerPluginAvailable("inter") && isGStreamerPluginAvailable("audiomixer");
}
GStreamerAudioMixer& GStreamerAudioMixer::singleton()
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
index 794beaa6932a..5f6b3826f182 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
@@ -105,6 +105,24 @@ GstPad* webkitGstGhostPadFromStaticTemplate(GstStaticPadTemplate* staticPadTempl
return pad;
}
+#if !GST_CHECK_VERSION(1, 18, 0)
+void webkitGstVideoFormatInfoComponent(const GstVideoFormatInfo* info, guint plane, gint components[GST_VIDEO_MAX_COMPONENTS])
+{
+ guint c, i = 0;
+
+ /* Reverse mapping of info->plane. */
+ for (c = 0; c < GST_VIDEO_FORMAT_INFO_N_COMPONENTS(info); c++) {
+ if (GST_VIDEO_FORMAT_INFO_PLANE(info, c) == plane) {
+ components[i] = c;
+ i++;
+ }
+ }
+
+ for (c = i; c < GST_VIDEO_MAX_COMPONENTS; c++)
+ components[c] = -1;
+}
+#endif
+
#if ENABLE(VIDEO)
bool getVideoSizeAndFormatFromCaps(const GstCaps* caps, WebCore::IntSize& size, GstVideoFormat& format, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride)
{
@@ -748,6 +766,36 @@ String gstStructureToJSONString(const GstStructure* structure)
return value->toJSONString();
}
+#if !GST_CHECK_VERSION(1, 18, 0)
+GstClockTime webkitGstElementGetCurrentRunningTime(GstElement* element)
+{
+ g_return_val_if_fail(GST_IS_ELEMENT(element), GST_CLOCK_TIME_NONE);
+
+ auto baseTime = gst_element_get_base_time(element);
+ if (!GST_CLOCK_TIME_IS_VALID(baseTime)) {
+ GST_DEBUG_OBJECT(element, "Could not determine base time");
+ return GST_CLOCK_TIME_NONE;
+ }
+
+ auto clock = adoptGRef(gst_element_get_clock(element));
+ if (!clock) {
+ GST_DEBUG_OBJECT(element, "Element has no clock");
+ return GST_CLOCK_TIME_NONE;
+ }
+
+ auto clockTime = gst_clock_get_time(clock.get());
+ if (!GST_CLOCK_TIME_IS_VALID(clockTime))
+ return GST_CLOCK_TIME_NONE;
+
+ if (clockTime < baseTime) {
+ GST_DEBUG_OBJECT(element, "Got negative current running time");
+ return GST_CLOCK_TIME_NONE;
+ }
+
+ return clockTime - baseTime;
+}
+#endif
+
GstClockTime webkitGstInitTime()
{
return s_webkitGstInitTime;
@@ -805,6 +853,7 @@ PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info)
case GST_VIDEO_TRANSFER_BT709:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt709;
break;
+#if GST_CHECK_VERSION(1, 18, 0)
case GST_VIDEO_TRANSFER_BT601:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Smpte170m;
break;
@@ -817,6 +866,7 @@ PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info)
case GST_VIDEO_TRANSFER_BT2020_10:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt2020_10bit;
break;
+#endif
case GST_VIDEO_TRANSFER_BT2020_12:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt2020_12bit;
break;
@@ -935,6 +985,7 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi
case PlatformVideoTransferCharacteristics::Bt709:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT709;
break;
+#if GST_CHECK_VERSION(1, 18, 0)
case PlatformVideoTransferCharacteristics::Smpte170m:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT601;
break;
@@ -947,6 +998,7 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi
case PlatformVideoTransferCharacteristics::Bt2020_10bit:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT2020_10;
break;
+#endif
case PlatformVideoTransferCharacteristics::Bt2020_12bit:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT2020_12;
break;
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
index fae7ef96d6c5..65ef4bfefdaa 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
@@ -56,6 +56,15 @@ inline bool webkitGstCheckVersion(guint major, guint minor, guint micro)
return true;
}
+// gst_video_format_info_component() is GStreamer 1.18 API, so for older versions we use a local
+// vendored copy of the function.
+#if !GST_CHECK_VERSION(1, 18, 0)
+#define GST_VIDEO_MAX_COMPONENTS 4
+void webkitGstVideoFormatInfoComponent(const GstVideoFormatInfo*, guint, gint components[GST_VIDEO_MAX_COMPONENTS]);
+
+#define gst_video_format_info_component webkitGstVideoFormatInfoComponent
+#endif
+
#define GST_VIDEO_CAPS_TYPE_PREFIX "video/"
#define GST_AUDIO_CAPS_TYPE_PREFIX "audio/"
#define GST_TEXT_CAPS_TYPE_PREFIX "text/"
@@ -323,6 +332,13 @@ GstElement* makeGStreamerBin(const char* description, bool ghostUnlinkedPads);
String gstStructureToJSONString(const GstStructure*);
+// gst_element_get_current_running_time() is GStreamer 1.18 API, so for older versions we use a local
+// vendored copy of the function.
+#if !GST_CHECK_VERSION(1, 18, 0)
+GstClockTime webkitGstElementGetCurrentRunningTime(GstElement*);
+#define gst_element_get_current_running_time webkitGstElementGetCurrentRunningTime
+#endif
+
GstClockTime webkitGstInitTime();
PlatformVideoColorSpace videoColorSpaceFromCaps(const GstCaps*);
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
index 7cd1926e6d15..032f086b43c0 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp
@@ -900,8 +900,13 @@ GStreamerRegistryScanner::CodecLookupResult GStreamerRegistryScanner::isAVC1Code
return checkH264Caps(makeString("video/x-h264, level=(string)", maxLevelString).utf8().data());
}
- GST_DEBUG("Checking video decoders for constrained caps");
- return checkH264Caps(makeString("video/x-h264, level=(string)", level, ", profile=(string)", profile).utf8().data());
+ if (webkitGstCheckVersion(1, 18, 0)) {
+ GST_DEBUG("Checking video decoders for constrained caps");
+ return checkH264Caps(makeString("video/x-h264, level=(string)", level, ", profile=(string)", profile).utf8().data());
+ }
+
+ GST_DEBUG("Falling back to unconstrained caps");
+ return checkH264Caps("video/x-h264");
}
const char* GStreamerRegistryScanner::configurationNameForLogging(Configuration configuration) const
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index aad2c0bc432b..77a0d6507240 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -4114,7 +4114,29 @@ GstElement* MediaPlayerPrivateGStreamer::createVideoSink()
g_signal_connect_swapped(m_videoSink.get(), "repaint-cancelled", G_CALLBACK(repaintCancelledCallback), this);
}
- return m_videoSink.get();
+ GstElement* videoSink = nullptr;
+ if (!webkitGstCheckVersion(1, 18, 0)) {
+ m_fpsSink = makeGStreamerElement("fpsdisplaysink", "sink");
+ if (m_fpsSink) {
+ g_object_set(m_fpsSink.get(), "silent", TRUE , nullptr);
+
+ // Turn off text overlay unless tracing is enabled.
+ if (gst_debug_category_get_threshold(webkit_media_player_debug) < GST_LEVEL_TRACE)
+ g_object_set(m_fpsSink.get(), "text-overlay", FALSE , nullptr);
+
+ if (gstObjectHasProperty(m_fpsSink.get(), "video-sink")) {
+ g_object_set(m_fpsSink.get(), "video-sink", m_videoSink.get(), nullptr);
+ videoSink = m_fpsSink.get();
+ } else
+ m_fpsSink = nullptr;
+ }
+ }
+
+ if (!m_fpsSink)
+ videoSink = m_videoSink.get();
+
+ ASSERT(videoSink);
+ return videoSink;
}
void MediaPlayerPrivateGStreamer::setStreamVolumeElement(GstStreamVolume* volume)
@@ -4147,16 +4169,26 @@ bool MediaPlayerPrivateGStreamer::updateVideoSinkStatistics()
if (!m_videoSink)
return false;
+ if (!webkitGstCheckVersion(1, 18, 0) && !m_fpsSink)
+ return false;
+
uint64_t totalVideoFrames = 0;
uint64_t droppedVideoFrames = 0;
- GUniqueOutPtr<GstStructure> stats;
- g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr);
+ if (webkitGstCheckVersion(1, 18, 0)) {
+ GUniqueOutPtr<GstStructure> stats;
+ g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr);
- if (!gst_structure_get_uint64(stats.get(), "rendered", &totalVideoFrames))
- return false;
+ if (!gst_structure_get_uint64(stats.get(), "rendered", &totalVideoFrames))
+ return false;
- if (!gst_structure_get_uint64(stats.get(), "dropped", &droppedVideoFrames))
- return false;
+ if (!gst_structure_get_uint64(stats.get(), "dropped", &droppedVideoFrames))
+ return false;
+ } else if (m_fpsSink) {
+ unsigned renderedFrames, droppedFrames;
+ g_object_get(m_fpsSink.get(), "frames-rendered", &renderedFrames, "frames-dropped", &droppedFrames, nullptr);
+ totalVideoFrames = renderedFrames;
+ droppedVideoFrames = droppedFrames;
+ }
// Caching is required so that metrics queries performed after EOS still return valid values.
if (totalVideoFrames)
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
index e0cdb0a2d01f..f33a674481e1 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -578,6 +578,7 @@ private:
uint64_t m_networkReadPosition { 0 };
mutable uint64_t m_readPositionAtLastDidLoadingProgress { 0 };
+ GRefPtr<GstElement> m_fpsSink { nullptr };
uint64_t m_totalVideoFrames { 0 };
uint64_t m_droppedVideoFrames { 0 };
uint64_t m_decodedVideoFrames { 0 };
diff --git a/Source/cmake/GStreamerChecks.cmake b/Source/cmake/GStreamerChecks.cmake
index 5380617afc9c..8774f1d2aca8 100644
--- a/Source/cmake/GStreamerChecks.cmake
+++ b/Source/cmake/GStreamerChecks.cmake
@@ -36,7 +36,7 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
list(APPEND GSTREAMER_COMPONENTS webrtc)
endif ()
- find_package(GStreamer 1.18.4 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
+ find_package(GStreamer 1.16.2 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
if (ENABLE_WEB_AUDIO)
if (NOT PC_GSTREAMER_AUDIO_FOUND OR NOT PC_GSTREAMER_FFT_FOUND)
--
2.41.0
From 9046961d80cc168aab253e3e0eda2268bd956293 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Wed, 20 Sep 2023 13:09:28 -0500
Subject: [PATCH 2/2] Revert GStreamer 1.16 dependency
This (mostly) reverts https://commits.webkit.org/256284@main
---
.../gstreamer/GLVideoSinkGStreamer.cpp | 20 ++++++++++++++++++-
.../gstreamer/eme/GStreamerEMEUtilities.h | 10 ++++++++++
...bKitCommonEncryptionDecryptorGStreamer.cpp | 7 +++++--
Source/cmake/GStreamerChecks.cmake | 2 +-
4 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
index f3a51be68534..bf8ebeda1725 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
@@ -88,7 +88,25 @@ static void webKitGLVideoSinkConstructed(GObject* object)
ASSERT(colorconvert);
gst_bin_add_many(GST_BIN_CAST(sink), upload, colorconvert, sink->priv->appSink.get(), nullptr);
- GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) " GST_GL_CAPS_FORMAT));
+ // Workaround until we can depend on GStreamer 1.16.2.
+ // https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/8d32de090554cf29fe359f83aa46000ba658a693
+ // Forcing a color conversion to RGBA here allows glupload to internally use
+ // an uploader that adds a VideoMeta, through the TextureUploadMeta caps
+ // feature, without needing the patch above. However this specific caps
+ // feature is going to be removed from GStreamer so it is considered a
+ // short-term workaround. This code path most likely will have a negative
+ // performance impact on embedded platforms as well. Downstream embedders
+ // are highly encouraged to cherry-pick the patch linked above in their BSP
+ // and set the WEBKIT_GST_NO_RGBA_CONVERSION environment variable until
+ // GStreamer 1.16.2 is released.
+ // See also https://bugs.webkit.org/show_bug.cgi?id=201422
+ GRefPtr<GstCaps> caps;
+ if (webkitGstCheckVersion(1, 16, 2) || getenv("WEBKIT_GST_NO_RGBA_CONVERSION"))
+ caps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) " GST_GL_CAPS_FORMAT));
+ else {
+ GST_INFO_OBJECT(sink, "Forcing RGBA as GStreamer is not new enough.");
+ caps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) RGBA"));
+ }
gst_caps_set_features(caps.get(), 0, gst_caps_features_new(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr));
g_object_set(sink->priv->appSink.get(), "caps", caps.get(), nullptr);
diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h b/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
index 6dbf6a67dfd1..184c5c3e5f77 100644
--- a/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
+++ b/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h
@@ -61,8 +61,10 @@ public:
const String& systemId() const { return m_systemId; }
String payloadContainerType() const
{
+#if GST_CHECK_VERSION(1, 16, 0)
if (m_systemId == GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s)
return "webm"_s;
+#endif
return "cenc"_s;
}
@@ -111,8 +113,10 @@ public:
static constexpr auto s_WidevineKeySystem = "com.widevine.alpha"_s;
static constexpr auto s_PlayReadyUUID = WEBCORE_GSTREAMER_EME_UTILITIES_PLAYREADY_UUID ""_s;
static constexpr std::array<ASCIILiteral, 2> s_PlayReadyKeySystems = { "com.microsoft.playready"_s, "com.youtube.playready"_s };
+#if GST_CHECK_VERSION(1, 16, 0)
static constexpr auto s_unspecifiedUUID = GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s;
static constexpr auto s_unspecifiedKeySystem = GST_PROTECTION_UNSPECIFIED_SYSTEM_ID ""_s;
+#endif
static bool isClearKeyKeySystem(const String& keySystem)
{
@@ -144,6 +148,7 @@ public:
return equalIgnoringASCIICase(uuid, s_PlayReadyUUID);
}
+#if GST_CHECK_VERSION(1, 16, 0)
static bool isUnspecifiedKeySystem(const String& keySystem)
{
return equalIgnoringASCIICase(keySystem, s_unspecifiedKeySystem);
@@ -153,6 +158,7 @@ public:
{
return equalIgnoringASCIICase(uuid, s_unspecifiedUUID);
}
+#endif
static const char* keySystemToUuid(const String& keySystem)
{
@@ -165,8 +171,10 @@ public:
if (isPlayReadyKeySystem(keySystem))
return s_PlayReadyUUID;
+#if GST_CHECK_VERSION(1, 16, 0)
if (isUnspecifiedKeySystem(keySystem))
return s_unspecifiedUUID;
+#endif
ASSERT_NOT_REACHED();
return { };
@@ -183,8 +191,10 @@ public:
if (isPlayReadyUUID(uuid))
return s_PlayReadyKeySystems[0];
+#if GST_CHECK_VERSION(1, 16, 0)
if (isUnspecifiedUUID(uuid))
return s_unspecifiedKeySystem;
+#endif
ASSERT_NOT_REACHED();
return ""_s;
diff --git a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
index 0cde37e1f83f..a7bbf7fc569c 100644
--- a/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp
@@ -171,8 +171,11 @@ static GstCaps* transformCaps(GstBaseTransform* base, GstPadDirection direction,
// GST_PROTECTION_UNSPECIFIED_SYSTEM_ID was added in the GStreamer
// developement git master which will ship as version 1.16.0.
- gst_structure_set_name(outgoingStructure.get(), !g_strcmp0(klass->protectionSystemId(self),
- GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" : "application/x-cenc");
+ gst_structure_set_name(outgoingStructure.get(),
+#if GST_CHECK_VERSION(1, 16, 0)
+ !g_strcmp0(klass->protectionSystemId(self), GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" :
+#endif
+ "application/x-cenc");
}
}
diff --git a/Source/cmake/GStreamerChecks.cmake b/Source/cmake/GStreamerChecks.cmake
index 8774f1d2aca8..d43093ec7824 100644
--- a/Source/cmake/GStreamerChecks.cmake
+++ b/Source/cmake/GStreamerChecks.cmake
@@ -36,7 +36,7 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO)
list(APPEND GSTREAMER_COMPONENTS webrtc)
endif ()
- find_package(GStreamer 1.16.2 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
+ find_package(GStreamer 1.14.0 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
if (ENABLE_WEB_AUDIO)
if (NOT PC_GSTREAMER_AUDIO_FOUND OR NOT PC_GSTREAMER_FFT_FOUND)
--
2.41.0

View File

@ -1,448 +0,0 @@
From 08a5ccf6fc4a998ca1fb5aa13c314640dd95b874 Mon Sep 17 00:00:00 2001
From: Michael Catanzaro <mcatanzaro@redhat.com>
Date: Fri, 4 Apr 2025 14:00:12 -0500
Subject: [PATCH] Build against GStreamer 1.16
---
.../AudioSourceProviderGStreamer.cpp | 3 +-
.../gstreamer/GLVideoSinkGStreamer.cpp | 35 ++++-----
.../gstreamer/GStreamerAudioMixer.cpp | 2 +-
.../graphics/gstreamer/GStreamerCommon.cpp | 77 +++++++++++++------
.../graphics/gstreamer/GStreamerCommon.h | 16 ++++
.../gstreamer/MediaPlayerPrivateGStreamer.cpp | 22 +-----
.../gstreamer/GStreamerCodecUtilities.cpp | 39 ++++++----
.../VideoEncoderPrivateGStreamer.cpp | 16 ----
Source/cmake/GStreamerChecks.cmake | 4 +-
9 files changed, 114 insertions(+), 100 deletions(-)
diff --git a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
index 0abdeb14826e..65763f3cfde3 100644
--- a/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
+++ b/Source/WebCore/platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp
@@ -124,7 +124,8 @@ AudioSourceProviderGStreamer::AudioSourceProviderGStreamer(MediaStreamTrackPriva
g_signal_connect_swapped(decodebin, "pad-added", G_CALLBACK(+[](AudioSourceProviderGStreamer* provider, GstPad* pad) {
auto padCaps = adoptGRef(gst_pad_query_caps(pad, nullptr));
bool isAudio = doCapsHaveType(padCaps.get(), "audio");
- RELEASE_ASSERT(isAudio);
+ if (!isAudio)
+ return;
auto sinkPad = adoptGRef(gst_element_get_static_pad(provider->m_audioSinkBin.get(), "sink"));
gst_pad_link(pad, sinkPad.get());
diff --git a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
index 12fed2ed3b21..fe0d6c660f80 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp
@@ -65,16 +65,7 @@ static bool s_isDMABufDisabled;
static void initializeDMABufAvailability()
{
- static std::once_flag onceFlag;
- std::call_once(onceFlag, [] {
- if (!webkitGstCheckVersion(1, 20, 0))
- return;
-
- auto value = unsafeSpan(g_getenv("WEBKIT_GST_DMABUF_SINK_DISABLED"));
- s_isDMABufDisabled = value.data() && (equalLettersIgnoringASCIICase(value, "true"_s) || equalLettersIgnoringASCIICase(value, "1"_s));
- if (!s_isDMABufDisabled && !DRMDeviceManager::singleton().mainGBMDeviceNode(DRMDeviceManager::NodeType::Render))
- s_isDMABufDisabled = true;
- });
+ s_isDMABufDisabled = true;
}
#endif
@@ -114,7 +105,19 @@ static void webKitGLVideoSinkConstructed(GObject* object)
if (!s_isDMABufDisabled)
gst_caps_append(caps.get(), buildDMABufCaps().leakRef());
#endif
- GRefPtr<GstCaps> glCaps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) " GST_GL_CAPS_FORMAT));
+ // Workaround until we can depend on GStreamer 1.16.2.
+ // https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/commit/8d32de090554cf29fe359f83aa46000ba658a693
+ // Forcing a color conversion to RGBA here allows glupload to internally use
+ // an uploader that adds a VideoMeta, through the TextureUploadMeta caps
+ // feature, without needing the patch above. However this specific caps
+ // feature is going to be removed from GStreamer so it is considered a
+ // short-term workaround. This code path most likely will have a negative
+ // performance impact on embedded platforms as well. Downstream embedders
+ // are highly encouraged to cherry-pick the patch linked above in their BSP
+ // and set the WEBKIT_GST_NO_RGBA_CONVERSION environment variable until
+ // GStreamer 1.16.2 is released.
+ // See also https://bugs.webkit.org/show_bug.cgi?id=201422
+ GRefPtr<GstCaps> glCaps = adoptGRef(gst_caps_from_string("video/x-raw, format = (string) RGBA"));
gst_caps_set_features(glCaps.get(), 0, gst_caps_features_new(GST_CAPS_FEATURE_MEMORY_GL_MEMORY, nullptr));
gst_caps_append(caps.get(), glCaps.leakRef());
@@ -172,17 +175,11 @@ static GstStateChangeReturn webKitGLVideoSinkChangeState(GstElement* element, Gs
return GST_ELEMENT_CLASS(webkit_gl_video_sink_parent_class)->change_state(element, transition);
}
-static void webKitGLVideoSinkGetProperty(GObject* object, guint propertyId, GValue* value, GParamSpec* paramSpec)
+static void webKitGLVideoSinkGetProperty(GObject* object, guint propertyId, GValue*, GParamSpec* paramSpec)
{
- WebKitGLVideoSink* sink = WEBKIT_GL_VIDEO_SINK(object);
-
switch (propertyId) {
- case WEBKIT_GL_VIDEO_SINK_PROP_STATS: {
- GUniqueOutPtr<GstStructure> stats;
- g_object_get(sink->priv->appSink.get(), "stats", &stats.outPtr(), nullptr);
- gst_value_set_structure(value, stats.get());
+ case WEBKIT_GL_VIDEO_SINK_PROP_STATS:
break;
- }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, paramSpec);
RELEASE_ASSERT_NOT_REACHED();
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
index 8b30e0f14b6a..2d587f68a3b2 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp
@@ -32,7 +32,7 @@ GST_DEBUG_CATEGORY_STATIC(webkit_media_gst_audio_mixer_debug);
bool GStreamerAudioMixer::isAvailable()
{
- return isGStreamerPluginAvailable("inter") && isGStreamerPluginAvailable("audiomixer");
+ return false;
}
GStreamerAudioMixer& GStreamerAudioMixer::singleton()
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
index 25c8abd3ec90..5ca712566cbd 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
@@ -132,6 +132,24 @@ GstPad* webkitGstGhostPadFromStaticTemplate(GstStaticPadTemplate* staticPadTempl
}
#if ENABLE(VIDEO)
+#if !GST_CHECK_VERSION(1, 18, 0)
+void webkitGstVideoFormatInfoComponent(const GstVideoFormatInfo* info, guint plane, gint components[GST_VIDEO_MAX_COMPONENTS])
+{
+ guint c, i = 0;
+
+ /* Reverse mapping of info->plane. */
+ for (c = 0; c < GST_VIDEO_FORMAT_INFO_N_COMPONENTS(info); c++) {
+ if (GST_VIDEO_FORMAT_INFO_PLANE(info, c) == plane) {
+ components[i] = c;
+ i++;
+ }
+ }
+
+ for (c = i; c < GST_VIDEO_MAX_COMPONENTS; c++)
+ components[c] = -1;
+}
+#endif
+
bool getVideoSizeAndFormatFromCaps(const GstCaps* caps, WebCore::IntSize& size, GstVideoFormat& format, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride)
{
if (!doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) {
@@ -633,31 +651,6 @@ void deinitializeGStreamer()
teardownVideoEncoderSingleton();
teardownGStreamerImageDecoders();
#endif
-
- bool isLeaksTracerActive = false;
- auto activeTracers = gst_tracing_get_active_tracers();
- while (activeTracers) {
- auto tracer = adoptGRef(GST_TRACER_CAST(activeTracers->data));
- if (!isLeaksTracerActive && !g_strcmp0(G_OBJECT_TYPE_NAME(G_OBJECT(tracer.get())), "GstLeaksTracer"))
- isLeaksTracerActive = true;
- activeTracers = g_list_delete_link(activeTracers, activeTracers);
- }
-
- if (!isLeaksTracerActive)
- return;
-
- // Make sure there is no active pipeline left. Those might trigger deadlocks during gst_deinit().
- {
- Locker locker { s_activePipelinesMapLock };
- for (auto& pipeline : activePipelinesMap().values()) {
- GST_DEBUG("Pipeline %" GST_PTR_FORMAT " was left running. Forcing clean-up.", pipeline.get());
- disconnectSimpleBusMessageCallback(pipeline.get());
- gst_element_set_state(pipeline.get(), GST_STATE_NULL);
- }
- activePipelinesMap().clear();
- }
-
- gst_deinit();
}
unsigned getGstPlayFlag(const char* nick)
@@ -1358,6 +1351,36 @@ String gstStructureToJSONString(const GstStructure* structure)
return value->toJSONString();
}
+#if !GST_CHECK_VERSION(1, 18, 0)
+GstClockTime webkitGstElementGetCurrentRunningTime(GstElement* element)
+{
+ g_return_val_if_fail(GST_IS_ELEMENT(element), GST_CLOCK_TIME_NONE);
+
+ auto baseTime = gst_element_get_base_time(element);
+ if (!GST_CLOCK_TIME_IS_VALID(baseTime)) {
+ GST_DEBUG_OBJECT(element, "Could not determine base time");
+ return GST_CLOCK_TIME_NONE;
+ }
+
+ auto clock = adoptGRef(gst_element_get_clock(element));
+ if (!clock) {
+ GST_DEBUG_OBJECT(element, "Element has no clock");
+ return GST_CLOCK_TIME_NONE;
+ }
+
+ auto clockTime = gst_clock_get_time(clock.get());
+ if (!GST_CLOCK_TIME_IS_VALID(clockTime))
+ return GST_CLOCK_TIME_NONE;
+
+ if (clockTime < baseTime) {
+ GST_DEBUG_OBJECT(element, "Got negative current running time");
+ return GST_CLOCK_TIME_NONE;
+ }
+
+ return clockTime - baseTime;
+}
+#endif
+
GstClockTime webkitGstInitTime()
{
return s_webkitGstInitTime;
@@ -1415,6 +1438,7 @@ PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info)
case GST_VIDEO_TRANSFER_BT709:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt709;
break;
+#if GST_CHECK_VERSION(1, 18, 0)
case GST_VIDEO_TRANSFER_BT601:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Smpte170m;
break;
@@ -1427,6 +1451,7 @@ PlatformVideoColorSpace videoColorSpaceFromInfo(const GstVideoInfo& info)
case GST_VIDEO_TRANSFER_BT2020_10:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt2020_10bit;
break;
+#endif
case GST_VIDEO_TRANSFER_BT2020_12:
colorSpace.transfer = PlatformVideoTransferCharacteristics::Bt2020_12bit;
break;
@@ -1545,6 +1570,7 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi
case PlatformVideoTransferCharacteristics::Bt709:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT709;
break;
+#if GST_CHECK_VERSION(1, 18, 0)
case PlatformVideoTransferCharacteristics::Smpte170m:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT601;
break;
@@ -1557,6 +1583,7 @@ void fillVideoInfoColorimetryFromColorSpace(GstVideoInfo* info, const PlatformVi
case PlatformVideoTransferCharacteristics::Bt2020_10bit:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT2020_10;
break;
+#endif
case PlatformVideoTransferCharacteristics::Bt2020_12bit:
GST_VIDEO_INFO_COLORIMETRY(info).transfer = GST_VIDEO_TRANSFER_BT2020_12;
break;
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
index f332ddd0e040..217132050db0 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h
@@ -64,6 +64,15 @@ inline bool webkitGstCheckVersion(guint major, guint minor, guint micro)
return true;
}
+#if !GST_CHECK_VERSION(1, 18, 0)
+// gst_video_format_info_component() is GStreamer 1.18 API, so for older versions we use a local
+// vendored copy of the function.
+#define GST_VIDEO_MAX_COMPONENTS 4
+void webkitGstVideoFormatInfoComponent(const GstVideoFormatInfo*, guint, gint components[GST_VIDEO_MAX_COMPONENTS]);
+#endif
+
+#define gst_video_format_info_component webkitGstVideoFormatInfoComponent
+
#define GST_VIDEO_CAPS_TYPE_PREFIX "video/"
#define GST_AUDIO_CAPS_TYPE_PREFIX "audio/"
#define GST_TEXT_CAPS_TYPE_PREFIX "text/"
@@ -301,6 +310,13 @@ Vector<T> gstStructureGetArray(const GstStructure*, ASCIILiteral key);
String gstStructureToJSONString(const GstStructure*);
+#if !GST_CHECK_VERSION(1, 18, 0)
+// gst_element_get_current_running_time() is GStreamer 1.18 API, so for older versions we use a local
+// vendored copy of the function.
+GstClockTime webkitGstElementGetCurrentRunningTime(GstElement*);
+#define gst_element_get_current_running_time webkitGstElementGetCurrentRunningTime
+#endif
+
GstClockTime webkitGstInitTime();
PlatformVideoColorSpace videoColorSpaceFromCaps(const GstCaps*);
diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 80fdb52a342c..30a535eb816b 100644
--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -587,7 +587,6 @@ bool MediaPlayerPrivateGStreamer::doSeek(const SeekTarget& target, float rate)
auto seekStart = toGstClockTime(startTime);
auto seekStop = toGstClockTime(endTime);
- GST_DEBUG_OBJECT(pipeline(), "[Seek] Performing actual seek to %" GST_TIMEP_FORMAT " (endTime: %" GST_TIMEP_FORMAT ") at rate %f", &seekStart, &seekStop, rate);
return gst_element_seek(m_pipeline.get(), rate, GST_FORMAT_TIME, m_seekFlags, GST_SEEK_TYPE_SET, seekStart, GST_SEEK_TYPE_SET, seekStop);
}
@@ -4153,26 +4152,7 @@ void MediaPlayerPrivateGStreamer::setStreamVolumeElement(GstStreamVolume* volume
bool MediaPlayerPrivateGStreamer::updateVideoSinkStatistics()
{
- if (!m_videoSink)
- return false;
-
- GUniqueOutPtr<GstStructure> stats;
- g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr);
- if (!stats)
- return false;
-
- auto totalVideoFrames = gstStructureGet<uint64_t>(stats.get(), "rendered"_s);
- auto droppedVideoFrames = gstStructureGet<uint64_t>(stats.get(), "dropped"_s);
-
- if (!totalVideoFrames || !droppedVideoFrames)
- return false;
-
- // Caching is required so that metrics queries performed after EOS still return valid values.
- if (*totalVideoFrames)
- m_totalVideoFrames = *totalVideoFrames;
- if (*droppedVideoFrames)
- m_droppedVideoFrames = *droppedVideoFrames;
- return true;
+ return false;
}
std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateGStreamer::videoPlaybackQualityMetrics()
diff --git a/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp b/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp
index 870570cf204a..cc41cdf8911c 100644
--- a/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp
+++ b/Source/WebCore/platform/gstreamer/GStreamerCodecUtilities.cpp
@@ -256,9 +256,10 @@ static std::pair<GRefPtr<GstCaps>, GRefPtr<GstCaps>> vpxCapsFromCodecString(cons
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT709;
else if (transfer == VPConfigurationTransferCharacteristics::BT_470_7_BG)
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_GAMMA28;
- else if (transfer == VPConfigurationTransferCharacteristics::BT_601_7)
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT601;
- else if (transfer == VPConfigurationTransferCharacteristics::SMPTE_ST_240)
+ else if (transfer == VPConfigurationTransferCharacteristics::BT_601_7) {
+ GST_WARNING("VPConfigurationTransferCharacteristics::BT_601_7 not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
+ } else if (transfer == VPConfigurationTransferCharacteristics::SMPTE_ST_240)
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_SMPTE240M;
else if (transfer == VPConfigurationTransferCharacteristics::Linear)
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_GAMMA10;
@@ -271,17 +272,21 @@ static std::pair<GRefPtr<GstCaps>, GRefPtr<GstCaps>> vpxCapsFromCodecString(cons
else if (transfer == VPConfigurationTransferCharacteristics::IEC_61966_2_1) {
GST_WARNING("VPConfigurationTransferCharacteristics::IEC_61966_2_1 not supported");
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
- } else if (transfer == VPConfigurationTransferCharacteristics::BT_2020_10bit)
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT2020_10;
- else if (transfer == VPConfigurationTransferCharacteristics::BT_2020_12bit)
+ } else if (transfer == VPConfigurationTransferCharacteristics::BT_2020_10bit) {
+ GST_WARNING("VPConfigurationTransferCharacteristics::BT_2020_10bit not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
+ } else if (transfer == VPConfigurationTransferCharacteristics::BT_2020_12bit)
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT2020_12;
- else if (transfer == VPConfigurationTransferCharacteristics::SMPTE_ST_2084)
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_SMPTE2084;
- else if (transfer == VPConfigurationTransferCharacteristics::SMPTE_ST_428_1) {
+ else if (transfer == VPConfigurationTransferCharacteristics::SMPTE_ST_2084) {
+ GST_WARNING("VPConfigurationTransferCharacteristics::SMPTE_ST_2084 not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
+ } else if (transfer == VPConfigurationTransferCharacteristics::SMPTE_ST_428_1) {
GST_WARNING("VPConfigurationTransferCharacteristics::SMPTE_ST_428_1 not supported");
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
- } else if (transfer == VPConfigurationTransferCharacteristics::BT_2100_HLG)
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_ARIB_STD_B67;
+ } else if (transfer == VPConfigurationTransferCharacteristics::BT_2100_HLG) {
+ GST_WARNING("VPConfigurationTransferCharacteristics::BT_2100_HLG not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
+ }
auto matrix = parameters->matrixCoefficients;
if (matrix == VPConfigurationMatrixCoefficients::Identity)
@@ -422,7 +427,8 @@ static std::pair<GRefPtr<GstCaps>, GRefPtr<GstCaps>> av1CapsFromCodecString(cons
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_GAMMA28;
break;
case AV1ConfigurationTransferCharacteristics::BT_601_7:
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT601;
+ GST_WARNING("AV1ConfigurationTransferCharacteristics::BT_601_7 not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
break;
case AV1ConfigurationTransferCharacteristics::SMPTE_ST_240:
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_SMPTE240M;
@@ -446,20 +452,23 @@ static std::pair<GRefPtr<GstCaps>, GRefPtr<GstCaps>> av1CapsFromCodecString(cons
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
break;
case AV1ConfigurationTransferCharacteristics::BT_2020_10bit:
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT2020_10;
+ GST_WARNING("AV1ConfigurationTransferCharacteristics::BT_2020_10bit not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
break;
case AV1ConfigurationTransferCharacteristics::BT_2020_12bit:
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_BT2020_12;
break;
case AV1ConfigurationTransferCharacteristics::SMPTE_ST_2084:
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_SMPTE2084;
+ GST_WARNING("AV1ConfigurationTransferCharacteristics::SMPTE_ST_2084 not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
break;
case AV1ConfigurationTransferCharacteristics::SMPTE_ST_428_1:
GST_WARNING("AV1ConfigurationTransferCharacteristics::SMPTE_ST_428_1 not supported");
GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
break;
case AV1ConfigurationTransferCharacteristics::BT_2100_HLG:
- GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_ARIB_STD_B67;
+ GST_WARNING("AV1ConfigurationTransferCharacteristics::BT_2100_HLG not supported");
+ GST_VIDEO_INFO_COLORIMETRY(&info).transfer = GST_VIDEO_TRANSFER_UNKNOWN;
break;
};
diff --git a/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp b/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp
index d21b24cfe1ed..aa7492b14dd7 100644
--- a/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp
+++ b/Source/WebCore/platform/gstreamer/VideoEncoderPrivateGStreamer.cpp
@@ -898,22 +898,6 @@ static void webkit_video_encoder_class_init(WebKitVideoEncoderClass* klass)
"temporal-scalability-rate-decimator", decimators.get(),
"temporal-scalability-target-bitrate", bitrates.get(), nullptr);
- if (layerFlags) {
- GValue layerSyncFlagsValue G_VALUE_INIT;
-
- g_value_init(&boolValue, G_TYPE_BOOLEAN);
- gst_value_array_init(&layerSyncFlagsValue, layerSyncFlags.size());
- for (auto& flag : layerSyncFlags) {
- g_value_set_boolean(&boolValue, flag);
- gst_value_array_append_value(&layerSyncFlagsValue, &boolValue);
- }
-
- g_object_set_property(G_OBJECT(encoder), "temporal-scalability-layer-sync-flags", &layerSyncFlagsValue);
- g_value_unset(&layerSyncFlagsValue);
- g_value_unset(&boolValue);
- gst_util_set_object_arg(G_OBJECT(encoder), "temporal-scalability-layer-flags", layerFlags.characters());
- }
-
ALLOW_DEPRECATED_DECLARATIONS_END;
});
diff --git a/Source/cmake/GStreamerChecks.cmake b/Source/cmake/GStreamerChecks.cmake
index 27816a97ff26..94863212aee9 100644
--- a/Source/cmake/GStreamerChecks.cmake
+++ b/Source/cmake/GStreamerChecks.cmake
@@ -1,7 +1,7 @@
if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO OR ENABLE_WEB_CODECS)
SET_AND_EXPOSE_TO_BUILD(USE_GSTREAMER TRUE)
if (USE_GSTREAMER_FULL)
- find_package(GStreamer 1.18.4 REQUIRED COMPONENTS full)
+ find_package(GStreamer 1.16.1 REQUIRED COMPONENTS full)
if (NOT PC_GSTREAMER_FULL_FOUND)
message(FATAL_ERROR "GStreamer static library libgstreamer-full-1.0 not found")
else ()
@@ -25,7 +25,7 @@ if (ENABLE_VIDEO OR ENABLE_WEB_AUDIO OR ENABLE_WEB_CODECS)
list(APPEND GSTREAMER_COMPONENTS webrtc)
endif ()
- find_package(GStreamer 1.18.4 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
+ find_package(GStreamer 1.16.1 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
if (ENABLE_WEB_AUDIO)
if (NOT PC_GSTREAMER_AUDIO_FOUND OR NOT PC_GSTREAMER_FFT_FOUND)
--
2.49.0

View File

@ -1,48 +0,0 @@
diff --git a/Source/WebCore/platform/graphics/skia/SkiaHarfBuzzFont.cpp b/Source/WebCore/platform/graphics/skia/SkiaHarfBuzzFont.cpp
index 8bc21b21976c..68654f602c92 100644
--- a/Source/WebCore/platform/graphics/skia/SkiaHarfBuzzFont.cpp
+++ b/Source/WebCore/platform/graphics/skia/SkiaHarfBuzzFont.cpp
@@ -101,9 +101,10 @@ static HbUniquePtr<hb_face_t> createHarfBuzzFace(SkTypeface& typeface)
HbUniquePtr<hb_blob_t> blob(hb_blob_create(reinterpret_cast<const char*>(memory), size, HB_MEMORY_MODE_READONLY, stream.release(), [](void* data) {
delete reinterpret_cast<SkStreamAsset*>(data);
}));
- auto faceCount = hb_face_count(blob.get());
- if (faceCount && static_cast<unsigned>(index) < faceCount)
- return HbUniquePtr<hb_face_t>(hb_face_create(blob.get(), index));
+ HbUniquePtr<hb_face_t> result(hb_face_create(blob.get(), index));
+ HbUniquePtr<hb_face_t> empty(hb_face_get_empty());
+ if (result.get() != empty.get())
+ return result;
}
}
@@ -126,6 +127,7 @@ SkiaHarfBuzzFont::SkiaHarfBuzzFont(SkTypeface& typeface)
{
auto hbFace = createHarfBuzzFace(typeface);
HbUniquePtr<hb_font_t> hbFont(hb_font_create(hbFace.get()));
+ hb_ot_font_set_funcs(hbFont.get());
if (int axisCount = typeface.getVariationDesignPosition(nullptr, 0)) {
Vector<SkFontArguments::VariationPosition::Coordinate> axisValues(axisCount);
diff --git a/Source/ThirdParty/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp b/Source/ThirdParty/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp
index 065385774422..498994ff7aa7 100644
--- a/Source/ThirdParty/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp
+++ b/Source/ThirdParty/skia/modules/skshaper/src/SkShaper_harfbuzz.cpp
@@ -277,13 +277,10 @@ HBFace create_hb_face(const SkTypeface& typeface) {
// hb_face_create always succeeds. Check that the format is minimally recognized first.
// hb_face_create_for_tables may still create a working hb_face.
// See https://github.com/harfbuzz/harfbuzz/issues/248 .
- unsigned int num_hb_faces = hb_face_count(blob.get());
- if (0 < num_hb_faces && (unsigned)index < num_hb_faces) {
- face.reset(hb_face_create(blob.get(), (unsigned)index));
- // Check the number of glyphs as a basic sanitization step.
- if (face && hb_face_get_glyph_count(face.get()) == 0) {
- face.reset();
- }
+ face.reset(hb_face_create(blob.get(), (unsigned)index));
+ // Check the number of glyphs as a basic sanitization step.
+ if (face && hb_face_get_glyph_count(face.get()) == 0) {
+ face.reset();
}
}
if (!face) {

16
SOURCES/i686-build.patch Normal file
View File

@ -0,0 +1,16 @@
From: Alberto Garcia <berto@igalia.com>
Subject: Fix FTBFS in i386
Bug: https://bugs.webkit.org/show_bug.cgi?id=268739
Index: webkitgtk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
===================================================================
--- webkitgtk.orig/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
+++ webkitgtk/Source/JavaScriptCore/llint/LowLevelInterpreter.cpp
@@ -336,8 +336,6 @@ JSValue CLoop::execute(OpcodeID entryOpc
UNUSED_VARIABLE(t2);
UNUSED_VARIABLE(t3);
UNUSED_VARIABLE(t5);
- UNUSED_VARIABLE(t6);
- UNUSED_VARIABLE(t7);
struct StackPointerScope {
StackPointerScope(CLoopStack& stack)

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +0,0 @@
diff --git a/Source/ThirdParty/ANGLE/src/common/mathutil.h b/Source/ThirdParty/ANGLE/src/common/mathutil.h
index 8f4579dc5611..4d981d4427bc 100644
--- a/Source/ThirdParty/ANGLE/src/common/mathutil.h
+++ b/Source/ThirdParty/ANGLE/src/common/mathutil.h
@@ -550,7 +550,7 @@ inline R roundToNearest(T input)
{
static_assert(std::is_floating_point<T>::value);
static_assert(std::numeric_limits<R>::is_integer);
-#if defined(__aarch64__) || defined(_M_ARM64)
+#if defined(__aarch64__) || defined(_M_ARM64) || defined(__s390x__)
// On armv8, this expression is compiled to a dedicated round-to-nearest instruction
return static_cast<R>(std::round(input));
#else

View File

@ -0,0 +1,6 @@
-----BEGIN PGP SIGNATURE-----
iF0EABEDAB0WIQTX/PYc+aLeqzHYG9Pz0yLQ7EWCwwUCZMjRYQAKCRDz0yLQ7EWC
wwPPAJ0XUmEmSr4IFQWpbDfPOR9keXY+lwCfVLyOFL8T55psriGN4vkxVZqq+EM=
=nGCs
-----END PGP SIGNATURE-----

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEAToBJ6ycZbNP+mJSbBAJtpOXU5MFAmftAf8ACgkQbBAJtpOX
U5PdBg//TpfUIuSwl5OgwqsB8WNvrtCdGGwrYa3k9E9pp57KHLvlqNeDmToy/U9t
gAOIUIyIxgVBRgJQrcQW/NfPx49jd3ISt9h54A0c/MgIb4+4vsvoRz3pwX407+QR
7rZA72GA1im3u5+IWTGeeWzTGNQtvGbd1DzA6OpdvC0MRS2JAfYvgDHyAzaQu0Of
JZdMrZlwoaMeZDTKI+qV/ZY2mZ59xiD0ltRU6X1B7/YS2MEsqztO7FFWO/xuhdps
qIZF/jwuVfcGrI5JPVZzsf0V2RHmgF4j9rNEZwSxP8BkWfYQ+BjZI6gzKjVgDYED
6D70tf0+q9UqSSYaX0Wk2+IqaNiO09md4nYZJ1I6VLz8sm6AZTB2XXiWxB3hEuFO
j7Dk11I4DKPJjBHIQN/3kqutvRG5plyi4HIL2BzvnVstxrlTAocIFvhey1GOiLSu
UfX97ruyNECpwMIafxCsqOVAjg4wkf6df0yCJVokNRBunnsQPABjDXfhS7dDvE3B
6u2BIVudba2xEeMqqHZBrFAy4UXLcfJYnvvsBbPGFHibooCIuwd5VrTIVUE7bsI1
QqEAlryx1grnyDN77aHri2bBK44aHMIix19kRgwdK8wcT3iz1vdUcgigcDYbD2Sc
0LGzxB5OY+jd7zvSczqNCX6Ll7W7dIgjR60nuVl4+yYNnzSM+EM=
=6kwl
-----END PGP SIGNATURE-----

View File

@ -3,75 +3,60 @@
## directory names (from the source tree) as prefixes for the files. ## directory names (from the source tree) as prefixes for the files.
%global add_to_license_files() \ %global add_to_license_files() \
mkdir -p _license_files ; \ mkdir -p _license_files ; \
cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g')- cp -p %1 _license_files/$(echo '%1' | sed -e 's!/!.!g')
# There is a special buildroot required to build this package:
# $ rhpkg build --target rhel-8.10.0-z-webkitgtk-stack-gate
Name: webkit2gtk3 Name: webkit2gtk3
Version: 2.48.1 Version: 2.42.5
Release: 1%{?dist} Release: 1%{?dist}
Summary: GTK Web content engine library Summary: GTK Web content engine library
License: LGPLv2 License: LGPLv2
URL: https://www.webkitgtk.org/ URL: http://www.webkitgtk.org/
Source0: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz Source0: http://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz
Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc
# Use the keys from https://webkitgtk.org/verifying.html # Use the keys from https://webkitgtk.org/verifying.html
# $ gpg --import aperez.key carlosgc.key # $ gpg --import aperez.key carlosgc.key
# $ gpg --export --export-options export-minimal 013A0127AC9C65B34FFA62526C1009B693975393 5AA3BC334FD7E3369E7C77B291C559DBE4C9123B > webkitgtk-keys.gpg # $ gpg --export --export-options export-minimal D7FCF61CF9A2DEAB31D81BD3F3D322D0EC4582C3 5AA3BC334FD7E3369E7C77B291C559DBE4C9123B > webkitgtk-keys.gpg
Source2: webkitgtk-keys.gpg Source2: webkitgtk-keys.gpg
## # https://bugs.webkit.org/show_bug.cgi?id=193749
## Patches to support older build toolchain Patch0: evolution-shared-secondary-process.patch
##
Patch100: compiler-flags.patch # https://bugs.webkit.org/show_bug.cgi?id=235367
Patch101: s390x-build.patch Patch1: icu60.patch
## # Partial revert of https://commits.webkit.org/256284@main
## Patches to support older or missing build dependencies Patch2: gstreamer-1.16.1.patch
##
Patch200: cairo-1.15.patch # Partial revert of https://commits.webkit.org/260744@main
Patch201: glib-2.56.patch Patch3: cairo-1.15.patch
Patch202: gstreamer-1.16.patch
Patch203: harfbuzz-1.7.5.patch
Patch204: icu60.patch
## # Avoid dependency on GEnumClass_autoptr
## Patches to support older Evolution Patch4: glib-2.56.patch
##
Patch300: evolution-shared-secondary-process.patch # https://bugs.webkit.org/show_bug.cgi?id=268739
Patch301: evolution-sandbox-warning.patch Patch5: i686-build.patch
##
## Upstream patches to remove, hopefully after next update
##
Patch: denormal-disabler-build.patch
BuildRequires: bison BuildRequires: bison
BuildRequires: clang
BuildRequires: cmake BuildRequires: cmake
BuildRequires: flex BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: gcc-toolset-13
BuildRequires: gettext BuildRequires: gettext
BuildRequires: git BuildRequires: git
BuildRequires: gnupg2
BuildRequires: gperf BuildRequires: gperf
BuildRequires: hyphen-devel BuildRequires: hyphen-devel
BuildRequires: libatomic BuildRequires: libatomic
BuildRequires: ninja-build BuildRequires: ninja-build
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: perl(bigint)
BuildRequires: perl(English) BuildRequires: perl(English)
BuildRequires: perl(FindBin) BuildRequires: perl(FindBin)
BuildRequires: perl(JSON::PP) BuildRequires: perl(JSON::PP)
BuildRequires: python3 BuildRequires: python3
BuildRequires: ruby BuildRequires: ruby
BuildRequires: rubygems
BuildRequires: rubygem-json BuildRequires: rubygem-json
BuildRequires: rubygems
BuildRequires: shadow-utils
BuildRequires: unifdef BuildRequires: unifdef
BuildRequires: pkgconfig(atspi-2) BuildRequires: pkgconfig(atspi-2)
@ -99,6 +84,7 @@ BuildRequires: pkgconfig(lcms2)
BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(libjpeg) BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libnotify) BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(libopenjp2)
BuildRequires: pkgconfig(libpcre) BuildRequires: pkgconfig(libpcre)
BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libseccomp) BuildRequires: pkgconfig(libseccomp)
@ -115,6 +101,8 @@ BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-egl) BuildRequires: pkgconfig(wayland-egl)
BuildRequires: pkgconfig(wayland-protocols) BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(wayland-server) BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(wpe-1.0)
BuildRequires: pkgconfig(wpebackend-fdo-1.0)
BuildRequires: pkgconfig(xt) BuildRequires: pkgconfig(xt)
# libepoxy will crash when WebKit tries using GLES2 if it's not installed. # libepoxy will crash when WebKit tries using GLES2 if it's not installed.
@ -148,8 +136,6 @@ Provides: webkit2gtk3-doc = %{version}-%{release}
# We're supposed to specify versions here, but these libraries don't do # We're supposed to specify versions here, but these libraries don't do
# normal releases. Accordingly, they're not suitable to be system libs. # normal releases. Accordingly, they're not suitable to be system libs.
Provides: bundled(angle) Provides: bundled(angle)
Provides: bundled(pdfjs)
Provides: bundled(skia)
Provides: bundled(xdgmime) Provides: bundled(xdgmime)
# Require the jsc subpackage # Require the jsc subpackage
@ -180,8 +166,6 @@ files for developing applications that use %{name}.
Summary: JavaScript engine from %{name} Summary: JavaScript engine from %{name}
Obsoletes: webkitgtk4-jsc < %{version}-%{release} Obsoletes: webkitgtk4-jsc < %{version}-%{release}
Provides: webkitgtk4-jsc = %{version}-%{release} Provides: webkitgtk4-jsc = %{version}-%{release}
Provides: bundled(simde)
Provides: bundled(simdutf)
%description jsc %description jsc
This package contains JavaScript engine from %{name}. This package contains JavaScript engine from %{name}.
@ -198,7 +182,7 @@ files for developing applications that use JavaScript engine from %{name}.
%prep %prep
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%autosetup -p1 -n webkitgtk-%{version} %autosetup -p1 -n webkitgtk-%{version} -S git
# Remove bundled libraries # Remove bundled libraries
rm -rf Source/ThirdParty/gtest/ rm -rf Source/ThirdParty/gtest/
@ -221,41 +205,42 @@ rm -rf Source/ThirdParty/qunit/
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif %endif
# The system GCC is too old to build WebKit, so use a GCC Toolset instead.
# This prints warnings complaining that it should not be used except in
# SCL scriplets, but I can't figure out any other way to make it work.
source scl_source enable gcc-toolset-13
# -DUSE_SYSTEM_MALLOC=ON is really bad for security, but libpas requires # -DUSE_SYSTEM_MALLOC=ON is really bad for security, but libpas requires
# __atomic_compare_exchange_16 which is not available in RHEL 8. # __atomic_compare_exchange_16 which does not seem to be available.
mkdir -p %{_target_platform}
pushd %{_target_platform}
%cmake \ %cmake \
-GNinja \ -GNinja \
-DPORT=GTK \ -DPORT=GTK \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DENABLE_BUBBLEWRAP_SANDBOX=OFF \
-DENABLE_DOCUMENTATION=OFF \
-DENABLE_GAMEPAD=OFF \
-DENABLE_JIT=OFF \
-DENABLE_SPEECH_SYNTHESIS=OFF \
-DENABLE_WEB_CODECS=OFF \
-DUSE_AVIF=OFF \
-DUSE_GSTREAMER_TRANSCODER=OFF \
-DUSE_GTK4=OFF \
-DUSE_JPEGXL=OFF \
-DUSE_LIBBACKTRACE=OFF \
-DUSE_SOUP2=ON \
-DUSE_SYSTEM_MALLOC=ON \ -DUSE_SYSTEM_MALLOC=ON \
-DUSE_SYSTEM_SYSPROF_CAPTURE=OFF \ -DENABLE_JIT=OFF \
-DENABLE_BUBBLEWRAP_SANDBOX=OFF \
-DUSE_SOUP2=ON \
-DUSE_AVIF=OFF \
-DENABLE_DOCUMENTATION=OFF \
-DUSE_GSTREAMER_TRANSCODER=OFF \
-DUSE_JPEGXL=OFF \
-DENABLE_GAMEPAD=OFF \
%if 0%{?rhel} %if 0%{?rhel}
%ifarch aarch64 %ifarch aarch64
-DUSE_64KB_PAGE_BLOCK=ON \ -DUSE_64KB_PAGE_BLOCK=ON \
%endif %endif
%endif %endif
%{nil} ..
popd
# Show the build time in the status # Show the build time in the status
export NINJA_STATUS="[%f/%t][%e] " export NINJA_STATUS="[%f/%t][%e] "
%cmake_build %ninja_build -C %{_target_platform}
%install %install
%cmake_install %ninja_install -C %{_target_platform}
%find_lang WebKitGTK-4.0 %find_lang WebKitGTK-4.0
@ -317,24 +302,6 @@ export NINJA_STATUS="[%f/%t][%e] "
%{_datadir}/gir-1.0/JavaScriptCore-4.0.gir %{_datadir}/gir-1.0/JavaScriptCore-4.0.gir
%changelog %changelog
* Fri Apr 11 2025 Michael Catanzaro <mcatanzaro@redhat.com> - 2.48.1-1
- Update to 2.48.1
* Thu Mar 13 2025 Michael Catanzaro <mcatanzaro@redhat.com> - 2.46.6-2
- Add patch for CVE-2025-24201
* Tue Feb 25 2025 Michael Catanzaro <mcatanzaro@redhat.com> - 2.46.6-1
- Update to 2.46.6
* Wed Dec 18 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.46.5-1
- Update to 2.46.5
* Mon Nov 25 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.46.3-2
- Add patch for CVE-2024-44309
* Fri Nov 08 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.46.3-1
- Update to 2.46.3
* Mon Feb 05 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.42.5-1 * Mon Feb 05 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.42.5-1
- Update to 2.42.5 - Update to 2.42.5
Resolves: RHEL-3961 Resolves: RHEL-3961