Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1 | /* |
| 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> |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 5 | * Copyright (c) 2014-2018 The strace developers. |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 6 | * All rights reserved. |
| 7 | * |
| 8 | * Redistribution and use in source and binary forms, with or without |
| 9 | * modification, are permitted provided that the following conditions |
| 10 | * are met: |
| 11 | * 1. Redistributions of source code must retain the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer. |
| 13 | * 2. Redistributions in binary form must reproduce the above copyright |
| 14 | * notice, this list of conditions and the following disclaimer in the |
| 15 | * documentation and/or other materials provided with the distribution. |
| 16 | * 3. The name of the author may not be used to endorse or promote products |
| 17 | * derived from this software without specific prior written permission. |
| 18 | * |
| 19 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 20 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 21 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 22 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 24 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | */ |
| 30 | |
| 31 | #include "defs.h" |
| 32 | |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 33 | #include <stdint.h> |
| 34 | #include <linux/ioctl.h> |
| 35 | #include <linux/types.h> |
| 36 | #include <linux/videodev2.h> |
| 37 | |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 38 | #include DEF_MPERS_TYPE(struct_v4l2_buffer) |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 39 | #include DEF_MPERS_TYPE(struct_v4l2_clip) |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 40 | #ifdef VIDIOC_CREATE_BUFS |
| 41 | # include DEF_MPERS_TYPE(struct_v4l2_create_buffers) |
| 42 | #endif |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 43 | #include DEF_MPERS_TYPE(struct_v4l2_ext_control) |
| 44 | #include DEF_MPERS_TYPE(struct_v4l2_ext_controls) |
| 45 | #include DEF_MPERS_TYPE(struct_v4l2_format) |
| 46 | #include DEF_MPERS_TYPE(struct_v4l2_framebuffer) |
| 47 | #include DEF_MPERS_TYPE(struct_v4l2_input) |
| 48 | #include DEF_MPERS_TYPE(struct_v4l2_standard) |
| 49 | |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 50 | typedef struct v4l2_buffer struct_v4l2_buffer; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 51 | typedef struct v4l2_clip struct_v4l2_clip; |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 52 | #ifdef VIDIOC_CREATE_BUFS |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 53 | typedef struct v4l2_create_buffers struct_v4l2_create_buffers; |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 54 | #endif |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 55 | typedef struct v4l2_ext_control struct_v4l2_ext_control; |
| 56 | typedef struct v4l2_ext_controls struct_v4l2_ext_controls; |
| 57 | typedef struct v4l2_format struct_v4l2_format; |
| 58 | typedef struct v4l2_framebuffer struct_v4l2_framebuffer; |
| 59 | typedef struct v4l2_input struct_v4l2_input; |
| 60 | typedef struct v4l2_standard struct_v4l2_standard; |
| 61 | |
| 62 | #include MPERS_DEFS |
| 63 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 64 | #include "print_fields.h" |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 65 | #include "xstring.h" |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 66 | |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 67 | /* v4l2_fourcc_be was added by Linux commit v3.18-rc1~101^2^2~127 */ |
| 68 | #ifndef v4l2_fourcc_be |
| 69 | # define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31)) |
| 70 | #endif |
| 71 | |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 72 | #define FMT_FRACT "%u/%u" |
| 73 | #define ARGS_FRACT(x) ((x).numerator), ((x).denominator) |
| 74 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 75 | #define FMT_RECT "{left=%d, top=%d, width=%u, height=%u}" |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 76 | #define ARGS_RECT(x) (x).left, (x).top, (x).width, (x).height |
| 77 | |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 78 | #include "xlat/v4l2_pix_fmts.h" |
| 79 | #include "xlat/v4l2_sdr_fmts.h" |
| 80 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 81 | static void |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 82 | print_pixelformat(uint32_t fourcc, const struct xlat *xlat) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 83 | { |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 84 | unsigned char a[] = { |
| 85 | (unsigned char) fourcc, |
| 86 | (unsigned char) (fourcc >> 8), |
| 87 | (unsigned char) (fourcc >> 16), |
| 88 | (unsigned char) (fourcc >> 24), |
Dmitry V. Levin | f2f162e | 2016-05-13 03:51:43 +0000 | [diff] [blame] | 89 | }; |
Dmitry V. Levin | f0a5b08 | 2015-01-25 00:27:00 +0000 | [diff] [blame] | 90 | unsigned int i; |
| 91 | |
| 92 | tprints("v4l2_fourcc("); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 93 | for (i = 0; i < ARRAY_SIZE(a); ++i) { |
| 94 | unsigned char c = a[i]; |
Dmitry V. Levin | f0a5b08 | 2015-01-25 00:27:00 +0000 | [diff] [blame] | 95 | |
| 96 | if (i) |
| 97 | tprints(", "); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 98 | if (c == '\'' || c == '\\') { |
Dmitry V. Levin | f0a5b08 | 2015-01-25 00:27:00 +0000 | [diff] [blame] | 99 | char sym[] = { |
| 100 | '\'', |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 101 | '\\', |
| 102 | c, |
| 103 | '\'', |
| 104 | '\0' |
| 105 | }; |
| 106 | tprints(sym); |
| 107 | } else if (c >= ' ' && c <= 0x7e) { |
| 108 | char sym[] = { |
| 109 | '\'', |
| 110 | c, |
| 111 | '\'', |
| 112 | '\0' |
Dmitry V. Levin | f0a5b08 | 2015-01-25 00:27:00 +0000 | [diff] [blame] | 113 | }; |
| 114 | tprints(sym); |
| 115 | } else { |
| 116 | char hex[] = { |
| 117 | '\'', |
| 118 | '\\', |
| 119 | 'x', |
| 120 | "0123456789abcdef"[c >> 4], |
| 121 | "0123456789abcdef"[c & 0xf], |
| 122 | '\'', |
| 123 | '\0' |
| 124 | }; |
| 125 | tprints(hex); |
| 126 | } |
| 127 | } |
| 128 | tprints(")"); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 129 | |
| 130 | if (xlat) { |
| 131 | const char *pixfmt_name = xlookup(xlat, fourcc); |
| 132 | |
| 133 | if (pixfmt_name) |
| 134 | tprints_comment(pixfmt_name); |
| 135 | } |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 136 | } |
| 137 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 138 | #include "xlat/v4l2_device_capabilities_flags.h" |
| 139 | |
| 140 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 141 | print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 142 | { |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 143 | struct v4l2_capability caps; |
| 144 | |
| 145 | if (entering(tcp)) |
| 146 | return 0; |
| 147 | tprints(", "); |
| 148 | if (umove_or_printaddr(tcp, arg, &caps)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 149 | return RVAL_IOCTL_DECODED; |
| 150 | PRINT_FIELD_CSTRING("{", caps, driver); |
| 151 | PRINT_FIELD_CSTRING(", ", caps, card); |
| 152 | PRINT_FIELD_CSTRING(", ", caps, bus_info); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 153 | tprintf(", version=%u.%u.%u, capabilities=", |
| 154 | (caps.version >> 16) & 0xFF, |
| 155 | (caps.version >> 8) & 0xFF, |
| 156 | caps.version & 0xFF); |
| 157 | printflags(v4l2_device_capabilities_flags, caps.capabilities, |
| 158 | "V4L2_CAP_???"); |
| 159 | #ifdef V4L2_CAP_DEVICE_CAPS |
| 160 | tprints(", device_caps="); |
| 161 | printflags(v4l2_device_capabilities_flags, caps.device_caps, |
| 162 | "V4L2_CAP_???"); |
| 163 | #endif |
| 164 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 165 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | #include "xlat/v4l2_buf_types.h" |
| 169 | #include "xlat/v4l2_format_description_flags.h" |
| 170 | |
| 171 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 172 | print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 173 | { |
| 174 | struct v4l2_fmtdesc f; |
| 175 | |
| 176 | if (entering(tcp)) { |
| 177 | tprints(", "); |
| 178 | if (umove_or_printaddr(tcp, arg, &f)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 179 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 180 | tprintf("{index=%u, type=", f.index); |
| 181 | printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???"); |
| 182 | return 0; |
| 183 | } |
| 184 | |
| 185 | if (!syserror(tcp) && !umove(tcp, arg, &f)) { |
| 186 | tprints(", flags="); |
| 187 | printflags(v4l2_format_description_flags, f.flags, |
| 188 | "V4L2_FMT_FLAG_???"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 189 | PRINT_FIELD_CSTRING(", ", f, description); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 190 | tprints(", pixelformat="); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 191 | print_pixelformat(f.pixelformat, v4l2_pix_fmts); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 192 | } |
| 193 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 194 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 195 | } |
| 196 | |
| 197 | #include "xlat/v4l2_fields.h" |
| 198 | #include "xlat/v4l2_colorspaces.h" |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 199 | #include "xlat/v4l2_vbi_flags.h" |
| 200 | #include "xlat/v4l2_sliced_flags.h" |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 201 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 202 | static bool |
Elliott Hughes | dc75b01 | 2017-07-05 13:54:44 -0700 | [diff] [blame] | 203 | print_v4l2_clip(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 204 | { |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 205 | const struct_v4l2_clip *p = elem_buf; |
| 206 | tprintf(FMT_RECT, ARGS_RECT(p->c)); |
| 207 | return true; |
| 208 | } |
| 209 | |
| 210 | static bool |
| 211 | print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix, |
| 212 | const struct_v4l2_format *f) |
| 213 | { |
| 214 | bool ret = true; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 215 | switch (f->type) { |
| 216 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 217 | case V4L2_BUF_TYPE_VIDEO_OUTPUT: |
| 218 | tprints(prefix); |
| 219 | tprintf("fmt.pix={width=%u, height=%u, pixelformat=", |
| 220 | f->fmt.pix.width, f->fmt.pix.height); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 221 | print_pixelformat(f->fmt.pix.pixelformat, v4l2_pix_fmts); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 222 | tprints(", field="); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 223 | printxval(v4l2_fields, f->fmt.pix.field, "V4L2_FIELD_???"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 224 | tprintf(", bytesperline=%u, sizeimage=%u, colorspace=", |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 225 | f->fmt.pix.bytesperline, f->fmt.pix.sizeimage); |
| 226 | printxval(v4l2_colorspaces, f->fmt.pix.colorspace, |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 227 | "V4L2_COLORSPACE_???"); |
| 228 | tprints("}"); |
| 229 | break; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 230 | #if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE |
| 231 | case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: |
| 232 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 233 | unsigned int i, max; |
| 234 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 235 | tprints(prefix); |
| 236 | tprintf("fmt.pix_mp={width=%u, height=%u, pixelformat=", |
| 237 | f->fmt.pix_mp.width, f->fmt.pix_mp.height); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 238 | print_pixelformat(f->fmt.pix_mp.pixelformat, v4l2_pix_fmts); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 239 | tprints(", field="); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 240 | printxval(v4l2_fields, f->fmt.pix_mp.field, "V4L2_FIELD_???"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 241 | tprints(", colorspace="); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 242 | printxval(v4l2_colorspaces, f->fmt.pix_mp.colorspace, |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 243 | "V4L2_COLORSPACE_???"); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 244 | tprints(", plane_fmt=["); |
| 245 | max = f->fmt.pix_mp.num_planes; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 246 | if (max > VIDEO_MAX_PLANES) |
| 247 | max = VIDEO_MAX_PLANES; |
| 248 | for (i = 0; i < max; i++) { |
| 249 | if (i > 0) |
| 250 | tprints(", "); |
| 251 | tprintf("{sizeimage=%u, bytesperline=%u}", |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 252 | f->fmt.pix_mp.plane_fmt[i].sizeimage, |
| 253 | f->fmt.pix_mp.plane_fmt[i].bytesperline); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 254 | } |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 255 | tprintf("], num_planes=%u}", |
| 256 | (unsigned) f->fmt.pix_mp.num_planes); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 257 | break; |
| 258 | } |
| 259 | #endif |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 260 | /* OUTPUT_OVERLAY since Linux v2.6.22-rc1~1118^2~179 */ |
Dmitry V. Levin | 197db57 | 2015-01-09 04:53:19 +0000 | [diff] [blame] | 261 | #if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 262 | case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: |
Dmitry V. Levin | 197db57 | 2015-01-09 04:53:19 +0000 | [diff] [blame] | 263 | #endif |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 264 | case V4L2_BUF_TYPE_VIDEO_OVERLAY: { |
| 265 | struct_v4l2_clip clip; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 266 | tprints(prefix); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 267 | tprintf("fmt.win={left=%d, top=%d, width=%u, height=%u, field=", |
| 268 | ARGS_RECT(f->fmt.win.w)); |
| 269 | printxval(v4l2_fields, f->fmt.win.field, "V4L2_FIELD_???"); |
| 270 | tprintf(", chromakey=%#x, clips=", f->fmt.win.chromakey); |
| 271 | ret = print_array(tcp, ptr_to_kulong(f->fmt.win.clips), |
| 272 | f->fmt.win.clipcount, &clip, sizeof(clip), |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 273 | tfetch_mem, print_v4l2_clip, 0); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 274 | tprintf(", clipcount=%u, bitmap=", f->fmt.win.clipcount); |
| 275 | printaddr(ptr_to_kulong(f->fmt.win.bitmap)); |
Elliott Hughes | dc75b01 | 2017-07-05 13:54:44 -0700 | [diff] [blame] | 276 | #ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 277 | tprintf(", global_alpha=%#x", f->fmt.win.global_alpha); |
| 278 | #endif |
| 279 | tprints("}"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 280 | break; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 281 | } |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 282 | case V4L2_BUF_TYPE_VBI_CAPTURE: |
| 283 | case V4L2_BUF_TYPE_VBI_OUTPUT: |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 284 | tprints(prefix); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 285 | tprintf("fmt.vbi={sampling_rate=%u, offset=%u, " |
| 286 | "samples_per_line=%u, sample_format=", |
| 287 | f->fmt.vbi.sampling_rate, f->fmt.vbi.offset, |
| 288 | f->fmt.vbi.samples_per_line); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 289 | print_pixelformat(f->fmt.vbi.sample_format, v4l2_pix_fmts); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 290 | tprintf(", start=[%u, %u], count=[%u, %u], ", |
| 291 | f->fmt.vbi.start[0], f->fmt.vbi.start[1], |
| 292 | f->fmt.vbi.count[0], f->fmt.vbi.count[1]); |
| 293 | tprints("flags="); |
| 294 | printxval(v4l2_vbi_flags, f->fmt.vbi.flags, "V4L2_VBI_???"); |
| 295 | tprints("}"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 296 | break; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 297 | /* both since Linux v2.6.14-rc2~64 */ |
| 298 | #if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 299 | case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 300 | case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { |
| 301 | unsigned int i, j; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 302 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 303 | tprints(prefix); |
| 304 | tprints("fmt.sliced={service_set="); |
| 305 | printxval(v4l2_sliced_flags, f->fmt.sliced.service_set, |
| 306 | "V4L2_SLICED_???"); |
| 307 | tprintf(", io_size=%u, service_lines=[", |
| 308 | f->fmt.sliced.io_size); |
| 309 | for (i = 0; i < ARRAY_SIZE(f->fmt.sliced.service_lines); i++) { |
| 310 | if (i > 0) |
| 311 | tprints(", "); |
| 312 | tprints("["); |
| 313 | for (j = 0; |
| 314 | j < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); |
| 315 | j++) { |
| 316 | if (j > 0) |
| 317 | tprints(", "); |
| 318 | tprintf("%#x", |
| 319 | f->fmt.sliced.service_lines[i][j]); |
| 320 | } |
| 321 | tprints("]"); |
| 322 | } |
| 323 | tprints("]}"); |
| 324 | break; |
| 325 | } |
| 326 | #endif |
| 327 | /* since Linux v4.4-rc1~118^2~14 */ |
| 328 | #if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT |
| 329 | case V4L2_BUF_TYPE_SDR_OUTPUT: |
| 330 | #endif |
| 331 | /* since Linux v3.15-rc1~85^2~213 */ |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 332 | #if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE |
| 333 | case V4L2_BUF_TYPE_SDR_CAPTURE: |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 334 | tprints(prefix); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 335 | tprints("fmt.sdr={pixelformat="); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 336 | print_pixelformat(f->fmt.sdr.pixelformat, v4l2_sdr_fmts); |
Elliott Hughes | dc75b01 | 2017-07-05 13:54:44 -0700 | [diff] [blame] | 337 | #ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 338 | tprintf(", buffersize=%u", |
| 339 | f->fmt.sdr.buffersize); |
| 340 | #endif |
| 341 | tprints("}"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 342 | break; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 343 | #endif |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 344 | } |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 345 | return ret; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 346 | } |
| 347 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 348 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 349 | print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg, |
| 350 | const bool is_get) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 351 | { |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 352 | struct_v4l2_format f; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 353 | |
| 354 | if (entering(tcp)) { |
| 355 | tprints(", "); |
| 356 | if (umove_or_printaddr(tcp, arg, &f)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 357 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 358 | tprints("{type="); |
| 359 | printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???"); |
| 360 | if (is_get) |
| 361 | return 0; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 362 | if (!print_v4l2_format_fmt(tcp, ", ", &f)) { |
| 363 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 364 | return RVAL_IOCTL_DECODED; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 365 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 366 | |
| 367 | return 0; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 368 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 369 | |
| 370 | if (!syserror(tcp) && !umove(tcp, arg, &f)) |
| 371 | print_v4l2_format_fmt(tcp, is_get ? ", " : " => ", &f); |
| 372 | |
| 373 | tprints("}"); |
| 374 | |
| 375 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | #include "xlat/v4l2_memories.h" |
| 379 | |
| 380 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 381 | print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 382 | { |
| 383 | struct v4l2_requestbuffers reqbufs; |
| 384 | |
| 385 | if (entering(tcp)) { |
| 386 | tprints(", "); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 387 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 388 | if (umove_or_printaddr(tcp, arg, &reqbufs)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 389 | return RVAL_IOCTL_DECODED; |
| 390 | |
| 391 | tprintf("{type="); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 392 | printxval(v4l2_buf_types, reqbufs.type, "V4L2_BUF_TYPE_???"); |
| 393 | tprints(", memory="); |
| 394 | printxval(v4l2_memories, reqbufs.memory, "V4L2_MEMORY_???"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 395 | tprintf(", count=%u", reqbufs.count); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 396 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 397 | return 0; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 398 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 399 | |
| 400 | if (!syserror(tcp)) { |
| 401 | tprints(" => "); |
| 402 | |
| 403 | if (!umove(tcp, arg, &reqbufs)) |
| 404 | tprintf("%u", reqbufs.count); |
| 405 | else |
| 406 | tprints("???"); |
| 407 | } |
| 408 | |
| 409 | tprints("}"); |
| 410 | |
| 411 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 412 | } |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 413 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 414 | #include "xlat/v4l2_buf_flags.h" |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 415 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 416 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 417 | print_v4l2_buffer(struct tcb *const tcp, const unsigned int code, |
| 418 | const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 419 | { |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 420 | struct_v4l2_buffer b; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 421 | |
| 422 | if (entering(tcp)) { |
| 423 | tprints(", "); |
| 424 | if (umove_or_printaddr(tcp, arg, &b)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 425 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 426 | tprints("{type="); |
| 427 | printxval(v4l2_buf_types, b.type, "V4L2_BUF_TYPE_???"); |
| 428 | if (code != VIDIOC_DQBUF) |
| 429 | tprintf(", index=%u", b.index); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 430 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 431 | return 0; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 432 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 433 | |
| 434 | if (!syserror(tcp) && !umove(tcp, arg, &b)) { |
| 435 | if (code == VIDIOC_DQBUF) |
| 436 | tprintf(", index=%u", b.index); |
| 437 | tprints(", memory="); |
| 438 | printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); |
| 439 | |
| 440 | if (b.memory == V4L2_MEMORY_MMAP) { |
| 441 | tprintf(", m.offset=%#x", b.m.offset); |
| 442 | } else if (b.memory == V4L2_MEMORY_USERPTR) { |
| 443 | tprints(", m.userptr="); |
| 444 | printaddr(b.m.userptr); |
| 445 | } |
| 446 | |
| 447 | tprintf(", length=%u, bytesused=%u, flags=", |
| 448 | b.length, b.bytesused); |
| 449 | printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???"); |
| 450 | if (code == VIDIOC_DQBUF) { |
| 451 | tprints(", timestamp = "); |
| 452 | MPERS_FUNC_NAME(print_struct_timeval)(&b.timestamp); |
| 453 | } |
| 454 | tprints(", ..."); |
| 455 | } |
| 456 | |
| 457 | tprints("}"); |
| 458 | |
| 459 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 460 | } |
| 461 | |
| 462 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 463 | print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 464 | { |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 465 | struct_v4l2_framebuffer b; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 466 | |
| 467 | tprints(", "); |
| 468 | if (!umove_or_printaddr(tcp, arg, &b)) { |
Dmitry V. Levin | 484326d | 2016-06-11 01:28:21 +0000 | [diff] [blame] | 469 | tprintf("{capability=%#x, flags=%#x, base=", |
| 470 | b.capability, b.flags); |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 471 | printaddr(ptr_to_kulong(b.base)); |
Dmitry V. Levin | 484326d | 2016-06-11 01:28:21 +0000 | [diff] [blame] | 472 | tprints("}"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 473 | } |
| 474 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 475 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 476 | } |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 477 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 478 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 479 | print_v4l2_buf_type(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 480 | { |
| 481 | int type; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 482 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 483 | tprints(", "); |
| 484 | if (!umove_or_printaddr(tcp, arg, &type)) { |
| 485 | tprints("["); |
| 486 | printxval(v4l2_buf_types, type, "V4L2_BUF_TYPE_???"); |
| 487 | tprints("]"); |
| 488 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 489 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 490 | } |
| 491 | |
| 492 | #include "xlat/v4l2_streaming_capabilities.h" |
| 493 | #include "xlat/v4l2_capture_modes.h" |
| 494 | |
| 495 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 496 | print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg, |
| 497 | const bool is_get) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 498 | { |
| 499 | struct v4l2_streamparm s; |
| 500 | |
| 501 | if (entering(tcp)) { |
| 502 | tprints(", "); |
| 503 | if (umove_or_printaddr(tcp, arg, &s)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 504 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 505 | tprints("{type="); |
| 506 | printxval(v4l2_buf_types, s.type, "V4L2_BUF_TYPE_???"); |
| 507 | switch (s.type) { |
| 508 | case V4L2_BUF_TYPE_VIDEO_CAPTURE: |
| 509 | case V4L2_BUF_TYPE_VIDEO_OUTPUT: |
| 510 | if (is_get) |
| 511 | return 0; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 512 | tprints(", "); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 513 | break; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 514 | default: |
| 515 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 516 | return RVAL_IOCTL_DECODED; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 517 | } |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 518 | } else { |
| 519 | if (syserror(tcp) || umove(tcp, arg, &s) < 0) { |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 520 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 521 | return RVAL_IOCTL_DECODED; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 522 | } |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 523 | tprints(is_get ? ", " : " => "); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 524 | } |
| 525 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 526 | if (s.type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { |
| 527 | tprints("parm.capture={capability="); |
| 528 | printflags(v4l2_streaming_capabilities, |
| 529 | s.parm.capture.capability, "V4L2_CAP_???"); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 530 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 531 | tprints(", capturemode="); |
| 532 | printflags(v4l2_capture_modes, |
| 533 | s.parm.capture.capturemode, "V4L2_MODE_???"); |
| 534 | |
| 535 | tprintf(", timeperframe=" FMT_FRACT, |
| 536 | ARGS_FRACT(s.parm.capture.timeperframe)); |
| 537 | |
| 538 | tprintf(", extendedmode=%u, readbuffers=%u}", |
| 539 | s.parm.capture.extendedmode, |
| 540 | s.parm.capture.readbuffers); |
| 541 | } else { |
| 542 | tprints("parm.output={capability="); |
| 543 | printflags(v4l2_streaming_capabilities, |
| 544 | s.parm.output.capability, "V4L2_CAP_???"); |
| 545 | |
| 546 | tprintf(", outputmode=%u", s.parm.output.outputmode); |
| 547 | |
| 548 | tprintf(", timeperframe=" FMT_FRACT, |
| 549 | ARGS_FRACT(s.parm.output.timeperframe)); |
| 550 | |
| 551 | tprintf(", extendedmode=%u, writebuffers=%u}", |
| 552 | s.parm.output.extendedmode, |
| 553 | s.parm.output.writebuffers); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 554 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 555 | if (entering(tcp)) { |
| 556 | return 0; |
| 557 | } else { |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 558 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 559 | return RVAL_IOCTL_DECODED; |
| 560 | } |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 561 | } |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 562 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 563 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 564 | print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 565 | { |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 566 | struct_v4l2_standard s; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 567 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 568 | if (entering(tcp)) { |
| 569 | tprints(", "); |
| 570 | if (umove_or_printaddr(tcp, arg, &s)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 571 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 572 | tprintf("{index=%u", s.index); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 573 | |
| 574 | return 0; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 575 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 576 | |
| 577 | if (!syserror(tcp) && !umove(tcp, arg, &s)) { |
| 578 | PRINT_FIELD_CSTRING(", ", s, name); |
| 579 | tprintf(", frameperiod=" FMT_FRACT, |
| 580 | ARGS_FRACT(s.frameperiod)); |
| 581 | tprintf(", framelines=%d", s.framelines); |
| 582 | } |
| 583 | |
| 584 | tprints("}"); |
| 585 | |
| 586 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | #include "xlat/v4l2_input_types.h" |
| 590 | |
| 591 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 592 | print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 593 | { |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 594 | struct_v4l2_input i; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 595 | |
| 596 | if (entering(tcp)) { |
| 597 | tprints(", "); |
| 598 | if (umove_or_printaddr(tcp, arg, &i)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 599 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 600 | tprintf("{index=%u", i.index); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 601 | |
| 602 | return 0; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 603 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 604 | |
| 605 | if (!syserror(tcp) && !umove(tcp, arg, &i)) { |
| 606 | PRINT_FIELD_CSTRING(", ", i, name); |
| 607 | tprints(", type="); |
| 608 | printxval(v4l2_input_types, i.type, "V4L2_INPUT_TYPE_???"); |
| 609 | } |
| 610 | |
| 611 | tprints("}"); |
| 612 | |
| 613 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 614 | } |
| 615 | |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 616 | /* |
| 617 | * We include it here and not before print_v4l2_ext_controls as we need |
| 618 | * V4L2_CTRL_CLASS_* definitions for V4L2_CID_*_BASE ones. |
| 619 | */ |
| 620 | #include "xlat/v4l2_control_classes.h" |
| 621 | #include "xlat/v4l2_control_id_bases.h" |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 622 | #include "xlat/v4l2_control_ids.h" |
| 623 | |
| 624 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 625 | print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg, |
| 626 | const bool is_get) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 627 | { |
| 628 | struct v4l2_control c; |
| 629 | |
| 630 | if (entering(tcp)) { |
| 631 | tprints(", "); |
| 632 | if (umove_or_printaddr(tcp, arg, &c)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 633 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 634 | tprints("{id="); |
| 635 | printxval(v4l2_control_ids, c.id, "V4L2_CID_???"); |
| 636 | if (!is_get) |
| 637 | tprintf(", value=%d", c.value); |
| 638 | return 0; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 639 | } |
| 640 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 641 | if (!syserror(tcp) && !umove(tcp, arg, &c)) { |
| 642 | tprints(is_get ? ", " : " => "); |
| 643 | tprintf("value=%d", c.value); |
| 644 | } |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 645 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 646 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 647 | |
| 648 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 649 | } |
| 650 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 651 | #include "xlat/v4l2_tuner_types.h" |
| 652 | #include "xlat/v4l2_tuner_capabilities.h" |
| 653 | #include "xlat/v4l2_tuner_rxsubchanses.h" |
| 654 | #include "xlat/v4l2_tuner_audmodes.h" |
| 655 | |
| 656 | static int |
| 657 | print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg, |
| 658 | const bool is_get) |
| 659 | { |
| 660 | struct v4l2_tuner c; |
| 661 | if (entering(tcp)) { |
| 662 | tprints(", "); |
| 663 | if (umove_or_printaddr(tcp, arg, &c)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 664 | return RVAL_IOCTL_DECODED; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 665 | tprintf("{index=%u", c.index); |
| 666 | if (is_get) |
| 667 | return 0; |
| 668 | tprints(", "); |
| 669 | } else { |
| 670 | if (syserror(tcp) || umove(tcp, arg, &c) < 0) { |
| 671 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 672 | return RVAL_IOCTL_DECODED; |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 673 | } |
| 674 | tprints(is_get ? ", " : " => "); |
| 675 | } |
| 676 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 677 | PRINT_FIELD_CSTRING("", c, name); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 678 | tprints(", type="); |
| 679 | printxval(v4l2_tuner_types, c.type, "V4L2_TUNER_TYPE_???"); |
| 680 | tprints(", capability="); |
| 681 | printxval(v4l2_tuner_capabilities, c.capability, |
| 682 | "V4L2_TUNER_CAP_???"); |
| 683 | tprintf(", rangelow=%u, rangehigh=%u, rxsubchans=", |
| 684 | c.rangelow, c.rangehigh); |
| 685 | printxval(v4l2_tuner_rxsubchanses, c.rxsubchans, |
| 686 | "V4L2_TUNER_SUB_???"); |
| 687 | tprints(", audmode="); |
| 688 | printxval(v4l2_tuner_audmodes, c.audmode, |
| 689 | "V4L2_TUNER_MODE_???"); |
| 690 | tprintf(", signal=%d, afc=%d", c.signal, c.afc); |
| 691 | |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 692 | if (entering(tcp)) { |
| 693 | return 0; |
| 694 | } else { |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 695 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 696 | return RVAL_IOCTL_DECODED; |
| 697 | } |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 698 | } |
| 699 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 700 | #include "xlat/v4l2_control_types.h" |
| 701 | #include "xlat/v4l2_control_flags.h" |
| 702 | |
| 703 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 704 | print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 705 | { |
| 706 | struct v4l2_queryctrl c; |
| 707 | |
| 708 | if (entering(tcp)) { |
| 709 | tprints(", "); |
| 710 | if (umove_or_printaddr(tcp, arg, &c)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 711 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 712 | tprints("{id="); |
| 713 | } else { |
| 714 | if (syserror(tcp) || umove(tcp, arg, &c) < 0) { |
| 715 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 716 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 717 | } |
Dmitry V. Levin | b759d27 | 2016-07-15 16:08:19 +0000 | [diff] [blame] | 718 | if (get_tcb_priv_ulong(tcp)) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 719 | tprints(" => "); |
| 720 | } |
| 721 | |
Dmitry V. Levin | b759d27 | 2016-07-15 16:08:19 +0000 | [diff] [blame] | 722 | if (entering(tcp) || get_tcb_priv_ulong(tcp)) { |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 723 | #ifdef V4L2_CTRL_FLAG_NEXT_CTRL |
Dmitry V. Levin | b759d27 | 2016-07-15 16:08:19 +0000 | [diff] [blame] | 724 | const unsigned long next = c.id & V4L2_CTRL_FLAG_NEXT_CTRL; |
| 725 | set_tcb_priv_ulong(tcp, next); |
| 726 | if (next) { |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 727 | print_xlat(V4L2_CTRL_FLAG_NEXT_CTRL); |
| 728 | tprints("|"); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 729 | c.id &= ~V4L2_CTRL_FLAG_NEXT_CTRL; |
| 730 | } |
| 731 | #endif |
| 732 | printxval(v4l2_control_ids, c.id, "V4L2_CID_???"); |
| 733 | } |
| 734 | |
| 735 | if (exiting(tcp)) { |
| 736 | tprints(", type="); |
| 737 | printxval(v4l2_control_types, c.type, "V4L2_CTRL_TYPE_???"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 738 | PRINT_FIELD_CSTRING(", ", c, name); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 739 | tprintf(", minimum=%d, maximum=%d, step=%d" |
| 740 | ", default_value=%d, flags=", |
| 741 | c.minimum, c.maximum, c.step, c.default_value); |
| 742 | printflags(v4l2_control_flags, c.flags, "V4L2_CTRL_FLAG_???"); |
| 743 | tprints("}"); |
| 744 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 745 | return entering(tcp) ? 0 : RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 746 | } |
| 747 | |
| 748 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 749 | print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 750 | { |
| 751 | struct v4l2_cropcap c; |
| 752 | |
| 753 | if (entering(tcp)) { |
| 754 | tprints(", "); |
| 755 | if (umove_or_printaddr(tcp, arg, &c)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 756 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 757 | tprints("{type="); |
| 758 | printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 759 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 760 | return 0; |
| 761 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 762 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 763 | if (!syserror(tcp) && !umove(tcp, arg, &c)) { |
| 764 | tprintf(", bounds=" FMT_RECT |
| 765 | ", defrect=" FMT_RECT |
| 766 | ", pixelaspect=" FMT_FRACT, |
| 767 | ARGS_RECT(c.bounds), |
| 768 | ARGS_RECT(c.defrect), |
| 769 | ARGS_FRACT(c.pixelaspect)); |
| 770 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 771 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 772 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 773 | |
| 774 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 775 | } |
| 776 | |
| 777 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 778 | print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg, |
| 779 | const bool is_get) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 780 | { |
| 781 | struct v4l2_crop c; |
| 782 | |
| 783 | if (entering(tcp)) { |
| 784 | tprints(", "); |
| 785 | if (umove_or_printaddr(tcp, arg, &c)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 786 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 787 | tprints("{type="); |
| 788 | printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???"); |
| 789 | if (is_get) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 790 | return 0; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 791 | tprintf(", c=" FMT_RECT, ARGS_RECT(c.c)); |
| 792 | } else { |
| 793 | if (!syserror(tcp) && !umove(tcp, arg, &c)) |
| 794 | tprintf(", c=" FMT_RECT, ARGS_RECT(c.c)); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 795 | } |
| 796 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 797 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 798 | |
| 799 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 800 | } |
| 801 | |
| 802 | #ifdef VIDIOC_S_EXT_CTRLS |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 803 | static bool |
| 804 | print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 805 | { |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 806 | const struct_v4l2_ext_control *p = elem_buf; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 807 | |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 808 | tprints("{id="); |
| 809 | printxval(v4l2_control_ids, p->id, "V4L2_CID_???"); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 810 | # if HAVE_DECL_V4L2_CTRL_TYPE_STRING |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 811 | tprintf(", size=%u", p->size); |
| 812 | if (p->size > 0) { |
| 813 | tprints(", string="); |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 814 | printstrn(tcp, ptr_to_kulong(p->string), p->size); |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 815 | } else |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 816 | # endif |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 817 | tprintf(", value=%d, value64=%" PRId64, p->value, (int64_t) p->value64); |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 818 | tprints("}"); |
| 819 | |
| 820 | return true; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 821 | } |
| 822 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 823 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 824 | print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, |
| 825 | const bool is_get) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 826 | { |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 827 | struct_v4l2_ext_controls c; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 828 | |
| 829 | if (entering(tcp)) { |
| 830 | tprints(", "); |
| 831 | if (umove_or_printaddr(tcp, arg, &c)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 832 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 833 | tprints("{ctrl_class="); |
| 834 | printxval(v4l2_control_classes, c.ctrl_class, |
| 835 | "V4L2_CTRL_CLASS_???"); |
| 836 | tprintf(", count=%u", c.count); |
| 837 | if (!c.count) { |
| 838 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 839 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 840 | } |
| 841 | if (is_get) |
| 842 | return 0; |
| 843 | tprints(", "); |
| 844 | } else { |
| 845 | if (umove(tcp, arg, &c) < 0) { |
| 846 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 847 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 848 | } |
| 849 | tprints(is_get ? ", " : " => "); |
| 850 | } |
| 851 | |
| 852 | tprints("controls="); |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 853 | struct_v4l2_ext_control ctrl; |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 854 | bool fail = !print_array(tcp, ptr_to_kulong(c.controls), c.count, |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 855 | &ctrl, sizeof(ctrl), |
Elliott Hughes | 03a418e | 2018-06-15 13:11:40 -0700 | [diff] [blame] | 856 | tfetch_mem_ignore_syserror, |
Dmitry V. Levin | 17d1a16 | 2016-05-07 23:15:36 +0000 | [diff] [blame] | 857 | print_v4l2_ext_control, 0); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 858 | |
| 859 | if (exiting(tcp) && syserror(tcp)) |
| 860 | tprintf(", error_idx=%u", c.error_idx); |
| 861 | |
| 862 | if (exiting(tcp) || fail) { |
| 863 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 864 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 865 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 866 | |
| 867 | /* entering */ |
| 868 | return 0; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 869 | } |
| 870 | #endif /* VIDIOC_S_EXT_CTRLS */ |
| 871 | |
| 872 | #ifdef VIDIOC_ENUM_FRAMESIZES |
| 873 | # include "xlat/v4l2_framesize_types.h" |
| 874 | |
| 875 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 876 | print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 877 | { |
| 878 | struct v4l2_frmsizeenum s; |
| 879 | |
| 880 | if (entering(tcp)) { |
| 881 | tprints(", "); |
| 882 | if (umove_or_printaddr(tcp, arg, &s)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 883 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 884 | tprintf("{index=%u, pixel_format=", s.index); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 885 | print_pixelformat(s.pixel_format, v4l2_pix_fmts); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 886 | return 0; |
| 887 | } |
| 888 | |
| 889 | if (!syserror(tcp) && !umove(tcp, arg, &s)) { |
| 890 | tprints(", type="); |
| 891 | printxval(v4l2_framesize_types, s.type, "V4L2_FRMSIZE_TYPE_???"); |
| 892 | switch (s.type) { |
| 893 | case V4L2_FRMSIZE_TYPE_DISCRETE: |
| 894 | tprintf(", discrete={width=%u, height=%u}", |
| 895 | s.discrete.width, s.discrete.height); |
| 896 | break; |
| 897 | case V4L2_FRMSIZE_TYPE_STEPWISE: |
| 898 | tprintf(", stepwise={min_width=%u, max_width=%u, " |
| 899 | "step_width=%u, min_height=%u, max_height=%u, " |
| 900 | "step_height=%u}", |
| 901 | s.stepwise.min_width, s.stepwise.max_width, |
| 902 | s.stepwise.step_width, s.stepwise.min_height, |
| 903 | s.stepwise.max_height, s.stepwise.step_height); |
| 904 | break; |
| 905 | } |
| 906 | } |
| 907 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 908 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 909 | } |
| 910 | #endif /* VIDIOC_ENUM_FRAMESIZES */ |
| 911 | |
Dmitry V. Levin | 197db57 | 2015-01-09 04:53:19 +0000 | [diff] [blame] | 912 | #ifdef VIDIOC_ENUM_FRAMEINTERVALS |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 913 | # include "xlat/v4l2_frameinterval_types.h" |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 914 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 915 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 916 | print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 917 | { |
| 918 | struct v4l2_frmivalenum f; |
| 919 | |
| 920 | if (entering(tcp)) { |
| 921 | tprints(", "); |
| 922 | if (umove_or_printaddr(tcp, arg, &f)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 923 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 924 | tprintf("{index=%u, pixel_format=", f.index); |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 925 | print_pixelformat(f.pixel_format, v4l2_pix_fmts); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 926 | tprintf(", width=%u, height=%u", f.width, f.height); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 927 | return 0; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 928 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 929 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 930 | if (!syserror(tcp) && !umove(tcp, arg, &f)) { |
| 931 | tprints(", type="); |
| 932 | printxval(v4l2_frameinterval_types, f.type, |
| 933 | "V4L2_FRMIVAL_TYPE_???"); |
| 934 | switch (f.type) { |
| 935 | case V4L2_FRMIVAL_TYPE_DISCRETE: |
| 936 | tprintf(", discrete=" FMT_FRACT, |
| 937 | ARGS_FRACT(f.discrete)); |
| 938 | break; |
| 939 | case V4L2_FRMIVAL_TYPE_STEPWISE: |
| 940 | case V4L2_FRMSIZE_TYPE_CONTINUOUS: |
| 941 | tprintf(", stepwise={min=" FMT_FRACT ", max=" |
| 942 | FMT_FRACT ", step=" FMT_FRACT "}", |
| 943 | ARGS_FRACT(f.stepwise.min), |
| 944 | ARGS_FRACT(f.stepwise.max), |
| 945 | ARGS_FRACT(f.stepwise.step)); |
| 946 | break; |
| 947 | } |
| 948 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 949 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 950 | tprints("}"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 951 | |
| 952 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 953 | } |
Dmitry V. Levin | 197db57 | 2015-01-09 04:53:19 +0000 | [diff] [blame] | 954 | #endif /* VIDIOC_ENUM_FRAMEINTERVALS */ |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 955 | |
Dmitry V. Levin | fffe50d | 2015-08-26 11:55:05 +0000 | [diff] [blame] | 956 | #ifdef VIDIOC_CREATE_BUFS |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 957 | static int |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 958 | print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 959 | { |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 960 | static const char fmt[] = "{index=%u, count=%u}"; |
| 961 | static char outstr[sizeof(fmt) + sizeof(int) * 6]; |
| 962 | |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 963 | struct_v4l2_create_buffers b; |
Philippe De Muyter | 6779e71 | 2015-04-18 15:06:43 +0200 | [diff] [blame] | 964 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 965 | if (entering(tcp)) { |
| 966 | tprints(", "); |
| 967 | if (umove_or_printaddr(tcp, arg, &b)) |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 968 | return RVAL_IOCTL_DECODED; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 969 | tprintf("{count=%u, memory=", b.count); |
| 970 | printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); |
| 971 | tprints(", format={type="); |
| 972 | printxval(v4l2_buf_types, b.format.type, |
| 973 | "V4L2_BUF_TYPE_???"); |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 974 | print_v4l2_format_fmt(tcp, ", ", |
Dmitry V. Levin | 1e56814 | 2016-05-03 22:30:41 +0000 | [diff] [blame] | 975 | (struct_v4l2_format *) &b.format); |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 976 | tprints("}}"); |
| 977 | return 0; |
Philippe De Muyter | 6779e71 | 2015-04-18 15:06:43 +0200 | [diff] [blame] | 978 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 979 | |
| 980 | if (syserror(tcp) || umove(tcp, arg, &b)) |
| 981 | return RVAL_IOCTL_DECODED; |
| 982 | |
Elliott Hughes | b755614 | 2018-02-20 17:03:16 -0800 | [diff] [blame] | 983 | xsprintf(outstr, fmt, b.index, b.count); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 984 | tcp->auxstr = outstr; |
| 985 | |
| 986 | return RVAL_IOCTL_DECODED | RVAL_STR; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 987 | } |
Dmitry V. Levin | fffe50d | 2015-08-26 11:55:05 +0000 | [diff] [blame] | 988 | #endif /* VIDIOC_CREATE_BUFS */ |
Philippe De Muyter | 6779e71 | 2015-04-18 15:06:43 +0200 | [diff] [blame] | 989 | |
Elliott Hughes | d35df49 | 2017-02-15 15:19:05 -0800 | [diff] [blame] | 990 | MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, |
| 991 | const unsigned int code, const kernel_ulong_t arg) |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 992 | { |
| 993 | if (!verbose(tcp)) |
| 994 | return RVAL_DECODED; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 995 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 996 | switch (code) { |
| 997 | case VIDIOC_QUERYCAP: /* R */ |
| 998 | return print_v4l2_capability(tcp, arg); |
| 999 | |
| 1000 | case VIDIOC_ENUM_FMT: /* RW */ |
| 1001 | return print_v4l2_fmtdesc(tcp, arg); |
| 1002 | |
| 1003 | case VIDIOC_G_FMT: /* RW */ |
| 1004 | case VIDIOC_S_FMT: /* RW */ |
| 1005 | case VIDIOC_TRY_FMT: /* RW */ |
| 1006 | return print_v4l2_format(tcp, arg, code == VIDIOC_G_FMT); |
| 1007 | |
| 1008 | case VIDIOC_REQBUFS: /* RW */ |
| 1009 | return print_v4l2_requestbuffers(tcp, arg); |
| 1010 | |
| 1011 | case VIDIOC_QUERYBUF: /* RW */ |
| 1012 | case VIDIOC_QBUF: /* RW */ |
| 1013 | case VIDIOC_DQBUF: /* RW */ |
| 1014 | return print_v4l2_buffer(tcp, code, arg); |
| 1015 | |
| 1016 | case VIDIOC_G_FBUF: /* R */ |
| 1017 | if (entering(tcp)) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1018 | return 0; |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 1019 | ATTRIBUTE_FALLTHROUGH; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1020 | case VIDIOC_S_FBUF: /* W */ |
| 1021 | return print_v4l2_framebuffer(tcp, arg); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1022 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1023 | case VIDIOC_STREAMON: /* W */ |
| 1024 | case VIDIOC_STREAMOFF: /* W */ |
| 1025 | return print_v4l2_buf_type(tcp, arg); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1026 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1027 | case VIDIOC_G_PARM: /* RW */ |
| 1028 | case VIDIOC_S_PARM: /* RW */ |
| 1029 | return print_v4l2_streamparm(tcp, arg, code == VIDIOC_G_PARM); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1030 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1031 | case VIDIOC_G_STD: /* R */ |
| 1032 | if (entering(tcp)) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1033 | return 0; |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 1034 | ATTRIBUTE_FALLTHROUGH; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1035 | case VIDIOC_S_STD: /* W */ |
| 1036 | tprints(", "); |
| 1037 | printnum_int64(tcp, arg, "%#" PRIx64); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1038 | break; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1039 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1040 | case VIDIOC_ENUMSTD: /* RW */ |
| 1041 | return print_v4l2_standard(tcp, arg); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1042 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1043 | case VIDIOC_ENUMINPUT: /* RW */ |
| 1044 | return print_v4l2_input(tcp, arg); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1045 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1046 | case VIDIOC_G_CTRL: /* RW */ |
| 1047 | case VIDIOC_S_CTRL: /* RW */ |
| 1048 | return print_v4l2_control(tcp, arg, code == VIDIOC_G_CTRL); |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1049 | |
Elliott Hughes | 39bac05 | 2017-05-25 16:56:11 -0700 | [diff] [blame] | 1050 | case VIDIOC_G_TUNER: /* RW */ |
| 1051 | case VIDIOC_S_TUNER: /* RW */ |
| 1052 | return print_v4l2_tuner(tcp, arg, code == VIDIOC_G_TUNER); |
| 1053 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1054 | case VIDIOC_QUERYCTRL: /* RW */ |
| 1055 | return print_v4l2_queryctrl(tcp, arg); |
| 1056 | |
| 1057 | case VIDIOC_G_INPUT: /* R */ |
| 1058 | if (entering(tcp)) |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1059 | return 0; |
Elliott Hughes | 28e98bc | 2018-06-14 16:59:04 -0700 | [diff] [blame] | 1060 | ATTRIBUTE_FALLTHROUGH; |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1061 | case VIDIOC_S_INPUT: /* RW */ |
| 1062 | tprints(", "); |
| 1063 | printnum_int(tcp, arg, "%u"); |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1064 | break; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1065 | |
Dmitry V. Levin | 0a47ff7 | 2016-05-01 17:25:24 +0000 | [diff] [blame] | 1066 | case VIDIOC_CROPCAP: /* RW */ |
| 1067 | return print_v4l2_cropcap(tcp, arg); |
| 1068 | |
| 1069 | case VIDIOC_G_CROP: /* RW */ |
| 1070 | case VIDIOC_S_CROP: /* W */ |
| 1071 | return print_v4l2_crop(tcp, arg, code == VIDIOC_G_CROP); |
| 1072 | |
| 1073 | #ifdef VIDIOC_S_EXT_CTRLS |
| 1074 | case VIDIOC_S_EXT_CTRLS: /* RW */ |
| 1075 | case VIDIOC_TRY_EXT_CTRLS: /* RW */ |
| 1076 | case VIDIOC_G_EXT_CTRLS: /* RW */ |
| 1077 | return print_v4l2_ext_controls(tcp, arg, |
| 1078 | code == VIDIOC_G_EXT_CTRLS); |
| 1079 | #endif /* VIDIOC_S_EXT_CTRLS */ |
| 1080 | |
| 1081 | #ifdef VIDIOC_ENUM_FRAMESIZES |
| 1082 | case VIDIOC_ENUM_FRAMESIZES: /* RW */ |
| 1083 | return print_v4l2_frmsizeenum(tcp, arg); |
| 1084 | #endif /* VIDIOC_ENUM_FRAMESIZES */ |
| 1085 | |
| 1086 | #ifdef VIDIOC_ENUM_FRAMEINTERVALS |
| 1087 | case VIDIOC_ENUM_FRAMEINTERVALS: /* RW */ |
| 1088 | return print_v4l2_frmivalenum(tcp, arg); |
| 1089 | #endif /* VIDIOC_ENUM_FRAMEINTERVALS */ |
| 1090 | |
| 1091 | #ifdef VIDIOC_CREATE_BUFS |
| 1092 | case VIDIOC_CREATE_BUFS: /* RW */ |
| 1093 | return print_v4l2_create_buffers(tcp, arg); |
| 1094 | #endif /* VIDIOC_CREATE_BUFS */ |
| 1095 | |
| 1096 | default: |
| 1097 | return RVAL_DECODED; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1098 | } |
Elliott Hughes | 77c3ff8 | 2017-09-08 17:11:00 -0700 | [diff] [blame] | 1099 | |
| 1100 | return RVAL_IOCTL_DECODED; |
Philippe De Muyter | 0cc9614 | 2014-11-03 21:27:40 +0100 | [diff] [blame] | 1101 | } |