Backport upstream fixes to WebRTC for screensharing on Wayland

This commit is contained in:
Jan Grulich 2022-07-11 11:12:34 +02:00
parent 65d5b6f154
commit 72a660f091
2 changed files with 208 additions and 184 deletions

View File

@ -169,7 +169,7 @@ ExcludeArch: aarch64
Summary: Mozilla Firefox Web browser Summary: Mozilla Firefox Web browser
Name: firefox Name: firefox
Version: 102.0 Version: 102.0
Release: 1%{?pre_tag}%{?dist} Release: 2%{?pre_tag}%{?dist}
URL: https://www.mozilla.org/firefox/ URL: https://www.mozilla.org/firefox/
License: MPLv1.1 or GPLv2+ or LGPLv2+ License: MPLv1.1 or GPLv2+ or LGPLv2+
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}%{?pre_version}/source/firefox-%{version}%{?pre_version}.source.tar.xz
@ -1112,6 +1112,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
#--------------------------------------------------------------------- #---------------------------------------------------------------------
%changelog %changelog
* Mon Jul 11 2022 Jan Grulich <jgrulich@redhat.com> - 102.0-2
- Backport upstream fixes to WebRTC for screensharing on Wayland
* Tue Jun 28 2022 Martin Stransky <stransky@redhat.com>- 102.0-1 * Tue Jun 28 2022 Martin Stransky <stransky@redhat.com>- 102.0-1
- Updated to 102.0 - Updated to 102.0
- Applied patch from https://src.fedoraproject.org/rpms/firefox/pull-request/43 - Applied patch from https://src.fedoraproject.org/rpms/firefox/pull-request/43

View File

