diff --git a/crates/pf-encode/src/enc/linux/vaapi.rs b/crates/pf-encode/src/enc/linux/vaapi.rs index ce457571..9ad47b48 100644 --- a/crates/pf-encode/src/enc/linux/vaapi.rs +++ b/crates/pf-encode/src/enc/linux/vaapi.rs @@ -39,11 +39,6 @@ use super::libav::{ }; use ffmpeg::ffi; // = ffmpeg_sys_next -/// `fourcc(a,b,c,d)` — DRM FourCC packing (`a | b<<8 | c<<16 | d<<24`). -const fn fourcc(a: u8, b: u8, c: u8, d: u8) -> u32 { - (a as u32) | ((b as u32) << 8) | ((c as u32) << 16) | ((d as u32) << 24) -} - /// The render node a VAAPI/DRM device should open, from [`pf_gpu::linux_render_node`]: a /// matched web-console GPU preference pins it, else `PUNKTFUNK_RENDER_NODE`, else the single-GPU /// default. diff --git a/crates/pf-encode/src/enc/linux/vulkan_video.rs b/crates/pf-encode/src/enc/linux/vulkan_video.rs index 530586d9..61aadfd7 100644 --- a/crates/pf-encode/src/enc/linux/vulkan_video.rs +++ b/crates/pf-encode/src/enc/linux/vulkan_video.rs @@ -524,7 +524,9 @@ impl VulkanVideoEncoder { /// `open` with the RGB-direct request explicit instead of read from the env — the smoke /// tests use this (env mutation races parallel tests). `want_rgb` engages the RGB-direct /// source only if [`probe_rgb_direct`] also passes; otherwise the session opens on the CSC - /// path with the verdict logged. + /// path with the verdict logged. Test-only: the production entry point is [`Self::open`], + /// which resolves `want_rgb` from the env + the `cursor_blend` hint. + #[cfg(test)] pub(crate) fn open_opts( codec: Codec, width: u32, diff --git a/crates/pf-encode/src/enc/windows/amf.rs b/crates/pf-encode/src/enc/windows/amf.rs index 979048f3..c5dca47b 100644 --- a/crates/pf-encode/src/enc/windows/amf.rs +++ b/crates/pf-encode/src/enc/windows/amf.rs @@ -2760,6 +2760,10 @@ mod tests { } /// The `p`-quantile of `samples` (µs), sorting in place. `0` when empty. + /// Gated like its only caller, the `amf-qsv`-only §5.2 latency A/B below — otherwise a + /// `--features nvenc,qsv` build compiles this helper with the benchmark cfg'd out and trips + /// `dead_code` (which the crate root no longer blanket-allows). + #[cfg(feature = "amf-qsv")] fn percentile(samples: &mut [u128], p: f64) -> u128 { if samples.is_empty() { return 0; @@ -2778,6 +2782,8 @@ mod tests { /// so its submit→AU is the bare ASIC time. The last ~2 unflushed frames on the ffmpeg path /// are left unmeasured (dropped with the encoder) so every recorded sample is a genuine paced /// submit→AU. + /// Gated like its only caller (see [`percentile`]). + #[cfg(feature = "amf-qsv")] #[allow(clippy::too_many_arguments)] fn drive_and_measure( enc: &mut dyn Encoder, diff --git a/crates/pf-encode/src/lib.rs b/crates/pf-encode/src/lib.rs index fb4edefc..c40ac25b 100644 --- a/crates/pf-encode/src/lib.rs +++ b/crates/pf-encode/src/lib.rs @@ -5,9 +5,11 @@ //! VA surface). One [`Encoder`] trait, selected in [`open_video`]. Extracted into a subsystem crate //! (plan §W6): depends on the shared frame vocabulary (`pf-frame`) + zero-copy plumbing //! (`pf-zerocopy`), never on capture — the capture→encode edge is one-way. -// Scaffold: some backend paths + trait defaults are defined ahead of the per-feature build that -// uses them (mirrors the host crate root's allow before the extraction). -#![allow(dead_code)] +// NOTE: no crate-wide `#![allow(dead_code)]`. It was inherited from the pre-extraction host crate +// root as scaffolding for backend paths defined ahead of the build that used them, but a census +// across every feature combination on both platforms found it was hiding exactly two items — so it +// bought nothing and blinded the crate to future rot. Genuinely test-only helpers carry +// `#[cfg(test)]` instead. // Every unsafe block in this module tree carries a `// SAFETY:` proof; enforce it (unsafe-proof // program). As a parent module this also covers the child modules (windows/linux backends). #![deny(clippy::undocumented_unsafe_blocks)]