Skip to content

Commit 6779e71

Browse files
phdmldv-alt
authored andcommitted
v4l2: add decoding for VIDIOC_CREATE_BUFS's arg.
* v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg.
1 parent f34b97f commit 6779e71

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

v4l2.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,32 @@ v4l2_ioctl(struct tcb *tcp, const unsigned int code, long arg)
581581
return 1;
582582
}
583583

584+
case VIDIOC_CREATE_BUFS: {
585+
struct v4l2_create_buffers b;
586+
587+
if (exiting(tcp) && syserror(tcp))
588+
return 1;
589+
if (umove(tcp, arg, &b) < 0)
590+
return 0;
591+
if (entering(tcp)) {
592+
tprintf(", {count=%u, memory=", b.count);
593+
printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???");
594+
tprints(", format={type=");
595+
printxval(v4l2_buf_types, b.format.type, "V4L2_BUF_TYPE_???");
596+
tprints(", ");
597+
print_v4l2_format_fmt(&b.format);
598+
tprints("}}");
599+
return 1;
600+
} else {
601+
static const char fmt[] = "{index=%u, count=%u}";
602+
static char outstr[sizeof(fmt) + sizeof(int) * 6];
603+
604+
sprintf(outstr, fmt, b.index, b.count);
605+
tcp->auxstr = outstr;
606+
return 1 + RVAL_STR;
607+
}
608+
}
609+
584610
case VIDIOC_REQBUFS: {
585611
struct v4l2_requestbuffers reqbufs;
586612

0 commit comments

Comments
 (0)