@ -1,25 +1,25 @@
From e0e925da71abb97a60d02716b18faa19a29fada6 Mon Sep 17 00:00:00 2001 From 60b164944e5dd2151cf3fcf959899e430cb57c47 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrulich@redhat.com> From: Jan Grulich <jgrulich@redhat.com>
Date: Mon, 21 Feb 2022 15:34:52 +0100 Date: Wed, 22 Jun 2022 13:49:07 +0200
Subject: WebRTC - screen cast sync Subject: WebRTC - screen cast sync
diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build diff --git a/dom/media/webrtc/third_party_build/moz.build b/dom/media/webrtc/third_party_build/moz.build
index e4c7ba7..a42f913 100644 index e4c7ba736e..a42f9138aa 100644
--- a/dom/media/webrtc/third_party_build/moz.build --- a/dom/media/webrtc/third_party_build/moz.build
+++ b/dom/media/webrtc/third_party_build/moz.build +++ b/dom/media/webrtc/third_party_build/moz.build
@@ -63,6 +63,8 @@ webrtc_non_unified_sources = [ @@ -63,6 +63,8 @@ webrtc_non_unified_sources = [
if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
DIRS += ["../../../../third_party/pipewire/libpipewire"] DIRS += ["../../../../third_party/pipewire/libpipewire"]
+ DIRS += ["../../../../third_party/drm/libdrm"] + DIRS += ["../../../../third_party/drm/libdrm"]
+ DIRS += ["../../../../third_party/gbm/libgbm"] + DIRS += ["../../../../third_party/gbm/libgbm"]
GN_DIRS += ["../../../../third_party/libwebrtc"] GN_DIRS += ["../../../../third_party/libwebrtc"]
diff --git a/third_party/drm/README b/third_party/drm/README diff --git a/third_party/drm/README b/third_party/drm/README
new file mode 100644 new file mode 100644
index 0000000..f68ed10 index 0000000000..f68ed100bb
--- /dev/null --- /dev/null
+++ b/third_party/drm/README +++ b/third_party/drm/README
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
@ -29,7 +29,7 @@ index 0000000..f68ed10
+libdrm directory stores headers of libdrm needed for build only. +libdrm directory stores headers of libdrm needed for build only.
diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h diff --git a/third_party/drm/drm/drm.h b/third_party/drm/drm/drm.h
new file mode 100644 new file mode 100644
index 0000000..5e54c3a index 0000000000..5e54c3aa4c
--- /dev/null --- /dev/null
+++ b/third_party/drm/drm/drm.h +++ b/third_party/drm/drm/drm.h
@@ -0,0 +1,1193 @@ @@ -0,0 +1,1193 @@
@ -1228,7 +1228,7 @@ index 0000000..5e54c3a
+#endif +#endif
diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h diff --git a/third_party/drm/drm/drm_fourcc.h b/third_party/drm/drm/drm_fourcc.h
new file mode 100644 new file mode 100644
index 0000000..4ececa8 index 0000000000..4ececa84ba
--- /dev/null --- /dev/null
+++ b/third_party/drm/drm/drm_fourcc.h +++ b/third_party/drm/drm/drm_fourcc.h
@@ -0,0 +1,1377 @@ @@ -0,0 +1,1377 @@
@ -2611,7 +2611,7 @@ index 0000000..4ececa8
+#endif /* DRM_FOURCC_H */ +#endif /* DRM_FOURCC_H */
diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h diff --git a/third_party/drm/drm/drm_mode.h b/third_party/drm/drm/drm_mode.h
new file mode 100644 new file mode 100644
index 0000000..e1e3516 index 0000000000..e1e3516828
--- /dev/null --- /dev/null
+++ b/third_party/drm/drm/drm_mode.h +++ b/third_party/drm/drm/drm_mode.h
@@ -0,0 +1,1217 @@ @@ -0,0 +1,1217 @@
@ -3834,17 +3834,17 @@ index 0000000..e1e3516
+#endif +#endif
diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h diff --git a/third_party/drm/drm/xf86drm.h b/third_party/drm/drm/xf86drm.h
new file mode 100644 new file mode 100644
index 0000000..58d66f1 index 0000000000..58d66f1a6b
--- /dev/null --- /dev/null
+++ b/third_party/drm/drm/xf86drm.h +++ b/third_party/drm/drm/xf86drm.h
@@ -0,0 +1,966 @@ @@ -0,0 +1,966 @@
+/** +/**
+ * \file xf86drm.h + * \file xf86drm.h
+ * OS-independent header for DRM user-level library interface. + * OS-independent header for DRM user-level library interface.
+ * + *
+ * \author Rickard E. (Rik) Faith <faith@valinux.com> + * \author Rickard E. (Rik) Faith <faith@valinux.com>
+ */ + */
+ +
+/* +/*
+ * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas. + * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
+ * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
@ -4037,9 +4037,9 @@ index 0000000..58d66f1
+typedef enum { +typedef enum {
+ /** \name Flags for DMA buffer dispatch */ + /** \name Flags for DMA buffer dispatch */
+ /*@{*/ + /*@{*/
+ DRM_DMA_BLOCK = 0x01, /**< + DRM_DMA_BLOCK = 0x01, /**<
+ * Block until buffer dispatched. + * Block until buffer dispatched.
+ * + *
+ * \note the buffer may not yet have been + * \note the buffer may not yet have been
+ * processed by the hardware -- getting a + * processed by the hardware -- getting a
+ * hardware lock with the hardware quiescent + * hardware lock with the hardware quiescent
@ -4533,7 +4533,7 @@ index 0000000..58d66f1
+ drmLockFlags flags); + drmLockFlags flags);
+extern int drmUnlock(int fd, drm_context_t context); +extern int drmUnlock(int fd, drm_context_t context);
+extern int drmFinish(int fd, int context, drmLockFlags flags); +extern int drmFinish(int fd, int context, drmLockFlags flags);
+extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, +extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id,
+ drm_handle_t * handle); + drm_handle_t * handle);
+ +
+/* AGP/GART support: X server (root) only */ +/* AGP/GART support: X server (root) only */
@ -4619,7 +4619,7 @@ index 0000000..58d66f1
+ int version; + int version;
+ +
+ void (*vblank_handler)(int fd, + void (*vblank_handler)(int fd,
+ unsigned int sequence, + unsigned int sequence,
+ unsigned int tv_sec, + unsigned int tv_sec,
+ unsigned int tv_usec, + unsigned int tv_usec,
+ void *user_data); + void *user_data);
@ -4806,7 +4806,7 @@ index 0000000..58d66f1
+#endif +#endif
diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build diff --git a/third_party/drm/libdrm/moz.build b/third_party/drm/libdrm/moz.build
new file mode 100644 new file mode 100644
index 0000000..3b37b91 index 0000000000..3b37b913e8
--- /dev/null --- /dev/null
+++ b/third_party/drm/libdrm/moz.build +++ b/third_party/drm/libdrm/moz.build
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
@ -4828,7 +4828,7 @@ index 0000000..3b37b91
+FINAL_LIBRARY = 'xul' +FINAL_LIBRARY = 'xul'
diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp diff --git a/third_party/drm/libdrm/mozdrm.cpp b/third_party/drm/libdrm/mozdrm.cpp
new file mode 100644 new file mode 100644
index 0000000..b2fb59b index 0000000000..b2fb59be64
--- /dev/null --- /dev/null
+++ b/third_party/drm/libdrm/mozdrm.cpp +++ b/third_party/drm/libdrm/mozdrm.cpp
@@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
@ -4900,7 +4900,7 @@ index 0000000..b2fb59b
+} +}
diff --git a/third_party/gbm/README b/third_party/gbm/README diff --git a/third_party/gbm/README b/third_party/gbm/README
new file mode 100644 new file mode 100644
index 0000000..4b6e2e8 index 0000000000..4b6e2e8e02
--- /dev/null --- /dev/null
+++ b/third_party/gbm/README +++ b/third_party/gbm/README
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
@ -4910,7 +4910,7 @@ index 0000000..4b6e2e8
+libgbm directory stores headers of libgbm needed for build only. +libgbm directory stores headers of libgbm needed for build only.
diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h diff --git a/third_party/gbm/gbm/gbm.h b/third_party/gbm/gbm/gbm.h
new file mode 100644 new file mode 100644
index 0000000..a963ed7 index 0000000000..a963ed78e4
--- /dev/null --- /dev/null
+++ b/third_party/gbm/gbm/gbm.h +++ b/third_party/gbm/gbm/gbm.h
@@ -0,0 +1,452 @@ @@ -0,0 +1,452 @@
@ -4988,7 +4988,7 @@ index 0000000..a963ed7
+/** Format of the allocated buffer */ +/** Format of the allocated buffer */
+enum gbm_bo_format { +enum gbm_bo_format {
+ /** RGB with 8 bits per channel in a 32 bit value */ + /** RGB with 8 bits per channel in a 32 bit value */
+ GBM_BO_FORMAT_XRGB8888, + GBM_BO_FORMAT_XRGB8888,
+ /** ARGB with 8 bits per channel in a 32 bit value */ + /** ARGB with 8 bits per channel in a 32 bit value */
+ GBM_BO_FORMAT_ARGB8888 + GBM_BO_FORMAT_ARGB8888
+}; +};
@ -5368,7 +5368,7 @@ index 0000000..a963ed7
+#endif +#endif
diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build diff --git a/third_party/gbm/libgbm/moz.build b/third_party/gbm/libgbm/moz.build
new file mode 100644 new file mode 100644
index 0000000..0953d2f index 0000000000..0953d2f17a
--- /dev/null --- /dev/null
+++ b/third_party/gbm/libgbm/moz.build +++ b/third_party/gbm/libgbm/moz.build
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
@ -5390,7 +5390,7 @@ index 0000000..0953d2f
+FINAL_LIBRARY = 'xul' +FINAL_LIBRARY = 'xul'
diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp diff --git a/third_party/gbm/libgbm/mozgbm.cpp b/third_party/gbm/libgbm/mozgbm.cpp
new file mode 100644 new file mode 100644
index 0000000..bc024a1 index 0000000000..bc024a11c0
--- /dev/null --- /dev/null
+++ b/third_party/gbm/libgbm/mozgbm.cpp +++ b/third_party/gbm/libgbm/mozgbm.cpp
@@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
@ -5460,8 +5460,81 @@ index 0000000..bc024a1
+ } + }
+ return gbm_device_destroy_fn(gbm); + return gbm_device_destroy_fn(gbm);
+} +}
diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
index d961d726d4..93c901364f 100644
--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin":
LOCAL_INCLUDES += [
"/media/libyuv/libyuv/include/",
"/media/libyuv/libyuv/include/",
+ "/third_party/drm/",
+ "/third_party/gbm/",
"/third_party/pipewire/"
]
@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux":
LOCAL_INCLUDES += [
"/media/libyuv/libyuv/include/",
"/media/libyuv/libyuv/include/",
- "/third_party/pipewire/",
+ "/third_party/drm/",
+ "/third_party/gbm/",
"/third_party/pipewire/"
]
@@ -115,12 +118,16 @@ if CONFIG["OS_TARGET"] == "Linux":
]
SOURCES += [
- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc"
+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc"
+
]
UNIFIED_SOURCES += [
- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc",
"/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc",
"/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
"/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
@@ -156,15 +163,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
]
SOURCES += [
- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc"
+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc"
]
UNIFIED_SOURCES += [
"/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc",
- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc",
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc",
@@ -206,6 +216,7 @@ if CONFIG["OS_TARGET"] == "WINNT":
LOCAL_INCLUDES += [
"/media/libyuv/libyuv/include/",
"/media/libyuv/libyuv/include/",
+ "/third_party/drm/"
"/third_party/pipewire/"
]
diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc
index c89896d..c8ef822 100644 index c89896d5fd..c8ef822938 100644
--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc
+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.cc
@@ -14,6 +14,9 @@ @@ -14,6 +14,9 @@
@ -5471,9 +5544,9 @@ index c89896d..c8ef822 100644
+#if defined(WEBRTC_USE_PIPEWIRE) +#if defined(WEBRTC_USE_PIPEWIRE)
+#include "modules/desktop_capture/linux/shared_screencast_stream.h" +#include "modules/desktop_capture/linux/shared_screencast_stream.h"
+#endif +#endif
namespace webrtc { namespace webrtc {
@@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() { @@ -35,6 +38,9 @@ DesktopCaptureOptions DesktopCaptureOptions::CreateDefault() {
#if defined(WEBRTC_USE_X11) #if defined(WEBRTC_USE_X11)
result.set_x_display(SharedXDisplay::CreateDefault()); result.set_x_display(SharedXDisplay::CreateDefault());
@ -5485,13 +5558,13 @@ index c89896d..c8ef822 100644
result.set_configuration_monitor(new DesktopConfigurationMonitor()); result.set_configuration_monitor(new DesktopConfigurationMonitor());
result.set_full_screen_window_detector( result.set_full_screen_window_detector(
diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h diff --git a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h
index ee0dd3a..ac56c8c 100644 index ee0dd3ab40..ac56c8c1c1 100644
--- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h --- a/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h
+++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h +++ b/third_party/libwebrtc/modules/desktop_capture/desktop_capture_options.h
@@ -17,6 +17,10 @@ @@ -17,6 +17,10 @@
#include "modules/desktop_capture/linux/shared_x_display.h" #include "modules/desktop_capture/linux/shared_x_display.h"
#endif #endif
+#if defined(WEBRTC_USE_PIPEWIRE) +#if defined(WEBRTC_USE_PIPEWIRE)
+#include "modules/desktop_capture/linux/shared_screencast_stream.h" +#include "modules/desktop_capture/linux/shared_screencast_stream.h"
+#endif +#endif
@ -5512,7 +5585,7 @@ index ee0dd3a..ac56c8c 100644
+ screencast_stream_ = stream; + screencast_stream_ = stream;
+ } + }
#endif #endif
private: private:
#if defined(WEBRTC_USE_X11) #if defined(WEBRTC_USE_X11)
rtc::scoped_refptr<SharedXDisplay> x_display_; rtc::scoped_refptr<SharedXDisplay> x_display_;
@ -5528,13 +5601,13 @@ index ee0dd3a..ac56c8c 100644
rtc::scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_; rtc::scoped_refptr<DesktopConfigurationMonitor> configuration_monitor_;
bool allow_iosurface_ = false; bool allow_iosurface_ = false;
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
index 2fd3b1a..e4685fc 100644 index 2fd3b1a575..e4685fc814 100644
--- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc --- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc
@@ -10,937 +10,67 @@ @@ -10,937 +10,67 @@
#include "modules/desktop_capture/linux/base_capturer_pipewire.h" #include "modules/desktop_capture/linux/base_capturer_pipewire.h"
-#include <gio/gunixfdlist.h> -#include <gio/gunixfdlist.h>
-#include <glib-object.h> -#include <glib-object.h>
-#include <spa/param/format-utils.h> -#include <spa/param/format-utils.h>
@ -5553,7 +5626,7 @@ index 2fd3b1a..e4685fc 100644
#include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/desktop_capturer.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
-#if defined(WEBRTC_DLOPEN_PIPEWIRE) -#if defined(WEBRTC_DLOPEN_PIPEWIRE)
-#include "modules/desktop_capture/linux/pipewire_stubs.h" -#include "modules/desktop_capture/linux/pipewire_stubs.h"
- -
@ -5563,7 +5636,7 @@ index 2fd3b1a..e4685fc 100644
-#endif // defined(WEBRTC_DLOPEN_PIPEWIRE) -#endif // defined(WEBRTC_DLOPEN_PIPEWIRE)
- -
namespace webrtc { namespace webrtc {
-const char kDesktopBusName[] = "org.freedesktop.portal.Desktop"; -const char kDesktopBusName[] = "org.freedesktop.portal.Desktop";
-const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop"; -const char kDesktopObjectPath[] = "/org/freedesktop/portal/desktop";
-const char kDesktopRequestObjectPath[] = -const char kDesktopRequestObjectPath[] =
@ -5639,7 +5712,7 @@ index 2fd3b1a..e4685fc 100644
+ screencast_portal_ = std::make_unique<ScreenCastPortal>( + screencast_portal_ = std::make_unique<ScreenCastPortal>(
+ ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this); + ScreenCastPortal::CaptureSourceType::kAnyScreenContent, this);
} }
-// static -// static
-void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id, -void BaseCapturerPipeWire::OnStreamParamChanged(void *data, uint32_t id,
- const struct spa_pod *format) { - const struct spa_pod *format) {
@ -5694,7 +5767,7 @@ index 2fd3b1a..e4685fc 100644
- struct pw_buffer *next_buffer; - struct pw_buffer *next_buffer;
- struct pw_buffer *buffer = nullptr; - struct pw_buffer *buffer = nullptr;
+BaseCapturerPipeWire::~BaseCapturerPipeWire() {} +BaseCapturerPipeWire::~BaseCapturerPipeWire() {}
- next_buffer = pw_stream_dequeue_buffer(that->pw_stream_); - next_buffer = pw_stream_dequeue_buffer(that->pw_stream_);
- while (next_buffer) { - while (next_buffer) {
- buffer = next_buffer; - buffer = next_buffer;
@ -5723,7 +5796,7 @@ index 2fd3b1a..e4685fc 100644
- -
- pw_stream_queue_buffer(that->pw_stream_, buffer); - pw_stream_queue_buffer(that->pw_stream_, buffer);
} }
-BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type) -BaseCapturerPipeWire::BaseCapturerPipeWire(CaptureSourceType source_type)
- : capture_source_type_(source_type) {} - : capture_source_type_(source_type) {}
- -
@ -6444,25 +6517,25 @@ index 2fd3b1a..e4685fc 100644
- -
- that->InitPipeWire(); - that->InitPipeWire();
} }
void BaseCapturerPipeWire::Start(Callback* callback) { void BaseCapturerPipeWire::Start(Callback* callback) {
RTC_DCHECK(!callback_); RTC_DCHECK(!callback_);
RTC_DCHECK(callback); RTC_DCHECK(callback);
- InitPortal(); - InitPortal();
- -
callback_ = callback; callback_ = callback;
+ +
+ screencast_portal_->Start(); + screencast_portal_->Start();
} }
void BaseCapturerPipeWire::CaptureFrame() { void BaseCapturerPipeWire::CaptureFrame() {
- if (portal_init_failed_) { - if (portal_init_failed_) {
+ if (capturer_failed_) { + if (capturer_failed_) {
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr);
return; return;
} }
- webrtc::MutexLock lock(&current_frame_lock_); - webrtc::MutexLock lock(&current_frame_lock_);
- if (!current_frame_) { - if (!current_frame_) {
- callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); - callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
@ -6475,7 +6548,7 @@ index 2fd3b1a..e4685fc 100644
- } - }
+ std::unique_ptr<DesktopFrame> frame = + std::unique_ptr<DesktopFrame> frame =
+ options_.screencast_stream()->CaptureFrame(); + options_.screencast_stream()->CaptureFrame();
- std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(frame_size)); - std::unique_ptr<DesktopFrame> result(new BasicDesktopFrame(frame_size));
- result->CopyPixelsFrom( - result->CopyPixelsFrom(
- current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel), - current_frame_.get(), (frame_size.width() * BasicDesktopFrame::kBytesPerPixel),
@ -6485,31 +6558,31 @@ index 2fd3b1a..e4685fc 100644
callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr); callback_->OnCaptureResult(Result::ERROR_TEMPORARY, nullptr);
return; return;
} }
- // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the - // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on the
- // frame, see ScreenCapturerX11::CaptureFrame. - // frame, see ScreenCapturerX11::CaptureFrame.
+ // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on + // TODO(julien.isorce): http://crbug.com/945468. Set the icc profile on
+ // the frame, see ScreenCapturerX11::CaptureFrame. + // the frame, see ScreenCapturerX11::CaptureFrame.
- callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); - callback_->OnCaptureResult(Result::SUCCESS, std::move(result));
+ callback_->OnCaptureResult(Result::SUCCESS, std::move(frame)); + callback_->OnCaptureResult(Result::SUCCESS, std::move(frame));
} }
// Keep in sync with defines at browser/actors/WebRTCParent.jsm // Keep in sync with defines at browser/actors/WebRTCParent.jsm
@@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() { @@ -953,31 +83,13 @@ void BaseCapturerPipeWire::CaptureFrame() {
#define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####" #define PIPEWIRE_NAME "####_PIPEWIRE_PORTAL_####"
bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) { bool BaseCapturerPipeWire::GetSourceList(SourceList* sources) {
+ RTC_DCHECK(sources->size() == 0); + RTC_DCHECK(sources->size() == 0);
sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME}); sources->push_back({PIPEWIRE_ID, 0, PIPEWIRE_NAME});
return true; return true;
} }
bool BaseCapturerPipeWire::SelectSource(SourceId id) { bool BaseCapturerPipeWire::SelectSource(SourceId id) {
- // Screen selection is handled by the xdg-desktop-portal. - // Screen selection is handled by the xdg-desktop-portal.
return id == PIPEWIRE_ID; return id == PIPEWIRE_ID;
} }
-// static -// static
-std::unique_ptr<DesktopCapturer> -std::unique_ptr<DesktopCapturer>
-BaseCapturerPipeWire::CreateRawScreenCapturer( -BaseCapturerPipeWire::CreateRawScreenCapturer(
@ -6530,13 +6603,13 @@ index 2fd3b1a..e4685fc 100644
- -
} // namespace webrtc } // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
index af8e20c..5db09e0 100644 index af8e20c84c..5db09e0244 100644
--- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h --- a/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.h
@@ -11,160 +11,39 @@ @@ -11,160 +11,39 @@
#ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ #ifndef MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_
#define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_ #define MODULES_DESKTOP_CAPTURE_LINUX_BASE_CAPTURER_PIPEWIRE_H_
-#include <gio/gio.h> -#include <gio/gio.h>
-#define typeof __typeof__ -#define typeof __typeof__
-#include <pipewire/pipewire.h> -#include <pipewire/pipewire.h>
@ -6547,9 +6620,9 @@ index af8e20c..5db09e0 100644
-#include "rtc_base/synchronization/mutex.h" -#include "rtc_base/synchronization/mutex.h"
+#include "modules/desktop_capture/linux/screencast_portal.h" +#include "modules/desktop_capture/linux/screencast_portal.h"
+#include "modules/desktop_capture/linux/shared_screencast_stream.h" +#include "modules/desktop_capture/linux/shared_screencast_stream.h"
namespace webrtc { namespace webrtc {
-class BaseCapturerPipeWire : public DesktopCapturer { -class BaseCapturerPipeWire : public DesktopCapturer {
+class BaseCapturerPipeWire : public DesktopCapturer, +class BaseCapturerPipeWire : public DesktopCapturer,
+ public ScreenCastPortal::PortalNotifier { + public ScreenCastPortal::PortalNotifier {
@ -6563,7 +6636,7 @@ index af8e20c..5db09e0 100644
- explicit BaseCapturerPipeWire(CaptureSourceType source_type); - explicit BaseCapturerPipeWire(CaptureSourceType source_type);
+ BaseCapturerPipeWire(const DesktopCaptureOptions& options); + BaseCapturerPipeWire(const DesktopCaptureOptions& options);
~BaseCapturerPipeWire() override; ~BaseCapturerPipeWire() override;
+ BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete; + BaseCapturerPipeWire(const BaseCapturerPipeWire&) = delete;
+ BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete; + BaseCapturerPipeWire& operator=(const BaseCapturerPipeWire&) = delete;
+ +
@ -6572,7 +6645,7 @@ index af8e20c..5db09e0 100644
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;
- static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer( - static std::unique_ptr<DesktopCapturer> CreateRawScreenCapturer(
- const DesktopCaptureOptions& options); - const DesktopCaptureOptions& options);
- -
@ -6583,7 +6656,7 @@ index af8e20c..5db09e0 100644
+ uint32_t stream_node_id, + uint32_t stream_node_id,
+ int fd) override; + int fd) override;
+ void OnScreenCastSessionClosed() override; + void OnScreenCastSessionClosed() override;
private: private:
- // PipeWire types --> - // PipeWire types -->
- pw_context* pw_context_ = nullptr; - pw_context* pw_context_ = nullptr;
@ -6707,11 +6780,11 @@ index af8e20c..5db09e0 100644
+ bool capturer_failed_ = false; + bool capturer_failed_ = false;
+ std::unique_ptr<ScreenCastPortal> screencast_portal_; + std::unique_ptr<ScreenCastPortal> screencast_portal_;
}; };
} // namespace webrtc } // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs
new file mode 100644 new file mode 100644
index 0000000..226979f index 0000000000..226979fe16
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs +++ b/third_party/libwebrtc/modules/desktop_capture/linux/drm.sigs
@@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
@ -6728,7 +6801,7 @@ index 0000000..226979f
+void drmFreeDevices(drmDevicePtr devices[], int count); +void drmFreeDevices(drmDevicePtr devices[], int count);
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc
new file mode 100644 new file mode 100644
index 0000000..de63c2a index 0000000000..de63c2a0b8
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc
@@ -0,0 +1,695 @@ @@ -0,0 +1,695 @@
@ -7429,7 +7502,7 @@ index 0000000..de63c2a
+} // namespace webrtc +} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h
new file mode 100644 new file mode 100644
index 0000000..b755d8b index 0000000000..b755d8ba37
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.h
@@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
@ -7503,7 +7576,7 @@ index 0000000..b755d8b
+#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_EGL_DMABUF_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc
new file mode 100644 new file mode 100644
index 0000000..09dea24 index 0000000000..09dea242b3
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc
@@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
@ -7565,7 +7638,7 @@ index 0000000..09dea24
+} // namespace webrtc +} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h
new file mode 100644 new file mode 100644
index 0000000..9b9ccf7 index 0000000000..9b9ccf74f8
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h
@@ -0,0 +1,41 @@ @@ -0,0 +1,41 @@
@ -7611,31 +7684,31 @@ index 0000000..9b9ccf7
+ +
+#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_MOUSE_CURSOR_MONITOR_PIPEWIRE_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs
index 3e21e9d..06a97b8 100644 index 3e21e9dc07..06a97b8f29 100644
--- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs --- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs +++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire.sigs
@@ -7,38 +7,44 @@ @@ -7,38 +7,44 @@
//------------------------------------------------ //------------------------------------------------
// core.h // core.h
-void pw_core_destroy(pw_core *core); -void pw_core_destroy(pw_core *core);
-pw_type *pw_core_get_type(pw_core *core); -pw_type *pw_core_get_type(pw_core *core);
-pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props); -pw_core * pw_core_new(pw_loop *main_loop, pw_properties *props);
+int pw_core_disconnect(pw_core *core); +int pw_core_disconnect(pw_core *core);
// loop.h // loop.h
void pw_loop_destroy(pw_loop *loop); void pw_loop_destroy(pw_loop *loop);
-pw_loop * pw_loop_new(pw_properties *properties); -pw_loop * pw_loop_new(pw_properties *properties);
+pw_loop * pw_loop_new(const spa_dict *props); +pw_loop * pw_loop_new(const spa_dict *props);
+ +
// pipewire.h // pipewire.h
void pw_init(int *argc, char **argv[]); void pw_init(int *argc, char **argv[]);
+const char* pw_get_library_version(); +const char* pw_get_library_version();
// properties.h // properties.h
pw_properties * pw_properties_new_string(const char *args); pw_properties * pw_properties_new_string(const char *args);
-// remote.h -// remote.h
-void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data); -void pw_remote_add_listener(pw_remote *remote, spa_hook *listener, const pw_remote_events *events, void *data);
-int pw_remote_connect_fd(pw_remote *remote, int fd); -int pw_remote_connect_fd(pw_remote *remote, int fd);
@ -7655,7 +7728,7 @@ index 3e21e9d..06a97b8 100644
int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer); int pw_stream_queue_buffer(pw_stream *stream, pw_buffer *buffer);
int pw_stream_set_active(pw_stream *stream, bool active); int pw_stream_set_active(pw_stream *stream, bool active);
+int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params); +int pw_stream_update_params(pw_stream *stream, const spa_pod **params, uint32_t n_params);
// thread-loop.h // thread-loop.h
void pw_thread_loop_destroy(pw_thread_loop *loop); void pw_thread_loop_destroy(pw_thread_loop *loop);
-pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name); -pw_thread_loop * pw_thread_loop_new(pw_loop *loop, const char *name);
@ -7674,18 +7747,18 @@ index 3e21e9d..06a97b8 100644
+pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size); +pw_core * pw_context_connect(pw_context *context, pw_properties *properties, size_t user_data_size);
+pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size); +pw_core * pw_context_connect_fd(pw_context *context, int fd, pw_properties *properties, size_t user_data_size);
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment
index 9d7dbd2..06ae18d 100644 index 9d7dbd27c5..06ae18dfd4 100644
--- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment --- a/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment +++ b/third_party/libwebrtc/modules/desktop_capture/linux/pipewire_stub_header.fragment
@@ -5,4 +5,5 @@ extern "C" { @@ -5,4 +5,5 @@ extern "C" {
#include <pipewire/pipewire.h> #include <pipewire/pipewire.h>
+#include <xf86drm.h> +#include <xf86drm.h>
} }
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc
new file mode 100644 new file mode 100644
index 0000000..51ca57a index 0000000000..51ca57adc1
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc
@@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
@ -7748,7 +7821,7 @@ index 0000000..51ca57a
+} // namespace webrtc +} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h
new file mode 100644 new file mode 100644
index 0000000..bf77855 index 0000000000..bf77855f95
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.h
@@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
@ -7819,7 +7892,7 @@ index 0000000..bf77855
+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCOPED_GLIB_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
deleted file mode 100644 deleted file mode 100644
index 3813d69..0000000 index 3813d697bb..0000000000
--- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc --- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc
+++ /dev/null +++ /dev/null
@@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
@ -7853,7 +7926,7 @@ index 3813d69..0000000
-} // namespace webrtc -} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h
deleted file mode 100644 deleted file mode 100644
index 66dcd68..0000000 index 66dcd680e0..0000000000
--- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h --- a/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.h
+++ /dev/null +++ /dev/null
@@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
@ -7892,7 +7965,7 @@ index 66dcd68..0000000
-#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_ -#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREEN_CAPTURER_PIPEWIRE_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc
new file mode 100644 new file mode 100644
index 0000000..306e984 index 0000000000..306e984207
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc
@@ -0,0 +1,532 @@ @@ -0,0 +1,532 @@
@ -8430,7 +8503,7 @@ index 0000000..306e984
+} // namespace webrtc +} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h
new file mode 100644 new file mode 100644
index 0000000..7da218e index 0000000000..7da218ed78
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.h
@@ -0,0 +1,169 @@ @@ -0,0 +1,169 @@
@ -8605,10 +8678,10 @@ index 0000000..7da218e
+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SCREENCAST_PORTAL_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc
new file mode 100644 new file mode 100644
index 0000000..c6ba661 index 0000000000..04284ebcb7
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc +++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc
@@ -0,0 +1,872 @@ @@ -0,0 +1,892 @@
+/* +/*
+ * Copyright 2022 The WebRTC project authors. All Rights Reserved. + * Copyright 2022 The WebRTC project authors. All Rights Reserved.
+ * + *
@ -9318,6 +9391,16 @@ index 0000000..c6ba661
+ plane_datas.push_back(data); + plane_datas.push_back(data);
+ } + }
+ +
+ // When importing DMA-BUFs, we use the stride (number of bytes from one row
+ // of pixels in the buffer) provided by PipeWire. The stride from PipeWire
+ // is given by the graphics driver and some drivers might add some
+ // additional padding for memory layout optimizations so not everytime the
+ // stride is equal to BYTES_PER_PIXEL x WIDTH. This is fine, because during
+ // the import we will use OpenGL and same graphics driver so it will be able
+ // to work with the stride it provided, but later on when we work with
+ // images we get from DMA-BUFs we will need to update the stride to be equal
+ // to BYTES_PER_PIXEL x WIDTH as that's the size of the DesktopFrame we
+ // allocate for each captured frame.
+ src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf( + src_unique_ptr = egl_dmabuf_->ImageFromDmaBuf(
+ desktop_size_, spa_video_format_.format, plane_datas, modifier_); + desktop_size_, spa_video_format_.format, plane_datas, modifier_);
+ if (src_unique_ptr) { + if (src_unique_ptr) {
@ -9326,7 +9409,7 @@ index 0000000..c6ba661
+ RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_ + RTC_LOG(LS_ERROR) << "Dropping DMA-BUF modifier: " << modifier_
+ << " and trying to renegotiate stream parameters"; + << " and trying to renegotiate stream parameters";
+ +
+ if (pw_client_version_ >= kDropSingleModifierMinVersion) { + if (pw_server_version_ >= kDropSingleModifierMinVersion) {
+ modifiers_.erase( + modifiers_.erase(
+ std::remove(modifiers_.begin(), modifiers_.end(), modifier_), + std::remove(modifiers_.begin(), modifiers_.end(), modifier_),
+ modifiers_.end()); + modifiers_.end());
@ -9392,8 +9475,19 @@ index 0000000..c6ba661
+ ? video_metadata->region.position.x + ? video_metadata->region.position.x
+ : 0; + : 0;
+ +
+ uint8_t* updated_src = src + (spa_buffer->datas[0].chunk->stride * y_offset) + + const uint32_t frame_stride = kBytesPerPixel * desktop_size_.width();
+ (kBytesPerPixel * x_offset); + uint32_t stride = spa_buffer->datas[0].chunk->stride;
+
+ if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf && stride > frame_stride) {
+ // When DMA-BUFs are used, sometimes spa_buffer->stride we get might
+ // contain additional padding, but after we import the buffer, the stride
+ // we used is no longer relevant and we should just calculate it based on
+ // width. For more context see https://crbug.com/1333304.
+ stride = frame_stride;
+ }
+
+ uint8_t* updated_src =
+ src + (stride * y_offset) + (kBytesPerPixel * x_offset);
+ +
+ webrtc::MutexLock lock(&queue_lock_); + webrtc::MutexLock lock(&queue_lock_);
+ +
@ -9415,8 +9509,7 @@ index 0000000..c6ba661
+ } + }
+ +
+ queue_.current_frame()->CopyPixelsFrom( + queue_.current_frame()->CopyPixelsFrom(
+ updated_src, + updated_src, (stride - (kBytesPerPixel * x_offset)),
+ (spa_buffer->datas[0].chunk->stride - (kBytesPerPixel * x_offset)),
+ DesktopRect::MakeWH(video_size_.width(), video_size_.height())); + DesktopRect::MakeWH(video_size_.width(), video_size_.height()));
+ +
+ if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx || + if (spa_video_format_.format == SPA_VIDEO_FORMAT_RGBx ||
@ -9483,7 +9576,7 @@ index 0000000..c6ba661
+} // namespace webrtc +} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h
new file mode 100644 new file mode 100644
index 0000000..72411e5 index 0000000000..72411e5607
--- /dev/null --- /dev/null
+++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h +++ b/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.h
@@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
@ -9560,7 +9653,7 @@ index 0000000..72411e5
+#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_ +#endif // MODULES_DESKTOP_CAPTURE_LINUX_SHARED_SCREENCAST_STREAM_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
deleted file mode 100644 deleted file mode 100644
index c43a1f1..0000000 index c43a1f1a0c..0000000000
--- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc --- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc
+++ /dev/null +++ /dev/null
@@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
@ -9594,7 +9687,7 @@ index c43a1f1..0000000
-} // namespace webrtc -} // namespace webrtc
diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h diff --git a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h b/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h
deleted file mode 100644 deleted file mode 100644
index 7f184ef..0000000 index 7f184ef299..0000000000
--- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h --- a/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.h
+++ /dev/null +++ /dev/null
@@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
@ -9632,19 +9725,19 @@ index 7f184ef..0000000
- -
-#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_ -#endif // MODULES_DESKTOP_CAPTURE_LINUX_WINDOW_CAPTURER_PIPEWIRE_H_
diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc
index e569f6e..3bb51e8 100644 index e569f6ef35..4a23ba59b2 100644
--- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc --- a/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc
+++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc
@@ -17,6 +17,10 @@ @@ -17,6 +17,10 @@
#include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h" #include "modules/desktop_capture/linux/mouse_cursor_monitor_x11.h"
#endif // defined(WEBRTC_USE_X11) #endif // defined(WEBRTC_USE_X11)
+#if defined(WEBRTC_USE_PIPEWIRE) +#if defined(WEBRTC_USE_PIPEWIRE)
+#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h" +#include "modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.h"
+#endif // defined(WEBRTC_USE_PIPEWIRE) +#endif // defined(WEBRTC_USE_PIPEWIRE)
+ +
namespace webrtc { namespace webrtc {
// static // static
@@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen( @@ -44,6 +48,13 @@ MouseCursorMonitor* MouseCursorMonitor::CreateForScreen(
// static // static
@ -9661,17 +9754,17 @@ index e569f6e..3bb51e8 100644
return MouseCursorMonitorX11::Create(options); return MouseCursorMonitorX11::Create(options);
#else #else
diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc
index 57a2002..b44ae35 100644 index 57a2002ac7..b44ae35292 100644
--- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc --- a/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc
+++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
#include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/desktop_capturer.h"
#if defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_PIPEWIRE)
-#include "modules/desktop_capture/linux/screen_capturer_pipewire.h" -#include "modules/desktop_capture/linux/screen_capturer_pipewire.h"
+#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +#include "modules/desktop_capture/linux/base_capturer_pipewire.h"
#endif // defined(WEBRTC_USE_PIPEWIRE) #endif // defined(WEBRTC_USE_PIPEWIRE)
#if defined(WEBRTC_USE_X11) #if defined(WEBRTC_USE_X11)
@@ -28,7 +28,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( @@ -28,7 +28,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
const DesktopCaptureOptions& options) { const DesktopCaptureOptions& options) {
@ -9681,19 +9774,19 @@ index 57a2002..b44ae35 100644
+ return std::make_unique<BaseCapturerPipeWire>(options); + return std::make_unique<BaseCapturerPipeWire>(options);
} }
#endif // defined(WEBRTC_USE_PIPEWIRE) #endif // defined(WEBRTC_USE_PIPEWIRE)
diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc diff --git a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc
index ed03ba0..3bc6577 100644 index ed03ba0291..3bc6577ca5 100644
--- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc --- a/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc
+++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc +++ b/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
#include "modules/desktop_capture/desktop_capturer.h" #include "modules/desktop_capture/desktop_capturer.h"
#if defined(WEBRTC_USE_PIPEWIRE) #if defined(WEBRTC_USE_PIPEWIRE)
-#include "modules/desktop_capture/linux/window_capturer_pipewire.h" -#include "modules/desktop_capture/linux/window_capturer_pipewire.h"
+#include "modules/desktop_capture/linux/base_capturer_pipewire.h" +#include "modules/desktop_capture/linux/base_capturer_pipewire.h"
#endif // defined(WEBRTC_USE_PIPEWIRE) #endif // defined(WEBRTC_USE_PIPEWIRE)
#if defined(WEBRTC_USE_X11) #if defined(WEBRTC_USE_X11)
@@ -28,7 +28,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( @@ -28,7 +28,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer(
const DesktopCaptureOptions& options) { const DesktopCaptureOptions& options) {
@ -9703,15 +9796,15 @@ index ed03ba0..3bc6577 100644
+ return std::make_unique<BaseCapturerPipeWire>(options); + return std::make_unique<BaseCapturerPipeWire>(options);
} }
#endif // defined(WEBRTC_USE_PIPEWIRE) #endif // defined(WEBRTC_USE_PIPEWIRE)
diff --git a/third_party/moz.build b/third_party/moz.build diff --git a/third_party/moz.build b/third_party/moz.build
index 1941c11..f804531 100644 index 8cf6f5d9f6..33d4dc29c7 100644
--- a/third_party/moz.build --- a/third_party/moz.build
+++ b/third_party/moz.build +++ b/third_party/moz.build
@@ -49,6 +49,12 @@ with Files("libwebrtc/**"): @@ -58,6 +58,12 @@ with Files("libwebrtc/**"):
with Files("pipewire/**"): with Files("pipewire/**"):
BUG_COMPONENT = ("Core", "WebRTC") BUG_COMPONENT = ("Core", "WebRTC")
+with Files("drm/**"): +with Files("drm/**"):
+ BUG_COMPONENT = ("Core", "WebRTC") + BUG_COMPONENT = ("Core", "WebRTC")
+ +
@ -9720,9 +9813,9 @@ index 1941c11..f804531 100644
+ +
with Files('rlbox_wasm2c_sandbox/**'): with Files('rlbox_wasm2c_sandbox/**'):
BUG_COMPONENT = ('Firefox Build System', 'General') BUG_COMPONENT = ('Firefox Build System', 'General')
diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp diff --git a/third_party/pipewire/libpipewire/mozpipewire.cpp b/third_party/pipewire/libpipewire/mozpipewire.cpp
index 1ecfc31..fbeeb8e 100644 index 1ecfc3196a..fbeeb8e5a7 100644
--- a/third_party/pipewire/libpipewire/mozpipewire.cpp --- a/third_party/pipewire/libpipewire/mozpipewire.cpp
+++ b/third_party/pipewire/libpipewire/mozpipewire.cpp +++ b/third_party/pipewire/libpipewire/mozpipewire.cpp
@@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream, @@ -69,11 +69,13 @@ static int (*pw_stream_connect_fn)(struct pw_stream *stream,
@ -9747,7 +9840,7 @@ index 1ecfc31..fbeeb8e 100644
+static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept); +static void (*pw_thread_loop_signal_fn)(struct pw_thread_loop *loop, bool wait_for_accept);
static struct pw_properties* (*pw_properties_new_string_fn)(const char *str); static struct pw_properties* (*pw_properties_new_string_fn)(const char *str);
+static const char* (*pw_get_library_version_fn)(); +static const char* (*pw_get_library_version_fn)();
bool IsPwLibraryLoaded() { bool IsPwLibraryLoaded() {
static bool isLoaded = static bool isLoaded =
@@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() { @@ -99,6 +104,7 @@ bool IsPwLibraryLoaded() {
@ -9767,7 +9860,7 @@ index 1ecfc31..fbeeb8e 100644
+ IS_FUNC_LOADED(pw_thread_loop_wait_fn) && + IS_FUNC_LOADED(pw_thread_loop_wait_fn) &&
+ IS_FUNC_LOADED(pw_properties_new_string_fn) && + IS_FUNC_LOADED(pw_properties_new_string_fn) &&
+ IS_FUNC_LOADED(pw_get_library_version_fn)); + IS_FUNC_LOADED(pw_get_library_version_fn));
return isLoaded; return isLoaded;
} }
@@ -136,6 +145,7 @@ bool LoadPWLibrary() { @@ -136,6 +145,7 @@ bool LoadPWLibrary() {
@ -9787,12 +9880,12 @@ index 1ecfc31..fbeeb8e 100644
GET_FUNC(pw_properties_new_string, pwLib); GET_FUNC(pw_properties_new_string, pwLib);
+ GET_FUNC(pw_get_library_version, pwLib); + GET_FUNC(pw_get_library_version, pwLib);
} }
return IsPwLibraryLoaded(); return IsPwLibraryLoaded();
@@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream, @@ -242,6 +255,15 @@ pw_stream_connect(struct pw_stream *stream,
params, n_params); params, n_params);
} }
+int +int
+pw_stream_disconnect(struct pw_stream *stream) +pw_stream_disconnect(struct pw_stream *stream)
+{ +{
@ -9808,7 +9901,7 @@ index 1ecfc31..fbeeb8e 100644
@@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop) @@ -356,6 +378,23 @@ pw_thread_loop_unlock(struct pw_thread_loop *loop)
return pw_thread_loop_unlock_fn(loop); return pw_thread_loop_unlock_fn(loop);
} }
+void +void
+pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept) +pw_thread_loop_signal(struct pw_thread_loop *loop, bool wait_for_accept)
+{ +{
@ -9826,13 +9919,13 @@ index 1ecfc31..fbeeb8e 100644
+ } + }
+ return pw_thread_loop_wait_fn(loop); + return pw_thread_loop_wait_fn(loop);
+} +}
struct pw_properties * struct pw_properties *
pw_properties_new_string(const char *str) pw_properties_new_string(const char *str)
@@ -366,3 +405,12 @@ pw_properties_new_string(const char *str) @@ -366,3 +405,12 @@ pw_properties_new_string(const char *str)
return pw_properties_new_string_fn(str); return pw_properties_new_string_fn(str);
} }
+const char* +const char*
+pw_get_library_version() +pw_get_library_version()
+{ +{
@ -9842,75 +9935,3 @@ index 1ecfc31..fbeeb8e 100644
+ return pw_get_library_version_fn(); + return pw_get_library_version_fn();
+} +}
+ +
diff -up firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build.libwebrtc-screen-cast-sync 2022-05-27 01:17:03.000000000 +0200
+++ firefox-101.0/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build 2022-06-02 12:48:28.316640076 +0200
@@ -76,6 +76,8 @@ if CONFIG["OS_TARGET"] == "Darwin":
LOCAL_INCLUDES += [
"/media/libyuv/libyuv/include/",
"/media/libyuv/libyuv/include/",
+ "/third_party/drm/",
+ "/third_party/gbm/",
"/third_party/pipewire/"
]
@@ -105,7 +107,8 @@ if CONFIG["OS_TARGET"] == "Linux":
LOCAL_INCLUDES += [
"/media/libyuv/libyuv/include/",
"/media/libyuv/libyuv/include/",
- "/third_party/pipewire/",
+ "/third_party/drm/",
+ "/third_party/gbm/",
"/third_party/pipewire/"
]
@@ -115,12 +118,16 @@ if CONFIG["OS_TARGET"] == "Linux":
]
SOURCES += [
- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc"
+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc"
+
]
UNIFIED_SOURCES += [
- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc",
"/third_party/libwebrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc",
"/third_party/libwebrtc/modules/desktop_capture/screen_capturer_linux.cc",
"/third_party/libwebrtc/modules/desktop_capture/window_capturer_linux.cc"
@@ -156,15 +163,18 @@ if CONFIG["OS_TARGET"] == "OpenBSD":
]
SOURCES += [
- "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc"
+ "/third_party/libwebrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/egl_dmabuf.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_pipewire.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/scoped_glib.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/screencast_portal.cc",
+ "/third_party/libwebrtc/modules/desktop_capture/linux/shared_screencast_stream.cc"
]
UNIFIED_SOURCES += [
"/third_party/libwebrtc/modules/desktop_capture/linux/mouse_cursor_monitor_x11.cc",
- "/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/screen_capturer_x11.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/shared_x_display.cc",
- "/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/window_capturer_x11.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/window_finder_x11.cc",
"/third_party/libwebrtc/modules/desktop_capture/linux/window_list_utils.cc",
@@ -206,6 +216,7 @@ if CONFIG["OS_TARGET"] == "WINNT":
LOCAL_INCLUDES += [
"/media/libyuv/libyuv/include/",
"/media/libyuv/libyuv/include/",
+ "/third_party/drm/"
"/third_party/pipewire/"
]