-
Notifications
You must be signed in to change notification settings - Fork 15k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fallback to X11 capturer if pipewire fails on Wayland (#37526)
* fix: fallback to x11 desktop capturer on Wayland Co-authored-by: VerteDinde <keeleymhammond@gmail.com> * fix: sanitize window/screen capturer inputs Co-authored-by: Keeley Hammond <vertedinde@electronjs.org> * chore: clean up patch description Co-authored-by: Keeley Hammond <vertedinde@electronjs.org> * chore: update patches --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <keeleymhammond@gmail.com> Co-authored-by: Keeley Hammond <vertedinde@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c174ed7
commit 093a215
Showing
5 changed files
with
84 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
cherry-pick-e0efbd45ea74.patch | ||
fix_fallback_to_x11_capturer_on_wayland.patch |
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
patches/webrtc/fix_fallback_to_x11_capturer_on_wayland.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: VerteDinde <keeleymhammond@gmail.com> | ||
Date: Sun, 5 Mar 2023 21:04:37 -0800 | ||
Subject: fix: fallback to X11 capturer on Wayland | ||
|
||
CL: https://webrtc-review.googlesource.com/c/src/+/279163 | ||
|
||
Desktop Capturer behaves inconsistently on Wayland. PipeWire does not | ||
always successfully start; if it does not, we return a nullptr rather | ||
than falling back on the X11 capturer, crashing the application. | ||
|
||
If the X11 capturer is enabled, we should at minimum try to fallback | ||
to X11 for desktop capturer. This patch re-enables that fallback, | ||
which was previously default behavior. | ||
|
||
This patch can be removed when 1) this fix is upstreamed, or 2) the | ||
stability of PipeWire initialization is improved upstream. | ||
|
||
Patch_Filename: fix_fallback_to_x11_desktop_capturer_wayland.patch | ||
|
||
diff --git a/modules/desktop_capture/screen_capturer_linux.cc b/modules/desktop_capture/screen_capturer_linux.cc | ||
index 44993837e8bbd84a11ec9d187349a95f83258910..cd9f8b0be6a19d057fe9150382fb72bc4032b343 100644 | ||
--- a/modules/desktop_capture/screen_capturer_linux.cc | ||
+++ b/modules/desktop_capture/screen_capturer_linux.cc | ||
@@ -34,11 +34,10 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( | ||
#endif // defined(WEBRTC_USE_PIPEWIRE) | ||
|
||
#if defined(WEBRTC_USE_X11) | ||
- if (!DesktopCapturer::IsRunningUnderWayland()) | ||
- return ScreenCapturerX11::CreateRawScreenCapturer(options); | ||
-#endif // defined(WEBRTC_USE_X11) | ||
- | ||
+ return ScreenCapturerX11::CreateRawScreenCapturer(options); | ||
+#else | ||
return nullptr; | ||
+#endif // defined(WEBRTC_USE_X11) | ||
} | ||
|
||
} // namespace webrtc | ||
diff --git a/modules/desktop_capture/window_capturer_linux.cc b/modules/desktop_capture/window_capturer_linux.cc | ||
index 4205bf9bc0eede48cdc39353c77ceb6e7529fd51..785dc01a1911fd027401b1461223668333e05558 100644 | ||
--- a/modules/desktop_capture/window_capturer_linux.cc | ||
+++ b/modules/desktop_capture/window_capturer_linux.cc | ||
@@ -34,11 +34,10 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawWindowCapturer( | ||
#endif // defined(WEBRTC_USE_PIPEWIRE) | ||
|
||
#if defined(WEBRTC_USE_X11) | ||
- if (!DesktopCapturer::IsRunningUnderWayland()) | ||
- return WindowCapturerX11::CreateRawWindowCapturer(options); | ||
-#endif // defined(WEBRTC_USE_X11) | ||
- | ||
+ return WindowCapturerX11::CreateRawWindowCapturer(options); | ||
+#else | ||
return nullptr; | ||
+#endif // defined(WEBRTC_USE_X11) | ||
} | ||
|
||
} // namespace webrtc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters