From 63fed87bc5c5bc21271ea3d237ef435818219d20 Mon Sep 17 00:00:00 2001 From: claude-noether Date: Sun, 17 May 2026 16:34:52 +0000 Subject: [PATCH] iter39 fresnel fix: advertise P010 unconditionally in QueryImageFormats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/image.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/image.c b/src/image.c index 6c4cedb..bd2d706 100644 --- a/src/image.c +++ b/src/image.c @@ -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;