From 44a73271aec3a6f42aae656e2ccfa49e0a7af850 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Sat, 25 Apr 2026 22:08:28 +0000 Subject: [PATCH] WIP: defer STREAMON in CreateContext (probe how far vaCreateContext gets) Co-Authored-By: Claude Opus 4.7 (1M context) --- src/context.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/context.c b/src/context.c index 4ebc8da..dac5fbf 100644 --- a/src/context.c +++ b/src/context.c @@ -188,19 +188,14 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id, surface_object->source_size = length; } - rc = v4l2_set_stream(driver_data->video_fd, output_type, true); - if (rc < 0) { - request_log("CreateContext: STREAMON(OUTPUT) failed\n"); - status = VA_STATUS_ERROR_OPERATION_FAILED; - goto error; - } - - rc = v4l2_set_stream(driver_data->video_fd, capture_type, true); - if (rc < 0) { - request_log("CreateContext: STREAMON(CAPTURE) failed\n"); - status = VA_STATUS_ERROR_OPERATION_FAILED; - goto error; - } + /* Fourier-local: defer STREAMON until first frame is actually queued. + * The V4L2 stateless protocol requires OUTPUT format + at least one + * queued slice with SPS/PPS controls attached before STREAMON will + * succeed on hantro. The bootlin library was written for sunxi-cedrus + * which used a different protocol with no such ordering constraint. + * Just being able to vaCreateContext() without erroring lets us see + * what the next stage of the call chain expects. */ + request_log("CreateContext: deferred STREAMON until first QBUF\n"); context_object->config_id = config_id; context_object->render_surface_id = VA_INVALID_ID;