diff options
Diffstat (limited to 'firefox-pipewire.patch')
-rw-r--r-- | firefox-pipewire.patch | 346 |
1 files changed, 154 insertions, 192 deletions
diff --git a/firefox-pipewire.patch b/firefox-pipewire.patch index f4d6c55..362abd4 100644 --- a/firefox-pipewire.patch +++ b/firefox-pipewire.patch @@ -1,13 +1,6 @@ ->From 4709953855a4243ce2d2ec45f63059baf604a499 Mon Sep 17 00:00:00 2001 -From: Jan Grulich <jgrulich@redhat.com> -Date: Thu, 18 Oct 2018 10:25:56 +0200 -Subject: PW support - - -diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild -index 60967bd51..11eb07a65 100644 ---- a/config/system-headers.mozbuild -+++ b/config/system-headers.mozbuild +diff -up firefox-64.0/config/system-headers.mozbuild.firefox-pipewire firefox-64.0/config/system-headers.mozbuild +--- firefox-64.0/config/system-headers.mozbuild.firefox-pipewire 2018-12-04 00:34:00.000000000 +0100 ++++ firefox-64.0/config/system-headers.mozbuild 2018-12-05 13:04:08.828063572 +0100 @@ -314,6 +314,7 @@ system_headers = [ 'Gestalt.h', 'getopt.h', @@ -24,23 +17,9 @@ index 60967bd51..11eb07a65 100644 'pixman.h', 'pk11func.h', 'pk11pqg.h', -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn -index ed12a1521..a9e700ccd 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn -@@ -213,7 +213,6 @@ rtc_static_library("desktop_capture") { - if (build_with_mozilla) { - sources += [ - "app_capturer_x11.cc", -- "app_capturer_x11.h", - "x11/desktop_device_info_x11.cc", - "x11/desktop_device_info_x11.h", - "x11/shared_x_util.cc", -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc -new file mode 100644 -index 000000000..4ac35aa84 ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc.firefox-pipewire 2018-12-05 13:04:08.828063572 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc 2018-12-05 13:04:08.828063572 +0100 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. @@ -97,10 +76,9 @@ index 000000000..4ac35aa84 +} + +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc -index 5a0b1a28f..84a7e5951 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc.firefox-pipewire 2018-12-04 00:34:15.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_null.cc 2018-12-05 13:04:08.829063566 +0100 @@ -7,8 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. @@ -126,7 +104,7 @@ index 5a0b1a28f..84a7e5951 100644 private: Callback* callback_; -@@ -61,7 +63,16 @@ bool AppCapturerNull::BringAppToFront() { +@@ -61,7 +63,16 @@ bool AppCapturerNull::BringAppToFront() return false; } @@ -169,10 +147,9 @@ index 5a0b1a28f..84a7e5951 100644 +#endif // not defined(USE_PIPEWIRE) } // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc -index 821582367..5c20ed0a5 100755 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc 2018-12-05 13:04:08.829063566 +0100 @@ -53,10 +53,13 @@ protected: std::unique_ptr<DesktopFrame> frame_; }; @@ -203,7 +180,7 @@ index 821582367..5c20ed0a5 100755 : callback_(NULL), selected_process_(0), x_display_(options.x_display()) { -@@ -103,7 +105,7 @@ AppCapturerLinux::AppCapturerLinux(const DesktopCaptureOptions& options) +@@ -103,7 +105,7 @@ AppCapturerLinux::AppCapturerLinux(const rgn_background_ = XCreateRegion(); } @@ -260,7 +237,7 @@ index 821582367..5c20ed0a5 100755 XErrorTrap error_trap(GetDisplay()); if (!pDesktopFrame) { -@@ -192,7 +194,7 @@ void AppCapturerLinux::FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFra +@@ -192,7 +194,7 @@ void AppCapturerLinux::FillDesktopFrameR } } @@ -292,11 +269,9 @@ index 821582367..5c20ed0a5 100755 return std::unique_ptr<DesktopCapturer>(std::move(capturer)); } -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc -new file mode 100644 -index 000000000..39c19164d ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc.firefox-pipewire 2018-12-05 13:04:08.832063551 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc 2018-12-05 13:04:08.832063551 +0100 @@ -0,0 +1,849 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1147,11 +1122,9 @@ index 000000000..39c19164d +} + +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h -new file mode 100644 -index 000000000..4577ddf6b ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h.firefox-pipewire 2018-12-05 13:04:08.832063551 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h 2018-12-05 13:04:08.832063551 +0100 @@ -0,0 +1,167 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1320,65 +1293,74 @@ index 000000000..4577ddf6b +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build -index ea1726a51..d72fe8161 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build -@@ -166,10 +166,6 @@ if CONFIG["OS_TARGET"] == "Linux": - ] - - UNIFIED_SOURCES += [ -- "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc", -- "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc", -- "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc", -- "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc", - "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/desktop_device_info_x11.cc", - "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/shared_x_display.cc", - "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/shared_x_util.cc", -@@ -177,6 +173,38 @@ if CONFIG["OS_TARGET"] == "Linux": - "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc" - ] - -+# Common stuff between Pipewire and X11 -+if CONFIG["OS_TARGET"] == "Linux": -+ -+ UNIFIED_SOURCES += [ -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc", -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc", -+ ] -+ -+# Pipewire -+if CONFIG["OS_TARGET"] == "Linux": -+ -+ DEFINES["USE_PIPEWIRE"] = "1" -+ -+ OS_LIBS += [ -+ "rt", -+ "pipewire-0.2", -+ "glib-2.0", -+ "gio-2.0", -+ "gobject-2.0" -+ ] -+ -+ CXXFLAGS += CONFIG['TK_CFLAGS'] -+ -+ UNIFIED_SOURCES += [ -+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc" -+ ] -+ - if CONFIG["OS_TARGET"] == "NetBSD": - - DEFINES["USE_X11"] = "1" -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc -index 7510bde47..9dab1eb50 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc -@@ -66,4 +66,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateAppCapturer( +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn 2018-12-05 13:04:08.828063572 +0100 +@@ -213,7 +213,6 @@ rtc_static_library("desktop_capture") { + if (build_with_mozilla) { + sources += [ + "app_capturer_x11.cc", +- "app_capturer_x11.h", + "x11/desktop_device_info_x11.cc", + "x11/desktop_device_info_x11.h", + "x11/shared_x_util.cc", +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build.firefox-pipewire 2018-12-05 13:04:08.832063551 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_gn/moz.build 2018-12-05 13:12:40.063396138 +0100 +@@ -100,10 +100,6 @@ if CONFIG["OS_TARGET"] == "DragonFly": + ]
+
+ UNIFIED_SOURCES += [
+- "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc",
+- "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc",
+- "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc",
+- "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc",
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/desktop_device_info_x11.cc",
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/shared_x_display.cc",
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/shared_x_util.cc",
+@@ -111,6 +107,38 @@ if CONFIG["OS_TARGET"] == "DragonFly": + "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc"
+ ]
+
++# Common stuff between Pipewire and X11
++if CONFIG["OS_TARGET"] == "Linux":
++
++ UNIFIED_SOURCES += [
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc",
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc",
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc",
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc",
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc",
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc",
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc",
++ ]
++
++# Pipewire
++if CONFIG["OS_TARGET"] == "Linux":
++
++ DEFINES["USE_PIPEWIRE"] = "1"
++
++ OS_LIBS += [
++ "rt",
++ "pipewire-0.2",
++ "glib-2.0",
++ "gio-2.0",
++ "gobject-2.0"
++ ]
++
++ CXXFLAGS += CONFIG['TK_CFLAGS']
++
++ UNIFIED_SOURCES += [
++ "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc"
++ ]
++
+ if CONFIG["OS_TARGET"] == "FreeBSD":
+
+ DEFINES["USE_X11"] = "1"
+diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc 2018-12-05 13:04:08.832063551 +0100 +@@ -66,4 +66,17 @@ std::unique_ptr<DesktopCapturer> Desktop return capturer; } @@ -1396,10 +1378,9 @@ index 7510bde47..9dab1eb50 100644 +#endif + } // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h -index eb84d3c3b..17cacc5dc 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h 2018-12-05 13:04:08.832063551 +0100 @@ -129,6 +129,10 @@ class DesktopCapturer { static std::unique_ptr<DesktopCapturer> CreateAppCapturer( const DesktopCaptureOptions& options); @@ -1411,11 +1392,9 @@ index eb84d3c3b..17cacc5dc 100644 protected: // CroppingWindowCapturer needs to create raw capturers without wrappers, so // the following two functions are protected. -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc -new file mode 100644 -index 000000000..f7aaf3dcd ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.firefox-pipewire 2018-12-05 13:04:08.832063551 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2018-12-05 13:04:08.832063551 +0100 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. @@ -1461,10 +1440,9 @@ index 000000000..f7aaf3dcd +} + +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc -index 3a632cc0d..b70b4e256 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc.firefox-pipewire 2018-12-04 00:34:15.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_null.cc 2018-12-05 13:04:08.832063551 +0100 @@ -14,6 +14,7 @@ namespace webrtc { @@ -1473,18 +1451,17 @@ index 3a632cc0d..b70b4e256 100644 MouseCursorMonitor* MouseCursorMonitor::CreateForWindow( const DesktopCaptureOptions& options, WindowId window) { -@@ -25,5 +26,6 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( +@@ -25,5 +26,6 @@ MouseCursorMonitor* MouseCursorMonitor:: ScreenId screen) { return NULL; } +#endif // not defined(USE_PIPEWIRE) } // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc -index 2dcad5b38..a8397f1ec 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc -@@ -69,6 +69,9 @@ class MouseCursorMonitorX11 : public MouseCursorMonitor, +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc 2018-12-05 13:04:08.832063551 +0100 +@@ -69,6 +69,9 @@ class MouseCursorMonitorX11 : public Mou void Stop() override; void Capture() override; @@ -1494,7 +1471,7 @@ index 2dcad5b38..a8397f1ec 100644 private: // SharedXDisplay::XEventHandler interface. bool HandleXEvent(const XEvent& event) override; -@@ -244,7 +247,7 @@ void MouseCursorMonitorX11::CaptureCursor() { +@@ -244,7 +247,7 @@ void MouseCursorMonitorX11::CaptureCurso } // static @@ -1503,7 +1480,7 @@ index 2dcad5b38..a8397f1ec 100644 const DesktopCaptureOptions& options, WindowId window) { if (!options.x_display()) return NULL; -@@ -254,7 +257,7 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForWindow( +@@ -254,7 +257,7 @@ MouseCursorMonitor* MouseCursorMonitor:: return new MouseCursorMonitorX11(options, outer_window, window); } @@ -1512,11 +1489,9 @@ index 2dcad5b38..a8397f1ec 100644 const DesktopCaptureOptions& options, ScreenId screen) { if (!options.x_display()) -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc -new file mode 100644 -index 000000000..43c4098e2 ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire 2018-12-05 13:04:08.833063546 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2018-12-05 13:04:08.833063546 +0100 @@ -0,0 +1,40 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1558,11 +1533,9 @@ index 000000000..43c4098e2 +} + +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc -new file mode 100644 -index 000000000..b506c562f ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc.firefox-pipewire 2018-12-05 13:04:08.833063546 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc 2018-12-05 13:04:08.833063546 +0100 @@ -0,0 +1,31 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1595,11 +1568,9 @@ index 000000000..b506c562f +} + +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h -new file mode 100644 -index 000000000..23cc3a53d ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h.firefox-pipewire 2018-12-05 13:04:08.833063546 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h 2018-12-05 13:04:08.833063546 +0100 @@ -0,0 +1,33 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1634,10 +1605,9 @@ index 000000000..23cc3a53d +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc -index 7692f8b70..ba1378534 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc 2018-12-05 13:04:08.833063546 +0100 @@ -34,18 +34,20 @@ namespace webrtc { namespace { @@ -1663,7 +1633,7 @@ index 7692f8b70..ba1378534 100644 // TODO(ajwong): Do we really want this to be synchronous? bool Init(const DesktopCaptureOptions& options); -@@ -118,14 +120,13 @@ class ScreenCapturerLinux : public DesktopCapturer, +@@ -118,14 +120,13 @@ class ScreenCapturerLinux : public Deskt // current with the last buffer used. DesktopRegion last_invalid_region_; @@ -1681,7 +1651,7 @@ index 7692f8b70..ba1378534 100644 options_.x_display()->RemoveEventHandler(ConfigureNotify, this); if (use_damage_) { options_.x_display()->RemoveEventHandler( -@@ -134,7 +135,7 @@ ScreenCapturerLinux::~ScreenCapturerLinux() { +@@ -134,7 +135,7 @@ ScreenCapturerLinux::~ScreenCapturerLinu DeinitXlib(); } @@ -1690,7 +1660,7 @@ index 7692f8b70..ba1378534 100644 options_ = options; root_window_ = RootWindow(display(), DefaultScreen(display())); -@@ -177,7 +178,7 @@ bool ScreenCapturerLinux::Init(const DesktopCaptureOptions& options) { +@@ -177,7 +178,7 @@ bool ScreenCapturerLinux::Init(const Des return true; } @@ -1699,7 +1669,7 @@ index 7692f8b70..ba1378534 100644 // Our use of XDamage requires XFixes. if (!has_xfixes_) { return; -@@ -218,18 +219,18 @@ void ScreenCapturerLinux::InitXDamage() { +@@ -218,18 +219,18 @@ void ScreenCapturerLinux::InitXDamage() LOG(LS_INFO) << "Using XDamage extension."; } @@ -1721,7 +1691,7 @@ index 7692f8b70..ba1378534 100644 int64_t capture_start_time_nanos = rtc::TimeNanos(); queue_.MoveToNextFrame(); -@@ -243,6 +244,7 @@ void ScreenCapturerLinux::CaptureFrame() { +@@ -243,6 +244,7 @@ void ScreenCapturerLinux::CaptureFrame() // in a good shape. if (!x_server_pixel_buffer_.is_initialized()) { // We failed to initialize pixel buffer. @@ -1729,7 +1699,7 @@ index 7692f8b70..ba1378534 100644 callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); return; } -@@ -258,6 +260,7 @@ void ScreenCapturerLinux::CaptureFrame() { +@@ -258,6 +260,7 @@ void ScreenCapturerLinux::CaptureFrame() std::unique_ptr<DesktopFrame> result = CaptureScreen(); if (!result) { @@ -1737,7 +1707,7 @@ index 7692f8b70..ba1378534 100644 callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); return; } -@@ -268,19 +271,19 @@ void ScreenCapturerLinux::CaptureFrame() { +@@ -268,19 +271,19 @@ void ScreenCapturerLinux::CaptureFrame() callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); } @@ -1760,7 +1730,7 @@ index 7692f8b70..ba1378534 100644 if (use_damage_ && (event.type == damage_event_base_ + XDamageNotify)) { const XDamageNotifyEvent* damage_event = reinterpret_cast<const XDamageNotifyEvent*>(&event); -@@ -295,7 +298,7 @@ bool ScreenCapturerLinux::HandleXEvent(const XEvent& event) { +@@ -295,7 +298,7 @@ bool ScreenCapturerLinux::HandleXEvent(c return false; } @@ -1769,7 +1739,7 @@ index 7692f8b70..ba1378534 100644 std::unique_ptr<SharedDesktopFrame> frame = queue_.current_frame()->Share(); RTC_DCHECK(x_server_pixel_buffer_.window_size().equals(frame->size())); -@@ -345,25 +348,26 @@ std::unique_ptr<DesktopFrame> ScreenCapturerLinux::CaptureScreen() { +@@ -345,25 +348,26 @@ std::unique_ptr<DesktopFrame> ScreenCapt // Doing full-screen polling, or this is the first capture after a // screen-resolution change. In either case, need a full-screen capture. DesktopRect screen_rect = DesktopRect::MakeSize(frame->size()); @@ -1800,7 +1770,7 @@ index 7692f8b70..ba1378534 100644 // Synchronize the current buffer with the previous one since we do not // capture the entire desktop. Note that encoder may be reading from the // previous buffer at this time so thread access complaints are false -@@ -383,7 +387,7 @@ void ScreenCapturerLinux::SynchronizeFrame() { +@@ -383,7 +387,7 @@ void ScreenCapturerLinux::SynchronizeFra } } @@ -1830,11 +1800,9 @@ index 7692f8b70..ba1378534 100644 } } // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc -new file mode 100644 -index 000000000..284ccdb7b ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire 2018-12-05 13:04:08.833063546 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2018-12-05 13:04:08.833063546 +0100 @@ -0,0 +1,40 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1876,11 +1844,10 @@ index 000000000..284ccdb7b +} + +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc -index 0f0159bb5..f6ef0639a 100755 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc -@@ -67,10 +67,12 @@ void WindowCapturerNull::CaptureFrame() { +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_null.cc 2018-12-05 13:04:08.833063546 +0100 +@@ -67,10 +67,12 @@ void WindowCapturerNull::CaptureFrame() } // namespace @@ -1893,11 +1860,9 @@ index 0f0159bb5..f6ef0639a 100755 +#endif // not defined(USE_PIPEWIRE) } // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc -new file mode 100644 -index 000000000..4f97e6ac2 ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc.firefox-pipewire 2018-12-05 13:04:08.833063546 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc 2018-12-05 13:04:08.833063546 +0100 @@ -0,0 +1,28 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1927,11 +1892,9 @@ index 000000000..4f97e6ac2 + return std::move(capturer); +} +} // namespace webrtc -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h -new file mode 100644 -index 000000000..e04bc7151 ---- /dev/null -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h.firefox-pipewire 2018-12-05 13:04:08.833063546 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h 2018-12-05 13:04:08.833063546 +0100 @@ -0,0 +1,33 @@ +/* + * Copyright 2018 The WebRTC project authors. All Rights Reserved. @@ -1966,10 +1929,9 @@ index 000000000..e04bc7151 +} // namespace webrtc + +#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ -diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc -index fecb329db..d478604aa 100644 ---- a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc -+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc +diff -up firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc.firefox-pipewire firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc +--- firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc.firefox-pipewire 2018-12-04 00:34:14.000000000 +0100 ++++ firefox-64.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc 2018-12-05 13:04:08.833063546 +0100 @@ -32,11 +32,13 @@ namespace webrtc { namespace { @@ -1987,7 +1949,7 @@ index fecb329db..d478604aa 100644 // DesktopCapturer interface. void Start(Callback* callback) override; -@@ -78,10 +80,10 @@ class WindowCapturerLinux : public DesktopCapturer, +@@ -78,10 +80,10 @@ class WindowCapturerLinux : public Deskt ::Window selected_window_ = 0; XServerPixelBuffer x_server_pixel_buffer_; @@ -2000,7 +1962,7 @@ index fecb329db..d478604aa 100644 : x_display_(options.x_display()) { // Create Atoms so we don't need to do it every time they are used. wm_state_atom_ = XInternAtom(display(), "WM_STATE", True); -@@ -102,11 +104,11 @@ WindowCapturerLinux::WindowCapturerLinux(const DesktopCaptureOptions& options) +@@ -102,11 +104,11 @@ WindowCapturerLinux::WindowCapturerLinux x_display_->AddEventHandler(ConfigureNotify, this); } @@ -2014,7 +1976,7 @@ index fecb329db..d478604aa 100644 SourceList result; XErrorTrap error_trap(display()); -@@ -159,7 +161,7 @@ bool WindowCapturerLinux::GetSourceList(SourceList* sources) { +@@ -159,7 +161,7 @@ bool WindowCapturerLinux::GetSourceList( return true; } @@ -2023,7 +1985,7 @@ index fecb329db..d478604aa 100644 if (!x_server_pixel_buffer_.Init(display(), id)) return false; -@@ -180,7 +182,7 @@ bool WindowCapturerLinux::SelectSource(SourceId id) { +@@ -180,7 +182,7 @@ bool WindowCapturerLinux::SelectSource(S return true; } @@ -2032,7 +1994,7 @@ index fecb329db..d478604aa 100644 if (!selected_window_) return false; -@@ -229,18 +231,18 @@ bool WindowCapturerLinux::FocusOnSelectedSource() { +@@ -229,18 +231,18 @@ bool WindowCapturerLinux::FocusOnSelecte return true; } @@ -2054,7 +2016,7 @@ index fecb329db..d478604aa 100644 x_display_->ProcessPendingXEvents(); if (!x_server_pixel_buffer_.IsWindowValid()) { -@@ -274,7 +276,7 @@ void WindowCapturerLinux::CaptureFrame() { +@@ -274,7 +276,7 @@ void WindowCapturerLinux::CaptureFrame() callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); } @@ -2063,7 +2025,7 @@ index fecb329db..d478604aa 100644 if (event.type == ConfigureNotify) { XConfigureEvent xce = event.xconfigure; if (!DesktopSize(xce.width, xce.height).equals( -@@ -288,7 +290,7 @@ bool WindowCapturerLinux::HandleXEvent(const XEvent& event) { +@@ -288,7 +290,7 @@ bool WindowCapturerLinux::HandleXEvent(c return false; } @@ -2072,7 +2034,7 @@ index fecb329db..d478604aa 100644 // Get WM_STATE property of the window. XWindowProperty<uint32_t> window_state(display(), window, wm_state_atom_); -@@ -326,7 +328,7 @@ bool WindowCapturerLinux::HandleXEvent(const XEvent& event) { +@@ -326,7 +328,7 @@ bool WindowCapturerLinux::HandleXEvent(c return app_window; } @@ -2081,7 +2043,7 @@ index fecb329db..d478604aa 100644 if (window == 0) return false; -@@ -361,7 +363,7 @@ bool WindowCapturerLinux::IsDesktopElement(::Window window) { +@@ -361,7 +363,7 @@ bool WindowCapturerLinux::IsDesktopEleme return result; } @@ -2090,7 +2052,7 @@ index fecb329db..d478604aa 100644 int status; bool result = false; XTextProperty window_name; -@@ -392,7 +394,7 @@ bool WindowCapturerLinux::GetWindowTitle(::Window window, std::string* title) { +@@ -392,7 +394,7 @@ bool WindowCapturerLinux::GetWindowTitle } // namespace @@ -2099,7 +2061,7 @@ index fecb329db..d478604aa 100644 // Get _NET_WM_PID property of the window. Atom process_atom = XInternAtom(display(), "_NET_WM_PID", True); XWindowProperty<uint32_t> process_id(display(), window, process_atom); -@@ -401,11 +403,11 @@ int WindowCapturerLinux::GetWindowProcessID(::Window window) { +@@ -401,11 +403,11 @@ int WindowCapturerLinux::GetWindowProces } // static |