fix(natives): port wayland capture to pipewire 0.9 Rc handle API

capture.rs still constructed the PipeWire main loop and context via the
0.8 owning constructors (MainLoop::new / Context::new / connect_fd),
which pipewire 0.9.2 removed in favour of the Rc handle types. The
migration was partial — StreamBox::new was already 0.9 — so the
wayland-pipewire feature failed to compile with E0599.

Switch to MainLoopRc::new / ContextRc::new(&loop, None) / connect_fd_rc.
The downstream call sites are unchanged: MainLoopRc derefs to MainLoop
(run/quit/clone), ContextRc derefs to Context, and CoreRc derefs to
Core so StreamBox::new(&core, ...) still coerces.

Fixes #7885
This commit is contained in:
roboomp
2026-08-07 06:42:16 +00:00
parent 3a8591a8af
commit 30264cb151
2 changed files with 8 additions and 4 deletions
@@ -147,11 +147,11 @@ fn rgba_from_buffer(
fn grab_pipewire_frame(node: u32, fd: OwnedFd) -> Result<RgbaImage, String> {
pw::init();
let mainloop =
pw::main_loop::MainLoop::new(None).map_err(|err| format!("PipeWire main loop: {err}"))?;
let context =
pw::context::Context::new(&mainloop).map_err(|err| format!("PipeWire context: {err}"))?;
pw::main_loop::MainLoopRc::new(None).map_err(|err| format!("PipeWire main loop: {err}"))?;
let context = pw::context::ContextRc::new(&mainloop, None)
.map_err(|err| format!("PipeWire context: {err}"))?;
let core = context
.connect_fd(fd, None)
.connect_fd_rc(fd, None)
.map_err(|err| format!("PipeWire remote: {err}"))?;
let stream = pw::stream::StreamBox::new(&core, "omp-computer-capture", properties! {
*pw::keys::MEDIA_TYPE => "Video",
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed the `wayland-pipewire` Cargo feature failing to compile: the PipeWire capture path still used the removed 0.8 `MainLoop::new` / `Context::new` / `connect_fd` constructors instead of the 0.9 `MainLoopRc` / `ContextRc` / `connect_fd_rc` handle API ([#7885](https://github.com/can1357/oh-my-pi/issues/7885)).
## [17.2.10] - 2026-08-06
### Fixed