From 11aa9d35e7342058940932750e6102274833c7a8 Mon Sep 17 00:00:00 2001 From: developer1010x Date: Fri, 20 Nov 2026 21:25:07 +0530 Subject: [PATCH] fix(capture): copy PipeWire frames into system memory to stop the green picture Co-Authored-By: Claude Opus 5.5 --- crates/openplay-pipeline/src/encoder.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/openplay-pipeline/src/encoder.rs b/crates/openplay-pipeline/src/encoder.rs index 814c1b7..a01f51a 100644 --- a/crates/openplay-pipeline/src/encoder.rs +++ b/crates/openplay-pipeline/src/encoder.rs @@ -254,7 +254,12 @@ pub fn build_capture_element( .property("fd", pw_fd) .property("path", node_id.to_string()) .property("do-timestamp", true) - .property("always-copy", false) + // Copy every frame into system memory. Without this the portal can + // hand out DMABuf/shared buffers that the CPU-side `videoconvert` + // downstream reads as zeros, and all-zero YUV encodes as a solid + // green picture at the receiver. One memcpy per frame is cheap + // next to the encode. + .property("always-copy", true) .build() .map_err(|e| PipelineError::MissingElement(format!("pipewiresrc: {e}"))) }