forked from unom/punktfunk
cargo tree -p punktfunk-client-session finds no ffmpeg. The host still does, which is the whole point: pf-encode keeps libavcodec unconditionally and no host workflow, packaging script or licence file was touched. Deleted: crates/pf-ffvk, video_vulkan.rs, video_vaapi.rs, video_libav.rs, the libavcodec half of video_d3d11.rs, the av_log machinery, ffmpeg::codec::Id as the decoder's vocabulary (the quic CODEC_* wire constants now serve, which is why the evidence table was keyed on them), DecodedImage::VkFrame and ::Dmabuf, the presenter's AVVkFrame lane, and the ffmpeg-fallback feature with everything behind it. DrmFrameGuard collapses from an enum to a newtype, which removes an unsafe impl Send. Roughly 25,000 lines. Then the CI, packaging, licensing and docs work the plan's §6 lists: the Windows workflows lose FFMPEG_DIR, PF_FFVK_VULKAN_INCLUDE and their PATH prepend; the MSIX loses its DLL wildcard; the client .deb stops emitting libav sonames on its own because depends come from dpkg-shlibdeps; arch, flatpak and nix drop the dependency; and the README's "FFmpeg 7 or 8" contract narrows to the host. Three defects reached users' machines in the first cut, and none was in the deletion itself. All three desktop Settings UIs offer vulkan, vaapi and d3d11va as stored decoder values, so those strings sit in shipped settings files today. Refusing them by name — which is the correct rule for a stale pin — would have bricked every upgraded client whose owner ever touched that dropdown. They now migrate onto the native rung for the same hardware family, at decoder construction AND at each dialog's lookup, because a legacy value that matches no preset displays as "Automatic" and silently rewrites the user's preference on the next save. M9's evidence filter was deleted on the argument that with no libavcodec twin below, barring an unproven rung removes hardware decode rather than moving down one rung. That is true on Windows and false on Linux for Intel and every unknown vendor id, where prefer_vulkan_first is false and the order is native-vaapi → native-vk: a rung that has decoded nothing anywhere sitting above one that is 250/250 on three drivers. Every Intel Linux desktop would have moved from libavcodec VAAPI, shipping for years, onto pf-vaadec by default — and a rung that constructs and then produces wrong pixels leaves only by the error-streak demotion, which this codebase already documents as not tripping on the B580's strobing. The filter is restored as a narrow, pure, testable rule: an unproven rung yields to a proven one, and to nothing else. Windows deliberately passes no rung below, because that vendor family is the one with a measured wrong-pixel report against Vulkan decode, and trading no evidence for evidence of corruption is the wrong direction. And the notices still said FFmpeg was bundled. The root file is what both desktop clients include_str! and what the MSIX ships, three lines under the new card saying no FFmpeg is bundled; Apple's Acknowledgements said it too, on iOS, tvOS and macOS. The generator now emits four per-client files scoped by transitive closure — 0 FFmpeg mentions in each, verified — while the root file keeps it for the host. That also ends the standing false attribution of ffmpeg-next, GTK4, windows-rs and the NVENC SDK to an iPhone. Windows has no reachable box, so it was compiled instead: a cross clippy at -D warnings on x86_64 and aarch64-pc-windows-msvc with the C toolchain stubbed so build scripts run without linking. That gate immediately caught an include_str! path one directory too deep, which nothing else could have. Gates: container clippy -D warnings, 160 tests, workspace check, both Windows targets clean, client ffmpeg count 0 and host 2. The four decode crates are untouched, so the hardware rungs' 250/250 stands. ⚠ Owed and unrun: no GPU has executed any of this milestone. M8's on-glass software check, M7's D3D11 and VAAPI AV1 hardware legs, and M9's field bake all still want hardware, and the bake window and criteria remain the user's.
142 lines
5.9 KiB
Rust
142 lines
5.9 KiB
Rust
//! The stream status page: streams run in the spawned `punktfunk-session` child's own window,
|
|
//! so the shell shows a status card in the app's card language — host header, the child's live
|
|
//! `stats:` line as a chip row + stage lines, the in-window shortcuts, and a Disconnect.
|
|
|
|
use super::style::{edges, uniform};
|
|
use std::sync::Arc;
|
|
use windows_reactor::*;
|
|
|
|
/// One HUD refresh: the session child's latest formatted `stats:` line, mirrored into root state
|
|
/// by the poll thread (`pf-hud`) and passed down as a prop.
|
|
#[derive(Clone, Default, PartialEq)]
|
|
pub(crate) struct HudSample {
|
|
/// The session child's latest formatted `stats:` line, for the status page. Empty before the
|
|
/// child's first stats window.
|
|
pub(crate) stats_line: String,
|
|
}
|
|
|
|
/// Spawn mode's Stream screen: the stream runs in the punktfunk-session child's own
|
|
/// window, so the shell shows a status card in the app's card language — monogram +
|
|
/// host header, the child's live `stats:` line as a chip row + stage lines, the
|
|
/// in-window shortcuts, and a Disconnect that kills the child (its exit event routes
|
|
/// the app back to the host list, same as the child's window closing). No hooks.
|
|
pub(crate) fn session_page(ctx: &Arc<super::AppCtx>, hud: &HudSample) -> Element {
|
|
use super::style::{avatar, card, pill, Pill};
|
|
let host = ctx.shared.target.lock().unwrap().name.clone();
|
|
let browse = ctx.shared.browse.load(std::sync::atomic::Ordering::SeqCst);
|
|
let title = match (browse, host.is_empty()) {
|
|
(true, true) => "Console library".to_string(),
|
|
(true, false) => format!("Console library \u{00B7} {host}"),
|
|
(false, true) => "Streaming".to_string(),
|
|
(false, false) => format!("Streaming to {host}"),
|
|
};
|
|
|
|
// Header: monogram + title + the one thing worth knowing (where the video went).
|
|
let header: Element = grid((
|
|
avatar(&host)
|
|
.grid_column(0)
|
|
.vertical_alignment(VerticalAlignment::Center),
|
|
vstack((
|
|
text_block(&title).font_size(18.0).semibold(),
|
|
text_block(
|
|
"The stream has its own window \u{2014} this one returns when the session ends.",
|
|
)
|
|
.font_size(12.0)
|
|
.foreground(ThemeRef::SecondaryText),
|
|
))
|
|
.spacing(2.0)
|
|
.grid_column(1)
|
|
.vertical_alignment(VerticalAlignment::Center)
|
|
.margin(edges(12.0, 0.0, 0.0, 0.0)),
|
|
))
|
|
.columns([GridLength::Auto, GridLength::Star(1.0)])
|
|
.into();
|
|
|
|
// The child prints one formatted stats line per 1 s window:
|
|
// "<mode> · <fps> · <Mb/s> · <path> [· HDR] | e2e … | …" — the first segment becomes
|
|
// a chip row (the decode path gets the status colour), the rest dim stage lines.
|
|
let mut body: Vec<Element> = vec![header];
|
|
if hud.stats_line.is_empty() {
|
|
// The child prints `stats:` lines only while its stats view is on (the Settings
|
|
// toggle / Ctrl+Alt+Shift+S) — say so instead of waiting forever. Browse idles in
|
|
// the library between launches, so no stats there is simply normal: no line.
|
|
if !browse {
|
|
let msg = if ctx.settings.lock().unwrap().show_stats {
|
|
"Waiting for the first stats window\u{2026}"
|
|
} else {
|
|
"Stats are off \u{2014} Ctrl+Alt+Shift+S in the stream window turns them on."
|
|
};
|
|
body.push(
|
|
text_block(msg)
|
|
.font_size(11.0)
|
|
.foreground(ThemeRef::SecondaryText)
|
|
.into(),
|
|
);
|
|
}
|
|
} else {
|
|
let mut segments = hud.stats_line.split(" | ");
|
|
if let Some(first) = segments.next() {
|
|
let chips: Vec<Element> = first
|
|
.split(" \u{00B7} ")
|
|
.map(str::trim)
|
|
.filter(|c| !c.is_empty())
|
|
.map(|c| {
|
|
// The `stats:` decode-path tags (see pf-client-core's session
|
|
// pump). M10 removed the `vulkan`/`vaapi`/`d3d11va` tags with their
|
|
// rungs; a hardware rung is now always a `native-*` one.
|
|
let kind = match c {
|
|
"native-vulkan" | "native-vaapi" | "native-d3d11va" | "pyrowave" => {
|
|
Pill::Good
|
|
}
|
|
"software" => Pill::Info,
|
|
_ => Pill::Neutral,
|
|
};
|
|
pill(c, kind).into()
|
|
})
|
|
.collect();
|
|
body.push(hstack(chips).spacing(6.0).into());
|
|
}
|
|
for seg in segments {
|
|
body.push(
|
|
text_block(seg.trim())
|
|
.font_size(11.0)
|
|
.foreground(ThemeRef::SecondaryText)
|
|
.into(),
|
|
);
|
|
}
|
|
}
|
|
|
|
body.push(
|
|
text_block(
|
|
"Ctrl+Alt+Shift+Q releases input \u{00B7} Ctrl+Alt+Shift+D disconnects \u{00B7} \
|
|
Ctrl+Alt+Shift+S stats \u{00B7} F11 fullscreen",
|
|
)
|
|
.font_size(11.0)
|
|
.wrap()
|
|
.foreground(ThemeRef::SecondaryText)
|
|
.margin(edges(0.0, 4.0, 0.0, 0.0))
|
|
.into(),
|
|
);
|
|
body.push({
|
|
let ctx = ctx.clone();
|
|
button("Disconnect")
|
|
.icon(Symbol::Cancel)
|
|
.on_click(move || {
|
|
// Kill the child; its exit event (the reader thread) navigates to the
|
|
// host list, exactly like the session window closing.
|
|
ctx.shared.session.lock().unwrap().kill();
|
|
})
|
|
.margin(edges(0.0, 6.0, 0.0, 0.0))
|
|
.into()
|
|
});
|
|
|
|
// One centred card, sized like the app's dialogs — Stretch + max_width (the `page`
|
|
// pattern) instead of a fixed width, so a narrow window shrinks the card instead of
|
|
// clipping it while a wide one still centres it at 520.
|
|
border(card(vstack(body).spacing(12.0)))
|
|
.max_width(520.0)
|
|
.margin(uniform(24.0))
|
|
.vertical_alignment(VerticalAlignment::Center)
|
|
.into()
|
|
}
|