Commit Graph
2 Commits
Author SHA1 Message Date
Anees Iqbal caf9ae1120 🐛 Fail the schedule of a decode the driver cannot complete
A decode the driver could not send (no output surface, refused parameter
sets, no command buffer) was answered done at its status query, and
VideoToolbox took the untouched surface for a decoded frame. AppleGVA
reports a decode error only when the schedule fails: a schedule answering 5
reaches the client as kVTVideoDecoderMalfunctionErr (-12911), and it ignores
every failure a status query can answer, a detail word, a failed query and
the statuses 0 and 3 alike (measured on the guest with the RTX 5080).

So the schedule of a command the driver cannot send now fails, for H.264 as
for HEVC, and logs one line. A failure the host reports for a picture it was
sent shows only at the query: the driver marks the picture's session, and
the session's next schedule fails, one picture late. A context's deletion
clears it from the tokens, so a later context at its address is never
failed for it.
2026-11-05 21:59:24 -08:00
Anees Iqbal ae30f6891a 🆕 Decode HEVC in the guest's video driver
The video driver now offers AppleGVA HEVC decode where the host's video
caps list it: Main into NV12 ('420v', '420f') and Main 10 into P010
('x420', 'xf20'), in the profiles the host lists. Each picture goes to the
host as H.264's do, its slice segments copied out of AppleGVA's bitstream
buffer and the SPS and PPS written from AppleGVA's parsed form where they
changed (RgfxVideoH265.cpp, sharing the bit writer with H.264).

An HEVC decode command carries no output surface and no transfer command,
unlike H.264's: AppleGVA names the output frame in its decoded-picture
record, whose frame holds the surface's global IOSurface id, and the driver
looks it up there. AppleGVA holds each short-term set of the SPS by its
pictures, a predicted set's already derived, and the writer writes every set
by them. Both measured on the guest with the RTX 5080; the sets' layout
against hevc-main-720p-sets-sps, whose 25 sets AppleGVA held as 7-61 and
7-62 derive them, and whose SPS written from AppleGVA's struct decodes as
the stream's own.
2026-11-05 21:59:24 -08:00