fix: check PipeWire init before creating generic capturer (#39873)

* 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.

Co-authored-by: Athul Iddya <athul@iddya.com>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Athul Iddya <athul@iddya.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
This commit is contained in:
trop[bot]
2023-09-19 10:03:56 +02:00
committed by GitHub
parent 496577d9cd
commit 8e3189a8ba
2 changed files with 24 additions and 0 deletions

View File

@@ -3,3 +3,4 @@ cherry-pick-0e9556a90cec.patch
fix_mark_pipewire_capturer_as_failed_after_session_is_closed.patch
pipewire_capturer_increase_buffer_size_to_avoid_buffer_overflow.patch
prevent_sdp_munging_of_duplicate_ssrcs.patch
fix_check_pipewire_init_before_creating_generic_capturer.patch

View File

@@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Athul Iddya <athul@iddya.com>
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 b99f5ecb803ac0ac0e26fbdb3411c77605f33011..8c377459c6c1fa2597b6a63991cfdd58a99b1900 100644
--- a/modules/desktop_capture/desktop_capturer.cc
+++ b/modules/desktop_capture/desktop_capturer.cc
@@ -111,7 +111,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateGenericCapturer(
std::unique_ptr<DesktopCapturer> capturer;
#if defined(WEBRTC_USE_PIPEWIRE)
- if (options.allow_pipewire() && DesktopCapturer::IsRunningUnderWayland()) {
+ if (options.allow_pipewire() && BaseCapturerPipeWire::IsSupported()) {
capturer = std::make_unique<BaseCapturerPipeWire>(
options, CaptureType::kAnyScreenContent);
}