iter35 DIAG: env-gated dump of v4l2_ctrl_mpeg2_* contents

This commit is contained in:
2026-05-14 17:55:09 +00:00
parent 7e0848d7d2
commit 48fd0288c3
+24
View File
@@ -57,6 +57,9 @@
#include "surface.h" #include "surface.h"
#include <assert.h> #include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@@ -221,6 +224,27 @@ int mpeg2_set_controls(struct request_data *driver_data,
* surface's permanent request_fd (iter6 per-OUTPUT-slot binding; * surface's permanent request_fd (iter6 per-OUTPUT-slot binding;
* picture.c:284 sets surface_object->request_fd at BeginPicture). * picture.c:284 sets surface_object->request_fd at BeginPicture).
*/ */
/* iter35 DIAG: dump v4l2_ctrl_mpeg2_* contents. LIBVA_MPEG2_DUMP_FRAME=1 */
if (getenv("LIBVA_MPEG2_DUMP_FRAME")) {
uint8_t *sb = (uint8_t *)&sequence;
uint8_t *pb = (uint8_t *)&pic;
uint8_t *qb = (uint8_t *)&quant;
unsigned int k;
fprintf(stderr, "mpeg2: SEQ size=%zu ", sizeof(sequence));
for (k = 0; k < sizeof(sequence); k++)
fprintf(stderr, "%02x ", sb[k]);
fprintf(stderr, "\nmpeg2: PIC size=%zu [0..32]=", sizeof(pic));
for (k = 0; k < 32 && k < sizeof(pic); k++)
fprintf(stderr, "%02x ", pb[k]);
fprintf(stderr, "\nmpeg2: PIC [32..end]=");
for (k = 32; k < sizeof(pic); k++)
fprintf(stderr, "%02x ", pb[k]);
fprintf(stderr, "\nmpeg2: QUANT size=%zu [0..16]=", sizeof(quant));
for (k = 0; k < 16; k++)
fprintf(stderr, "%02x ", qb[k]);
fprintf(stderr, "\n");
}
struct v4l2_ext_control ctrls[3] = { struct v4l2_ext_control ctrls[3] = {
{ {
.id = V4L2_CID_STATELESS_MPEG2_SEQUENCE, .id = V4L2_CID_STATELESS_MPEG2_SEQUENCE,