diff --git a/src/context.c b/src/context.c index 2c863c8..d959d1b 100644 --- a/src/context.c +++ b/src/context.c @@ -146,6 +146,23 @@ VAStatus RequestCreateContext(VADriverContextP context, VAConfigID config_id, dev_ctrls, 2); } + /* + * Mirror the ANNEX_B start-code mode set on the device above + * into context_object->h264_start_code so picture.c:: + * codec_store_buffer prepends 0x00 0x00 0x01 to each slice + * payload it copies into the OUTPUT buffer. Without this, the + * kernel — which we just told to expect ANNEX_B — sees a raw + * NAL stream with no start codes, fails to find slice + * boundaries, and emits a zeroed CAPTURE buffer (visually a + * flat dark-green frame). + * + * h264_get_controls() exists for this purpose but is never + * called in the current code path; the planned probe-then-set + * commit will replace this hardcoded assignment with a runtime + * read of the kernel's accepted START_CODE value. + */ + context_object->h264_start_code = true; + rc = v4l2_set_stream(driver_data->video_fd, output_type, true); if (rc < 0) { status = VA_STATUS_ERROR_OPERATION_FAILED;