diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn index 787a5c83b0..487bbf28ab 100644 --- a/modules/desktop_capture/BUILD.gn +++ b/modules/desktop_capture/BUILD.gn @@ -249,14 +249,14 @@ if (is_linux || is_chromeos) { ":libdrm", ] deps = [ "../../rtc_base" ] - extra_header = "linux/pipewire_stub_header.fragment" + extra_header = "linux/wayland/pipewire_stub_header.fragment" logging_function = "RTC_LOG(LS_VERBOSE)" logging_include = "rtc_base/logging.h" - output_name = "linux/pipewire_stubs" - path_from_source = "modules/desktop_capture/linux" + output_name = "linux/wayland/pipewire_stubs" + path_from_source = "modules/desktop_capture/linux/wayland" sigs = [ - "linux/pipewire.sigs", - "linux/drm.sigs", + "linux/wayland/pipewire.sigs", + "linux/wayland/drm.sigs", ] } } @@ -406,37 +406,38 @@ rtc_library("desktop_capture_generic") { if (build_with_mozilla && (is_linux || is_chromeos)) { sources += [ "app_capturer_linux.cc", - "linux/app_capturer_x11.cc", - "linux/desktop_device_info_linux.cc", - "linux/desktop_device_info_linux.h", - "linux/shared_x_util.cc", - "linux/shared_x_util.h", + "linux/x11/app_capturer_x11.cc", + "linux/x11/desktop_device_info_linux.cc", + "linux/x11/desktop_device_info_linux.h", + "linux/x11/shared_x_util.cc", + "linux/x11/shared_x_util.h", ] } } if (rtc_use_x11_extensions) { sources += [ - "linux/mouse_cursor_monitor_x11.cc", - "linux/mouse_cursor_monitor_x11.h", - "linux/screen_capturer_x11.cc", - "linux/screen_capturer_x11.h", - "linux/shared_x_display.cc", "linux/shared_x_display.h", - "linux/window_capturer_x11.cc", - "linux/window_capturer_x11.h", - "linux/window_finder_x11.cc", - "linux/window_finder_x11.h", - "linux/window_list_utils.cc", - "linux/window_list_utils.h", - "linux/x_atom_cache.cc", - "linux/x_atom_cache.h", - "linux/x_error_trap.cc", - "linux/x_error_trap.h", - "linux/x_server_pixel_buffer.cc", - "linux/x_server_pixel_buffer.h", - "linux/x_window_property.cc", - "linux/x_window_property.h", + "linux/x11/mouse_cursor_monitor_x11.cc", + "linux/x11/mouse_cursor_monitor_x11.h", + "linux/x11/screen_capturer_x11.cc", + "linux/x11/screen_capturer_x11.h", + "linux/x11/shared_x_display.cc", + "linux/x11/shared_x_display.h", + "linux/x11/window_capturer_x11.cc", + "linux/x11/window_capturer_x11.h", + "linux/x11/window_finder_x11.cc", + "linux/x11/window_finder_x11.h", + "linux/x11/window_list_utils.cc", + "linux/x11/window_list_utils.h", + "linux/x11/x_atom_cache.cc", + "linux/x11/x_atom_cache.h", + "linux/x11/x_error_trap.cc", + "linux/x11/x_error_trap.h", + "linux/x11/x_server_pixel_buffer.cc", + "linux/x11/x_server_pixel_buffer.h", + "linux/x11/x_window_property.cc", + "linux/x11/x_window_property.h", ] libs = [ "X11", @@ -561,10 +562,10 @@ rtc_library("desktop_capture_generic") { if (rtc_use_pipewire) { sources += [ - "linux/base_capturer_pipewire.cc", - "linux/base_capturer_pipewire.h", - "linux/egl_dmabuf.cc", - "linux/egl_dmabuf.h", + "linux/wayland/base_capturer_pipewire.cc", + "linux/wayland/base_capturer_pipewire.h", + "linux/wayland/egl_dmabuf.cc", + "linux/wayland/egl_dmabuf.h", ] configs += [ diff --git a/modules/desktop_capture/desktop_capture_options.h b/modules/desktop_capture/desktop_capture_options.h index 19bea1f6d0..2044a5b881 100644 --- a/modules/desktop_capture/desktop_capture_options.h +++ b/modules/desktop_capture/desktop_capture_options.h @@ -14,7 +14,7 @@ #include "rtc_base/system/rtc_export.h" #if defined(WEBRTC_USE_X11) -#include "modules/desktop_capture/linux/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" #endif #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) diff --git a/modules/desktop_capture/linux/shared_x_display.h b/modules/desktop_capture/linux/shared_x_display.h index da130b0072..503394c593 100644 --- a/modules/desktop_capture/linux/shared_x_display.h +++ b/modules/desktop_capture/linux/shared_x_display.h @@ -8,77 +8,4 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SHARED_X_DISPLAY_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_SHARED_X_DISPLAY_H_ - -#include -#include -#include - -#include "api/ref_counted_base.h" -#include "api/scoped_refptr.h" -#include "rtc_base/constructor_magic.h" -#include "rtc_base/system/rtc_export.h" - -// Including Xlib.h will involve evil defines (Bool, Status, True, False), which -// easily conflict with other headers. -typedef struct _XDisplay Display; -typedef union _XEvent XEvent; - -namespace webrtc { - -// A ref-counted object to store XDisplay connection. -class RTC_EXPORT SharedXDisplay - : public rtc::RefCountedNonVirtual { - public: - class XEventHandler { - public: - virtual ~XEventHandler() {} - - // Processes XEvent. Returns true if the event has been handled. - virtual bool HandleXEvent(const XEvent& event) = 0; - }; - - // Creates a new X11 Display for the `display_name`. NULL is returned if X11 - // connection failed. Equivalent to CreateDefault() when `display_name` is - // empty. - static rtc::scoped_refptr Create( - const std::string& display_name); - - // Creates X11 Display connection for the default display (e.g. specified in - // DISPLAY). NULL is returned if X11 connection failed. - static rtc::scoped_refptr CreateDefault(); - - Display* display() { return display_; } - - // Adds a new event `handler` for XEvent's of `type`. - void AddEventHandler(int type, XEventHandler* handler); - - // Removes event `handler` added using `AddEventHandler`. Doesn't do anything - // if `handler` is not registered. - void RemoveEventHandler(int type, XEventHandler* handler); - - // Processes pending XEvents, calling corresponding event handlers. - void ProcessPendingXEvents(); - - void IgnoreXServerGrabs(); - - ~SharedXDisplay(); - - protected: - // Takes ownership of `display`. - explicit SharedXDisplay(Display* display); - - private: - typedef std::map > EventHandlersMap; - - Display* display_; - - EventHandlersMap event_handlers_; - - RTC_DISALLOW_COPY_AND_ASSIGN(SharedXDisplay); -}; - -} // namespace webrtc - -#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_X_DISPLAY_H_ +#include "modules/desktop_capture/linux/x11/shared_x_display.h" diff --git a/modules/desktop_capture/linux/base_capturer_pipewire.cc b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc similarity index 95% rename from modules/desktop_capture/linux/base_capturer_pipewire.cc rename to modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc index be8b5f3bf8..aea6cdfde2 100644 --- a/modules/desktop_capture/linux/base_capturer_pipewire.cc +++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +#include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" #include #include @@ -19,9 +19,9 @@ #include #include -#include #include #include +#include #include "absl/memory/memory.h" #include "modules/desktop_capture/desktop_capture_options.h" @@ -31,11 +31,11 @@ #include "rtc_base/string_encode.h" #if defined(WEBRTC_DLOPEN_PIPEWIRE) -#include "modules/desktop_capture/linux/pipewire_stubs.h" -using modules_desktop_capture_linux::InitializeStubs; -using modules_desktop_capture_linux::kModuleDrm; -using modules_desktop_capture_linux::kModulePipewire; -using modules_desktop_capture_linux::StubPathMap; +#include "modules/desktop_capture/linux/wayland/pipewire_stubs.h" +using modules_desktop_capture_linux_wayland::InitializeStubs; +using modules_desktop_capture_linux_wayland::kModuleDrm; +using modules_desktop_capture_linux_wayland::kModulePipewire; +using modules_desktop_capture_linux_wayland::StubPathMap; #endif // defined(WEBRTC_DLOPEN_PIPEWIRE) namespace webrtc { @@ -420,8 +420,8 @@ void BaseCapturerPipeWire::InitPortal() { g_dbus_proxy_new_for_bus( G_BUS_TYPE_SESSION, G_DBUS_PROXY_FLAGS_NONE, /*info=*/nullptr, kDesktopBusName, kDesktopObjectPath, kScreenCastInterfaceName, - cancellable_, - reinterpret_cast(OnProxyRequested), this); + cancellable_, reinterpret_cast(OnProxyRequested), + this); } void BaseCapturerPipeWire::Init() { @@ -569,9 +569,8 @@ void BaseCapturerPipeWire::HandleBuffer(pw_buffer* buffer) { plane_datas.push_back(data); } - src_unique_ptr = - egl_dmabuf_->ImageFromDmaBuf(desktop_size_, spa_video_format_.format, - plane_datas, modifier_); + src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( + desktop_size_, spa_video_format_.format, plane_datas, modifier_); src = src_unique_ptr.get(); } else if (spa_buffer->datas[0].type == SPA_DATA_MemPtr) { src = static_cast(spa_buffer->datas[0].data); @@ -728,14 +727,14 @@ void BaseCapturerPipeWire::SessionRequest() { portal_handle_, OnSessionRequestResponseSignal); RTC_LOG(LS_INFO) << "Screen cast session requested."; - g_dbus_proxy_call( - proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), - G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, - reinterpret_cast(OnSessionRequested), this); + g_dbus_proxy_call(proxy_, "CreateSession", g_variant_new("(a{sv})", &builder), + G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, + reinterpret_cast(OnSessionRequested), + this); } // static -void BaseCapturerPipeWire::OnSessionRequested(GDBusProxy *proxy, +void BaseCapturerPipeWire::OnSessionRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data) { BaseCapturerPipeWire* that = static_cast(user_data); @@ -841,15 +840,15 @@ void BaseCapturerPipeWire::SourcesRequest() { sources_handle_, OnSourcesRequestResponseSignal); RTC_LOG(LS_INFO) << "Requesting sources from the screen cast session."; - g_dbus_proxy_call( - proxy_, "SelectSources", - g_variant_new("(oa{sv})", session_handle_, &builder), - G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, - reinterpret_cast(OnSourcesRequested), this); + g_dbus_proxy_call(proxy_, "SelectSources", + g_variant_new("(oa{sv})", session_handle_, &builder), + G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, cancellable_, + reinterpret_cast(OnSourcesRequested), + this); } // static -void BaseCapturerPipeWire::OnSourcesRequested(GDBusProxy *proxy, +void BaseCapturerPipeWire::OnSourcesRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data) { BaseCapturerPipeWire* that = static_cast(user_data); @@ -935,7 +934,7 @@ void BaseCapturerPipeWire::StartRequest() { } // static -void BaseCapturerPipeWire::OnStartRequested(GDBusProxy *proxy, +void BaseCapturerPipeWire::OnStartRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data) { BaseCapturerPipeWire* that = static_cast(user_data); @@ -1034,17 +1033,15 @@ void BaseCapturerPipeWire::OpenPipeWireRemote() { g_dbus_proxy_call_with_unix_fd_list( proxy_, "OpenPipeWireRemote", g_variant_new("(oa{sv})", session_handle_, &builder), - G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, - cancellable_, + G_DBUS_CALL_FLAGS_NONE, /*timeout=*/-1, /*fd_list=*/nullptr, cancellable_, reinterpret_cast(OnOpenPipeWireRemoteRequested), this); } // static -void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested( - GDBusProxy *proxy, - GAsyncResult* result, - gpointer user_data) { +void BaseCapturerPipeWire::OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, + GAsyncResult* result, + gpointer user_data) { BaseCapturerPipeWire* that = static_cast(user_data); RTC_DCHECK(that); diff --git a/modules/desktop_capture/linux/base_capturer_pipewire.h b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h similarity index 91% rename from modules/desktop_capture/linux/base_capturer_pipewire.h rename to modules/desktop_capture/linux/wayland/base_capturer_pipewire.h index a7f954d516..238439e672 100644 --- a/modules/desktop_capture/linux/base_capturer_pipewire.h +++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.h @@ -8,18 +8,20 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_BASE_CAPTURER_PIPEWIRE_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_BASE_CAPTURER_PIPEWIRE_H_ #include #define typeof __typeof__ #include #include #include +#include + #include "absl/types/optional.h" #include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capturer.h" -#include "modules/desktop_capture/linux/egl_dmabuf.h" +#include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" #include "rtc_base/constructor_magic.h" #include "rtc_base/synchronization/mutex.h" @@ -80,7 +82,7 @@ class BaseCapturerPipeWire : public DesktopCapturer { GDBusConnection* connection_ = nullptr; GDBusProxy* proxy_ = nullptr; - GCancellable *cancellable_ = nullptr; + GCancellable* cancellable_ = nullptr; gchar* portal_handle_ = nullptr; gchar* session_handle_ = nullptr; gchar* sources_handle_ = nullptr; @@ -138,7 +140,7 @@ class BaseCapturerPipeWire : public DesktopCapturer { const gchar* token); void SessionRequest(); - static void OnSessionRequested(GDBusProxy *proxy, + static void OnSessionRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data); static void OnSessionRequestResponseSignal(GDBusConnection* connection, @@ -150,7 +152,7 @@ class BaseCapturerPipeWire : public DesktopCapturer { gpointer user_data); void SourcesRequest(); - static void OnSourcesRequested(GDBusProxy *proxy, + static void OnSourcesRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data); static void OnSourcesRequestResponseSignal(GDBusConnection* connection, @@ -162,7 +164,7 @@ class BaseCapturerPipeWire : public DesktopCapturer { gpointer user_data); void StartRequest(); - static void OnStartRequested(GDBusProxy *proxy, + static void OnStartRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data); static void OnStartRequestResponseSignal(GDBusConnection* connection, @@ -174,7 +176,7 @@ class BaseCapturerPipeWire : public DesktopCapturer { gpointer user_data); void OpenPipeWireRemote(); - static void OnOpenPipeWireRemoteRequested(GDBusProxy *proxy, + static void OnOpenPipeWireRemoteRequested(GDBusProxy* proxy, GAsyncResult* result, gpointer user_data); @@ -183,4 +185,4 @@ class BaseCapturerPipeWire : public DesktopCapturer { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_BASE_CAPTURER_PIPEWIRE_H_ diff --git a/modules/desktop_capture/linux/drm.sigs b/modules/desktop_capture/linux/wayland/drm.sigs similarity index 100% rename from modules/desktop_capture/linux/drm.sigs rename to modules/desktop_capture/linux/wayland/drm.sigs diff --git a/modules/desktop_capture/linux/egl_dmabuf.cc b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc similarity index 99% rename from modules/desktop_capture/linux/egl_dmabuf.cc rename to modules/desktop_capture/linux/wayland/egl_dmabuf.cc index 7e464a1e88..e872636d04 100644 --- a/modules/desktop_capture/linux/egl_dmabuf.cc +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/egl_dmabuf.h" +#include "modules/desktop_capture/linux/wayland/egl_dmabuf.h" #include #include diff --git a/modules/desktop_capture/linux/egl_dmabuf.h b/modules/desktop_capture/linux/wayland/egl_dmabuf.h similarity index 89% rename from modules/desktop_capture/linux/egl_dmabuf.h rename to modules/desktop_capture/linux/wayland/egl_dmabuf.h index 9d7309f562..bc512a3e66 100644 --- a/modules/desktop_capture/linux/egl_dmabuf.h +++ b/modules/desktop_capture/linux/wayland/egl_dmabuf.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_EGL_DMABUF_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_EGL_DMABUF_H_ #include #include @@ -62,4 +62,4 @@ class EglDmaBuf { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_WAYLAND_EGL_DMABUF_H_ diff --git a/modules/desktop_capture/linux/pipewire.sigs b/modules/desktop_capture/linux/wayland/pipewire.sigs similarity index 100% rename from modules/desktop_capture/linux/pipewire.sigs rename to modules/desktop_capture/linux/wayland/pipewire.sigs diff --git a/modules/desktop_capture/linux/pipewire_stub_header.fragment b/modules/desktop_capture/linux/wayland/pipewire_stub_header.fragment similarity index 100% rename from modules/desktop_capture/linux/pipewire_stub_header.fragment rename to modules/desktop_capture/linux/wayland/pipewire_stub_header.fragment diff --git a/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc b/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc similarity index 97% rename from modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc rename to modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc index 761d428f42..0f4be547e9 100644 --- a/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc +++ b/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" +#include "modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h" #include #include @@ -23,7 +23,7 @@ #include "modules/desktop_capture/desktop_capture_types.h" #include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_geometry.h" -#include "modules/desktop_capture/linux/x_error_trap.h" +#include "modules/desktop_capture/linux/x11/x_error_trap.h" #include "modules/desktop_capture/mouse_cursor.h" #include "modules/desktop_capture/mouse_cursor_monitor.h" #include "rtc_base/checks.h" @@ -208,7 +208,7 @@ void MouseCursorMonitorX11::CaptureCursor() { new BasicDesktopFrame(DesktopSize(img->width, img->height))); // Xlib stores 32-bit data in longs, even if longs are 64-bits long. - unsigned long* src = img->pixels; + unsigned long* src = img->pixels; // NOLINT(runtime/int) uint32_t* dst = reinterpret_cast(image->data()); uint32_t* dst_end = dst + (img->width * img->height); while (dst < dst_end) { diff --git a/modules/desktop_capture/linux/mouse_cursor_monitor_x11.h b/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h similarity index 87% rename from modules/desktop_capture/linux/mouse_cursor_monitor_x11.h rename to modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h index c34eaf468e..980d254a0a 100644 --- a/modules/desktop_capture/linux/mouse_cursor_monitor_x11.h +++ b/modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_X11_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_X11_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_MOUSE_CURSOR_MONITOR_X11_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_MOUSE_CURSOR_MONITOR_X11_H_ #include @@ -18,7 +18,7 @@ #include "api/scoped_refptr.h" #include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capture_types.h" -#include "modules/desktop_capture/linux/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" #include "modules/desktop_capture/mouse_cursor.h" #include "modules/desktop_capture/mouse_cursor_monitor.h" @@ -65,4 +65,4 @@ class MouseCursorMonitorX11 : public MouseCursorMonitor, } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_MOUSE_CURSOR_MONITOR_X11_H_ diff --git a/modules/desktop_capture/linux/screen_capturer_x11.cc b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc similarity index 99% rename from modules/desktop_capture/linux/screen_capturer_x11.cc rename to modules/desktop_capture/linux/x11/screen_capturer_x11.cc index c601a2afb8..2de387578e 100644 --- a/modules/desktop_capture/linux/screen_capturer_x11.cc +++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/screen_capturer_x11.h" +#include "modules/desktop_capture/linux/x11/screen_capturer_x11.h" #include #include @@ -25,7 +25,7 @@ #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/linux/x_server_pixel_buffer.h" +#include "modules/desktop_capture/linux/x11/x_server_pixel_buffer.h" #include "modules/desktop_capture/screen_capture_frame_queue.h" #include "modules/desktop_capture/screen_capturer_helper.h" #include "modules/desktop_capture/shared_desktop_frame.h" diff --git a/modules/desktop_capture/linux/screen_capturer_x11.h b/modules/desktop_capture/linux/x11/screen_capturer_x11.h similarity index 92% rename from modules/desktop_capture/linux/screen_capturer_x11.h rename to modules/desktop_capture/linux/x11/screen_capturer_x11.h index c98b9fbf97..ebf18a451b 100644 --- a/modules/desktop_capture/linux/screen_capturer_x11.h +++ b/modules/desktop_capture/linux/x11/screen_capturer_x11.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_X11_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_X11_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_SCREEN_CAPTURER_X11_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_SCREEN_CAPTURER_X11_H_ #include #include @@ -23,9 +23,9 @@ #include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_region.h" -#include "modules/desktop_capture/linux/shared_x_display.h" -#include "modules/desktop_capture/linux/x_atom_cache.h" -#include "modules/desktop_capture/linux/x_server_pixel_buffer.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/x_atom_cache.h" +#include "modules/desktop_capture/linux/x11/x_server_pixel_buffer.h" #include "modules/desktop_capture/screen_capture_frame_queue.h" #include "modules/desktop_capture/screen_capturer_helper.h" #include "modules/desktop_capture/shared_desktop_frame.h" @@ -144,4 +144,4 @@ class ScreenCapturerX11 : public DesktopCapturer, } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_SCREEN_CAPTURER_X11_H_ diff --git a/modules/desktop_capture/linux/shared_x_display.cc b/modules/desktop_capture/linux/x11/shared_x_display.cc similarity index 97% rename from modules/desktop_capture/linux/shared_x_display.cc rename to modules/desktop_capture/linux/x11/shared_x_display.cc index 3133134a70..ca084d4bf5 100644 --- a/modules/desktop_capture/linux/shared_x_display.cc +++ b/modules/desktop_capture/linux/x11/shared_x_display.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" #include #include diff --git a/modules/desktop_capture/linux/x11/shared_x_display.h b/modules/desktop_capture/linux/x11/shared_x_display.h new file mode 100644 index 0000000000..13e1c8d2d5 --- /dev/null +++ b/modules/desktop_capture/linux/x11/shared_x_display.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_SHARED_X_DISPLAY_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_SHARED_X_DISPLAY_H_ + +#include +#include +#include + +#include "api/ref_counted_base.h" +#include "api/scoped_refptr.h" +#include "rtc_base/constructor_magic.h" +#include "rtc_base/system/rtc_export.h" + +// Including Xlib.h will involve evil defines (Bool, Status, True, False), which +// easily conflict with other headers. +typedef struct _XDisplay Display; +typedef union _XEvent XEvent; + +namespace webrtc { + +// A ref-counted object to store XDisplay connection. +class RTC_EXPORT SharedXDisplay + : public rtc::RefCountedNonVirtual { + public: + class XEventHandler { + public: + virtual ~XEventHandler() {} + + // Processes XEvent. Returns true if the event has been handled. + virtual bool HandleXEvent(const XEvent& event) = 0; + }; + + // Creates a new X11 Display for the `display_name`. NULL is returned if X11 + // connection failed. Equivalent to CreateDefault() when `display_name` is + // empty. + static rtc::scoped_refptr Create( + const std::string& display_name); + + // Creates X11 Display connection for the default display (e.g. specified in + // DISPLAY). NULL is returned if X11 connection failed. + static rtc::scoped_refptr CreateDefault(); + + Display* display() { return display_; } + + // Adds a new event `handler` for XEvent's of `type`. + void AddEventHandler(int type, XEventHandler* handler); + + // Removes event `handler` added using `AddEventHandler`. Doesn't do anything + // if `handler` is not registered. + void RemoveEventHandler(int type, XEventHandler* handler); + + // Processes pending XEvents, calling corresponding event handlers. + void ProcessPendingXEvents(); + + void IgnoreXServerGrabs(); + + ~SharedXDisplay(); + + protected: + // Takes ownership of `display`. + explicit SharedXDisplay(Display* display); + + private: + typedef std::map > EventHandlersMap; + + Display* display_; + + EventHandlersMap event_handlers_; + + RTC_DISALLOW_COPY_AND_ASSIGN(SharedXDisplay); +}; + +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_SHARED_X_DISPLAY_H_ diff --git a/modules/desktop_capture/linux/window_capturer_x11.cc b/modules/desktop_capture/linux/x11/window_capturer_x11.cc similarity index 96% rename from modules/desktop_capture/linux/window_capturer_x11.cc rename to modules/desktop_capture/linux/x11/window_capturer_x11.cc index 94f9f92c81..5b87e8cbd3 100644 --- a/modules/desktop_capture/linux/window_capturer_x11.cc +++ b/modules/desktop_capture/linux/x11/window_capturer_x11.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/window_capturer_x11.h" +#include "modules/desktop_capture/linux/x11/window_capturer_x11.h" #include #include @@ -23,9 +23,9 @@ #include "modules/desktop_capture/desktop_capture_types.h" #include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_region.h" -#include "modules/desktop_capture/linux/shared_x_display.h" -#include "modules/desktop_capture/linux/window_finder_x11.h" -#include "modules/desktop_capture/linux/window_list_utils.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/window_finder_x11.h" +#include "modules/desktop_capture/linux/x11/window_list_utils.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" #include "rtc_base/trace_event.h" diff --git a/modules/desktop_capture/linux/window_capturer_x11.h b/modules/desktop_capture/linux/x11/window_capturer_x11.h similarity index 81% rename from modules/desktop_capture/linux/window_capturer_x11.h rename to modules/desktop_capture/linux/x11/window_capturer_x11.h index d8a085f366..f15b1474e0 100644 --- a/modules/desktop_capture/linux/window_capturer_x11.h +++ b/modules/desktop_capture/linux/x11/window_capturer_x11.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_X11_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_X11_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_CAPTURER_X11_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_CAPTURER_X11_H_ #include #include @@ -21,10 +21,10 @@ #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/linux/shared_x_display.h" -#include "modules/desktop_capture/linux/window_finder_x11.h" -#include "modules/desktop_capture/linux/x_atom_cache.h" -#include "modules/desktop_capture/linux/x_server_pixel_buffer.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/window_finder_x11.h" +#include "modules/desktop_capture/linux/x11/x_atom_cache.h" +#include "modules/desktop_capture/linux/x11/x_server_pixel_buffer.h" #include "rtc_base/constructor_magic.h" namespace webrtc { @@ -71,4 +71,4 @@ class WindowCapturerX11 : public DesktopCapturer, } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_CAPTURER_X11_H_ diff --git a/modules/desktop_capture/linux/window_finder_x11.cc b/modules/desktop_capture/linux/x11/window_finder_x11.cc similarity index 90% rename from modules/desktop_capture/linux/window_finder_x11.cc rename to modules/desktop_capture/linux/x11/window_finder_x11.cc index 16fb3252ad..dec17ab51f 100644 --- a/modules/desktop_capture/linux/window_finder_x11.cc +++ b/modules/desktop_capture/linux/x11/window_finder_x11.cc @@ -8,13 +8,13 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/window_finder_x11.h" +#include "modules/desktop_capture/linux/x11/window_finder_x11.h" #include #include -#include "modules/desktop_capture/linux/window_list_utils.h" +#include "modules/desktop_capture/linux/x11/window_list_utils.h" #include "rtc_base/checks.h" namespace webrtc { diff --git a/modules/desktop_capture/linux/window_finder_x11.h b/modules/desktop_capture/linux/x11/window_finder_x11.h similarity index 81% rename from modules/desktop_capture/linux/window_finder_x11.h rename to modules/desktop_capture/linux/x11/window_finder_x11.h index d0bba8697b..91de876417 100644 --- a/modules/desktop_capture/linux/window_finder_x11.h +++ b/modules/desktop_capture/linux/x11/window_finder_x11.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_FINDER_X11_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_FINDER_X11_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_FINDER_X11_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_FINDER_X11_H_ #include "modules/desktop_capture/window_finder.h" @@ -32,4 +32,4 @@ class WindowFinderX11 final : public WindowFinder { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_FINDER_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_FINDER_X11_H_ diff --git a/modules/desktop_capture/linux/window_list_utils.cc b/modules/desktop_capture/linux/x11/window_list_utils.cc similarity index 96% rename from modules/desktop_capture/linux/window_list_utils.cc rename to modules/desktop_capture/linux/x11/window_list_utils.cc index ade92d2be8..a366f9e061 100644 --- a/modules/desktop_capture/linux/window_list_utils.cc +++ b/modules/desktop_capture/linux/x11/window_list_utils.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/window_list_utils.h" +#include "modules/desktop_capture/linux/x11/window_list_utils.h" #include #include @@ -16,8 +16,8 @@ #include -#include "modules/desktop_capture/linux/x_error_trap.h" -#include "modules/desktop_capture/linux/x_window_property.h" +#include "modules/desktop_capture/linux/x11/x_error_trap.h" +#include "modules/desktop_capture/linux/x11/x_window_property.h" #include "rtc_base/checks.h" #include "rtc_base/constructor_magic.h" #include "rtc_base/logging.h" diff --git a/modules/desktop_capture/linux/window_list_utils.h b/modules/desktop_capture/linux/x11/window_list_utils.h similarity index 89% rename from modules/desktop_capture/linux/window_list_utils.h rename to modules/desktop_capture/linux/x11/window_list_utils.h index 3ffd336705..923842df14 100644 --- a/modules/desktop_capture/linux/window_list_utils.h +++ b/modules/desktop_capture/linux/x11/window_list_utils.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_LIST_UTILS_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_LIST_UTILS_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_LIST_UTILS_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_LIST_UTILS_H_ #include #include @@ -17,7 +17,7 @@ #include "api/function_view.h" #include "modules/desktop_capture/desktop_geometry.h" -#include "modules/desktop_capture/linux/x_atom_cache.h" +#include "modules/desktop_capture/linux/x11/x_atom_cache.h" namespace webrtc { @@ -53,4 +53,4 @@ DesktopRect DesktopRectFromXAttributes(const T& attributes) { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_LIST_UTILS_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_WINDOW_LIST_UTILS_H_ diff --git a/modules/desktop_capture/linux/x_atom_cache.cc b/modules/desktop_capture/linux/x11/x_atom_cache.cc similarity index 95% rename from modules/desktop_capture/linux/x_atom_cache.cc rename to modules/desktop_capture/linux/x11/x_atom_cache.cc index 4ea024938e..157ba8b8fd 100644 --- a/modules/desktop_capture/linux/x_atom_cache.cc +++ b/modules/desktop_capture/linux/x11/x_atom_cache.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/x_atom_cache.h" +#include "modules/desktop_capture/linux/x11/x_atom_cache.h" #include "rtc_base/checks.h" diff --git a/modules/desktop_capture/linux/x_atom_cache.h b/modules/desktop_capture/linux/x11/x_atom_cache.h similarity index 85% rename from modules/desktop_capture/linux/x_atom_cache.h rename to modules/desktop_capture/linux/x11/x_atom_cache.h index 0249c15978..39d957e98b 100644 --- a/modules/desktop_capture/linux/x_atom_cache.h +++ b/modules/desktop_capture/linux/x11/x_atom_cache.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X_ATOM_CACHE_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_X_ATOM_CACHE_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_X_ATOM_CACHE_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_X_ATOM_CACHE_H_ #include #include @@ -42,4 +42,4 @@ class XAtomCache final { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_X_ATOM_CACHE_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_X_ATOM_CACHE_H_ diff --git a/modules/desktop_capture/linux/x_error_trap.cc b/modules/desktop_capture/linux/x11/x_error_trap.cc similarity index 96% rename from modules/desktop_capture/linux/x_error_trap.cc rename to modules/desktop_capture/linux/x11/x_error_trap.cc index 13233d8274..f31565e24b 100644 --- a/modules/desktop_capture/linux/x_error_trap.cc +++ b/modules/desktop_capture/linux/x11/x_error_trap.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/x_error_trap.h" +#include "modules/desktop_capture/linux/x11/x_error_trap.h" #include diff --git a/modules/desktop_capture/linux/x_error_trap.h b/modules/desktop_capture/linux/x11/x_error_trap.h similarity index 84% rename from modules/desktop_capture/linux/x_error_trap.h rename to modules/desktop_capture/linux/x11/x_error_trap.h index 1fb0fdcc92..ceb660ccbd 100644 --- a/modules/desktop_capture/linux/x_error_trap.h +++ b/modules/desktop_capture/linux/x11/x_error_trap.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X_ERROR_TRAP_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_X_ERROR_TRAP_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_X_ERROR_TRAP_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_X_ERROR_TRAP_H_ #include @@ -36,4 +36,4 @@ class XErrorTrap { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_X_ERROR_TRAP_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_X_ERROR_TRAP_H_ diff --git a/modules/desktop_capture/linux/x_server_pixel_buffer.cc b/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc similarity index 97% rename from modules/desktop_capture/linux/x_server_pixel_buffer.cc rename to modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc index 84b57f1eb7..fd6fc7daf4 100644 --- a/modules/desktop_capture/linux/x_server_pixel_buffer.cc +++ b/modules/desktop_capture/linux/x11/x_server_pixel_buffer.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/x_server_pixel_buffer.h" +#include "modules/desktop_capture/linux/x11/x_server_pixel_buffer.h" #include #include @@ -17,9 +17,9 @@ #include #include "modules/desktop_capture/desktop_frame.h" -#include "modules/desktop_capture/linux/window_list_utils.h" -#include "modules/desktop_capture/linux/x_error_trap.h" -#include "modules/desktop_capture/linux/x_window_property.h" +#include "modules/desktop_capture/linux/x11/window_list_utils.h" +#include "modules/desktop_capture/linux/x11/x_error_trap.h" +#include "modules/desktop_capture/linux/x11/x_window_property.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" diff --git a/modules/desktop_capture/linux/x_server_pixel_buffer.h b/modules/desktop_capture/linux/x11/x_server_pixel_buffer.h similarity index 93% rename from modules/desktop_capture/linux/x_server_pixel_buffer.h rename to modules/desktop_capture/linux/x11/x_server_pixel_buffer.h index aa3f903e0a..84e1de35e5 100644 --- a/modules/desktop_capture/linux/x_server_pixel_buffer.h +++ b/modules/desktop_capture/linux/x11/x_server_pixel_buffer.h @@ -10,8 +10,8 @@ // Don't include this file in any .h files because it pulls in some X headers. -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X_SERVER_PIXEL_BUFFER_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_X_SERVER_PIXEL_BUFFER_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_X_SERVER_PIXEL_BUFFER_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_X_SERVER_PIXEL_BUFFER_H_ #include #include @@ -86,4 +86,4 @@ class XServerPixelBuffer { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_X_SERVER_PIXEL_BUFFER_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_X_SERVER_PIXEL_BUFFER_H_ diff --git a/modules/desktop_capture/linux/x_window_property.cc b/modules/desktop_capture/linux/x11/x_window_property.cc similarity index 95% rename from modules/desktop_capture/linux/x_window_property.cc rename to modules/desktop_capture/linux/x11/x_window_property.cc index ba25deec3d..5e16dac404 100644 --- a/modules/desktop_capture/linux/x_window_property.cc +++ b/modules/desktop_capture/linux/x11/x_window_property.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/desktop_capture/linux/x_window_property.h" +#include "modules/desktop_capture/linux/x11/x_window_property.h" namespace webrtc { diff --git a/modules/desktop_capture/linux/x_window_property.h b/modules/desktop_capture/linux/x11/x_window_property.h similarity index 90% rename from modules/desktop_capture/linux/x_window_property.h rename to modules/desktop_capture/linux/x11/x_window_property.h index ef643b6a8f..71cbf06eb3 100644 --- a/modules/desktop_capture/linux/x_window_property.h +++ b/modules/desktop_capture/linux/x11/x_window_property.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X_WINDOW_PROPERTY_H_ -#define MODULES_DESKTOP_CAPTURE_LINUX_X_WINDOW_PROPERTY_H_ +#ifndef MODULES_DESKTOP_CAPTURE_LINUX_X11_X_WINDOW_PROPERTY_H_ +#define MODULES_DESKTOP_CAPTURE_LINUX_X11_X_WINDOW_PROPERTY_H_ #include #include @@ -60,4 +60,4 @@ class XWindowProperty : public XWindowPropertyBase { } // namespace webrtc -#endif // MODULES_DESKTOP_CAPTURE_LINUX_X_WINDOW_PROPERTY_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_X11_X_WINDOW_PROPERTY_H_ diff --git a/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/modules/desktop_capture/mouse_cursor_monitor_linux.cc index e569f6ef35..87edb40373 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_linux.cc +++ b/modules/desktop_capture/mouse_cursor_monitor_linux.cc @@ -14,7 +14,7 @@ #include "modules/desktop_capture/mouse_cursor_monitor.h" #if defined(WEBRTC_USE_X11) -#include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" +#include "modules/desktop_capture/linux/x11/mouse_cursor_monitor_x11.h" #endif // defined(WEBRTC_USE_X11) namespace webrtc { diff --git a/modules/desktop_capture/screen_capturer_linux.cc b/modules/desktop_capture/screen_capturer_linux.cc index 6cad2acd64..267491aaf9 100644 --- a/modules/desktop_capture/screen_capturer_linux.cc +++ b/modules/desktop_capture/screen_capturer_linux.cc @@ -14,11 +14,11 @@ #include "modules/desktop_capture/desktop_capturer.h" #if defined(WEBRTC_USE_PIPEWIRE) -#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +#include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -#include "modules/desktop_capture/linux/screen_capturer_x11.h" +#include "modules/desktop_capture/linux/x11/screen_capturer_x11.h" #endif // defined(WEBRTC_USE_X11) namespace webrtc { diff --git a/modules/desktop_capture/screen_drawer_linux.cc b/modules/desktop_capture/screen_drawer_linux.cc index 823126548c..fce036b4aa 100644 --- a/modules/desktop_capture/screen_drawer_linux.cc +++ b/modules/desktop_capture/screen_drawer_linux.cc @@ -17,7 +17,7 @@ #include "api/scoped_refptr.h" #include "modules/desktop_capture/desktop_capture_types.h" #include "modules/desktop_capture/desktop_geometry.h" -#include "modules/desktop_capture/linux/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" #include "modules/desktop_capture/rgba_color.h" #include "modules/desktop_capture/screen_drawer.h" #include "modules/desktop_capture/screen_drawer_lock_posix.h" diff --git a/modules/desktop_capture/window_capturer_linux.cc b/modules/desktop_capture/window_capturer_linux.cc index 89ba90d80e..9c0e2bf81a 100644 --- a/modules/desktop_capture/window_capturer_linux.cc +++ b/modules/desktop_capture/window_capturer_linux.cc @@ -14,11 +14,11 @@ #include "modules/desktop_capture/desktop_capturer.h" #if defined(WEBRTC_USE_PIPEWIRE) -#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +#include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h" #endif // defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_X11) -#include "modules/desktop_capture/linux/window_capturer_x11.h" +#include "modules/desktop_capture/linux/x11/window_capturer_x11.h" #endif // defined(WEBRTC_USE_X11) namespace webrtc { diff --git a/modules/desktop_capture/window_finder_unittest.cc b/modules/desktop_capture/window_finder_unittest.cc index 7a586c7361..ac13f124d3 100644 --- a/modules/desktop_capture/window_finder_unittest.cc +++ b/modules/desktop_capture/window_finder_unittest.cc @@ -21,8 +21,8 @@ #include "test/gtest.h" #if defined(WEBRTC_USE_X11) -#include "modules/desktop_capture/linux/shared_x_display.h" -#include "modules/desktop_capture/linux/x_atom_cache.h" +#include "modules/desktop_capture/linux/x11/shared_x_display.h" +#include "modules/desktop_capture/linux/x11/x_atom_cache.h" #endif #if defined(WEBRTC_WIN)