From 50ce02c312ac78d170d3e94dda0282fc64080862 Mon Sep 17 00:00:00 2001 From: Athul Iddya Date: Thu, 14 Sep 2023 12:50:20 -0700 Subject: [PATCH] fix: check PipeWire init before creating generic capturer (#39846) Check if PipeWire can be initialized before creating generic capturer. This harmonizes the conditions with the ones used in Linux implementations of DesktopCapturer::CreateRawScreenCapturer and DesktopCapturer::CreateRawWindowCapturer. --- patches/webrtc/.patches | 1 + ...nit_before_creating_generic_capturer.patch | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 patches/webrtc/fix_check_pipewire_init_before_creating_generic_capturer.patch diff --git a/patches/webrtc/.patches b/patches/webrtc/.patches index 0cf4d364bb50..63f7e05ecd6b 100644 --- a/patches/webrtc/.patches +++ b/patches/webrtc/.patches @@ -1,2 +1,3 @@ fix_fallback_to_x11_capturer_on_wayland.patch fix_mark_pipewire_capturer_as_failed_after_session_is_closed.patch +fix_check_pipewire_init_before_creating_generic_capturer.patch diff --git a/patches/webrtc/fix_check_pipewire_init_before_creating_generic_capturer.patch b/patches/webrtc/fix_check_pipewire_init_before_creating_generic_capturer.patch new file mode 100644 index 000000000000..e68db3ae8f36 --- /dev/null +++ b/patches/webrtc/fix_check_pipewire_init_before_creating_generic_capturer.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Athul Iddya +Date: Tue, 12 Sep 2023 22:19:46 -0700 +Subject: fix: check PipeWire init before creating generic capturer + +Check if PipeWire can be initialized before creating generic capturer. +This harmonizes the conditions with the ones used in Linux +implementations of DesktopCapturer::CreateRawScreenCapturer and +DesktopCapturer::CreateRawWindowCapturer. + +diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc +index a52a76c2625cf0a2eae7ab5b841e0bf4ff499d88..099313bc1b4e75ebbe62c30190a068f68bfe5366 100644 +--- a/modules/desktop_capture/desktop_capturer.cc ++++ b/modules/desktop_capture/desktop_capturer.cc +@@ -113,7 +113,7 @@ std::unique_ptr DesktopCapturer::CreateGenericCapturer( + std::unique_ptr capturer; + + #if defined(WEBRTC_USE_PIPEWIRE) +- if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) { ++ if (options.allow_pipewire() && BaseCapturerPipeWire::IsSupported()) { + capturer = std::make_unique( + options, CaptureType::kAnyScreenContent); + }