summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/moz-patch-stack/0085.patch
blob: bac4cf6c9c1b0aceae9e1ced6b6d0e976b17b014 (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
From: Jan Grulich <jgrulich@redhat.com>
Date: Mon, 27 Feb 2023 13:57:00 +0000
Subject: Bug 1819044 - fix build non-pipewire builds
 r=webrtc-reviewers,pehrsons

We should check only for PipeWire presence when building code specific
to PipeWire.

Differential Revision: https://phabricator.services.mozilla.com/D171071
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/7a879ad084a6e9768479c73cc5c3f4e9d95a2ab9

Also includes:

    Bug 1819044 - fix build non-pipewire builds (attempt #2) r=webrtc-reviewers,pehrsons

    Make the new API available to everyone and just return an empty capturer
    in case when building without PipeWire. It will not make any difference
    because using X11 based capturers on Wayland is useless anyway so if we
    fail for missing PipeWire on Wayland, it will have the same outcome.

    Differential Revision: https://phabricator.services.mozilla.com/D171192
    Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/ad247b0aac896d884eba5e40f0ec8a9f50d8b85b
---
 modules/desktop_capture/desktop_capturer.cc | 7 +++----
 modules/desktop_capture/desktop_capturer.h  | 4 ----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
index 7df6becb4e..1af19a1fd2 100644
--- a/modules/desktop_capture/desktop_capturer.cc
+++ b/modules/desktop_capture/desktop_capturer.cc
@@ -26,7 +26,7 @@
 #include "rtc_base/win/windows_version.h"
 #endif  // defined(RTC_ENABLE_WIN_WGC)
 
-#if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
+#if defined(WEBRTC_USE_PIPEWIRE)
 #include "modules/desktop_capture/linux/wayland/base_capturer_pipewire.h"
 #endif
 
@@ -88,7 +88,6 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
   return capturer;
 }
 
-#if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
 // static
 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
     const DesktopCaptureOptions& options) {
@@ -100,17 +99,17 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
   return capturer;
 }
 
-// static
 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawGenericCapturer(
     const DesktopCaptureOptions& options) {
+#if defined(WEBRTC_USE_PIPEWIRE)
   if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) {
     return std::make_unique<BaseCapturerPipeWire>(options,
                                                   CaptureType::kAnyScreenContent);
   }
+#endif  // defined(WEBRTC_USE_PIPEWIRE)
 
   return nullptr;
 }
-#endif  // defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
 
 // static
 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
diff --git a/modules/desktop_capture/desktop_capturer.h b/modules/desktop_capture/desktop_capturer.h
index 951c4a9b10..12ef57ba26 100644
--- a/modules/desktop_capture/desktop_capturer.h
+++ b/modules/desktop_capture/desktop_capturer.h
@@ -170,11 +170,9 @@ class RTC_EXPORT DesktopCapturer {
   // The return value if `pos` is out of the scope of the source is undefined.
   virtual bool IsOccluded(const DesktopVector& pos);
 
-#if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
   // Creates a DesktopCapturer instance which targets to capture windows and screens.
   static std::unique_ptr<DesktopCapturer> CreateGenericCapturer(
       const DesktopCaptureOptions& options);
-#endif
 
   // Creates a DesktopCapturer instance which targets to capture windows.
   static std::unique_ptr<DesktopCapturer> CreateWindowCapturer(
@@ -204,12 +202,10 @@ class RTC_EXPORT DesktopCapturer {
   // CroppingWindowCapturer needs to create raw capturers without wrappers, so
   // the following two functions are protected.
 
-#if defined(WEBRTC_USE_PIPEWIRE) || defined(WEBRTC_USE_X11)
   // Creates a platform specific DesktopCapturer instance which targets to
   // capture windows and screens.
   static std::unique_ptr<DesktopCapturer> CreateRawGenericCapturer(
       const DesktopCaptureOptions& options);
-#endif
 
   // Creates a platform specific DesktopCapturer instance which targets to
   // capture windows.
-- 
2.34.1