From 910417e77281b215a35163beb546cbfe4cde498e Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 25 Oct 2026 15:50:08 -0700 Subject: [PATCH 1/2] fix(relay,video): unbreak the Windows platform build The relay's module-wide clippy::disallowed_methods expectation is only fulfilled by the Unix-only signal test, so Windows reports it unfulfilled and the denied-warnings test build fails. Move it onto that test. moq-video compiled code on Windows that nothing there calls: I420::from_bgra (only PipeWire uses it), pump::Read::Idle (only X11 returns it), and Applied::new under default features (NVENC and VA-API backends are Linux-only). Gate each to where it is used. Co-Authored-By: Claude Opus 5.5 --- rs/moq-relay/src/relay.rs | 7 +++++-- rs/moq-video/src/capture/pump.rs | 4 +++- rs/moq-video/src/encode/encoder.rs | 6 +++++- rs/moq-video/src/frame.rs | 7 +++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/rs/moq-relay/src/relay.rs b/rs/moq-relay/src/relay.rs index 6979b978f61..4e8b5c34af8 100644 --- a/rs/moq-relay/src/relay.rs +++ b/rs/moq-relay/src/relay.rs @@ -868,7 +868,6 @@ async fn serve_listening( } #[cfg(test)] -#[expect(clippy::disallowed_methods, reason = "tests read the host clock directly")] mod tests { #[cfg(feature = "stun")] #[tokio::test] @@ -920,7 +919,11 @@ mod tests { /// exits at once rather than starting the drain again. #[cfg(unix)] #[tokio::test(start_paused = true)] - #[expect(clippy::disallowed_types, reason = "tests read the host clock directly")] + #[expect( + clippy::disallowed_methods, + clippy::disallowed_types, + reason = "tests read the host clock directly" + )] async fn a_signal_after_an_early_trigger_exits_at_once() { let _signals = crate::shutdown::SIGNALS.lock().await; // Either arm is ready, so an unbiased wait would pass some runs. diff --git a/rs/moq-video/src/capture/pump.rs b/rs/moq-video/src/capture/pump.rs index fb7c5baae94..5b233be1d9f 100644 --- a/rs/moq-video/src/capture/pump.rs +++ b/rs/moq-video/src/capture/pump.rs @@ -31,7 +31,8 @@ pub(super) enum Read { FrameAt(Surface, moq_net::Timestamp), /// No frame this turn, but the source is still live: the pump re-checks its /// stop flag and calls again. A backend uses this to hold a capture (a - /// minimized or mid-resize window) without ending the stream. + /// minimized or mid-resize window) without ending the stream. Only X11 holds one. + #[cfg(target_os = "linux")] Idle, /// The source stopped producing; the stream ends and the caller reopens. Done, @@ -98,6 +99,7 @@ where match read(&mut source) { Ok(Read::Frame(frame)) => chan.push(frame), Ok(Read::FrameAt(frame, timestamp)) => chan.push_native(frame, timestamp), + #[cfg(target_os = "linux")] Ok(Read::Idle) => {} // held: re-check the stop flag, then read again Ok(Read::Done) => break, // device stopped producing frames Err(err) => { diff --git a/rs/moq-video/src/encode/encoder.rs b/rs/moq-video/src/encode/encoder.rs index ab16582db9b..d035ee8a8ac 100644 --- a/rs/moq-video/src/encode/encoder.rs +++ b/rs/moq-video/src/encode/encoder.rs @@ -146,7 +146,11 @@ impl Applied { /// A report that `preset` took effect through `controls`. #[cfg_attr( - not(any(feature = "openh264", feature = "nvidia", feature = "vaapi", target_os = "macos")), + not(any( + feature = "openh264", + apple, + all(target_os = "linux", any(feature = "nvidia", feature = "vaapi")) + )), allow(dead_code, reason = "only the encoder backends report a preset") )] pub(crate) fn new(preset: Preset, controls: impl Into) -> Self { diff --git a/rs/moq-video/src/frame.rs b/rs/moq-video/src/frame.rs index f8a05b3384f..da14325e7bc 100644 --- a/rs/moq-video/src/frame.rs +++ b/rs/moq-video/src/frame.rs @@ -884,10 +884,9 @@ impl I420 { /// Convert BGRA to I420 in [`Color::infer`]'s color space for this size. /// `stride` is the source row pitch in bytes (>= `width * 4`), so a padded - /// surface maps directly. Used by the screen-capture paths: Windows Desktop - /// Duplication (BGRA staging texture) and Linux PipeWire (BGRx/BGRA - /// shared-memory buffers). - #[cfg(any(target_os = "windows", all(target_os = "linux", feature = "pipewire")))] + /// surface maps directly. Used by PipeWire capture's BGRx/BGRA shared-memory + /// buffers. + #[cfg(all(target_os = "linux", feature = "pipewire"))] pub(crate) fn from_bgra(bgra: &[u8], stride: u32, size: Size) -> Result { use yuv::bgra_to_yuv420; From ec149783934ebebb1ab932c6d3a114e556245a3d Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 25 Oct 2026 16:26:52 -0700 Subject: [PATCH 2/2] fix(relay): allow the clock in the STUN test too The module-wide expectation also covered the stun-gated test's tokio::time::timeout, so the all-features shape now needs its own allowance. Also take rustfmt's spacing on the gated match arm. Co-Authored-By: Claude Opus 5.5 --- rs/moq-relay/src/relay.rs | 1 + rs/moq-video/src/capture/pump.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rs/moq-relay/src/relay.rs b/rs/moq-relay/src/relay.rs index 4e8b5c34af8..08e5b3a1b43 100644 --- a/rs/moq-relay/src/relay.rs +++ b/rs/moq-relay/src/relay.rs @@ -871,6 +871,7 @@ async fn serve_listening( mod tests { #[cfg(feature = "stun")] #[tokio::test] + #[expect(clippy::disallowed_methods, reason = "tests read the host clock directly")] async fn stun_listener_runs_with_the_relay_and_stops_with_it() { use stun_types::message::{BINDING, Message, MessageWriteVec}; use stun_types::prelude::*; diff --git a/rs/moq-video/src/capture/pump.rs b/rs/moq-video/src/capture/pump.rs index 5b233be1d9f..7a30767062a 100644 --- a/rs/moq-video/src/capture/pump.rs +++ b/rs/moq-video/src/capture/pump.rs @@ -100,7 +100,7 @@ where Ok(Read::Frame(frame)) => chan.push(frame), Ok(Read::FrameAt(frame, timestamp)) => chan.push_native(frame, timestamp), #[cfg(target_os = "linux")] - Ok(Read::Idle) => {} // held: re-check the stop flag, then read again + Ok(Read::Idle) => {} // held: re-check the stop flag, then read again Ok(Read::Done) => break, // device stopped producing frames Err(err) => { chan.fail(err);