From a13215de456627279862b33883e398e994fec966 Mon Sep 17 00:00:00 2001 From: claude-noether Date: Sun, 17 May 2026 16:34:14 +0000 Subject: [PATCH] iter39 fresnel fix: skip pre-S_FMT NV15 CAPTURE format probe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RK3399 rkvdec advertises NV15 in VIDIOC_ENUM_FMT(CAPTURE) only AFTER S_FMT(OUTPUT) + S_EXT_CTRLS(SPS) resolve image_fmt to 420_10BIT. Pre-flight v4l2_find_format(NV15) always returns 0 → video_format stays NULL → CreateContext returns OPERATION_FAILED → ffmpeg-vaapi hwaccel init fails with "Failed to create decode context: 1". Verified on fresnel (kernel 7.0-14 / linux-fresnel-fourier): v4l2-ctl -d /dev/video1 --list-formats → only NV12 enumerated Fix: for 10-bit profiles, skip the find_format probe and directly map to our NV15 video_format entry. The later S_FMT(CAPTURE) in the same RequestCreateContext path commits the actual NV15 mode once the synthetic-SPS injection sets bit_depth_luma_minus8=2. Discovered during Phase 7 sub-profile verification — Criterion 1 (vainfo enumeration) PASSed but Criteria 2/3 (Hi10P/Main10 decode) failed with the hwaccel init error. iter38 5/5 baseline still PASSES (no regression — non-10-bit path unchanged). Co-Authored-By: Claude Opus 4.7 --- src/context.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/context.c b/src/context.c index 4785399..47bfc55 100644 --- a/src/context.c +++ b/src/context.c @@ -142,11 +142,17 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id, if (found) video_format = video_format_find(V4L2_PIX_FMT_NV12); } else { - found = v4l2_find_format(driver_data->video_fd, - V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, - V4L2_PIX_FMT_NV15); - if (found) - video_format = video_format_find(V4L2_PIX_FMT_NV15); + /* + * iter39 fresnel fix: rkvdec only advertises NV15 in + * VIDIOC_ENUM_FMT(CAPTURE) AFTER S_FMT(OUTPUT) + + * S_EXT_CTRLS(SPS) resolve image_fmt to 420_10BIT. + * Before that, only NV12 is enumerated. Pre-finding + * NV15 always fails. Skip the find_format check and + * directly map to our NV15 video_format entry; the + * later S_FMT(CAPTURE) commits the actual NV15 mode + * once the synthetic SPS sets bit_depth_luma_minus8=2. + */ + video_format = video_format_find(V4L2_PIX_FMT_NV15); } if (video_format == NULL) {