Rebase and apply the PipeWire patch

This commit is contained in:
Tomas Popela 2019-03-13 09:21:33 +01:00
parent bc42e3d624
commit 69d7077952
2 changed files with 112 additions and 174 deletions

View File

@ -1,7 +1,6 @@
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild diff -up firefox-66.0/config/system-headers.mozbuild.firefox-pipewire firefox-66.0/config/system-headers.mozbuild
index b257e6f8e3..aa58a7fe58 100644 --- firefox-66.0/config/system-headers.mozbuild.firefox-pipewire 2019-03-12 01:22:15.000000000 +0100
--- a/config/system-headers.mozbuild +++ firefox-66.0/config/system-headers.mozbuild 2019-03-12 15:27:37.675285710 +0100
+++ b/config/system-headers.mozbuild
@@ -314,6 +314,7 @@ system_headers = [ @@ -314,6 +314,7 @@ system_headers = [
'Gestalt.h', 'Gestalt.h',
'getopt.h', 'getopt.h',
@ -18,11 +17,9 @@ index b257e6f8e3..aa58a7fe58 100644
'pixman.h', 'pixman.h',
'pk11func.h', 'pk11func.h',
'pk11pqg.h', 'pk11pqg.h',
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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc.firefox-pipewire 2019-03-12 15:27:37.675285710 +0100
index 0000000000..508b695540 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc 2019-03-12 15:27:37.675285710 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
+/* +/*
+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
@ -63,10 +60,9 @@ index 0000000000..508b695540
+} +}
+ +
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc
index 5cbd143556..95d816f973 100755 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc.firefox-pipewire 2019-03-12 01:22:20.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc 2019-03-12 15:27:37.675285710 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc
@@ -7,9 +7,6 @@ @@ -7,9 +7,6 @@
* in the file PATENTS. All contributing project authors may * in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
@ -77,7 +73,7 @@ index 5cbd143556..95d816f973 100755
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
@@ -21,80 +18,18 @@ @@ -21,79 +18,18 @@
#include <algorithm> #include <algorithm>
@ -127,7 +123,6 @@ index 5cbd143556..95d816f973 100755
- -
- // DesktopCapturer interface. - // DesktopCapturer interface.
- virtual void Start(Callback* callback) override; - virtual void Start(Callback* callback) override;
- virtual void Stop() override;
- virtual void CaptureFrame() override; - virtual void CaptureFrame() override;
- virtual bool SelectSource(SourceId id) override - virtual bool SelectSource(SourceId id) override
- { - {
@ -161,7 +156,7 @@ index 5cbd143556..95d816f973 100755
: callback_(NULL), : callback_(NULL),
selected_process_(0), selected_process_(0),
x_display_(options.x_display()) { x_display_(options.x_display()) {
@@ -103,7 +38,7 @@ AppCapturerLinux::AppCapturerLinux(const DesktopCaptureOptions& options) @@ -102,7 +38,7 @@ AppCapturerLinux::AppCapturerLinux(const
rgn_background_ = XCreateRegion(); rgn_background_ = XCreateRegion();
} }
@ -170,7 +165,7 @@ index 5cbd143556..95d816f973 100755
if (rgn_mask_) { if (rgn_mask_) {
XDestroyRegion(rgn_mask_); XDestroyRegion(rgn_mask_);
} }
@@ -116,32 +51,32 @@ AppCapturerLinux::~AppCapturerLinux() { @@ -115,28 +51,28 @@ AppCapturerLinux::~AppCapturerLinux() {
} }
// AppCapturer interface. // AppCapturer interface.
@ -199,17 +194,12 @@ index 5cbd143556..95d816f973 100755
callback_ = callback; callback_ = callback;
} }
-void AppCapturerLinux::Stop() {
+void AppCapturerX11::Stop() {
callback_ = NULL;
}
-void AppCapturerLinux::CaptureFrame() { -void AppCapturerLinux::CaptureFrame() {
+void AppCapturerX11::CaptureFrame() { +void AppCapturerX11::CaptureFrame() {
XErrorTrap error_trap(GetDisplay()); XErrorTrap error_trap(GetDisplay());
//Capture screen >> set root window as capture window //Capture screen >> set root window as capture window
@@ -169,7 +104,7 @@ void AppCapturerLinux::CaptureFrame() { @@ -164,7 +100,7 @@ void AppCapturerLinux::CaptureFrame() {
} }
} }
@ -218,7 +208,7 @@ index 5cbd143556..95d816f973 100755
XErrorTrap error_trap(GetDisplay()); XErrorTrap error_trap(GetDisplay());
if (!pDesktopFrame) { if (!pDesktopFrame) {
@@ -192,7 +127,7 @@ void AppCapturerLinux::FillDesktopFrameRegionWithColor(DesktopFrame* pDesktopFra @@ -187,7 +123,7 @@ void AppCapturerLinux::FillDesktopFrameR
} }
} }
@ -227,7 +217,7 @@ index 5cbd143556..95d816f973 100755
XErrorTrap error_trap(GetDisplay()); XErrorTrap error_trap(GetDisplay());
XSubtractRegion(rgn_visual_, rgn_visual_, rgn_visual_); XSubtractRegion(rgn_visual_, rgn_visual_, rgn_visual_);
@@ -269,21 +204,19 @@ bool AppCapturerLinux::UpdateRegions() { @@ -264,21 +200,19 @@ bool AppCapturerLinux::UpdateRegions() {
return true; return true;
} }
@ -253,12 +243,10 @@ index 5cbd143556..95d816f973 100755
return std::unique_ptr<DesktopCapturer>(std::move(capturer)); return std::unique_ptr<DesktopCapturer>(std::move(capturer));
} }
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h.firefox-pipewire 2019-03-12 15:27:37.676285720 +0100
index 0000000000..2b3d0dc0ad +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h 2019-03-12 16:08:04.440031789 +0100
--- /dev/null @@ -0,0 +1,97 @@
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.h
@@ -0,0 +1,98 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
+ * + *
@ -325,7 +313,6 @@ index 0000000000..2b3d0dc0ad
+ +
+ // DesktopCapturer interface. + // DesktopCapturer interface.
+ virtual void Start(Callback* callback) override; + virtual void Start(Callback* callback) override;
+ virtual void Stop() override;
+ virtual void CaptureFrame() override; + virtual void CaptureFrame() override;
+ virtual bool SelectSource(SourceId id) override + virtual bool SelectSource(SourceId id) override
+ { + {
@ -357,11 +344,9 @@ index 0000000000..2b3d0dc0ad
+} // namespace webrtc +} // namespace webrtc
+ +
+#endif // MODULES_DESKTOP_CAPTURE_APP_CAPTURER_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_APP_CAPTURER_X11_H_
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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc.firefox-pipewire 2019-03-12 15:27:37.676285720 +0100
index 0000000000..47350149f4 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc 2019-03-12 15:27:37.676285720 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.cc
@@ -0,0 +1,849 @@ @@ -0,0 +1,849 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -1212,12 +1197,10 @@ index 0000000000..47350149f4
+} +}
+ +
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h.firefox-pipewire 2019-03-12 15:27:37.676285720 +0100
index 0000000000..3841938bd7 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h 2019-03-12 16:08:26.294298896 +0100
--- /dev/null @@ -0,0 +1,166 @@
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/base_capturer_pipewire.h
@@ -0,0 +1,167 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
+ * + *
@ -1258,7 +1241,6 @@ index 0000000000..3841938bd7
+ +
+ // DesktopCapturer interface. + // DesktopCapturer interface.
+ void Start(Callback* delegate) override; + void Start(Callback* delegate) override;
+ void Stop() override { callback_ = nullptr; }
+ void CaptureFrame() override; + void CaptureFrame() override;
+ bool GetSourceList(SourceList* sources) override; + bool GetSourceList(SourceList* sources) override;
+ bool SelectSource(SourceId id) override; + bool SelectSource(SourceId id) override;
@ -1385,10 +1367,9 @@ index 0000000000..3841938bd7
+} // namespace webrtc +} // namespace webrtc
+ +
+#endif // MODULES_DESKTOP_CAPTURE_BASE_CAPTURER_PIPEWIRE_H_ +#endif // MODULES_DESKTOP_CAPTURE_BASE_CAPTURER_PIPEWIRE_H_
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
index e8421fc3d3..6be802e0b4 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.firefox-pipewire 2019-03-12 01:22:20.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2019-03-12 15:27:37.676285720 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
@@ -152,10 +152,10 @@ if CONFIG["OS_TARGET"] == "FreeBSD": @@ -152,10 +152,10 @@ if CONFIG["OS_TARGET"] == "FreeBSD":
"/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc" "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc"
] ]
@ -1401,11 +1382,10 @@ index e8421fc3d3..6be802e0b4 100644
DEFINES["WEBRTC_LINUX"] = True DEFINES["WEBRTC_LINUX"] = True
DEFINES["WEBRTC_POSIX"] = True DEFINES["WEBRTC_POSIX"] = True
DEFINES["_FILE_OFFSET_BITS"] = "64" DEFINES["_FILE_OFFSET_BITS"] = "64"
@@ -174,6 +174,18 @@ if CONFIG["OS_TARGET"] == "Linux": @@ -175,6 +175,18 @@ if CONFIG["OS_TARGET"] == "Linux":
"Xrender"
] ]
+ UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc", + "/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_linux.cc",
+ "/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.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_linux.cc",
@ -1417,9 +1397,10 @@ index e8421fc3d3..6be802e0b4 100644
+ +
+ DEFINES["USE_X11"] = "1" + DEFINES["USE_X11"] = "1"
+ +
UNIFIED_SOURCES += [ + UNIFIED_SOURCES += [
"/media/webrtc/trunk/webrtc/modules/desktop_capture/app_capturer_x11.cc", "/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/mouse_cursor_monitor_x11.cc",
"/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc",
@@ -189,6 +201,27 @@ if CONFIG["OS_TARGET"] == "Linux": @@ -189,6 +201,27 @@ if CONFIG["OS_TARGET"] == "Linux":
"/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc" "/media/webrtc/trunk/webrtc/modules/desktop_capture/x11/x_server_pixel_buffer.cc"
] ]
@ -1448,10 +1429,9 @@ index e8421fc3d3..6be802e0b4 100644
if CONFIG["OS_TARGET"] == "NetBSD": if CONFIG["OS_TARGET"] == "NetBSD":
DEFINES["USE_X11"] = "1" DEFINES["USE_X11"] = "1"
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
index fec5ff0ac5..3e23773549 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h 2019-03-12 15:27:37.677285729 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture_options.h
@@ -113,6 +113,11 @@ class DesktopCaptureOptions { @@ -113,6 +113,11 @@ class DesktopCaptureOptions {
} }
#endif #endif
@ -1474,11 +1454,10 @@ index fec5ff0ac5..3e23773549 100644
}; };
} // namespace webrtc } // namespace webrtc
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc
index 2fe6e4a03e..7575fd22bb 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc 2019-03-12 15:27:37.677285729 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.cc @@ -70,4 +70,17 @@ std::unique_ptr<DesktopCapturer> Desktop
@@ -70,4 +70,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateAppCapturer(
return capturer; return capturer;
} }
@ -1496,11 +1475,10 @@ index 2fe6e4a03e..7575fd22bb 100644
+#endif +#endif
+ +
} // namespace webrtc } // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h
index ad61e044c8..cfabf3e864 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h.firefox-pipewire 2019-03-12 01:22:20.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h 2019-03-12 15:27:37.677285729 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capturer.h @@ -139,6 +139,10 @@ class DesktopCapturer {
@@ -140,6 +140,10 @@ class DesktopCapturer {
static std::unique_ptr<DesktopCapturer> CreateAppCapturer( static std::unique_ptr<DesktopCapturer> CreateAppCapturer(
const DesktopCaptureOptions& options); const DesktopCaptureOptions& options);
@ -1511,11 +1489,9 @@ index ad61e044c8..cfabf3e864 100644
protected: protected:
// CroppingWindowCapturer needs to create raw capturers without wrappers, so // CroppingWindowCapturer needs to create raw capturers without wrappers, so
// the following two functions are protected. // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc.firefox-pipewire 2019-03-12 15:27:37.677285729 +0100
index 0000000000..c3e608b701 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc 2019-03-12 15:27:37.677285729 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+/* +/*
+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
@ -1557,10 +1533,9 @@ index 0000000000..c3e608b701
+} +}
+ +
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc
index 53e808f4ca..e552b5ec4c 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc 2019-03-12 15:27:37.678285739 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.cc
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
@ -1570,7 +1545,7 @@ index 53e808f4ca..e552b5ec4c 100644
#include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capture_options.h"
#include "modules/desktop_capture/desktop_capture_types.h" #include "modules/desktop_capture/desktop_capture_types.h"
#include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_frame.h"
@@ -60,38 +62,6 @@ Window GetTopLevelWindow(Display* display, Window window) { @@ -60,37 +62,6 @@ Window GetTopLevelWindow(Display* displa
namespace webrtc { namespace webrtc {
@ -1581,7 +1556,6 @@ index 53e808f4ca..e552b5ec4c 100644
- ~MouseCursorMonitorX11() override; - ~MouseCursorMonitorX11() override;
- -
- void Init(Callback* callback, Mode mode) override; - void Init(Callback* callback, Mode mode) override;
- void Stop() override;
- void Capture() override; - void Capture() override;
- -
- private: - private:
@ -1609,7 +1583,7 @@ index 53e808f4ca..e552b5ec4c 100644
MouseCursorMonitorX11::MouseCursorMonitorX11( MouseCursorMonitorX11::MouseCursorMonitorX11(
const DesktopCaptureOptions& options, const DesktopCaptureOptions& options,
Window window, Window inner_window) Window window, Window inner_window)
@@ -263,7 +233,7 @@ void MouseCursorMonitorX11::CaptureCursor() { @@ -257,7 +228,7 @@ void MouseCursorMonitorX11::CaptureCurso
} }
// static // static
@ -1618,7 +1592,7 @@ index 53e808f4ca..e552b5ec4c 100644
const DesktopCaptureOptions& options, WindowId window) { const DesktopCaptureOptions& options, WindowId window) {
if (!options.x_display()) if (!options.x_display())
return NULL; return NULL;
@@ -273,7 +243,7 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForWindow( @@ -267,7 +238,7 @@ MouseCursorMonitor* MouseCursorMonitor::
return new MouseCursorMonitorX11(options, outer_window, window); return new MouseCursorMonitorX11(options, outer_window, window);
} }
@ -1627,12 +1601,10 @@ index 53e808f4ca..e552b5ec4c 100644
const DesktopCaptureOptions& options, const DesktopCaptureOptions& options,
ScreenId screen) { ScreenId screen) {
if (!options.x_display()) if (!options.x_display())
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h.firefox-pipewire 2019-03-12 15:27:37.678285739 +0100
index 0000000000..1e164be38b +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h 2019-03-13 08:06:28.525517995 +0100
--- /dev/null @@ -0,0 +1,62 @@
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/mouse_cursor_monitor_x11.h
@@ -0,0 +1,63 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
+ * + *
@ -1665,7 +1637,6 @@ index 0000000000..1e164be38b
+ ~MouseCursorMonitorX11() override; + ~MouseCursorMonitorX11() override;
+ +
+ void Init(Callback* callback, Mode mode) override; + void Init(Callback* callback, Mode mode) override;
+ void Stop() override;
+ void Capture() override; + void Capture() override;
+ +
+ static MouseCursorMonitor* CreateForWindow(const DesktopCaptureOptions& options, WindowId window); + static MouseCursorMonitor* CreateForWindow(const DesktopCaptureOptions& options, WindowId window);
@ -1696,11 +1667,9 @@ index 0000000000..1e164be38b
+} // namespace webrtc +} // namespace webrtc
+ +
+#endif // MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_MONITOR_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_MOUSE_CURSOR_MONITOR_X11_H_
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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc.firefox-pipewire 2019-03-12 15:27:37.678285739 +0100
index 0000000000..74de2a43df +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc 2019-03-12 15:27:37.678285739 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_linux.cc
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -1742,11 +1711,9 @@ index 0000000000..74de2a43df
+} +}
+ +
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc.firefox-pipewire 2019-03-12 15:27:37.678285739 +0100
index 0000000000..ac48c2e0d7 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc 2019-03-12 15:27:37.678285739 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.cc
@@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -1779,11 +1746,9 @@ index 0000000000..ac48c2e0d7
+} +}
+ +
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h.firefox-pipewire 2019-03-12 15:27:37.679285748 +0100
index 0000000000..05200b36b7 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h 2019-03-12 15:27:37.679285748 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_pipewire.h
@@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -1818,10 +1783,9 @@ index 0000000000..05200b36b7
+} // namespace webrtc +} // namespace webrtc
+ +
+#endif // MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_PIPEWIRE_H_ +#endif // MODULES_DESKTOP_CAPTURE_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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc
index 38810317b1..4379101695 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc 2019-03-12 15:27:37.679285748 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.cc
@@ -19,6 +19,8 @@ @@ -19,6 +19,8 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
@ -1831,7 +1795,7 @@ index 38810317b1..4379101695 100644
#include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capture_options.h"
#include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/desktop_capturer.h"
#include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_frame.h"
@@ -32,100 +34,12 @@ @@ -32,99 +34,12 @@
#include "rtc_base/timeutils.h" #include "rtc_base/timeutils.h"
namespace webrtc { namespace webrtc {
@ -1855,7 +1819,6 @@ index 38810317b1..4379101695 100644
- -
- // DesktopCapturer interface. - // DesktopCapturer interface.
- void Start(Callback* delegate) override; - void Start(Callback* delegate) override;
- void Stop() override;
- void CaptureFrame() override; - void CaptureFrame() override;
- bool GetSourceList(SourceList* sources) override; - bool GetSourceList(SourceList* sources) override;
- bool SelectSource(SourceId id) override; - bool SelectSource(SourceId id) override;
@ -1920,12 +1883,11 @@ index 38810317b1..4379101695 100644
- // Invalid region from the previous capture. This is used to synchronize the - // Invalid region from the previous capture. This is used to synchronize the
- // current with the last buffer used. - // current with the last buffer used.
- DesktopRegion last_invalid_region_; - DesktopRegion last_invalid_region_;
-
- RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerLinux); - RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerLinux);
-}; -};
- -
-ScreenCapturerLinux::ScreenCapturerLinux() { -ScreenCapturerLinux::ScreenCapturerLinux() {
+
+ScreenCapturerX11::ScreenCapturerX11() { +ScreenCapturerX11::ScreenCapturerX11() {
helper_.SetLogGridSize(4); helper_.SetLogGridSize(4);
} }
@ -1935,7 +1897,7 @@ index 38810317b1..4379101695 100644
options_.x_display()->RemoveEventHandler(ConfigureNotify, this); options_.x_display()->RemoveEventHandler(ConfigureNotify, this);
if (use_damage_) { if (use_damage_) {
options_.x_display()->RemoveEventHandler( options_.x_display()->RemoveEventHandler(
@@ -134,7 +48,7 @@ ScreenCapturerLinux::~ScreenCapturerLinux() { @@ -133,7 +48,7 @@ ScreenCapturerLinux::~ScreenCapturerLinu
DeinitXlib(); DeinitXlib();
} }
@ -1944,7 +1906,7 @@ index 38810317b1..4379101695 100644
options_ = options; options_ = options;
root_window_ = RootWindow(display(), DefaultScreen(display())); root_window_ = RootWindow(display(), DefaultScreen(display()));
@@ -177,7 +91,7 @@ bool ScreenCapturerLinux::Init(const DesktopCaptureOptions& options) { @@ -176,7 +91,7 @@ bool ScreenCapturerLinux::Init(const Des
return true; return true;
} }
@ -1953,7 +1915,7 @@ index 38810317b1..4379101695 100644
// Our use of XDamage requires XFixes. // Our use of XDamage requires XFixes.
if (!has_xfixes_) { if (!has_xfixes_) {
return; return;
@@ -218,18 +132,18 @@ void ScreenCapturerLinux::InitXDamage() { @@ -217,14 +132,14 @@ void ScreenCapturerLinux::InitXDamage()
RTC_LOG(LS_INFO) << "Using XDamage extension."; RTC_LOG(LS_INFO) << "Using XDamage extension.";
} }
@ -1965,17 +1927,12 @@ index 38810317b1..4379101695 100644
callback_ = callback; callback_ = callback;
} }
-void ScreenCapturerLinux::Stop() {
+void ScreenCapturerX11::Stop() {
callback_ = NULL;
}
-void ScreenCapturerLinux::CaptureFrame() { -void ScreenCapturerLinux::CaptureFrame() {
+void ScreenCapturerX11::CaptureFrame() { +void ScreenCapturerX11::CaptureFrame() {
int64_t capture_start_time_nanos = rtc::TimeNanos(); int64_t capture_start_time_nanos = rtc::TimeNanos();
queue_.MoveToNextFrame(); queue_.MoveToNextFrame();
@@ -243,6 +157,7 @@ void ScreenCapturerLinux::CaptureFrame() { @@ -238,6 +153,7 @@ void ScreenCapturerLinux::CaptureFrame()
// in a good shape. // in a good shape.
if (!x_server_pixel_buffer_.is_initialized()) { if (!x_server_pixel_buffer_.is_initialized()) {
// We failed to initialize pixel buffer. // We failed to initialize pixel buffer.
@ -1983,7 +1940,7 @@ index 38810317b1..4379101695 100644
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return; return;
} }
@@ -258,6 +173,7 @@ void ScreenCapturerLinux::CaptureFrame() { @@ -253,6 +169,7 @@ void ScreenCapturerLinux::CaptureFrame()
std::unique_ptr<DesktopFrame> result = CaptureScreen(); std::unique_ptr<DesktopFrame> result = CaptureScreen();
if (!result) { if (!result) {
@ -1991,7 +1948,7 @@ index 38810317b1..4379101695 100644
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return; return;
} }
@@ -268,19 +184,19 @@ void ScreenCapturerLinux::CaptureFrame() { @@ -263,19 +180,19 @@ void ScreenCapturerLinux::CaptureFrame()
callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); callback_->OnCaptureResult(Result::SUCCESS, std::move(result));
} }
@ -2014,7 +1971,7 @@ index 38810317b1..4379101695 100644
if (use_damage_ && (event.type == damage_event_base_ + XDamageNotify)) { if (use_damage_ && (event.type == damage_event_base_ + XDamageNotify)) {
const XDamageNotifyEvent* damage_event = const XDamageNotifyEvent* damage_event =
reinterpret_cast<const XDamageNotifyEvent*>(&event); reinterpret_cast<const XDamageNotifyEvent*>(&event);
@@ -295,7 +211,7 @@ bool ScreenCapturerLinux::HandleXEvent(const XEvent& event) { @@ -290,7 +207,7 @@ bool ScreenCapturerLinux::HandleXEvent(c
return false; return false;
} }
@ -2023,7 +1980,7 @@ index 38810317b1..4379101695 100644
std::unique_ptr<SharedDesktopFrame> frame = queue_.current_frame()->Share(); std::unique_ptr<SharedDesktopFrame> frame = queue_.current_frame()->Share();
RTC_DCHECK(x_server_pixel_buffer_.window_size().equals(frame->size())); RTC_DCHECK(x_server_pixel_buffer_.window_size().equals(frame->size()));
@@ -353,7 +269,7 @@ std::unique_ptr<DesktopFrame> ScreenCapturerLinux::CaptureScreen() { @@ -348,7 +265,7 @@ std::unique_ptr<DesktopFrame> ScreenCapt
return std::move(frame); return std::move(frame);
} }
@ -2032,7 +1989,7 @@ index 38810317b1..4379101695 100644
// Make sure the frame buffers will be reallocated. // Make sure the frame buffers will be reallocated.
queue_.Reset(); queue_.Reset();
@@ -364,7 +280,7 @@ void ScreenCapturerLinux::ScreenConfigurationChanged() { @@ -359,7 +276,7 @@ void ScreenCapturerLinux::ScreenConfigur
} }
} }
@ -2041,7 +1998,7 @@ index 38810317b1..4379101695 100644
// Synchronize the current buffer with the previous one since we do not // Synchronize the current buffer with the previous one since we do not
// capture the entire desktop. Note that encoder may be reading from the // capture the entire desktop. Note that encoder may be reading from the
// previous buffer at this time so thread access complaints are false // previous buffer at this time so thread access complaints are false
@@ -384,7 +300,7 @@ void ScreenCapturerLinux::SynchronizeFrame() { @@ -379,7 +296,7 @@ void ScreenCapturerLinux::SynchronizeFra
} }
} }
@ -2050,7 +2007,7 @@ index 38810317b1..4379101695 100644
if (gc_) { if (gc_) {
XFreeGC(display(), gc_); XFreeGC(display(), gc_);
gc_ = nullptr; gc_ = nullptr;
@@ -405,15 +321,13 @@ void ScreenCapturerLinux::DeinitXlib() { @@ -400,15 +317,13 @@ void ScreenCapturerLinux::DeinitXlib() {
} }
} }
@ -2068,12 +2025,10 @@ index 38810317b1..4379101695 100644
if (!capturer.get()->Init(options)) { if (!capturer.get()->Init(options)) {
return nullptr; return nullptr;
} }
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h.firefox-pipewire 2019-03-12 15:27:37.679285748 +0100
index 0000000000..6b0620236c +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h 2019-03-13 08:06:40.412607602 +0100
--- /dev/null @@ -0,0 +1,123 @@
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/screen_capturer_x11.h
@@ -0,0 +1,124 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
+ * + *
@ -2126,7 +2081,6 @@ index 0000000000..6b0620236c
+ +
+ // DesktopCapturer interface. + // DesktopCapturer interface.
+ void Start(Callback* delegate) override; + void Start(Callback* delegate) override;
+ void Stop() override;
+ void CaptureFrame() override; + void CaptureFrame() override;
+ bool GetSourceList(SourceList* sources) override; + bool GetSourceList(SourceList* sources) override;
+ bool SelectSource(SourceId id) override; + bool SelectSource(SourceId id) override;
@ -2198,11 +2152,9 @@ index 0000000000..6b0620236c
+} // namespace webrtc +} // namespace webrtc
+ +
+#endif // MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_X11_H_ +#endif // MODULES_DESKTOP_CAPTURE_SCREEN_CAPTURER_X11_H_
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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc.firefox-pipewire 2019-03-12 15:27:37.679285748 +0100
index 0000000000..befabb9438 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc 2019-03-12 15:27:37.679285748 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_linux.cc
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -2244,11 +2196,9 @@ index 0000000000..befabb9438
+} +}
+ +
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc.firefox-pipewire 2019-03-12 15:27:37.680285758 +0100
index 0000000000..e80eaa7598 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc 2019-03-12 15:27:37.680285758 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.cc
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -2278,11 +2228,9 @@ index 0000000000..e80eaa7598
+ return std::move(capturer); + return std::move(capturer);
+} +}
+} // namespace webrtc +} // 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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h.firefox-pipewire 2019-03-12 15:27:37.680285758 +0100
index 0000000000..a3fea6cb82 +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h 2019-03-12 15:27:37.680285758 +0100
--- /dev/null
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_pipewire.h
@@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
@ -2317,10 +2265,9 @@ index 0000000000..a3fea6cb82
+} // namespace webrtc +} // namespace webrtc
+ +
+#endif // MODULES_DESKTOP_CAPTURE_WINDOW_CAPTURER_PIPEWIRE_H_ +#endif // MODULES_DESKTOP_CAPTURE_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 diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc
index a97698dcbd..f3fb28d808 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc.firefox-pipewire 2019-03-12 01:22:21.000000000 +0100
--- a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc 2019-03-12 15:27:37.680285758 +0100
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.cc
@@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
#include <utility> #include <utility>
@ -2330,7 +2277,7 @@ index a97698dcbd..f3fb28d808 100644
#include "modules/desktop_capture/desktop_capture_options.h" #include "modules/desktop_capture/desktop_capture_options.h"
#include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/desktop_capturer.h"
#include "modules/desktop_capture/desktop_frame.h" #include "modules/desktop_capture/desktop_frame.h"
@@ -32,50 +34,7 @@ @@ -32,49 +34,7 @@
namespace webrtc { namespace webrtc {
@ -2344,7 +2291,6 @@ index a97698dcbd..f3fb28d808 100644
- -
- // DesktopCapturer interface. - // DesktopCapturer interface.
- void Start(Callback* callback) override; - void Start(Callback* callback) override;
- void Stop() override;
- void CaptureFrame() override; - void CaptureFrame() override;
- bool GetSourceList(SourceList* sources) override; - bool GetSourceList(SourceList* sources) override;
- bool SelectSource(SourceId id) override; - bool SelectSource(SourceId id) override;
@ -2382,7 +2328,7 @@ index a97698dcbd..f3fb28d808 100644
: x_display_(options.x_display()), : x_display_(options.x_display()),
atom_cache_(display()), atom_cache_(display()),
window_finder_(&atom_cache_) { window_finder_(&atom_cache_) {
@@ -92,11 +51,11 @@ WindowCapturerLinux::WindowCapturerLinux(const DesktopCaptureOptions& options) @@ -91,11 +51,11 @@ WindowCapturerLinux::WindowCapturerLinux
x_display_->AddEventHandler(ConfigureNotify, this); x_display_->AddEventHandler(ConfigureNotify, this);
} }
@ -2396,7 +2342,7 @@ index a97698dcbd..f3fb28d808 100644
return GetWindowList(&atom_cache_, return GetWindowList(&atom_cache_,
[this, sources](::Window window) { [this, sources](::Window window) {
Source w; Source w;
@@ -109,7 +68,7 @@ bool WindowCapturerLinux::GetSourceList(SourceList* sources) { @@ -108,7 +68,7 @@ bool WindowCapturerLinux::GetSourceList(
}); });
} }
@ -2405,7 +2351,7 @@ index a97698dcbd..f3fb28d808 100644
if (!x_server_pixel_buffer_.Init(display(), id)) if (!x_server_pixel_buffer_.Init(display(), id))
return false; return false;
@@ -130,7 +89,7 @@ bool WindowCapturerLinux::SelectSource(SourceId id) { @@ -129,7 +89,7 @@ bool WindowCapturerLinux::SelectSource(S
return true; return true;
} }
@ -2414,7 +2360,7 @@ index a97698dcbd..f3fb28d808 100644
if (!selected_window_) if (!selected_window_)
return false; return false;
@@ -179,18 +138,18 @@ bool WindowCapturerLinux::FocusOnSelectedSource() { @@ -178,14 +138,14 @@ bool WindowCapturerLinux::FocusOnSelecte
return true; return true;
} }
@ -2426,17 +2372,12 @@ index a97698dcbd..f3fb28d808 100644
callback_ = callback; callback_ = callback;
} }
-void WindowCapturerLinux::Stop() {
+void WindowCapturerX11::Stop() {
callback_ = NULL;
}
-void WindowCapturerLinux::CaptureFrame() { -void WindowCapturerLinux::CaptureFrame() {
+void WindowCapturerX11::CaptureFrame() { +void WindowCapturerX11::CaptureFrame() {
x_display_->ProcessPendingXEvents(); x_display_->ProcessPendingXEvents();
if (!x_server_pixel_buffer_.IsWindowValid()) { if (!x_server_pixel_buffer_.IsWindowValid()) {
@@ -233,12 +192,12 @@ void WindowCapturerLinux::CaptureFrame() { @@ -228,12 +188,12 @@ void WindowCapturerLinux::CaptureFrame()
callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
} }
@ -2451,7 +2392,7 @@ index a97698dcbd..f3fb28d808 100644
if (event.type == ConfigureNotify) { if (event.type == ConfigureNotify) {
XConfigureEvent xce = event.xconfigure; XConfigureEvent xce = event.xconfigure;
if (xce.window == selected_window_) { if (xce.window == selected_window_) {
@@ -256,7 +215,7 @@ bool WindowCapturerLinux::HandleXEvent(const XEvent& event) { @@ -251,7 +211,7 @@ bool WindowCapturerLinux::HandleXEvent(c
return false; return false;
} }
@ -2460,7 +2401,7 @@ index a97698dcbd..f3fb28d808 100644
int status; int status;
bool result = false; bool result = false;
XTextProperty window_name; XTextProperty window_name;
@@ -285,9 +244,7 @@ bool WindowCapturerLinux::GetWindowTitle(::Window window, std::string* title) { @@ -280,9 +240,7 @@ bool WindowCapturerLinux::GetWindowTitle
return result; return result;
} }
@ -2471,7 +2412,7 @@ index a97698dcbd..f3fb28d808 100644
// Get _NET_WM_PID property of the window. // Get _NET_WM_PID property of the window.
Atom process_atom = XInternAtom(display(), "_NET_WM_PID", True); Atom process_atom = XInternAtom(display(), "_NET_WM_PID", True);
XWindowProperty<uint32_t> process_id(display(), window, process_atom); XWindowProperty<uint32_t> process_id(display(), window, process_atom);
@@ -296,11 +253,11 @@ int WindowCapturerLinux::GetWindowProcessID(::Window window) { @@ -291,11 +249,11 @@ int WindowCapturerLinux::GetWindowProces
} }
// static // static
@ -2485,12 +2426,10 @@ index a97698dcbd..f3fb28d808 100644
} }
} // namespace webrtc } // namespace webrtc
diff --git a/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h diff -up firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h.firefox-pipewire firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h
new file mode 100644 --- firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h.firefox-pipewire 2019-03-12 15:27:37.680285758 +0100
index 0000000000..369c59813e +++ firefox-66.0/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h 2019-03-13 08:06:55.974724907 +0100
--- /dev/null @@ -0,0 +1,76 @@
+++ b/media/webrtc/trunk/webrtc/modules/desktop_capture/window_capturer_x11.h
@@ -0,0 +1,77 @@
+/* +/*
+ * Copyright 2018 The WebRTC project authors. All Rights Reserved. + * Copyright 2018 The WebRTC project authors. All Rights Reserved.
+ * + *
@ -2532,7 +2471,6 @@ index 0000000000..369c59813e
+ +
+ // DesktopCapturer interface. + // DesktopCapturer interface.
+ void Start(Callback* callback) override; + void Start(Callback* callback) override;
+ void Stop() override;
+ void CaptureFrame() override; + void CaptureFrame() override;
+ bool GetSourceList(SourceList* sources) override; + bool GetSourceList(SourceList* sources) override;
+ bool SelectSource(SourceId id) override; + bool SelectSource(SourceId id) override;

View File

@ -355,7 +355,7 @@ This package contains results of tests executed during build.
# Wayland specific upstream patches # Wayland specific upstream patches
%if 0%{?fedora} > 28 %if 0%{?fedora} > 28
#%patch574 -p1 -b .firefox-pipewire %patch574 -p1 -b .firefox-pipewire
%endif %endif
%patch575 -p1 -b .mozilla-1423598-popup %patch575 -p1 -b .mozilla-1423598-popup
%patch576 -p1 -b .mozilla-1532643-popup %patch576 -p1 -b .mozilla-1532643-popup