From eb8a659319e80935df980291dff218a66890091e Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Wed, 15 Jul 2026 02:18:45 +0200 Subject: [PATCH] fix(client): unused 'decoder label under default features + box the PyroWave backend variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ci.yml's -D warnings clippy (default features) flagged the labeled block whose only break lives behind the pyrowave cfg — restructured as cfg'd let-bindings, no label. Also boxed Backend::PyroWave (the decoder's pinned create-info hold + plane ring dwarfed the other variants — clippy::large_enum_variant under the feature). Both configs strict-clippy clean on .21; 26 tests green. Co-Authored-By: Claude Fable 5 --- crates/pf-client-core/src/session.rs | 27 ++++++++++++++------------- crates/pf-client-core/src/video.rs | 7 ++++--- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/crates/pf-client-core/src/session.rs b/crates/pf-client-core/src/session.rs index 2dd44f03..8298ee9b 100644 --- a/crates/pf-client-core/src/session.rs +++ b/crates/pf-client-core/src/session.rs @@ -278,22 +278,23 @@ fn pump( welcome_codec = connector.codec, "negotiated video codec" ); - let built = 'decoder: { - // A negotiated PyroWave session decodes on the presenter's device, no FFmpeg — - // reachable only through the explicit preference above (resolve_codec never - // auto-picks the bit), so failing loudly here is failing an opted-in experiment. - #[cfg(all(target_os = "linux", feature = "pyrowave"))] - if connector.codec == punktfunk_core::quic::CODEC_PYROWAVE { - let mode = connector.mode(); - break 'decoder match params.vulkan.as_ref() { - Some(vk) => Decoder::new_pyrowave(vk, mode.width, mode.height), - None => Err(anyhow::anyhow!( - "pyrowave session without a presenter device" - )), - }; + // A negotiated PyroWave session decodes on the presenter's device, no FFmpeg — + // reachable only through the explicit preference above (resolve_codec never + // auto-picks the bit), so failing loudly here is failing an opted-in experiment. + #[cfg(all(target_os = "linux", feature = "pyrowave"))] + let built = if connector.codec == punktfunk_core::quic::CODEC_PYROWAVE { + let mode = connector.mode(); + match params.vulkan.as_ref() { + Some(vk) => Decoder::new_pyrowave(vk, mode.width, mode.height), + None => Err(anyhow::anyhow!( + "pyrowave session without a presenter device" + )), } + } else { Decoder::new(codec_id, ¶ms.decoder, params.vulkan.as_ref()) }; + #[cfg(not(all(target_os = "linux", feature = "pyrowave")))] + let built = Decoder::new(codec_id, ¶ms.decoder, params.vulkan.as_ref()); let mut decoder = match built { Ok(d) => d, Err(e) => { diff --git a/crates/pf-client-core/src/video.rs b/crates/pf-client-core/src/video.rs index 05907148..c3c47cb3 100644 --- a/crates/pf-client-core/src/video.rs +++ b/crates/pf-client-core/src/video.rs @@ -323,8 +323,9 @@ enum Backend { D3d11va(crate::video_d3d11::D3d11vaDecoder), /// PyroWave (wired-LAN wavelet codec): pyrowave compute on the presenter's device, /// no FFmpeg involvement. No demotion rung — there is no other decoder for it. + /// Boxed: the decoder (pinned create-info hold + plane ring) dwarfs the other variants. #[cfg(all(target_os = "linux", feature = "pyrowave"))] - PyroWave(crate::video_pyrowave::PyroWaveDecoder), + PyroWave(Box), Software(SoftwareDecoder), } @@ -573,9 +574,9 @@ impl Decoder { #[cfg(all(target_os = "linux", feature = "pyrowave"))] pub fn new_pyrowave(vk: &VulkanDecodeDevice, width: u32, height: u32) -> Result { Ok(Decoder { - backend: Backend::PyroWave(crate::video_pyrowave::PyroWaveDecoder::new( + backend: Backend::PyroWave(Box::new(crate::video_pyrowave::PyroWaveDecoder::new( vk, width, height, - )?), + )?)), codec_id: ffmpeg::codec::Id::HEVC, vaapi_fails: 0, want_keyframe: false,