Commit ccc66b3
vnc: cycle codec to H.264 when VNC is enabled mid-session
If a browser tab negotiated H.265 before VNC was toggled on, the
capture pipeline keeps emitting H.265 NALs. resolveCodec only
forces H.264 for *new* WebRTC sessions; the in-flight one is not
disturbed. So when a TigerVNC client subsequently connected, it
received H.265 NALs marked as OpenH264 (encoding 50), which the
spec defines as H.264-only — the client's decoder failed silently
and the user kept seeing the (already-rendered) placeholder.
After enabling VNC via JSON-RPC, check the running codec; if it is
not H.264, cycle the pipeline (VideoStop → SetCodecType(0) →
VideoStart). The active WebRTC session will see frames briefly
disappear and then need to refresh — the warning log says so.
Also adds trace-level diagnostics so the user can see what is
happening with `JETKVM_LOG_TRACE=vnc`:
- codec value at the moment a VNC client connects
- dropped non-IDR frames during the keyframe wait
- rect emissions (OpenH264 size/flags or Raw placeholder)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 1d41410 commit ccc66b3
2 files changed
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
81 | 113 | | |
82 | 114 | | |
83 | 115 | | |
| |||
222 | 254 | | |
223 | 255 | | |
224 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
225 | 260 | | |
226 | 261 | | |
227 | 262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| 287 | + | |
285 | 288 | | |
286 | 289 | | |
287 | 290 | | |
| |||
0 commit comments