Skip to content

Commit

Permalink
Merge branch 'Igalia:main' into fix/commercial-license
Browse files Browse the repository at this point in the history
  • Loading branch information
kwavnet authored Dec 9, 2024
2 parents 3bfa477 + 3c7ce76 commit 19673ca
Show file tree
Hide file tree
Showing 6 changed files with 1,311 additions and 11 deletions.
3 changes: 0 additions & 3 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ LAYERDEPENDS_webkit = "\
openembedded-layer \
"

# do not error out on bbappends for missing recipes
BB_DANGLINGAPPENDS_WARNONLY = "true"

# Support from the current actively maintained LTS Yocto release
LAYERSERIES_COMPAT_webkit = "kirkstone langdale mickledore nanbield scarthgap styhead walnascar"
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
From bfb9d664b19813a407d5a0eaf477c28cdf96d850 Mon Sep 17 00:00:00 2001
From: Philippe Normand <[email protected]>
Date: Wed, 27 Nov 2024 07:20:41 -0800
Subject: [PATCH] Build fixes for gbm disabled and release logs disabled
https://bugs.webkit.org/show_bug.cgi?id=283750

Reviewed by Michael Catanzaro.

* Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::PeerConnectionBackend):
* Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::startRTCLogs):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h:
* Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp:
(WKWPE::ViewPlatform::ViewPlatform):

Canonical link: https://commits.webkit.org/287124@main

Upstream-Status: Backport [https://commits.webkit.org/287124@main]
---
.../WebCore/Modules/mediastream/PeerConnectionBackend.cpp | 4 ++++
.../WebCore/Modules/mediastream/PeerConnectionBackend.h | 2 +-
.../mediastream/gstreamer/GStreamerMediaEndpoint.cpp | 2 ++
.../platform/graphics/gstreamer/GStreamerCommon.cpp | 8 ++++----
.../graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h | 3 ++-
5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
index d6bb7ef7..d9c85af5 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
@@ -165,6 +165,10 @@ PeerConnectionBackend::PeerConnectionBackend(RTCPeerConnection& peerConnection)
m_shouldFilterICECandidates = page->webRTCProvider().isSupportingMDNS();
#endif

+#if RELEASE_LOG_DISABLED
+ m_logIdentifierString = makeString(hex(reinterpret_cast<uintptr_t>(this)));
+#endif
+
#if !RELEASE_LOG_DISABLED && (PLATFORM(WPE) || PLATFORM(GTK))
m_jsonFilePath = String::fromUTF8(getenv("WEBKIT_WEBRTC_JSON_EVENTS_FILE"));
if (!m_jsonFilePath.isEmpty())
diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
index e0615025..cd7912df 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
@@ -281,8 +281,8 @@ private:
#if !RELEASE_LOG_DISABLED
Ref<const Logger> m_logger;
const void* m_logIdentifier;
- String m_logIdentifierString;
#endif
+ String m_logIdentifierString;
bool m_finishedGatheringCandidates { false };
bool m_isProcessingLocalDescriptionAnswer { false };

diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
index deb6281f..e678b04e 100644
--- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
+++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
@@ -2228,7 +2228,9 @@ std::optional<bool> GStreamerMediaEndpoint::canTrickleIceCandidates() const
void GStreamerMediaEndpoint::startRTCLogs()
{
m_isGatheringRTCLogs = true;
+#if !RELEASE_LOG_DISABLED
startLoggingStats();
+#endif
}

void GStreamerMediaEndpoint::stopRTCLogs()
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
index 812a1f6a..1d83f3b2 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
@@ -1726,7 +1726,7 @@ void gstStructureFilterAndMapInPlace(GstStructure* structure, Function<bool(GstI
#endif
}

-#if !GST_CHECK_VERSION(1, 24, 0)
+#if USE(GBM) && !GST_CHECK_VERSION(1, 24, 0)
static GstVideoFormat drmFourccToGstVideoFormat(uint32_t fourcc)
{
switch (fourcc) {
@@ -1761,7 +1761,7 @@ static GstVideoFormat drmFourccToGstVideoFormat(uint32_t fourcc)
RELEASE_ASSERT_NOT_REACHED();
return GST_VIDEO_FORMAT_UNKNOWN;
}
-#endif // !GST_CHECK_VERSION(1, 24, 0)
+#endif // USE(GBM) && !GST_CHECK_VERSION(1, 24, 0)

#if USE(GBM)
GRefPtr<GstCaps> buildDMABufCaps()
@@ -1805,7 +1805,7 @@ GRefPtr<GstCaps> buildDMABufCaps()
gst_value_list_append_and_take_value(&supportedFormats, &value);
}
}
-#else
+#elif USE(GBM)
GValue value = G_VALUE_INIT;
g_value_init(&value, G_TYPE_STRING);
g_value_set_string(&value, gst_video_format_to_string(drmFourccToGstVideoFormat(format.fourcc)));
@@ -1815,7 +1815,7 @@ GRefPtr<GstCaps> buildDMABufCaps()

#if GST_CHECK_VERSION(1, 24, 0)
gst_caps_set_value(caps.get(), "drm-format", &supportedFormats);
-#else
+#elif USE(GBM)
gst_caps_set_value(caps.get(), "format", &supportedFormats);
#endif
g_value_unset(&supportedFormats);
diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
index 701a300d..5264b32a 100644
--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
@@ -93,13 +93,14 @@ private:
#if !RELEASE_LOG_DISABLED
Ref<const Logger> m_logger;
const void* m_logIdentifier;
+#endif
+
uint64_t m_nextSourceBufferID { 0 };

// Stores known track IDs, so we can work around ID collisions between multiple source buffers.
// The registry is placed here to enforce ID uniqueness specifically by player, not by process,
// since its not an issue if multiple players use the same ID, and we want to preserve IDs as much as possible.
HashSet<TrackID, WTF::IntHash<TrackID>, WTF::UnsignedWithZeroKeyHashTraits<TrackID>> m_trackIdRegistry;
-#endif
};

} // namespace WebCore
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ DEPENDS = "curl libxml2 libxslt libidn \

FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"

SRC_URI = " \
https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz;name=tarball \
file://fix-bmalloc-armhf.patch \
"
SRC_URI = "https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz;name=tarball \
file://fix-bmalloc-armhf.patch \
file://0001-Build-fixes-for-gbm-disabled-and-release-logs-disabl.patch \
"

SRC_URI[tarball.sha256sum] = "5aae1c5c0a30d5e9c5831652b6f1bdefc31d75e0ad81cb40185b0aed92ce79b6"
SRC_URI[tarball.sha256sum] = "0eff5f0ab0a2872ec87df62bc32e3289c8af625716ac71e94b298d74e0374176"

RRECOMMENDS:${PN} = "${PN}-bin \
ca-certificates \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
From 6802852a0e5caaa1f8bac5813e18309e169d7751 Mon Sep 17 00:00:00 2001
From: Philippe Normand <[email protected]>
Date: Wed, 27 Nov 2024 07:20:41 -0800
Subject: [PATCH] [WPE][GTK] Build fixes for gbm disabled and release logs
disabled https://bugs.webkit.org/show_bug.cgi?id=283750

Reviewed by Michael Catanzaro.

* Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::PeerConnectionBackend):
* Source/WebCore/Modules/mediastream/PeerConnectionBackend.h:
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::startRTCLogs):
* Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp:
* Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h:
* Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp:
(WKWPE::ViewPlatform::ViewPlatform):

Canonical link: https://commits.webkit.org/287124@main

