summaryrefslogtreecommitdiff
path: root/pw3.patch
blob: 82d451eb16da0b91054b18ccb2619cdc25618da6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183

# HG changeset patch
# User stransky <stransky@redhat.com>
# Date 1604562423 0
# Node ID d1a244822d7811575f5bb3cd024f8f324275aec2
# Parent  998e6d0b24e4a560e5664aaef87307e9c069ad87
Bug 1672989 Build PipeWire as a part of default builds, r=dminor

Differential Revision: https://phabricator.services.mozilla.com/D94590

diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn b/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/BUILD.gn
@@ -152,22 +152,17 @@ if (rtc_include_tests) {
       "../../rtc_base:rtc_base_approved",
       "../../test:test_support",
     ]
   }
 }
 
 if (is_linux) {
   if (rtc_use_pipewire) {
-    pkg_config("pipewire") {
-      packages = [ "libpipewire-0.2" ]
-
-      defines = [ "WEBRTC_USE_PIPEWIRE" ]
-    }
-
+    defines = [ "WEBRTC_USE_PIPEWIRE" ]
     pkg_config("gio") {
       packages = [
         "gio-2.0",
         "gio-unix-2.0",
       ]
     }
   }
 }
@@ -326,16 +321,17 @@ rtc_static_library("desktop_capture_gene
   } else {
     sources += [
       "fake_desktop_capturer.cc",
       "fake_desktop_capturer.h",
     ]
   }
 
   if (use_x11 || rtc_use_pipewire) {
+    include_dirs = [ "/third_party/libwebrtc/third_party/pipewire" ]
     sources += [
       "mouse_cursor_monitor_linux.cc",
       "screen_capturer_linux.cc",
       "window_capturer_linux.cc",
     ]
   }
 
   if (use_x11) {
@@ -367,16 +363,17 @@ rtc_static_library("desktop_capture_gene
         "linux/desktop_device_info_x11.h",
         "linux/shared_x_util.cc",
         "linux/shared_x_util.h",
       ]
     }
   }
 
   if (rtc_use_pipewire) {
+    include_dirs = [ "/third_party/libwebrtc/third_party/pipewire" ]
     sources += [
       "linux/base_capturer_pipewire.cc",
       "linux/base_capturer_pipewire.h",
       "linux/screen_capturer_pipewire.cc",
       "linux/screen_capturer_pipewire.h",
       "linux/window_capturer_pipewire.cc",
       "linux/window_capturer_pipewire.h",
     ]
diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn/moz.build
@@ -20,17 +20,18 @@ DEFINES["WEBRTC_RESTRICT_LOGGING"] = Tru
 FINAL_LIBRARY = "webrtc"
 
 
 LOCAL_INCLUDES += [
     "!/ipc/ipdl/_ipdlheaders",
     "/ipc/chromium/src",
     "/ipc/glue",
     "/media/libyuv/libyuv/include/",
-    "/third_party/libwebrtc/webrtc/"
+    "/third_party/libwebrtc/webrtc/",
+    "/third_party/pipewire"
 ]
 
 UNIFIED_SOURCES += [
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/capture_result_desktop_capturer_wrapper.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/cropped_desktop_frame.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/cropping_window_capturer.cc",
     "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc",
@@ -156,16 +157,17 @@ if CONFIG["OS_TARGET"] == "FreeBSD":
 
 if CONFIG["OS_TARGET"] == "Linux":
 
     DEFINES["USE_NSS_CERTS"] = "1"
     DEFINES["USE_X11"] = "1"
     DEFINES["WEBRTC_LINUX"] = True
     DEFINES["WEBRTC_POSIX"] = True
     DEFINES["_FILE_OFFSET_BITS"] = "64"
+    DEFINES["WEBRTC_USE_PIPEWIRE"] = "1"
 
     OS_LIBS += [
         "rt",
         "X11",
         "X11-xcb",
         "xcb",
         "Xcomposite",
         "Xcursor",
@@ -188,16 +190,24 @@ if CONFIG["OS_TARGET"] == "Linux":
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/x_atom_cache.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/x_error_trap.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/x_server_pixel_buffer.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/mouse_cursor_monitor_linux.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/screen_capturer_linux.cc",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/window_capturer_linux.cc"
     ]
 
+    CXXFLAGS += CONFIG['TK_CFLAGS']
+
+    UNIFIED_SOURCES += [
+        "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/base_capturer_pipewire.cc",
+        "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/screen_capturer_pipewire.cc",
+        "/third_party/libwebrtc/webrtc/modules/desktop_capture/linux/window_capturer_pipewire.cc"
+    ]
+
 if CONFIG["OS_TARGET"] == "NetBSD":
 
     DEFINES["USE_X11"] = "1"
     DEFINES["WEBRTC_BSD"] = True
     DEFINES["WEBRTC_POSIX"] = True
     DEFINES["_FILE_OFFSET_BITS"] = "64"
 
     OS_LIBS += [
diff --git a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h
--- a/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h
+++ b/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_options.h
@@ -136,15 +136,15 @@ class DesktopCaptureOptions {
 #if defined(USE_X11)
   bool use_update_notifications_ = false;
 #else
   bool use_update_notifications_ = true;
 #endif
   bool disable_effects_ = true;
   bool detect_updated_region_ = false;
 #if defined(WEBRTC_USE_PIPEWIRE)
-  bool allow_pipewire_ = false;
+  bool allow_pipewire_ = true;
 #endif
 };
 
 }  // namespace webrtc
 
 #endif  // MODULES_DESKTOP_CAPTURE_DESKTOP_CAPTURE_OPTIONS_H_
diff --git a/third_party/libwebrtc/webrtc/moz.build b/third_party/libwebrtc/webrtc/moz.build
--- a/third_party/libwebrtc/webrtc/moz.build
+++ b/third_party/libwebrtc/webrtc/moz.build
@@ -181,16 +181,19 @@ if CONFIG["OS_TARGET"] == "Linux":
 
     DIRS += [
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/webrtc/modules/video_capture/video_capture_internal_impl_gn",
         "/third_party/libwebrtc/webrtc/system_wrappers/cpu_features_linux_gn"
     ]
+    DIRS += [
+        "/third_party/pipewire/libpipewire"
+    ]
 
 if CONFIG["OS_TARGET"] == "NetBSD":
 
     DIRS += [
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_generic_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/desktop_capture_gn",
         "/third_party/libwebrtc/webrtc/modules/desktop_capture/primitives_gn",
         "/third_party/libwebrtc/webrtc/modules/video_capture/video_capture_internal_impl_gn"

bgstack15