From a83acf3ee1d048a19447b13655b9c2a25ab10d28 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 19 Jul 2026 10:09:34 +0200 Subject: [PATCH] style(fmt): rustfmt the GNOME 50 HDR files under the pinned toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `feat(hdr): GNOME 50 HDR screencast capture` (0e977817) landed with rustfmt drift — six files were not clean under the pinned 1.96.0 toolchain, so `cargo fmt --all --check` (ci.yml "Format") is red on main. Pure whitespace/ wrapping from `cargo fmt --all`; no semantic change. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/pf-capture/src/lib.rs | 3 ++- crates/pf-capture/src/linux/mod.rs | 8 +++++--- crates/pf-encode/src/enc/linux/vaapi.rs | 5 ++++- crates/pf-encode/src/enc/sw.rs | 5 ++++- crates/punktfunk-host/src/gamestream/stream.rs | 7 +++---- crates/punktfunk-host/src/spike.rs | 5 ++++- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/crates/pf-capture/src/lib.rs b/crates/pf-capture/src/lib.rs index 938bdd6f..02cd1c02 100644 --- a/crates/pf-capture/src/lib.rs +++ b/crates/pf-capture/src/lib.rs @@ -286,7 +286,8 @@ pub fn capturer_supports_hdr() -> bool { /// 10-second negotiation timeout on every reconnect. Sticky until host restart (matching the /// zero-copy downgrade latches); the log line at latch time says so. #[cfg(target_os = "linux")] -static HDR_CAPTURE_FAILED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false); +static HDR_CAPTURE_FAILED: std::sync::atomic::AtomicBool = + std::sync::atomic::AtomicBool::new(false); #[cfg(target_os = "linux")] pub fn hdr_capture_failed() -> bool { diff --git a/crates/pf-capture/src/linux/mod.rs b/crates/pf-capture/src/linux/mod.rs index e019c9a9..98a7af27 100644 --- a/crates/pf-capture/src/linux/mod.rs +++ b/crates/pf-capture/src/linux/mod.rs @@ -405,7 +405,7 @@ impl Capturer for PortalCapturer { Some(punktfunk_core::quic::HdrMeta { // ST.2086 order G, B, R; (x, y) chromaticity in 1/50000 units. display_primaries: [[8500, 39850], [6550, 2300], [35400, 14600]], - white_point: [15635, 16450], // D65 + white_point: [15635, 16450], // D65 max_display_mastering_luminance: 10_000_000, // 1000 cd/m² (0.0001 units) min_display_mastering_luminance: 50, // 0.005 cd/m² max_cll: 0, @@ -548,8 +548,10 @@ pub fn gnome_hdr_monitor_active() -> bool { ) .await .context("DisplayConfig.GetCurrentState")?; - let (_serial, monitors, _logical, _props): State = - reply.body().deserialize().context("parse GetCurrentState")?; + let (_serial, monitors, _logical, _props): State = reply + .body() + .deserialize() + .context("parse GetCurrentState")?; Ok(monitors.iter().any(|(_spec, _modes, props)| { props .get("color-mode") diff --git a/crates/pf-encode/src/enc/linux/vaapi.rs b/crates/pf-encode/src/enc/linux/vaapi.rs index add1017d..ce457571 100644 --- a/crates/pf-encode/src/enc/linux/vaapi.rs +++ b/crates/pf-encode/src/enc/linux/vaapi.rs @@ -479,7 +479,10 @@ impl CpuInner { ) }; if sws.is_null() { - bail!("sws_getContext(RGB→{})", if ten_bit { "P010" } else { "NV12" }); + bail!( + "sws_getContext(RGB→{})", + if ten_bit { "P010" } else { "NV12" } + ); } // SAFETY: `sws` is the non-null `SwsContext` from `sws_getContext` above (the `is_null()` // check immediately preceding returned false). The coefficient table from diff --git a/crates/pf-encode/src/enc/sw.rs b/crates/pf-encode/src/enc/sw.rs index 3a6b04e4..330a943a 100644 --- a/crates/pf-encode/src/enc/sw.rs +++ b/crates/pf-encode/src/enc/sw.rs @@ -184,7 +184,10 @@ impl Encoder for OpenH264Encoder { // 10-bit HDR comes only from the GPU paths; the software 8-bit H.264 encoder can't // represent it (and never receives it — HDR is never negotiated on a software host). PixelFormat::Rgb10a2 | PixelFormat::X2Rgb10 | PixelFormat::X2Bgr10 => { - anyhow::bail!("software H.264 encoder cannot encode 10-bit HDR ({:?})", self.src_format) + anyhow::bail!( + "software H.264 encoder cannot encode 10-bit HDR ({:?})", + self.src_format + ) } // NV12/P010 are GPU-resident video-processor outputs for the NVENC path; the software // encoder never receives them (it only gets CPU RGB frames). diff --git a/crates/punktfunk-host/src/gamestream/stream.rs b/crates/punktfunk-host/src/gamestream/stream.rs index 551b72c6..f6650d4f 100644 --- a/crates/punktfunk-host/src/gamestream/stream.rs +++ b/crates/punktfunk-host/src/gamestream/stream.rs @@ -419,10 +419,9 @@ fn gs_bit_depth(format: crate::capture::PixelFormat) -> u8 { use crate::capture::PixelFormat; match format { // Windows IDD-push HDR formats, and the Linux GNOME 50+ portal HDR formats. - PixelFormat::P010 - | PixelFormat::Rgb10a2 - | PixelFormat::X2Rgb10 - | PixelFormat::X2Bgr10 => 10, + PixelFormat::P010 | PixelFormat::Rgb10a2 | PixelFormat::X2Rgb10 | PixelFormat::X2Bgr10 => { + 10 + } _ => 8, } } diff --git a/crates/punktfunk-host/src/spike.rs b/crates/punktfunk-host/src/spike.rs index 4adc047d..369ca24d 100644 --- a/crates/punktfunk-host/src/spike.rs +++ b/crates/punktfunk-host/src/spike.rs @@ -90,7 +90,10 @@ pub fn run(opts: Options) -> Result<()> { // PUNKTFUNK_SPIKE_HDR=1: run the GNOME 50+ HDR offer (10-bit PQ dmabufs) — the dev // validation lever for the Linux HDR capture path without a full GameStream client. let want_hdr = std::env::var("PUNKTFUNK_SPIKE_HDR").as_deref() == Ok("1"); - tracing::info!(want_hdr, "spike source: xdg ScreenCast portal (live monitor)"); + tracing::info!( + want_hdr, + "spike source: xdg ScreenCast portal (live monitor)" + ); capture::open_portal_monitor(want_hdr).context("open portal capturer")? } Source::KwinVirtual => {