commit e774818fc59945332a71daa449756ddfbd05576b parent c34bf72d925b11d3d39382d93e1b5fd5d76f56c3 Author: Dan Baker <dbaker@mozilla.com> Date: Wed, 22 Oct 2025 13:58:55 -0600 Bug 1995393 - Vendor libwebrtc from 8f712e0ae3 Upstream commit: https://webrtc.googlesource.com/src/+/8f712e0ae30b56cd52166dfb50c2937d2223db1a IWYU modules/desktop_capture and modules/video_capture for PipeWire Done using find modules -name "*.h" -o -name "*.cc" | xargs tools_webrtc/iwyu/apply-include-cleaner followed by tools_webrtc/gn_check_autofix.py -C out/Default/ and git cl format. Still keep pipewire/spa headers as ignored until PipeWire with IWYU annotations is available and until we require version of PipeWire where we are sure all the headers do exist. Bug: webrtc:422940461 Change-Id: Idb8a43f77bfe7f5e08b6542211ca1400715093f0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/401602 Reviewed-by: Philipp Hancke <phancke@meta.com> Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Jan Grulich <grulja@gmail.com> Cr-Commit-Position: refs/heads/main@{#45289} Diffstat:
14 files changed, 80 insertions(+), 28 deletions(-)
diff --git a/third_party/libwebrtc/README.mozilla.last-vendor b/third_party/libwebrtc/README.mozilla.last-vendor @@ -1,4 +1,4 @@ # ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc -libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-22T19:56:14.992285+00:00. +libwebrtc updated from /Users/danielbaker/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2025-10-22T19:58:41.295699+00:00. # base of lastest vendoring -83740a071e +8f712e0ae3 diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/egl_dmabuf.cc @@ -21,7 +21,7 @@ #include <gbm.h> #include <gdk/gdk.h> #include <libdrm/drm_fourcc.h> -#include <spa/param/video/format-utils.h> +#include <spa/param/video/raw.h> #include <unistd.h> #include <xf86drm.h> diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc @@ -12,7 +12,13 @@ #include <libdrm/drm_fourcc.h> #include <pipewire/pipewire.h> -#include <spa/param/video/format-utils.h> +#include <spa/param/format.h> +#include <spa/param/param.h> +#include <spa/pod/builder.h> +#include <spa/pod/iter.h> +#include <spa/pod/pod.h> +#include <spa/pod/vararg.h> +#include <spa/utils/type.h> #include <cstdint> #include <optional> diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc @@ -13,7 +13,19 @@ #include <fcntl.h> #include <libdrm/drm_fourcc.h> #include <pipewire/pipewire.h> +#include <spa/buffer/buffer.h> +#include <spa/buffer/meta.h> +#include <spa/param/format.h> +#include <spa/param/param.h> #include <spa/param/video/format-utils.h> +#include <spa/param/video/raw.h> +#include <spa/pod/builder.h> +#include <spa/pod/iter.h> +#include <spa/pod/vararg.h> +#include <spa/support/loop.h> +#include <spa/utils/defs.h> +#include <spa/utils/hook.h> +#include <spa/utils/type.h> #include <sys/mman.h> #include <sys/types.h> diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc @@ -13,7 +13,16 @@ #include <fcntl.h> #include <pipewire/pipewire.h> +#include <spa/buffer/buffer.h> +#include <spa/buffer/meta.h> +#include <spa/param/format.h> +#include <spa/param/param.h> #include <spa/param/video/format-utils.h> +#include <spa/param/video/raw.h> +#include <spa/pod/builder.h> +#include <spa/pod/vararg.h> +#include <spa/utils/defs.h> +#include <spa/utils/type.h> #include <sys/mman.h> #include <unistd.h> diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h b/third_party/libwebrtc/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h @@ -12,7 +12,8 @@ #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_ #include <pipewire/pipewire.h> -#include <spa/param/video/format-utils.h> +#include <spa/param/video/raw.h> +#include <spa/utils/hook.h> #include <cstdint> diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.cc @@ -11,11 +11,18 @@ #include "modules/video_capture/linux/pipewire_session.h" #include "modules/video_capture/linux/device_info_pipewire.h" +#include <pipewire/pipewire.h> #include <spa/monitor/device.h> #include <spa/param/format-utils.h> #include <spa/param/format.h> +#include <spa/param/param.h> #include <spa/param/video/raw.h> -#include <spa/pod/parser.h> +#include <spa/pod/iter.h> +#include <spa/pod/pod.h> +#include <spa/utils/defs.h> +#include <spa/utils/dict.h> +#include <spa/utils/hook.h> +#include <spa/utils/type.h> #include <algorithm> #include <cstdint> diff --git a/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h b/third_party/libwebrtc/modules/video_capture/linux/pipewire_session.h @@ -12,6 +12,9 @@ #define MODULES_VIDEO_CAPTURE_LINUX_PIPEWIRE_SESSION_H_ #include <pipewire/pipewire.h> +#include <spa/pod/pod.h> +#include <spa/utils/dict.h> +#include <spa/utils/hook.h> #include <cstdint> #include <deque> @@ -71,8 +74,8 @@ class PipeWireNode { const spa_pod* param); static bool ParseFormat(const spa_pod* param, VideoCaptureCapability* cap); - pw_proxy* proxy_; - spa_hook node_listener_; + struct pw_proxy* proxy_; + struct spa_hook node_listener_; PipeWireSession* session_; uint32_t id_; std::string display_name_; diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.cc @@ -10,10 +10,20 @@ #include "modules/video_capture/linux/video_capture_pipewire.h" +#include <pipewire/pipewire.h> +#include <spa/buffer/buffer.h> +#include <spa/buffer/meta.h> +#include <spa/param/format-utils.h> #include <spa/param/format.h> +#include <spa/param/param.h> #include <spa/param/video/format-utils.h> +#include <spa/param/video/raw.h> #include <spa/pod/builder.h> +#include <spa/pod/iter.h> +#include <spa/pod/vararg.h> +#include <spa/utils/defs.h> #include <spa/utils/result.h> +#include <spa/utils/type.h> #include <sys/mman.h> #include <algorithm> diff --git a/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h b/third_party/libwebrtc/modules/video_capture/linux/video_capture_pipewire.h @@ -11,6 +11,10 @@ #ifndef MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ #define MODULES_VIDEO_CAPTURE_LINUX_VIDEO_CAPTURE_PIPEWIRE_H_ +#include <pipewire/pipewire.h> +#include <spa/pod/pod.h> +#include <spa/utils/hook.h> + #include <cstdint> #include "api/scoped_refptr.h" diff --git a/third_party/libwebrtc/moz-patch-stack/s0063.patch b/third_party/libwebrtc/moz-patch-stack/s0063.patch @@ -18,7 +18,7 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/c8606497de1f461a6 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc -index b580717bf4..821fdfb487 100644 +index 3a80f4ecc1..f7e1b0a00d 100644 --- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc @@ -19,6 +19,7 @@ @@ -27,7 +27,7 @@ index b580717bf4..821fdfb487 100644 #include <gbm.h> +#include <gdk/gdk.h> #include <libdrm/drm_fourcc.h> - #include <spa/param/video/format-utils.h> + #include <spa/param/video/raw.h> #include <unistd.h> @@ -230,6 +231,26 @@ static void CloseLibrary(void* library) { } diff --git a/third_party/libwebrtc/moz-patch-stack/s0074.patch b/third_party/libwebrtc/moz-patch-stack/s0074.patch @@ -10,10 +10,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/158a888cad8869a2f 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index 403e07ba57..d97eed6457 100644 +index 02f5a56bed..f1f5a796e1 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -45,6 +45,13 @@ +@@ -57,6 +57,13 @@ #include "rtc_base/thread_annotations.h" #include "rtc_base/time_utils.h" @@ -27,7 +27,7 @@ index 403e07ba57..d97eed6457 100644 namespace webrtc { const int kBytesPerPixel = 4; -@@ -286,7 +293,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( +@@ -298,7 +305,7 @@ void SharedScreenCastStreamPrivate::OnStreamParamChanged( that->modifier_ = has_modifier ? that->spa_video_format_.modifier : DRM_FORMAT_MOD_INVALID; std::vector<const spa_pod*> params; diff --git a/third_party/libwebrtc/moz-patch-stack/s0075.patch b/third_party/libwebrtc/moz-patch-stack/s0075.patch @@ -12,10 +12,10 @@ Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/237d19fe96dd7d25b 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -index d97eed6457..5828014a4e 100644 +index f1f5a796e1..9be5546e3c 100644 --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc -@@ -424,7 +424,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( +@@ -436,7 +436,9 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( RTC_LOG(LS_ERROR) << "Unable to open PipeWire library"; return false; } @@ -26,7 +26,7 @@ index d97eed6457..5828014a4e 100644 pw_stream_node_id_ = stream_node_id; -@@ -513,7 +515,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( +@@ -525,7 +527,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream( for (uint32_t format : {SPA_VIDEO_FORMAT_BGRA, SPA_VIDEO_FORMAT_RGBA, SPA_VIDEO_FORMAT_BGRx, SPA_VIDEO_FORMAT_RGBx}) { // Modifiers can be used with PipeWire >= 0.3.33 @@ -36,7 +36,7 @@ index d97eed6457..5828014a4e 100644 modifiers_ = egl_dmabuf_->QueryDmaBufModifiers(format); if (!modifiers_.empty()) { -@@ -959,7 +962,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( +@@ -971,7 +974,7 @@ bool SharedScreenCastStreamPrivate::ProcessDMABuffer( const uint n_planes = spa_buffer->n_datas; diff --git a/third_party/libwebrtc/moz-patch-stack/s0098.patch b/third_party/libwebrtc/moz-patch-stack/s0098.patch @@ -42,7 +42,7 @@ index 009e1408b9..a737f9bdb3 100644 uint32_t DeviceInfoPipeWire::NumberOfDevices() { RTC_CHECK(pipewire_session_); diff --git a/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc -index 2c533a0edb..86368f6aa1 100644 +index 2eb73a47e8..aa791b31c7 100644 --- a/modules/video_capture/linux/pipewire_session.cc +++ b/modules/video_capture/linux/pipewire_session.cc @@ -9,6 +9,7 @@ @@ -51,9 +51,9 @@ index 2c533a0edb..86368f6aa1 100644 #include "modules/video_capture/linux/pipewire_session.h" +#include "modules/video_capture/linux/device_info_pipewire.h" + #include <pipewire/pipewire.h> #include <spa/monitor/device.h> - #include <spa/param/format-utils.h> -@@ -296,6 +297,28 @@ void PipeWireSession::InitPipeWire(int fd) { +@@ -303,6 +304,28 @@ void PipeWireSession::InitPipeWire(int fd) { Finish(VideoCaptureOptions::Status::ERROR); } @@ -82,7 +82,7 @@ index 2c533a0edb..86368f6aa1 100644 RTC_NO_SANITIZE("cfi-icall") bool PipeWireSession::StartPipeWire(int fd) { pw_init(/*argc=*/nullptr, /*argv=*/nullptr); -@@ -368,6 +391,21 @@ void PipeWireSession::PipeWireSync() { +@@ -375,6 +398,21 @@ void PipeWireSession::PipeWireSync() { sync_seq_ = pw_core_sync(pw_core_, PW_ID_CORE, sync_seq_); } @@ -104,7 +104,7 @@ index 2c533a0edb..86368f6aa1 100644 // static void PipeWireSession::OnCoreError(void* data, uint32_t id, -@@ -426,6 +464,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, +@@ -433,6 +471,8 @@ void PipeWireSession::OnRegistryGlobal(void* data, that->nodes_.push_back(PipeWireNode::Create(that, id, props)); that->PipeWireSync(); @@ -113,7 +113,7 @@ index 2c533a0edb..86368f6aa1 100644 } // static -@@ -437,10 +477,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { +@@ -444,10 +484,15 @@ void PipeWireSession::OnRegistryGlobalRemove(void* data, uint32_t id) { return node->id() == id; }); that->nodes_.erase(it, that->nodes_.end()); @@ -131,10 +131,10 @@ index 2c533a0edb..86368f6aa1 100644 webrtc::MutexLock lock(&callback_lock_); diff --git a/modules/video_capture/linux/pipewire_session.h b/modules/video_capture/linux/pipewire_session.h -index b2a2023585..ecf419a026 100644 +index 84848d76ef..a9e162a2ff 100644 --- a/modules/video_capture/linux/pipewire_session.h +++ b/modules/video_capture/linux/pipewire_session.h -@@ -31,6 +31,7 @@ +@@ -34,6 +34,7 @@ namespace webrtc { namespace videocapturemodule { @@ -142,7 +142,7 @@ index b2a2023585..ecf419a026 100644 class PipeWireSession; class VideoCaptureModulePipeWire; -@@ -99,6 +100,21 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual<PipeWireSession> { +@@ -102,6 +103,21 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual<PipeWireSession> { void Init(VideoCaptureOptions::Callback* callback, int fd = kInvalidPipeWireFd); @@ -164,7 +164,7 @@ index b2a2023585..ecf419a026 100644 const std::deque<PipeWireNode::PipeWireNodePtr>& nodes() const { return nodes_; } -@@ -113,6 +129,8 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual<PipeWireSession> { +@@ -116,6 +132,8 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual<PipeWireSession> { void StopPipeWire(); void PipeWireSync(); @@ -173,7 +173,7 @@ index b2a2023585..ecf419a026 100644 static void OnCoreError(void* data, uint32_t id, int seq, -@@ -135,7 +153,13 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual<PipeWireSession> { +@@ -138,7 +156,13 @@ class PipeWireSession : public webrtc::RefCountedNonVirtual<PipeWireSession> { VideoCaptureOptions::Callback* callback_ RTC_GUARDED_BY(&callback_lock_) = nullptr;