iter39 fresnel fix: advertise P010 unconditionally in QueryImageFormats

ffmpeg-vaapi's hwcontext_vaapi calls vaQueryImageFormats during
hwframes context setup, BEFORE vaCreateContext fires. Our previous
gate on driver_data->is_10bit meant P010 wasn't in the catalog at
that early query — ffmpeg's hwdownload then rejected pix_fmt=p010le
with "Invalid output format p010le for hwframe download" and decode
failed before our backend's CreateContext saw the 10-bit profile.

Fix: advertise P010 unconditionally in QueryImageFormats. Safe because
consumers ask for P010 only when their decode pipeline needs 10-bit,
and our P010 unpack path in copy_surface_to_image is gated on
image->format.fourcc == VA_FOURCC_P010 (independent of is_10bit).

Verified on fresnel: with this fix, Hi10P decode advances past the
hwdownload filter setup. (Run pending bundle to fresnel.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 16:34:52 +00:00
parent a13215de45
commit 63fed87bc5
+13 -1
View File
@@ -372,7 +372,19 @@ VAStatus RequestQueryImageFormats(VADriverContextP context,
formats[n].bits_per_pixel = 12;
n++;
if (driver_data->is_10bit && n < V4L2_REQUEST_MAX_IMAGE_FORMATS) {
/* iter39 fresnel fix: advertise P010 UNCONDITIONALLY (was gated on
* driver_data->is_10bit). ffmpeg-vaapi's hwcontext_vaapi calls
* vaQueryImageFormats during hwframes context setup, BEFORE
* vaCreateContext fires (so is_10bit isn't set yet). If P010 isn't
* in the format catalog at that early query, hwdownload rejects
* pix_fmt=p010le with "Invalid output format" and decode fails
* before our backend even sees the 10-bit context.
* Reporting P010 unconditionally is safe: consumers ask for it only
* when their decode pipeline actually needs 10-bit, and our P010
* unpack path in copy_surface_to_image gates on
* image->format.fourcc == VA_FOURCC_P010 (independent of is_10bit). */
(void)driver_data;
if (n < V4L2_REQUEST_MAX_IMAGE_FORMATS) {
memset(&formats[n], 0, sizeof(formats[n]));
formats[n].fourcc = VA_FOURCC_P010;
formats[n].byte_order = VA_LSB_FIRST;