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}
diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
index b580717..3a80f4e 100644
--- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
@@ -20,7 +20,7 @@
#include <fcntl.h>
#include <gbm.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/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc
index c0023ed..251bc4e 100644
--- a/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc
+++ b/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/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
index 403e07b..02f5a56 100644
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
+++ b/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/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc b/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc
index 8b7fb41..dc736dd 100644
--- a/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.cc
+++ b/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/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h b/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h
index 63244d2..d48b020 100644
--- a/modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h
+++ b/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/modules/video_capture/linux/pipewire_session.cc b/modules/video_capture/linux/pipewire_session.cc
index 2c533a0..2eb73a4 100644
--- a/modules/video_capture/linux/pipewire_session.cc
+++ b/modules/video_capture/linux/pipewire_session.cc
@@ -10,11 +10,18 @@
#include "modules/video_capture/linux/pipewire_session.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/modules/video_capture/linux/pipewire_session.h b/modules/video_capture/linux/pipewire_session.h
index b2a2023..84848d7 100644
--- a/modules/video_capture/linux/pipewire_session.h
+++ b/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>
@@ -70,8 +73,8 @@
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/modules/video_capture/linux/video_capture_pipewire.cc b/modules/video_capture/linux/video_capture_pipewire.cc
index e19af59..65bfb92 100644
--- a/modules/video_capture/linux/video_capture_pipewire.cc
+++ b/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/modules/video_capture/linux/video_capture_pipewire.h b/modules/video_capture/linux/video_capture_pipewire.h
index 1757303..a5f70f9 100644
--- a/modules/video_capture/linux/video_capture_pipewire.h
+++ b/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"