IWYU modules/desktop_capture (part 2)

Follow-up to
  https://webrtc-review.googlesource.com/c/src/+/393940

Done using
  find modules/desktop_capture/ -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.

Manual changes:
* screencast_stream_utils.cc: include string_utils

Bug: webrtc:42226242
Change-Id: I126f7cd6bfb194d7a93eb26e6652fd0262511bae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/394060
Commit-Queue: Philipp Hancke <phancke@meta.com>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Alexander Cooper <alcooper@chromium.org>
Cr-Commit-Position: refs/heads/main@{#44808}
diff --git a/modules/desktop_capture/full_screen_window_detector.cc b/modules/desktop_capture/full_screen_window_detector.cc
index b4eafc1..2bbd1f8 100644
--- a/modules/desktop_capture/full_screen_window_detector.cc
+++ b/modules/desktop_capture/full_screen_window_detector.cc
@@ -10,6 +10,10 @@
 
 #include "modules/desktop_capture/full_screen_window_detector.h"
 
+#include <cstdint>
+
+#include "api/function_view.h"
+#include "modules/desktop_capture/desktop_capturer.h"
 #include "modules/desktop_capture/full_screen_application_handler.h"
 #include "rtc_base/time_utils.h"
 
diff --git a/modules/desktop_capture/full_screen_window_detector.h b/modules/desktop_capture/full_screen_window_detector.h
index ad50c2c..2c88279 100644
--- a/modules/desktop_capture/full_screen_window_detector.h
+++ b/modules/desktop_capture/full_screen_window_detector.h
@@ -11,6 +11,8 @@
 #ifndef MODULES_DESKTOP_CAPTURE_FULL_SCREEN_WINDOW_DETECTOR_H_
 #define MODULES_DESKTOP_CAPTURE_FULL_SCREEN_WINDOW_DETECTOR_H_
 
+#include <cstdint>
+#include <functional>
 #include <memory>
 
 #include "api/function_view.h"
diff --git a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
index 76340ce..ed6a9a5 100644
--- a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
+++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
@@ -10,11 +10,22 @@
 
 #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h"
 
+#include <sys/types.h>
+
+#include <cstdint>
+#include <memory>
+#include <utility>
+
+#include "modules/desktop_capture/delegated_source_list_controller.h"
 #include "modules/desktop_capture/desktop_capture_options.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/desktop_capturer.h"
 #include "modules/desktop_capture/linux/wayland/restore_token_manager.h"
+#include "modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h"
+#include "modules/desktop_capture/linux/wayland/screencast_portal.h"
 #include "modules/portal/pipewire_utils.h"
-#include "modules/portal/xdg_desktop_portal_utils.h"
+#include "modules/portal/portal_request_response.h"
+#include "modules/portal/xdg_session_details.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 #include "rtc_base/time_utils.h"
diff --git a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h
index 083d373..7f2eaf1 100644
--- a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h
+++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h
@@ -11,15 +11,18 @@
 #ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_BASE_CAPTURER_PIPEWIRE_H_
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_BASE_CAPTURER_PIPEWIRE_H_
 
+#include <cstdint>
+#include <memory>
+
 #include "modules/desktop_capture/delegated_source_list_controller.h"
 #include "modules/desktop_capture/desktop_capture_options.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/desktop_capturer.h"
 #include "modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h"
 #include "modules/desktop_capture/linux/wayland/screencast_portal.h"
-#include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h"
 #include "modules/portal/portal_request_response.h"
-#include "modules/portal/xdg_desktop_portal_utils.h"
 #include "modules/portal/xdg_session_details.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
index c67f126..0187c56 100644
--- a/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
+++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc
@@ -10,19 +10,30 @@
 
 #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h"
 
+#include <EGL/egl.h>
 #include <EGL/eglext.h>
+#include <EGL/eglplatform.h>
+#include <GL/gl.h>
+#include <GL/glext.h>
 #include <asm/ioctl.h>
 #include <dlfcn.h>
 #include <fcntl.h>
+#include <gbm.h>
 #include <libdrm/drm_fourcc.h>
-#include <linux/types.h>
-#include <spa/param/video/format-utils.h>
+#include <spa/param/video/raw.h>
 #include <unistd.h>
 #include <xf86drm.h>
 
+#include <algorithm>
+#include <cerrno>
+#include <cstdint>
+#include <cstring>
 #include <optional>
+#include <string>
+#include <vector>
 
-#include "absl/memory/memory.h"
+#include "absl/strings/string_view.h"
+#include "modules/desktop_capture/desktop_geometry.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 #include "rtc_base/sanitizer.h"
diff --git a/modules/desktop_capture/linux/wayland/egl_dmabuf.h b/modules/desktop_capture/linux/wayland/egl_dmabuf.h
index 08df16b..a5d3868 100644
--- a/modules/desktop_capture/linux/wayland/egl_dmabuf.h
+++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.h
@@ -12,10 +12,11 @@
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_EGL_DMABUF_H_
 
 #include <EGL/egl.h>
+#include <EGL/eglplatform.h>
 #include <GL/gl.h>
 #include <gbm.h>
 
-#include <memory>
+#include <cstdint>
 #include <optional>
 #include <string>
 #include <vector>
diff --git a/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc b/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc
index 21f550b..03cc907 100644
--- a/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc
+++ b/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.cc
@@ -10,12 +10,16 @@
 
 #include "modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.h"
 
-#include <utility>
+#include <memory>
+#include <optional>
 
+#include "api/sequence_checker.h"
 #include "modules/desktop_capture/desktop_capture_options.h"
 #include "modules/desktop_capture/desktop_capturer.h"
+#include "modules/desktop_capture/desktop_geometry.h"
+#include "modules/desktop_capture/mouse_cursor.h"
+#include "modules/desktop_capture/mouse_cursor_monitor.h"
 #include "rtc_base/checks.h"
-#include "rtc_base/logging.h"
 
 namespace webrtc {
 
diff --git a/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.h b/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.h
index da670be..9ddb8e3 100644
--- a/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.h
+++ b/modules/desktop_capture/linux/wayland/mouse_cursor_monitor_pipewire.h
@@ -11,16 +11,11 @@
 #ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_
 
-#include <memory>
-
-#include "api/scoped_refptr.h"
 #include "api/sequence_checker.h"
 #include "modules/desktop_capture/desktop_capture_options.h"
-#include "modules/desktop_capture/desktop_capture_types.h"
-#include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h"
-#include "modules/desktop_capture/mouse_cursor.h"
 #include "modules/desktop_capture/mouse_cursor_monitor.h"
 #include "rtc_base/system/no_unique_address.h"
+#include "rtc_base/thread_annotations.h"
 
 namespace webrtc {
 
diff --git a/modules/desktop_capture/linux/wayland/restore_token_manager.cc b/modules/desktop_capture/linux/wayland/restore_token_manager.cc
index a17d9a4..e7fe134 100644
--- a/modules/desktop_capture/linux/wayland/restore_token_manager.cc
+++ b/modules/desktop_capture/linux/wayland/restore_token_manager.cc
@@ -10,6 +10,10 @@
 
 #include "modules/desktop_capture/linux/wayland/restore_token_manager.h"
 
+#include <string>
+
+#include "modules/desktop_capture/desktop_capturer.h"
+
 namespace webrtc {
 
 // static
diff --git a/modules/desktop_capture/linux/wayland/restore_token_manager.h b/modules/desktop_capture/linux/wayland/restore_token_manager.h
index ad4f747..06d3071 100644
--- a/modules/desktop_capture/linux/wayland/restore_token_manager.h
+++ b/modules/desktop_capture/linux/wayland/restore_token_manager.h
@@ -11,7 +11,6 @@
 #ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_RESTORE_TOKEN_MANAGER_H_
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_RESTORE_TOKEN_MANAGER_H_
 
-#include <mutex>
 #include <string>
 #include <unordered_map>
 
diff --git a/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc b/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc
index 1c7cc37..3ea47e4 100644
--- a/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc
+++ b/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.cc
@@ -9,8 +9,14 @@
  */
 #include "modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h"
 
+#include <gio/gio.h>
+#include <glib.h>
+
+#include <cstdint>
 #include <string>
 
+#include "modules/portal/portal_request_response.h"
+#include "modules/portal/scoped_glib.h"
 #include "modules/portal/xdg_desktop_portal_utils.h"
 #include "rtc_base/logging.h"
 
diff --git a/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h b/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h
index 7953c64..06401f0 100644
--- a/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h
+++ b/modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h
@@ -12,13 +12,13 @@
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SCREEN_CAPTURE_PORTAL_INTERFACE_H_
 
 #include <gio/gio.h>
+#include <glib.h>
 
 #include <string>
 
 #include "modules/portal/portal_request_response.h"
-#include "modules/portal/scoped_glib.h"
-#include "modules/portal/xdg_desktop_portal_utils.h"
 #include "modules/portal/xdg_session_details.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 namespace xdg_portal {
diff --git a/modules/desktop_capture/linux/wayland/screencast_portal.cc b/modules/desktop_capture/linux/wayland/screencast_portal.cc
index 958b4d0..d3c8c07 100644
--- a/modules/desktop_capture/linux/wayland/screencast_portal.cc
+++ b/modules/desktop_capture/linux/wayland/screencast_portal.cc
@@ -10,11 +10,23 @@
 
 #include "modules/desktop_capture/linux/wayland/screencast_portal.h"
 
+#include <gio/gio.h>
 #include <gio/gunixfdlist.h>
 #include <glib-object.h>
+#include <glib.h>
+#include <glibconfig.h>
+#include <unistd.h>
 
+#include <cstdint>
+#include <string>
+#include <utility>
+
+#include "modules/desktop_capture/desktop_capture_types.h"
+#include "modules/portal/pipewire_utils.h"
+#include "modules/portal/portal_request_response.h"
 #include "modules/portal/scoped_glib.h"
 #include "modules/portal/xdg_desktop_portal_utils.h"
+#include "modules/portal/xdg_session_details.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 
diff --git a/modules/desktop_capture/linux/wayland/screencast_portal.h b/modules/desktop_capture/linux/wayland/screencast_portal.h
index 2bf7800..de36b62 100644
--- a/modules/desktop_capture/linux/wayland/screencast_portal.h
+++ b/modules/desktop_capture/linux/wayland/screencast_portal.h
@@ -12,15 +12,18 @@
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SCREENCAST_PORTAL_H_
 
 #include <gio/gio.h>
+#include <glib-object.h>
+#include <glib.h>
 
+#include <cstdint>
 #include <string>
 
 #include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/linux/wayland/screen_capture_portal_interface.h"
 #include "modules/portal/pipewire_utils.h"
 #include "modules/portal/portal_request_response.h"
-#include "modules/portal/xdg_desktop_portal_utils.h"
 #include "modules/portal/xdg_session_details.h"
+#include "rtc_base/system/rtc_export.h"
 
 namespace webrtc {
 
diff --git a/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc b/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc
index e5eb267..278f15a 100644
--- a/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc
+++ b/modules/desktop_capture/linux/wayland/screencast_stream_utils.cc
@@ -11,11 +11,22 @@
 #include "modules/desktop_capture/linux/wayland/screencast_stream_utils.h"
 
 #include <libdrm/drm_fourcc.h>
-#include <pipewire/pipewire.h>
-#include <spa/param/video/format-utils.h>
+#include <pipewire/version.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 <string>
+#include <cstdint>
+#include <optional>
+#include <tuple>
+#include <vector>
 
+#include "absl/strings/string_view.h"
+#include "rtc_base/string_encode.h"
 #include "rtc_base/string_to_number.h"
 
 #if !PW_CHECK_VERSION(0, 3, 29)
diff --git a/modules/desktop_capture/linux/wayland/screencast_stream_utils.h b/modules/desktop_capture/linux/wayland/screencast_stream_utils.h
index 2f44300..ee684f4 100644
--- a/modules/desktop_capture/linux/wayland/screencast_stream_utils.h
+++ b/modules/desktop_capture/linux/wayland/screencast_stream_utils.h
@@ -13,10 +13,9 @@
 
 #include <stdint.h>
 
-#include <string>
 #include <vector>
 
-#include "rtc_base/string_encode.h"
+#include "absl/strings/string_view.h"
 
 struct spa_pod;
 struct spa_pod_builder;
diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
index a022de6..7b74c55 100644
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
@@ -12,19 +12,58 @@
 
 #include <fcntl.h>
 #include <libdrm/drm_fourcc.h>
+#include <pipewire/context.h>
+#include <pipewire/core.h>
+#include <pipewire/loop.h>
 #include <pipewire/pipewire.h>
-#include <spa/param/video/format-utils.h>
+#include <pipewire/port.h>
+#include <pipewire/properties.h>
+#include <pipewire/stream.h>
+#include <pipewire/thread-loop.h>
+#include <pipewire/version.h>
+#include <spa/buffer/buffer.h>
+#include <spa/buffer/meta.h>
+#include <spa/param/buffers.h>
+#include <spa/param/format.h>
+#include <spa/param/param.h>
+#include <spa/param/video/raw-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>
 
+#include <algorithm>
+#include <cerrno>
+#include <cstdint>
+#include <cstring>
+#include <memory>
+#include <optional>
+#include <utility>
 #include <vector>
 
-#include "absl/memory/memory.h"
+#include "api/scoped_refptr.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
+#include "modules/desktop_capture/desktop_capturer.h"
+#include "modules/desktop_capture/desktop_frame.h"
+#include "modules/desktop_capture/desktop_geometry.h"
+#include "modules/desktop_capture/desktop_region.h"
 #include "modules/desktop_capture/linux/wayland/egl_dmabuf.h"
 #include "modules/desktop_capture/linux/wayland/screencast_stream_utils.h"
+#include "modules/desktop_capture/mouse_cursor.h"
+#include "modules/desktop_capture/screen_capture_frame_queue.h"
+#include "modules/desktop_capture/shared_desktop_frame.h"
 #include "modules/portal/pipewire_utils.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 #include "rtc_base/sanitizer.h"
 #include "rtc_base/synchronization/mutex.h"
+#include "rtc_base/thread_annotations.h"
 #include "rtc_base/time_utils.h"
 
 namespace webrtc {
diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.h b/modules/desktop_capture/linux/wayland/shared_screencast_stream.h
index 0043f7a..7c9c680 100644
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.h
+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.h
@@ -11,14 +11,15 @@
 #ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SHARED_SCREENCAST_STREAM_H_
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_SHARED_SCREENCAST_STREAM_H_
 
+#include <cstdint>
 #include <memory>
 #include <optional>
 
 #include "api/ref_counted_base.h"
 #include "api/scoped_refptr.h"
 #include "modules/desktop_capture/desktop_capturer.h"
+#include "modules/desktop_capture/desktop_geometry.h"
 #include "modules/desktop_capture/mouse_cursor.h"
-#include "modules/desktop_capture/screen_capture_frame_queue.h"
 #include "modules/desktop_capture/shared_desktop_frame.h"
 #include "rtc_base/system/rtc_export.h"
 
diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream_unittest.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream_unittest.cc
index 4ae7b78..8a0c4d0 100644
--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream_unittest.cc
+++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream_unittest.cc
@@ -10,14 +10,16 @@
 
 #include "modules/desktop_capture/linux/wayland/shared_screencast_stream.h"
 
-#include <memory>
-#include <utility>
+#include <sys/types.h>
 
+#include <cstdint>
+#include <memory>
+
+#include "api/scoped_refptr.h"
 #include "api/units/time_delta.h"
-#include "modules/desktop_capture/desktop_capturer.h"
-#include "modules/desktop_capture/desktop_frame.h"
 #include "modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h"
 #include "modules/desktop_capture/rgba_color.h"
+#include "modules/desktop_capture/shared_desktop_frame.h"
 #include "rtc_base/event.h"
 #include "test/gmock.h"
 #include "test/gtest.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 1055104..9896b9f 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
@@ -12,15 +12,34 @@
 #include "modules/desktop_capture/linux/wayland/test/test_screencast_stream_provider.h"
 
 #include <fcntl.h>
+#include <pipewire/context.h>
+#include <pipewire/core.h>
+#include <pipewire/pipewire.h>
+#include <pipewire/port.h>
+#include <pipewire/stream.h>
+#include <pipewire/thread-loop.h>
+#include <spa/buffer/buffer.h>
+#include <spa/buffer/meta.h>
+#include <spa/param/buffers.h>
+#include <spa/param/format.h>
+#include <spa/param/param.h>
+#include <spa/param/video/raw-utils.h>
+#include <spa/param/video/raw.h>
+#include <spa/pod/builder.h>
+#include <spa/pod/pod.h>
+#include <spa/pod/vararg.h>
+#include <spa/utils/defs.h>
+#include <spa/utils/type.h>
 #include <sys/mman.h>
-#include <sys/types.h>
 #include <unistd.h>
 
-#include <string>
-#include <utility>
+#include <cstdint>
 #include <vector>
 
+#include "modules/desktop_capture/linux/wayland/screencast_stream_utils.h"
+#include "modules/desktop_capture/rgba_color.h"
 #include "modules/portal/pipewire_utils.h"
+#include "rtc_base/checks.h"
 #include "rtc_base/logging.h"
 
 namespace webrtc {
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 f63a2e6..31e10e5 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
@@ -11,12 +11,17 @@
 #ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_
 #define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_TEST_TEST_SCREENCAST_STREAM_PROVIDER_H_
 
-#include <pipewire/pipewire.h>
-#include <spa/param/video/format-utils.h>
+#include <pipewire/context.h>
+#include <pipewire/core.h>
+#include <pipewire/stream.h>
+#include <pipewire/thread-loop.h>
+#include <spa/param/video/raw.h>
+#include <spa/utils/hook.h>
+
+#include <cstdint>
 
 #include "modules/desktop_capture/linux/wayland/screencast_stream_utils.h"
 #include "modules/desktop_capture/rgba_color.h"
-#include "rtc_base/random.h"
 
 namespace webrtc {
 
diff --git a/modules/desktop_capture/linux/x11/x_window_property.cc b/modules/desktop_capture/linux/x11/x_window_property.cc
index 5e16dac..2965836 100644
--- a/modules/desktop_capture/linux/x11/x_window_property.cc
+++ b/modules/desktop_capture/linux/x11/x_window_property.cc
@@ -10,6 +10,9 @@
 
 #include "modules/desktop_capture/linux/x11/x_window_property.h"
 
+#include <X11/X.h>
+#include <X11/Xlib.h>
+
 namespace webrtc {
 
 XWindowPropertyBase::XWindowPropertyBase(Display* display,
diff --git a/modules/desktop_capture/linux/x11/x_window_property.h b/modules/desktop_capture/linux/x11/x_window_property.h
index 28dfb973..80b4acc 100644
--- a/modules/desktop_capture/linux/x11/x_window_property.h
+++ b/modules/desktop_capture/linux/x11/x_window_property.h
@@ -14,6 +14,8 @@
 #include <X11/X.h>
 #include <X11/Xlib.h>
 
+#include <cstddef>
+
 namespace webrtc {
 
 class XWindowPropertyBase {
diff --git a/modules/desktop_capture/mac/full_screen_mac_application_handler.h b/modules/desktop_capture/mac/full_screen_mac_application_handler.h
index 060cdb5..d9ff943 100644
--- a/modules/desktop_capture/mac/full_screen_mac_application_handler.h
+++ b/modules/desktop_capture/mac/full_screen_mac_application_handler.h
@@ -13,6 +13,7 @@
 
 #include <memory>
 
+#include "modules/desktop_capture/desktop_capturer.h"
 #include "modules/desktop_capture/full_screen_application_handler.h"
 
 namespace webrtc {
diff --git a/modules/desktop_capture/win/dxgi_frame.h b/modules/desktop_capture/win/dxgi_frame.h
index 6a9ce86..5c571a8 100644
--- a/modules/desktop_capture/win/dxgi_frame.h
+++ b/modules/desktop_capture/win/dxgi_frame.h
@@ -12,7 +12,6 @@
 #define MODULES_DESKTOP_CAPTURE_WIN_DXGI_FRAME_H_
 
 #include <memory>
-#include <vector>
 
 #include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/desktop_capturer.h"
diff --git a/modules/desktop_capture/window_capturer_linux.cc b/modules/desktop_capture/window_capturer_linux.cc
index 4205bf9..f621a63 100644
--- a/modules/desktop_capture/window_capturer_linux.cc
+++ b/modules/desktop_capture/window_capturer_linux.cc
@@ -11,6 +11,7 @@
 #include <memory>
 
 #include "modules/desktop_capture/desktop_capture_options.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/desktop_capturer.h"
 
 #if defined(WEBRTC_USE_PIPEWIRE)
diff --git a/modules/desktop_capture/window_capturer_null.cc b/modules/desktop_capture/window_capturer_null.cc
index 6da2a76..2061dc5 100644
--- a/modules/desktop_capture/window_capturer_null.cc
+++ b/modules/desktop_capture/window_capturer_null.cc
@@ -8,8 +8,9 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "modules/desktop_capture/desktop_capturer.h"
-#include "modules/desktop_capture/desktop_frame.h"
 #include "rtc_base/checks.h"
 
 namespace webrtc {
diff --git a/modules/desktop_capture/window_capturer_unittest.cc b/modules/desktop_capture/window_capturer_unittest.cc
index 3483d4d..4930f3d 100644
--- a/modules/desktop_capture/window_capturer_unittest.cc
+++ b/modules/desktop_capture/window_capturer_unittest.cc
@@ -16,7 +16,6 @@
 #include "modules/desktop_capture/desktop_capturer.h"
 #include "modules/desktop_capture/desktop_frame.h"
 #include "modules/desktop_capture/desktop_geometry.h"
-#include "rtc_base/checks.h"
 #include "test/gtest.h"
 
 namespace webrtc {
diff --git a/modules/desktop_capture/window_finder.h b/modules/desktop_capture/window_finder.h
index 1b79f93..407e6b6 100644
--- a/modules/desktop_capture/window_finder.h
+++ b/modules/desktop_capture/window_finder.h
@@ -13,7 +13,6 @@
 
 #include <memory>
 
-#include "api/scoped_refptr.h"
 #include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/desktop_geometry.h"
 
diff --git a/modules/desktop_capture/window_finder_mac.h b/modules/desktop_capture/window_finder_mac.h
index 171f098..429fadb 100644
--- a/modules/desktop_capture/window_finder_mac.h
+++ b/modules/desktop_capture/window_finder_mac.h
@@ -12,6 +12,8 @@
 #define MODULES_DESKTOP_CAPTURE_WINDOW_FINDER_MAC_H_
 
 #include "api/scoped_refptr.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
+#include "modules/desktop_capture/desktop_geometry.h"
 #include "modules/desktop_capture/window_finder.h"
 
 namespace webrtc {
diff --git a/modules/desktop_capture/window_finder_unittest.cc b/modules/desktop_capture/window_finder_unittest.cc
index e30d715..ebceac4 100644
--- a/modules/desktop_capture/window_finder_unittest.cc
+++ b/modules/desktop_capture/window_finder_unittest.cc
@@ -15,6 +15,7 @@
 #include <memory>
 
 #include "api/scoped_refptr.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
 #include "modules/desktop_capture/desktop_geometry.h"
 #include "modules/desktop_capture/screen_drawer.h"
 #include "rtc_base/logging.h"
diff --git a/modules/desktop_capture/window_finder_win.h b/modules/desktop_capture/window_finder_win.h
index a04e7e1..a25754c 100644
--- a/modules/desktop_capture/window_finder_win.h
+++ b/modules/desktop_capture/window_finder_win.h
@@ -11,6 +11,8 @@
 #ifndef MODULES_DESKTOP_CAPTURE_WINDOW_FINDER_WIN_H_
 #define MODULES_DESKTOP_CAPTURE_WINDOW_FINDER_WIN_H_
 
+#include "modules/desktop_capture/desktop_capture_types.h"
+#include "modules/desktop_capture/desktop_geometry.h"
 #include "modules/desktop_capture/window_finder.h"
 
 namespace webrtc {