refactor(host/W6.2): extract the shared frame/format vocabulary into the pf-frame leaf crate
The captured-frame types both capture (producer) and encode (consumer) speak —
PixelFormat, OutputFormat, CursorOverlay, CapturedFrame, FramePayload,
DmabufFrame, drm_fourcc — move into crates/pf-frame, alongside the small pure
helpers that ride the same seam: hdr (HDR static metadata / in-band SEI),
metronome (the metronomic-stall detector), thread_qos (per-thread scheduling
QoS), session_tuning (Windows process tuning), and the Windows DXGI capture
IDENTITY (WinCaptureTarget, D3d11Frame, pack_luid, make_device + the GPU
scheduling-priority hardening it applies) (plan §W6).
This is the crate that breaks the capture<->encode cycle: FramePayload's GPU
variants own their backends from BELOW (Cuda -> pf_zerocopy::DeviceBuffer,
D3d11 -> dxgi::D3d11Frame), so encode can speak the vocabulary without a path to
capture, and vice versa. The Windows DXGI identity moving here lets capture,
encode, and pf-vdisplay share ONE WinCaptureTarget/device factory instead of the
old capture<->encode<->vdisplay reach-in.
The host keeps thin facades: capture.rs re-exports the vocabulary
(crate::capture::{PixelFormat,…} unchanged); capture/windows/dxgi.rs keeps the
win32u GPU-preference hook + HDR/video-engine converters + self-test and
re-exports the identity; native.rs re-exports boost_thread_priority from
pf_frame. crate::hdr/metronome/session_tuning callers rewired to pf_frame::*.
metronome's Metronome::new gained a Default impl (new_without_default fires once
the type is public across the crate boundary).
Verified: Linux clippy -D warnings (pf-frame --all-targets + host
nvenc,vulkan-encode,pyrowave --all-targets) + 9/9 pf-frame tests; Windows clippy
nvenc,amf-qsv --all-targets Finished exit 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -42,11 +42,10 @@ use rand::RngCore;
|
||||
use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, AtomicU8, Ordering};
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Per-thread OS scheduling QoS lives in its own module (plan §W1); re-exported so
|
||||
/// `crate::native::boost_thread_priority` stays stable (the GameStream path and the direct-NVENC
|
||||
/// send thread reach it there).
|
||||
mod thread_qos;
|
||||
pub(crate) use thread_qos::boost_thread_priority;
|
||||
/// Per-thread OS scheduling QoS lives in the shared `pf-frame` leaf crate (plan §W1/§W6);
|
||||
/// re-exported so `crate::native::boost_thread_priority` stays stable (the GameStream path and the
|
||||
/// native data plane reach it there).
|
||||
pub(crate) use pf_frame::thread_qos::boost_thread_priority;
|
||||
|
||||
/// Compositor-preference resolution (plan §W1); `serve_session` reaches `resolve_compositor` here.
|
||||
mod compositor;
|
||||
@@ -1029,7 +1028,9 @@ async fn serve_session(
|
||||
// Prefer the CLIENT's own display volume (Hello::display_hdr): the virtual display's EDID
|
||||
// now advertises it, so host apps tone-map to exactly that volume — echoing it here keeps
|
||||
// the mastering metadata honest end-to-end. Generic HDR10 only for older clients.
|
||||
let meta = hello.display_hdr.unwrap_or_else(crate::hdr::generic_hdr10);
|
||||
let meta = hello
|
||||
.display_hdr
|
||||
.unwrap_or_else(pf_frame::hdr::generic_hdr10);
|
||||
let _ = conn.send_datagram(punktfunk_core::quic::encode_hdr_meta_datagram(&meta).into());
|
||||
tracing::info!(
|
||||
client_volume = hello.display_hdr.is_some(),
|
||||
|
||||
Reference in New Issue
Block a user