fix(host): native sessions on the console + GPU-aware codecs + gamestream capability

The web console Dashboard read AppState.{streaming,launch,stream}, which only the
GameStream path writes, so a native punktfunk/1 session (the DEFAULT plane) showed
"Idle / no session" while actively streaming — only the Stats page (shared recorder)
reflected it. Add a plane-neutral per-session registry (session_status.rs) the native
video loop publishes to; /status now merges both planes, reports active_sessions, and
the Stop / Request-IDR buttons reach native sessions too (so surfacing them doesn't
leave dead buttons). LocalSummary (tray) gets the same fix.

Also on the management API:
- /host codecs derive from Codec::host_wire_caps() instead of a hardcoded
  [H264,H265,AV1], so codecs the GPU can't encode no longer appear.
- ApiCodec serializes HEVC as "hevc" (matching the wire/SDP/stats label) so the same
  codec reads identically across console pages.
- HostInfo.gamestream reports whether the GameStream planes run (--gamestream), so the
  console can hide the Moonlight-only pairing UI on the native-only default host.
- StatsStatus.elapsed_ms (host-monotonic) so the capture timer doesn't mix host/browser
  clocks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-15 21:06:03 +02:00
parent c4645a8938
commit b8da32e8b6
7 changed files with 343 additions and 40 deletions
+24 -5
View File
@@ -2043,10 +2043,10 @@
},
"ApiCodec": {
"type": "string",
"description": "Video codec identifier.",
"description": "Video codec identifier. The wire token matches the codec's canonical name used across the\nstack (SDP/GameStream advertisement, the stats-capture `CaptureMeta.codec`, and the encoder's\n[`Codec::label`]) — notably `H.265` serializes as `\"hevc\"`, not `\"h265\"`, so the same codec\nreads identically on every console page.",
"enum": [
"h264",
"h265",
"hevc",
"av1",
"pyrowave"
]
@@ -2812,6 +2812,7 @@
"app_version",
"gfe_version",
"codecs",
"gamestream",
"ports"
],
"properties": {
@@ -2832,6 +2833,10 @@
},
"description": "Codecs the host can encode (NVENC)."
},
"gamestream": {
"type": "boolean",
"description": "Whether the GameStream/Moonlight-compat planes are running (`--gamestream`). `false` on the\nsecure default (native punktfunk/1 only) — a console can hide Moonlight-only UI (e.g. the\nMoonlight PIN pairing card, which could never receive a PIN when this is `false`)."
},
"gfe_version": {
"type": "string",
"description": "GFE version advertised to Moonlight clients."
@@ -3394,9 +3399,16 @@
"video_streaming",
"audio_streaming",
"pin_pending",
"paired_clients"
"paired_clients",
"active_sessions"
],
"properties": {
"active_sessions": {
"type": "integer",
"format": "int32",
"description": "Number of live streaming sessions across BOTH planes (GameStream + native punktfunk/1). The\nnative server admits concurrent sessions, so this can exceed 1; `session`/`stream` below\ndescribe a single representative session for the detail card.",
"minimum": 0
},
"audio_streaming": {
"type": "boolean",
"description": "True while the audio stream thread is running."
@@ -3418,7 +3430,7 @@
},
{
"$ref": "#/components/schemas/SessionInfo",
"description": "The active launch session (set by Moonlight's `/launch`, cleared on cancel/stop)."
"description": "A representative active session. GameStream's launch (Moonlight `/launch`) when present, else\nthe first live native session. `null` when nothing is streaming."
}
]
},
@@ -3429,7 +3441,7 @@
},
{
"$ref": "#/components/schemas/StreamInfo",
"description": "The RTSP-negotiated stream parameters (present once a client has completed ANNOUNCE)."
"description": "The active stream's parameters — RTSP-negotiated for GameStream, or the live native session's\nmode/codec/bitrate. `null` when nothing is streaming."
}
]
},
@@ -3600,6 +3612,7 @@
"armed",
"sample_count",
"started_unix_ms",
"elapsed_ms",
"kind"
],
"properties": {
@@ -3607,6 +3620,12 @@
"type": "boolean",
"description": "Capture currently running."
},
"elapsed_ms": {
"type": "integer",
"format": "int64",
"description": "Host-measured elapsed time of the in-progress capture, in ms (`0` if idle). Computed from the\nhost's MONOTONIC clock, so a console can show elapsed time without subtracting `started_unix_ms`\nfrom its own (possibly skewed) wall clock.",
"minimum": 0
},
"kind": {
"type": "string",
"description": "Path of the in-progress capture (`\"\"` if idle)."