blob: c0cda21c4a73a121a24fd6fb6b032db1f5206840 [file] [log] [blame]
Philippe De Muyter0cc96142014-11-03 21:27:40 +01001/*
2 * Copyright (c) 2014 Philippe De Muyter <phdm@macqel.be>
3 * Copyright (c) 2014 William Manley <will@williammanley.net>
4 * Copyright (c) 2011 Peter Zotov <whitequark@whitequark.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30#include "defs.h"
31
Dmitry V. Levin1e568142016-05-03 22:30:41 +000032#include DEF_MPERS_TYPE(struct_v4l2_buffer)
33#include DEF_MPERS_TYPE(struct_v4l2_create_buffers)
34#include DEF_MPERS_TYPE(struct_v4l2_ext_control)
35#include DEF_MPERS_TYPE(struct_v4l2_ext_controls)
36#include DEF_MPERS_TYPE(struct_v4l2_format)
37#include DEF_MPERS_TYPE(struct_v4l2_framebuffer)
38#include DEF_MPERS_TYPE(struct_v4l2_input)
39#include DEF_MPERS_TYPE(struct_v4l2_standard)
40
Philippe De Muyter0cc96142014-11-03 21:27:40 +010041#include <stdint.h>
Dmitry V. Levinfe3de9c2016-05-13 20:15:12 +000042#include <linux/ioctl.h>
Dmitry V. Levin0f4ad302015-02-22 02:13:04 +000043#include <linux/types.h>
Philippe De Muyter0cc96142014-11-03 21:27:40 +010044#include <linux/videodev2.h>
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +000045
Dmitry V. Levin1e568142016-05-03 22:30:41 +000046typedef struct v4l2_buffer struct_v4l2_buffer;
47typedef struct v4l2_create_buffers struct_v4l2_create_buffers;
48typedef struct v4l2_ext_control struct_v4l2_ext_control;
49typedef struct v4l2_ext_controls struct_v4l2_ext_controls;
50typedef struct v4l2_format struct_v4l2_format;
51typedef struct v4l2_framebuffer struct_v4l2_framebuffer;
52typedef struct v4l2_input struct_v4l2_input;
53typedef struct v4l2_standard struct_v4l2_standard;
54
55#include MPERS_DEFS
56
Philippe De Muyter0cc96142014-11-03 21:27:40 +010057/* some historical constants */
58#ifndef V4L2_CID_HCENTER
59#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
60#endif
61#ifndef V4L2_CID_VCENTER
62#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
63#endif
64#ifndef V4L2_CID_BAND_STOP_FILTER
65#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
66#endif
67
Philippe De Muyter0cc96142014-11-03 21:27:40 +010068#define FMT_FRACT "%u/%u"
69#define ARGS_FRACT(x) ((x).numerator), ((x).denominator)
70
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +000071#define FMT_RECT "{left=%d, top=%d, width=%u, height=%u}"
Philippe De Muyter0cc96142014-11-03 21:27:40 +010072#define ARGS_RECT(x) (x).left, (x).top, (x).width, (x).height
73
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +000074static void
75print_pixelformat(uint32_t fourcc)
Philippe De Muyter0cc96142014-11-03 21:27:40 +010076{
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +000077 const union {
Dmitry V. Levinf0a5b082015-01-25 00:27:00 +000078 uint32_t pixelformat;
79 unsigned char cc[sizeof(uint32_t)];
Dmitry V. Levinf2f162e2016-05-13 03:51:43 +000080 } u = {
81#if WORDS_BIGENDIAN
82 .cc = {
83 (unsigned char) (fourcc >> 24),
84 (unsigned char) (fourcc >> 16),
85 (unsigned char) (fourcc >> 8),
86 (unsigned char) fourcc
87 }
88#else
89 .pixelformat = fourcc
90#endif
91 };
Dmitry V. Levinf0a5b082015-01-25 00:27:00 +000092 unsigned int i;
93
94 tprints("v4l2_fourcc(");
95 for (i = 0; i < sizeof(u.cc); ++i) {
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +000096 unsigned char c = u.cc[i];
Dmitry V. Levinf0a5b082015-01-25 00:27:00 +000097
98 if (i)
99 tprints(", ");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000100 if (c == '\'' || c == '\\') {
Dmitry V. Levinf0a5b082015-01-25 00:27:00 +0000101 char sym[] = {
102 '\'',
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000103 '\\',
104 c,
105 '\'',
106 '\0'
107 };
108 tprints(sym);
109 } else if (c >= ' ' && c <= 0x7e) {
110 char sym[] = {
111 '\'',
112 c,
113 '\'',
114 '\0'
Dmitry V. Levinf0a5b082015-01-25 00:27:00 +0000115 };
116 tprints(sym);
117 } else {
118 char hex[] = {
119 '\'',
120 '\\',
121 'x',
122 "0123456789abcdef"[c >> 4],
123 "0123456789abcdef"[c & 0xf],
124 '\'',
125 '\0'
126 };
127 tprints(hex);
128 }
129 }
130 tprints(")");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100131}
132
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000133#include "xlat/v4l2_device_capabilities_flags.h"
134
135static int
136print_v4l2_capability(struct tcb *tcp, const long arg)
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100137{
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000138 struct v4l2_capability caps;
139
140 if (entering(tcp))
141 return 0;
142 tprints(", ");
143 if (umove_or_printaddr(tcp, arg, &caps))
144 return 1;
145 tprints("{driver=");
146 print_quoted_string((const char *) caps.driver,
147 sizeof(caps.driver), QUOTE_0_TERMINATED);
148 tprints(", card=");
149 print_quoted_string((const char *) caps.card,
150 sizeof(caps.card), QUOTE_0_TERMINATED);
151 tprints(", bus_info=");
152 print_quoted_string((const char *) caps.bus_info,
153 sizeof(caps.bus_info), QUOTE_0_TERMINATED);
154 tprintf(", version=%u.%u.%u, capabilities=",
155 (caps.version >> 16) & 0xFF,
156 (caps.version >> 8) & 0xFF,
157 caps.version & 0xFF);
158 printflags(v4l2_device_capabilities_flags, caps.capabilities,
159 "V4L2_CAP_???");
160#ifdef V4L2_CAP_DEVICE_CAPS
161 tprints(", device_caps=");
162 printflags(v4l2_device_capabilities_flags, caps.device_caps,
163 "V4L2_CAP_???");
164#endif
165 tprints("}");
166 return 1;
167}
168
169#include "xlat/v4l2_buf_types.h"
170#include "xlat/v4l2_format_description_flags.h"
171
172static int
173print_v4l2_fmtdesc(struct tcb *tcp, const long arg)
174{
175 struct v4l2_fmtdesc f;
176
177 if (entering(tcp)) {
178 tprints(", ");
179 if (umove_or_printaddr(tcp, arg, &f))
180 return RVAL_DECODED | 1;
181 tprintf("{index=%u, type=", f.index);
182 printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???");
183 return 0;
184 }
185
186 if (!syserror(tcp) && !umove(tcp, arg, &f)) {
187 tprints(", flags=");
188 printflags(v4l2_format_description_flags, f.flags,
189 "V4L2_FMT_FLAG_???");
190 tprints(", description=");
191 print_quoted_string((const char *) f.description,
192 sizeof(f.description),
193 QUOTE_0_TERMINATED);
194 tprints(", pixelformat=");
195 print_pixelformat(f.pixelformat);
196 }
197 tprints("}");
198 return 1;
199}
200
201#include "xlat/v4l2_fields.h"
202#include "xlat/v4l2_colorspaces.h"
203
204static void
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000205print_v4l2_format_fmt(const char *prefix, const struct_v4l2_format *f)
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000206{
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100207 switch (f->type) {
208 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000209 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
210 tprints(prefix);
211 tprintf("fmt.pix={width=%u, height=%u, pixelformat=",
212 f->fmt.pix.width, f->fmt.pix.height);
213 print_pixelformat(f->fmt.pix.pixelformat);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100214 tprints(", field=");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000215 printxval(v4l2_fields, f->fmt.pix.field, "V4L2_FIELD_???");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100216 tprintf(", bytesperline=%u, sizeimage=%u, colorspace=",
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000217 f->fmt.pix.bytesperline, f->fmt.pix.sizeimage);
218 printxval(v4l2_colorspaces, f->fmt.pix.colorspace,
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100219 "V4L2_COLORSPACE_???");
220 tprints("}");
221 break;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100222#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
223 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
224 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: {
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100225 unsigned int i, max;
226
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000227 tprints(prefix);
228 tprintf("fmt.pix_mp={width=%u, height=%u, pixelformat=",
229 f->fmt.pix_mp.width, f->fmt.pix_mp.height);
230 print_pixelformat(f->fmt.pix_mp.pixelformat);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100231 tprints(", field=");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000232 printxval(v4l2_fields, f->fmt.pix_mp.field, "V4L2_FIELD_???");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100233 tprints(", colorspace=");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000234 printxval(v4l2_colorspaces, f->fmt.pix_mp.colorspace,
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100235 "V4L2_COLORSPACE_???");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000236 tprints(", plane_fmt=[");
237 max = f->fmt.pix_mp.num_planes;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100238 if (max > VIDEO_MAX_PLANES)
239 max = VIDEO_MAX_PLANES;
240 for (i = 0; i < max; i++) {
241 if (i > 0)
242 tprints(", ");
243 tprintf("{sizeimage=%u, bytesperline=%u}",
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000244 f->fmt.pix_mp.plane_fmt[i].sizeimage,
245 f->fmt.pix_mp.plane_fmt[i].bytesperline);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100246 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000247 tprintf("], num_planes=%u}", (unsigned) f->fmt.pix_mp.num_planes);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100248 break;
249 }
250#endif
251
252 /* TODO: Complete this switch statement */
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000253#if 0
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100254 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
Dmitry V. Levin197db572015-01-09 04:53:19 +0000255#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100256 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
Dmitry V. Levin197db572015-01-09 04:53:19 +0000257#endif
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000258 tprints(prefix);
259 tprints("fmt.win={???}");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100260 break;
261
262 case V4L2_BUF_TYPE_VBI_CAPTURE:
263 case V4L2_BUF_TYPE_VBI_OUTPUT:
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000264 tprints(prefix);
265 tprints("fmt.vbi={???}");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100266 break;
267
268 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
269 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000270 tprints(prefix);
271 tprints("fmt.sliced={???}");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100272 break;
273
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000274#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE
275 case V4L2_BUF_TYPE_SDR_CAPTURE:
276 case V4L2_BUF_TYPE_SDR_OUTPUT:
277 tprints(prefix);
278 tprints("fmt.sdr={???}");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100279 break;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000280#endif
281#endif
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100282 }
283}
284
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000285static int
286print_v4l2_format(struct tcb *tcp, const long arg, const bool is_get)
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100287{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000288 struct_v4l2_format f;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000289
290 if (entering(tcp)) {
291 tprints(", ");
292 if (umove_or_printaddr(tcp, arg, &f))
293 return RVAL_DECODED | 1;
294 tprints("{type=");
295 printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???");
296 if (is_get)
297 return 0;
298 print_v4l2_format_fmt(", ", &f);
299 } else {
300 if (!syserror(tcp) && !umove(tcp, arg, &f)) {
301 const char *delim = is_get ? ", " : " => ";
302 print_v4l2_format_fmt(delim, &f);
303 }
304 tprints("}");
305 }
306 return 1;
307}
308
309#include "xlat/v4l2_memories.h"
310
311static int
312print_v4l2_requestbuffers(struct tcb *tcp, const long arg)
313{
314 struct v4l2_requestbuffers reqbufs;
315
316 if (entering(tcp)) {
317 tprints(", ");
318 if (umove_or_printaddr(tcp, arg, &reqbufs))
319 return RVAL_DECODED | 1;
320 tprintf("{count=%u, type=", reqbufs.count);
321 printxval(v4l2_buf_types, reqbufs.type, "V4L2_BUF_TYPE_???");
322 tprints(", memory=");
323 printxval(v4l2_memories, reqbufs.memory, "V4L2_MEMORY_???");
324 tprints("}");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100325 return 0;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000326 } else {
327 static char outstr[sizeof("{count=}") + sizeof(int) * 3];
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100328
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000329 if (syserror(tcp) || umove(tcp, arg, &reqbufs) < 0)
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100330 return 1;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000331 sprintf(outstr, "{count=%u}", reqbufs.count);
332 tcp->auxstr = outstr;
333 return 1 + RVAL_STR;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100334 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000335}
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100336
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000337#include "xlat/v4l2_buf_flags.h"
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100338
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000339static int
340print_v4l2_buffer(struct tcb *tcp, const unsigned int code, const long arg)
341{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000342 struct_v4l2_buffer b;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000343
344 if (entering(tcp)) {
345 tprints(", ");
346 if (umove_or_printaddr(tcp, arg, &b))
347 return RVAL_DECODED | 1;
348 tprints("{type=");
349 printxval(v4l2_buf_types, b.type, "V4L2_BUF_TYPE_???");
350 if (code != VIDIOC_DQBUF)
351 tprintf(", index=%u", b.index);
352 } else {
353 if (!syserror(tcp) && umove(tcp, arg, &b) == 0) {
354 if (code == VIDIOC_DQBUF)
355 tprintf(", index=%u", b.index);
356 tprints(", memory=");
357 printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???");
358
359 if (b.memory == V4L2_MEMORY_MMAP) {
360 tprintf(", m.offset=%#x", b.m.offset);
361 } else if (b.memory == V4L2_MEMORY_USERPTR) {
362 tprintf(", m.userptr=%#lx",
363 (unsigned long) b.m.userptr);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100364 }
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100365
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000366 tprintf(", length=%u, bytesused=%u, flags=",
367 b.length, b.bytesused);
368 printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???");
369 if (code == VIDIOC_DQBUF)
370 tprintf(", timestamp = {%ju.%06ju}",
371 (uintmax_t)b.timestamp.tv_sec,
372 (uintmax_t)b.timestamp.tv_usec);
373 tprints(", ...");
374 }
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100375 tprints("}");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000376 }
377 return 1;
378}
379
380static int
381print_v4l2_framebuffer(struct tcb *tcp, const long arg)
382{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000383 struct_v4l2_framebuffer b;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000384
385 tprints(", ");
386 if (!umove_or_printaddr(tcp, arg, &b)) {
387 tprintf("{capability=%#x, flags=%#x, base=%#lx}",
388 b.capability, b.flags, (unsigned long) b.base);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100389 }
390
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000391 return RVAL_DECODED | 1;
392}
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100393
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000394static int
395print_v4l2_buf_type(struct tcb *tcp, const long arg)
396{
397 int type;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100398
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000399 tprints(", ");
400 if (!umove_or_printaddr(tcp, arg, &type)) {
401 tprints("[");
402 printxval(v4l2_buf_types, type, "V4L2_BUF_TYPE_???");
403 tprints("]");
404 }
405 return RVAL_DECODED | 1;
406}
407
408#include "xlat/v4l2_streaming_capabilities.h"
409#include "xlat/v4l2_capture_modes.h"
410
411static int
412print_v4l2_streamparm(struct tcb *tcp, const long arg, const bool is_get)
413{
414 struct v4l2_streamparm s;
415
416 if (entering(tcp)) {
417 tprints(", ");
418 if (umove_or_printaddr(tcp, arg, &s))
419 return RVAL_DECODED | 1;
420 tprints("{type=");
421 printxval(v4l2_buf_types, s.type, "V4L2_BUF_TYPE_???");
422 switch (s.type) {
423 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
424 case V4L2_BUF_TYPE_VIDEO_OUTPUT:
425 if (is_get)
426 return 0;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100427 tprints(", ");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100428 break;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000429 default:
430 tprints("}");
431 return RVAL_DECODED | 1;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100432 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000433 } else {
434 if (syserror(tcp) || umove(tcp, arg, &s) < 0) {
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100435 tprints("}");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000436 return 1;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100437 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000438 tprints(is_get ? ", " : " => ");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100439 }
440
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000441 if (s.type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
442 tprints("parm.capture={capability=");
443 printflags(v4l2_streaming_capabilities,
444 s.parm.capture.capability, "V4L2_CAP_???");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100445
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000446 tprints(", capturemode=");
447 printflags(v4l2_capture_modes,
448 s.parm.capture.capturemode, "V4L2_MODE_???");
449
450 tprintf(", timeperframe=" FMT_FRACT,
451 ARGS_FRACT(s.parm.capture.timeperframe));
452
453 tprintf(", extendedmode=%u, readbuffers=%u}",
454 s.parm.capture.extendedmode,
455 s.parm.capture.readbuffers);
456 } else {
457 tprints("parm.output={capability=");
458 printflags(v4l2_streaming_capabilities,
459 s.parm.output.capability, "V4L2_CAP_???");
460
461 tprintf(", outputmode=%u", s.parm.output.outputmode);
462
463 tprintf(", timeperframe=" FMT_FRACT,
464 ARGS_FRACT(s.parm.output.timeperframe));
465
466 tprintf(", extendedmode=%u, writebuffers=%u}",
467 s.parm.output.extendedmode,
468 s.parm.output.writebuffers);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100469 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000470 if (exiting(tcp))
471 tprints("}");
472 return 1;
473}
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100474
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000475static int
476print_v4l2_standard(struct tcb *tcp, const long arg)
477{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000478 struct_v4l2_standard s;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100479
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000480 if (entering(tcp)) {
481 tprints(", ");
482 if (umove_or_printaddr(tcp, arg, &s))
483 return RVAL_DECODED | 1;
484 tprintf("{index=%u", s.index);
485 } else {
486 if (!syserror(tcp) && !umove(tcp, arg, &s)) {
487 tprints(", name=");
488 print_quoted_string((const char *) s.name,
489 sizeof(s.name),
490 QUOTE_0_TERMINATED);
491 tprintf(", frameperiod=" FMT_FRACT,
492 ARGS_FRACT(s.frameperiod));
493 tprintf(", framelines=%d", s.framelines);
494 }
495 tprints("}");
496 }
497 return 1;
498}
499
500#include "xlat/v4l2_input_types.h"
501
502static int
503print_v4l2_input(struct tcb *tcp, const long arg)
504{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000505 struct_v4l2_input i;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000506
507 if (entering(tcp)) {
508 tprints(", ");
509 if (umove_or_printaddr(tcp, arg, &i))
510 return RVAL_DECODED | 1;
511 tprintf("{index=%u", i.index);
512 } else {
513 if (!syserror(tcp) && !umove(tcp, arg, &i)) {
Dmitry V. Levin1de59cf2015-01-26 02:45:09 +0000514 tprints(", name=");
515 print_quoted_string((const char *) i.name,
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000516 sizeof(i.name),
517 QUOTE_0_TERMINATED);
Dmitry V. Levin1de59cf2015-01-26 02:45:09 +0000518 tprints(", type=");
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100519 printxval(v4l2_input_types, i.type,
520 "V4L2_INPUT_TYPE_???");
521 }
522 tprints("}");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000523 }
524 return 1;
525}
526
527#include "xlat/v4l2_control_ids.h"
528
529static int
530print_v4l2_control(struct tcb *tcp, const long arg, const bool is_get)
531{
532 struct v4l2_control c;
533
534 if (entering(tcp)) {
535 tprints(", ");
536 if (umove_or_printaddr(tcp, arg, &c))
537 return RVAL_DECODED | 1;
538 tprints("{id=");
539 printxval(v4l2_control_ids, c.id, "V4L2_CID_???");
540 if (!is_get)
541 tprintf(", value=%d", c.value);
542 return 0;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100543 }
544
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000545 if (!syserror(tcp) && !umove(tcp, arg, &c)) {
546 tprints(is_get ? ", " : " => ");
547 tprintf("value=%d", c.value);
548 }
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100549
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000550 tprints("}");
551 return 1;
552}
553
554#include "xlat/v4l2_control_types.h"
555#include "xlat/v4l2_control_flags.h"
556
557static int
558print_v4l2_queryctrl(struct tcb *tcp, const long arg)
559{
560 struct v4l2_queryctrl c;
561
562 if (entering(tcp)) {
563 tprints(", ");
564 if (umove_or_printaddr(tcp, arg, &c))
565 return RVAL_DECODED | 1;
566 tprints("{id=");
567 } else {
568 if (syserror(tcp) || umove(tcp, arg, &c) < 0) {
569 tprints("}");
570 return 1;
571 }
572 if (tcp->auxstr)
573 tprints(" => ");
574 }
575
576 if (entering(tcp) || tcp->auxstr) {
577#ifdef V4L2_CTRL_FLAG_NEXT_CTRL
578 tcp->auxstr = (c.id & V4L2_CTRL_FLAG_NEXT_CTRL) ? "" : NULL;
579 if (tcp->auxstr) {
580 tprints("V4L2_CTRL_FLAG_NEXT_CTRL|");
581 c.id &= ~V4L2_CTRL_FLAG_NEXT_CTRL;
582 }
583#endif
584 printxval(v4l2_control_ids, c.id, "V4L2_CID_???");
585 }
586
587 if (exiting(tcp)) {
588 tprints(", type=");
589 printxval(v4l2_control_types, c.type, "V4L2_CTRL_TYPE_???");
590 tprints(", name=");
591 print_quoted_string((const char *) c.name,
592 sizeof(c.name),
593 QUOTE_0_TERMINATED);
594 tprintf(", minimum=%d, maximum=%d, step=%d"
595 ", default_value=%d, flags=",
596 c.minimum, c.maximum, c.step, c.default_value);
597 printflags(v4l2_control_flags, c.flags, "V4L2_CTRL_FLAG_???");
598 tprints("}");
599 }
600 return 1;
601}
602
603static int
604print_v4l2_cropcap(struct tcb *tcp, const long arg)
605{
606 struct v4l2_cropcap c;
607
608 if (entering(tcp)) {
609 tprints(", ");
610 if (umove_or_printaddr(tcp, arg, &c))
611 return RVAL_DECODED | 1;
612 tprints("{type=");
613 printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???");
614 return 0;
615 }
616 if (!syserror(tcp) && !umove(tcp, arg, &c)) {
617 tprintf(", bounds=" FMT_RECT
618 ", defrect=" FMT_RECT
619 ", pixelaspect=" FMT_FRACT,
620 ARGS_RECT(c.bounds),
621 ARGS_RECT(c.defrect),
622 ARGS_FRACT(c.pixelaspect));
623 }
624 tprints("}");
625 return 1;
626}
627
628static int
629print_v4l2_crop(struct tcb *tcp, const long arg, const bool is_get)
630{
631 struct v4l2_crop c;
632
633 if (entering(tcp)) {
634 tprints(", ");
635 if (umove_or_printaddr(tcp, arg, &c))
636 return RVAL_DECODED | 1;
637 tprints("{type=");
638 printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???");
639 if (is_get)
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100640 return 0;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000641 tprintf(", c=" FMT_RECT, ARGS_RECT(c.c));
642 } else {
643 if (!syserror(tcp) && !umove(tcp, arg, &c))
644 tprintf(", c=" FMT_RECT, ARGS_RECT(c.c));
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100645 }
646
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000647 tprints("}");
648 return RVAL_DECODED | 1;
649}
650
651#ifdef VIDIOC_S_EXT_CTRLS
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000652static bool
653print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000654{
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000655 const struct_v4l2_ext_control *p = elem_buf;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000656
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000657 tprints("{id=");
658 printxval(v4l2_control_ids, p->id, "V4L2_CID_???");
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000659# if HAVE_DECL_V4L2_CTRL_TYPE_STRING
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000660 tprintf(", size=%u", p->size);
661 if (p->size > 0) {
662 tprints(", string=");
663 printstr(tcp, (long) p->string, p->size);
664 } else
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000665# endif
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000666 tprintf(", value=%d, value64=%lld", p->value,
667 (long long) p->value64);
668 tprints("}");
669
670 return true;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000671}
672
673#include "xlat/v4l2_control_classes.h"
674
675static int
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000676umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const long addr,
677 const unsigned int len, void *our_addr)
678{
679 if (!addr) {
680 tprints("NULL");
681 return -1;
682 }
683 if (umoven(tcp, addr, len, our_addr) < 0) {
684 tprintf("%#lx", addr);
685 return -1;
686 }
687 return 0;
688}
689
690static int
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000691print_v4l2_ext_controls(struct tcb *tcp, const long arg, const bool is_get)
692{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000693 struct_v4l2_ext_controls c;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000694
695 if (entering(tcp)) {
696 tprints(", ");
697 if (umove_or_printaddr(tcp, arg, &c))
698 return RVAL_DECODED | 1;
699 tprints("{ctrl_class=");
700 printxval(v4l2_control_classes, c.ctrl_class,
701 "V4L2_CTRL_CLASS_???");
702 tprintf(", count=%u", c.count);
703 if (!c.count) {
704 tprints("}");
705 return RVAL_DECODED | 1;
706 }
707 if (is_get)
708 return 0;
709 tprints(", ");
710 } else {
711 if (umove(tcp, arg, &c) < 0) {
712 tprints("}");
713 return 1;
714 }
715 tprints(is_get ? ", " : " => ");
716 }
717
718 tprints("controls=");
Dmitry V. Levin17d1a162016-05-07 23:15:36 +0000719 struct_v4l2_ext_control ctrl;
720 bool fail = !print_array(tcp, (unsigned long) c.controls, c.count,
721 &ctrl, sizeof(ctrl),
722 umoven_or_printaddr_ignore_syserror,
723 print_v4l2_ext_control, 0);
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000724
725 if (exiting(tcp) && syserror(tcp))
726 tprintf(", error_idx=%u", c.error_idx);
727
728 if (exiting(tcp) || fail) {
729 tprints("}");
730 return RVAL_DECODED | 1;
731 }
732 return 1;
733}
734#endif /* VIDIOC_S_EXT_CTRLS */
735
736#ifdef VIDIOC_ENUM_FRAMESIZES
737# include "xlat/v4l2_framesize_types.h"
738
739static int
740print_v4l2_frmsizeenum(struct tcb *tcp, const long arg)
741{
742 struct v4l2_frmsizeenum s;
743
744 if (entering(tcp)) {
745 tprints(", ");
746 if (umove_or_printaddr(tcp, arg, &s))
747 return RVAL_DECODED | 1;
748 tprintf("{index=%u, pixel_format=", s.index);
749 print_pixelformat(s.pixel_format);
750 return 0;
751 }
752
753 if (!syserror(tcp) && !umove(tcp, arg, &s)) {
754 tprints(", type=");
755 printxval(v4l2_framesize_types, s.type, "V4L2_FRMSIZE_TYPE_???");
756 switch (s.type) {
757 case V4L2_FRMSIZE_TYPE_DISCRETE:
758 tprintf(", discrete={width=%u, height=%u}",
759 s.discrete.width, s.discrete.height);
760 break;
761 case V4L2_FRMSIZE_TYPE_STEPWISE:
762 tprintf(", stepwise={min_width=%u, max_width=%u, "
763 "step_width=%u, min_height=%u, max_height=%u, "
764 "step_height=%u}",
765 s.stepwise.min_width, s.stepwise.max_width,
766 s.stepwise.step_width, s.stepwise.min_height,
767 s.stepwise.max_height, s.stepwise.step_height);
768 break;
769 }
770 }
771 tprints("}");
772 return 1;
773}
774#endif /* VIDIOC_ENUM_FRAMESIZES */
775
Dmitry V. Levin197db572015-01-09 04:53:19 +0000776#ifdef VIDIOC_ENUM_FRAMEINTERVALS
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000777# include "xlat/v4l2_frameinterval_types.h"
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100778
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000779static int
780print_v4l2_frmivalenum(struct tcb *tcp, const long arg)
781{
782 struct v4l2_frmivalenum f;
783
784 if (entering(tcp)) {
785 tprints(", ");
786 if (umove_or_printaddr(tcp, arg, &f))
787 return RVAL_DECODED | 1;
788 tprintf("{index=%u, pixel_format=", f.index);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100789 print_pixelformat(f.pixel_format);
790 tprintf(", width=%u, height=%u", f.width, f.height);
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000791 return 0;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100792 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000793 if (!syserror(tcp) && !umove(tcp, arg, &f)) {
794 tprints(", type=");
795 printxval(v4l2_frameinterval_types, f.type,
796 "V4L2_FRMIVAL_TYPE_???");
797 switch (f.type) {
798 case V4L2_FRMIVAL_TYPE_DISCRETE:
799 tprintf(", discrete=" FMT_FRACT,
800 ARGS_FRACT(f.discrete));
801 break;
802 case V4L2_FRMIVAL_TYPE_STEPWISE:
803 case V4L2_FRMSIZE_TYPE_CONTINUOUS:
804 tprintf(", stepwise={min=" FMT_FRACT ", max="
805 FMT_FRACT ", step=" FMT_FRACT "}",
806 ARGS_FRACT(f.stepwise.min),
807 ARGS_FRACT(f.stepwise.max),
808 ARGS_FRACT(f.stepwise.step));
809 break;
810 }
811 }
812 tprints("}");
813 return 1;
814}
Dmitry V. Levin197db572015-01-09 04:53:19 +0000815#endif /* VIDIOC_ENUM_FRAMEINTERVALS */
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100816
Dmitry V. Levinfffe50d2015-08-26 11:55:05 +0000817#ifdef VIDIOC_CREATE_BUFS
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000818static int
819print_v4l2_create_buffers(struct tcb *tcp, const long arg)
820{
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000821 struct_v4l2_create_buffers b;
Philippe De Muyter6779e712015-04-18 15:06:43 +0200822
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000823 if (entering(tcp)) {
824 tprints(", ");
825 if (umove_or_printaddr(tcp, arg, &b))
826 return RVAL_DECODED | 1;
827 tprintf("{count=%u, memory=", b.count);
828 printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???");
829 tprints(", format={type=");
830 printxval(v4l2_buf_types, b.format.type,
831 "V4L2_BUF_TYPE_???");
832 print_v4l2_format_fmt(", ",
Dmitry V. Levin1e568142016-05-03 22:30:41 +0000833 (struct_v4l2_format *) &b.format);
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000834 tprints("}}");
835 return 0;
836 } else {
837 static const char fmt[] = "{index=%u, count=%u}";
838 static char outstr[sizeof(fmt) + sizeof(int) * 6];
Philippe De Muyter6779e712015-04-18 15:06:43 +0200839
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000840 if (syserror(tcp) || umove(tcp, arg, &b) < 0)
841 return 1;
842 sprintf(outstr, fmt, b.index, b.count);
843 tcp->auxstr = outstr;
844 return 1 + RVAL_STR;
Philippe De Muyter6779e712015-04-18 15:06:43 +0200845 }
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000846}
Dmitry V. Levinfffe50d2015-08-26 11:55:05 +0000847#endif /* VIDIOC_CREATE_BUFS */
Philippe De Muyter6779e712015-04-18 15:06:43 +0200848
Dmitry V. Levina8fce092016-05-21 22:53:06 +0000849MPERS_PRINTER_DECL(int, v4l2_ioctl,
850 struct tcb *tcp, const unsigned int code, const long arg)
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000851{
852 if (!verbose(tcp))
853 return RVAL_DECODED;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100854
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000855 switch (code) {
856 case VIDIOC_QUERYCAP: /* R */
857 return print_v4l2_capability(tcp, arg);
858
859 case VIDIOC_ENUM_FMT: /* RW */
860 return print_v4l2_fmtdesc(tcp, arg);
861
862 case VIDIOC_G_FMT: /* RW */
863 case VIDIOC_S_FMT: /* RW */
864 case VIDIOC_TRY_FMT: /* RW */
865 return print_v4l2_format(tcp, arg, code == VIDIOC_G_FMT);
866
867 case VIDIOC_REQBUFS: /* RW */
868 return print_v4l2_requestbuffers(tcp, arg);
869
870 case VIDIOC_QUERYBUF: /* RW */
871 case VIDIOC_QBUF: /* RW */
872 case VIDIOC_DQBUF: /* RW */
873 return print_v4l2_buffer(tcp, code, arg);
874
875 case VIDIOC_G_FBUF: /* R */
876 if (entering(tcp))
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100877 return 0;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000878 /* fall through */
879 case VIDIOC_S_FBUF: /* W */
880 return print_v4l2_framebuffer(tcp, arg);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100881
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000882 case VIDIOC_STREAMON: /* W */
883 case VIDIOC_STREAMOFF: /* W */
884 return print_v4l2_buf_type(tcp, arg);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100885
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000886 case VIDIOC_G_PARM: /* RW */
887 case VIDIOC_S_PARM: /* RW */
888 return print_v4l2_streamparm(tcp, arg, code == VIDIOC_G_PARM);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100889
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000890 case VIDIOC_G_STD: /* R */
891 if (entering(tcp))
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100892 return 0;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000893 /* fall through */
894 case VIDIOC_S_STD: /* W */
895 tprints(", ");
896 printnum_int64(tcp, arg, "%#" PRIx64);
897 return RVAL_DECODED | 1;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100898
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000899 case VIDIOC_ENUMSTD: /* RW */
900 return print_v4l2_standard(tcp, arg);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100901
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000902 case VIDIOC_ENUMINPUT: /* RW */
903 return print_v4l2_input(tcp, arg);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100904
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000905 case VIDIOC_G_CTRL: /* RW */
906 case VIDIOC_S_CTRL: /* RW */
907 return print_v4l2_control(tcp, arg, code == VIDIOC_G_CTRL);
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100908
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000909 case VIDIOC_QUERYCTRL: /* RW */
910 return print_v4l2_queryctrl(tcp, arg);
911
912 case VIDIOC_G_INPUT: /* R */
913 if (entering(tcp))
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100914 return 0;
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000915 /* fall through */
916 case VIDIOC_S_INPUT: /* RW */
917 tprints(", ");
918 printnum_int(tcp, arg, "%u");
919 return RVAL_DECODED | 1;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100920
Dmitry V. Levin0a47ff72016-05-01 17:25:24 +0000921 case VIDIOC_CROPCAP: /* RW */
922 return print_v4l2_cropcap(tcp, arg);
923
924 case VIDIOC_G_CROP: /* RW */
925 case VIDIOC_S_CROP: /* W */
926 return print_v4l2_crop(tcp, arg, code == VIDIOC_G_CROP);
927
928#ifdef VIDIOC_S_EXT_CTRLS
929 case VIDIOC_S_EXT_CTRLS: /* RW */
930 case VIDIOC_TRY_EXT_CTRLS: /* RW */
931 case VIDIOC_G_EXT_CTRLS: /* RW */
932 return print_v4l2_ext_controls(tcp, arg,
933 code == VIDIOC_G_EXT_CTRLS);
934#endif /* VIDIOC_S_EXT_CTRLS */
935
936#ifdef VIDIOC_ENUM_FRAMESIZES
937 case VIDIOC_ENUM_FRAMESIZES: /* RW */
938 return print_v4l2_frmsizeenum(tcp, arg);
939#endif /* VIDIOC_ENUM_FRAMESIZES */
940
941#ifdef VIDIOC_ENUM_FRAMEINTERVALS
942 case VIDIOC_ENUM_FRAMEINTERVALS: /* RW */
943 return print_v4l2_frmivalenum(tcp, arg);
944#endif /* VIDIOC_ENUM_FRAMEINTERVALS */
945
946#ifdef VIDIOC_CREATE_BUFS
947 case VIDIOC_CREATE_BUFS: /* RW */
948 return print_v4l2_create_buffers(tcp, arg);
949#endif /* VIDIOC_CREATE_BUFS */
950
951 default:
952 return RVAL_DECODED;
Philippe De Muyter0cc96142014-11-03 21:27:40 +0100953 }
954}