Skip to content

Commit

Permalink
fix: check PipeWire init before creating generic capturer (#39873)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed Sep 19, 2023
1 parent 496577d commit 8e3189a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions patches/webrtc/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit 8e3189a

Please sign in to comment.