Upstream-Status: Backport [https://commits.webkit.org/287124@main]
---
.../WebCore/Modules/mediastream/PeerConnectionBackend.cpp | 4 ++++
.../WebCore/Modules/mediastream/PeerConnectionBackend.h | 2 +-
.../mediastream/gstreamer/GStreamerMediaEndpoint.cpp | 2 ++
.../platform/graphics/gstreamer/GStreamerCommon.cpp | 8 ++++----
.../graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h | 3 ++-
Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp | 2 ++
6 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
index d6bb7ef7..d9c85af5 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
@@ -165,6 +165,10 @@ PeerConnectionBackend::PeerConnectionBackend(RTCPeerConnection& peerConnection)
m_shouldFilterICECandidates = page->webRTCProvider().isSupportingMDNS();
#endif

+#if RELEASE_LOG_DISABLED
+ m_logIdentifierString = makeString(hex(reinterpret_cast<uintptr_t>(this)));
+#endif
+
#if !RELEASE_LOG_DISABLED && (PLATFORM(WPE) || PLATFORM(GTK))
m_jsonFilePath = String::fromUTF8(getenv("WEBKIT_WEBRTC_JSON_EVENTS_FILE"));
if (!m_jsonFilePath.isEmpty())
diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
index e0615025..cd7912df 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
@@ -281,8 +281,8 @@ private:
#if !RELEASE_LOG_DISABLED
Ref<const Logger> m_logger;
const void* m_logIdentifier;
- String m_logIdentifierString;
#endif
+ String m_logIdentifierString;
bool m_finishedGatheringCandidates { false };
bool m_isProcessingLocalDescriptionAnswer { false };

diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
index deb6281f..e678b04e 100644
--- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
+++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
@@ -2228,7 +2228,9 @@ std::optional<bool> GStreamerMediaEndpoint::canTrickleIceCandidates() const
void GStreamerMediaEndpoint::startRTCLogs()
{
m_isGatheringRTCLogs = true;
+#if !RELEASE_LOG_DISABLED
startLoggingStats();
+#endif
}

void GStreamerMediaEndpoint::stopRTCLogs()
diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
index 812a1f6a..1d83f3b2 100644
--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
@@ -1726,7 +1726,7 @@ void gstStructureFilterAndMapInPlace(GstStructure* structure, Function<bool(GstI
#endif
}

-#if !GST_CHECK_VERSION(1, 24, 0)
+#if USE(GBM) && !GST_CHECK_VERSION(1, 24, 0)
static GstVideoFormat drmFourccToGstVideoFormat(uint32_t fourcc)
{
switch (fourcc) {
@@ -1761,7 +1761,7 @@ static GstVideoFormat drmFourccToGstVideoFormat(uint32_t fourcc)
RELEASE_ASSERT_NOT_REACHED();
return GST_VIDEO_FORMAT_UNKNOWN;
}
-#endif // !GST_CHECK_VERSION(1, 24, 0)
+#endif // USE(GBM) && !GST_CHECK_VERSION(1, 24, 0)

#if USE(GBM)
GRefPtr<GstCaps> buildDMABufCaps()
@@ -1805,7 +1805,7 @@ GRefPtr<GstCaps> buildDMABufCaps()
gst_value_list_append_and_take_value(&supportedFormats, &value);
}
}
-#else
+#elif USE(GBM)
GValue value = G_VALUE_INIT;
g_value_init(&value, G_TYPE_STRING);
g_value_set_string(&value, gst_video_format_to_string(drmFourccToGstVideoFormat(format.fourcc)));
@@ -1815,7 +1815,7 @@ GRefPtr<GstCaps> buildDMABufCaps()

#if GST_CHECK_VERSION(1, 24, 0)
gst_caps_set_value(caps.get(), "drm-format", &supportedFormats);
-#else
+#elif USE(GBM)
gst_caps_set_value(caps.get(), "format", &supportedFormats);
#endif
g_value_unset(&supportedFormats);
diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
index 701a300d..5264b32a 100644
--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h
@@ -93,13 +93,14 @@ private:
#if !RELEASE_LOG_DISABLED
Ref<const Logger> m_logger;
const void* m_logIdentifier;
+#endif
+
uint64_t m_nextSourceBufferID { 0 };

// Stores known track IDs, so we can work around ID collisions between multiple source buffers.
// The registry is placed here to enforce ID uniqueness specifically by player, not by process,
// since its not an issue if multiple players use the same ID, and we want to preserve IDs as much as possible.
HashSet<TrackID, WTF::IntHash<TrackID>, WTF::UnsignedWithZeroKeyHashTraits<TrackID>> m_trackIdRegistry;
-#endif
};

} // namespace WebCore
diff --git a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
index 7ecf6015..b516f4b8 100644
--- a/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
+++ b/Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
@@ -118,10 +118,12 @@ ViewPlatform::ViewPlatform(WPEDisplay* display, const API::PageConfiguration& co
auto& webView = *reinterpret_cast<ViewPlatform*>(userData);
webView.toplevelStateChanged(previousState, wpe_view_get_toplevel_state(view));
}), this);
+#if USE(GBM)
g_signal_connect(m_wpeView.get(), "preferred-dma-buf-formats-changed", G_CALLBACK(+[](WPEView*, gpointer userData) {
auto& webView = *reinterpret_cast<ViewPlatform*>(userData);
webView.page().preferredBufferFormatsDidChange();
}), this);
+#endif

createWebPage(configuration);
m_pageProxy->setIntrinsicDeviceScaleFactor(wpe_view_get_scale(m_wpeView.get()));
Loading

0 comments on commit 19673ca

Please sign in to comment.