Files
electron/patches/webrtc/fix_handle_pipewire_capturer_initialization_and_management.patch
electron-roller[bot] 55d8b71d72 chore: bump chromium to 141.0.7346.0 (main) (#47983)
* chore: bump chromium in DEPS to 141.0.7341.0

* chore: bump chromium in DEPS to 141.0.7342.0

* chore: update patches

manually resolved conflict in `osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch` due to https://crrev.com/c/6681354

* 6819541: WebShare: Improve mac share behavior when sharing a URL
https://chromium-review.googlesource.com/c/chromium/src/+/6819541

* Add missing include for SkBitmap

Couldn't quickly find where we lost the full definition in this file's includes. 🤷

* 6771055: [SxS] Move devtools to ContentsContainerView supporting side-by-side.
https://chromium-review.googlesource.com/c/chromium/src/+/6771055

There may be some simplification possible here (set_x, Rect position, ...), but this change is satisfactory to maintain the current behavior.

* 6813689: Switch SystemMemoryInfoKB to use ByteCount
https://chromium-review.googlesource.com/c/chromium/src/+/6813689

* 6818486: Track DevTools feature usage in new badge tracker
https://chromium-review.googlesource.com/c/chromium/src/+/6818486

* chore: bump chromium in DEPS to 141.0.7344.0

* Remove ELECTRON_OZONE_PLATFORM_HINT env var

6819616: Remove OzonePlatformHint | https://chromium-review.googlesource.com/c/chromium/src/+/6819616

See: https://github.com/electron/electron/issues/48001

* chore: update patches

* Add missing include for `base::NumberToString`

* Remove `DESKTOP_STARTUP_ID` code

This was removed upstream in https://chromium-review.googlesource.com/c/chromium/src/+/6819616 and I confirmed with the author that it was an intentional change. Going to mirror upstream and remove it here too.

* chore: bump chromium in DEPS to 141.0.7346.0

* chore: update patches

* 6828465: Reland "Remove BluezDBusThreadManager"
https://chromium-review.googlesource.com/c/chromium/src/+/6828465

* Patch change to Node.js test output

V8 enhanced the stack trace of "thenable" async tasks. A couple of Node.js tests needed to have their snapshots updates to accomodate the extra stack trace frames in the output.

This patch should be upstreamed to Node.js.

See:
6826001: fix thenable async stack trace
https://chromium-review.googlesource.com/c/v8/v8/+/6826001

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
2025-08-11 12:57:31 +09:00

101 lines
4.6 KiB
Diff

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: Handle PipeWire capturer initialization and management
This patch handles several fixes related to PipeWire capturer initialization
and management.
1. Mark PipeWire capturer as failed after session is closed
After a PipeWire screencast session is successfully started, the
consumer is expected to keep calling CaptureFrame() from the
DesktopCapturer interface in a loop to pull frames. A PipeWire
screencast session can be closed by the server on user action. Once the
session is closed, there's no point in calling CaptureFrame() again as
the capture has to be restarted. Inform the caller of the failure by
returning Result::ERROR_PERMANENT on the next invocation of
CaptureFrame().
2. 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.
3. Establishes fallback to X11 capturer when PipeWire fails to start
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 change re-enables that fallback, which was
previously default behavior.
diff --git a/modules/desktop_capture/desktop_capturer.cc b/modules/desktop_capture/desktop_capturer.cc
index ae9aba26ee56e8a0d48f81994f964b278c9019d3..758f1b44e01adb6807bc7c5f673d06fffbac5865 100644
--- a/modules/desktop_capture/desktop_capturer.cc
+++ b/modules/desktop_capture/desktop_capturer.cc
@@ -123,7 +123,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);
}
diff --git a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
index 361b465dad2a53f4dac774fa2d6d6d9e3fc5fc31..ef05a35bc4f2c2352b12c0af0b09193b6cd53244 100644
--- a/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
+++ b/modules/desktop_capture/linux/wayland/base_capturer_pipewire.cc
@@ -123,6 +123,7 @@ void BaseCapturerPipeWire::OnScreenCastRequestResult(RequestResponse result,
void BaseCapturerPipeWire::OnScreenCastSessionClosed() {
if (!capturer_failed_) {
options_.screencast_stream()->StopScreenCastStream();
+ capturer_failed_ = true;
}
capturer_failed_ = true;
}
diff --git a/modules/desktop_capture/screen_capturer_linux.cc b/modules/desktop_capture/screen_capturer_linux.cc
index 94726750c5762e22b517445b23254513eb207aae..85946a6c7eef56a66c0ee2ec06bdc5f2ba49c53c 100644
--- a/modules/desktop_capture/screen_capturer_linux.cc
+++ b/modules/desktop_capture/screen_capturer_linux.cc
@@ -35,11 +35,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 f621a63e72131fd8426361a078a55d1e07c0e436..91394503da5e7f6d090e2eaede02316cf51ad7b2 100644
--- a/modules/desktop_capture/window_capturer_linux.cc
+++ b/modules/desktop_capture/window_capturer_linux.cc
@@ -35,11 +35,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