]> granicus.if.org Git - strace/commitdiff
v4l2: add decoding for VIDIOC_CREATE_BUFS's arg.
authorPhilippe De Muyter <phdm@macqel.be>
Sat, 18 Apr 2015 13:06:43 +0000 (15:06 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 18 Apr 2015 13:26:48 +0000 (13:26 +0000)
* v4l2.c (v4l2_ioctl): Add decoding for VIDIOC_CREATE_BUFS's arg.

v4l2.c

diff --git a/v4l2.c b/v4l2.c
index ae1ebb8adf2046151815880f8ba586d8585c51dc..2a3a98396fc867969958dab44393426f780dec2b 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -581,6 +581,32 @@ v4l2_ioctl(struct tcb *tcp, const unsigned int code, long arg)
                return 1;
        }
 
+       case VIDIOC_CREATE_BUFS: {
+               struct v4l2_create_buffers b;
+
+               if (exiting(tcp) && syserror(tcp))
+                       return 1;
+               if (umove(tcp, arg, &b) < 0)
+                       return 0;
+               if (entering(tcp)) {
+                       tprintf(", {count=%u, memory=", b.count);
+                       printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???");
+                       tprints(", format={type=");
+                       printxval(v4l2_buf_types, b.format.type, "V4L2_BUF_TYPE_???");
+                       tprints(", ");
+                       print_v4l2_format_fmt(&b.format);
+                       tprints("}}");
+                       return 1;
+               } else {
+                       static const char fmt[] = "{index=%u, count=%u}";
+                       static char outstr[sizeof(fmt) + sizeof(int) * 6];
+
+                       sprintf(outstr, fmt, b.index, b.count);
+                       tcp->auxstr = outstr;
+                       return 1 + RVAL_STR;
+               }
+       }
+
        case VIDIOC_REQBUFS: {
                struct v4l2_requestbuffers reqbufs;