d57a5d85a2206dfd4d2c7a0392858578c2bfe185
[openwrt/staging/jow.git] /
1 From 52e50fa34c27b65ebbdab8525ae4a23af880be44 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 31 Oct 2018 14:58:08 +0000
4 Subject: [PATCH 196/782] media: videodev2: Add helper defines for printing
5 FOURCCs
6
7 New helper defines that allow printing of a FOURCC using
8 printf(V4L2_FOURCC_CONV, V4L2_FOURCC_CONV_ARGS(fourcc));
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
11 ---
12 include/uapi/linux/videodev2.h | 5 +++++
13 1 file changed, 5 insertions(+)
14
15 --- a/include/uapi/linux/videodev2.h
16 +++ b/include/uapi/linux/videodev2.h
17 @@ -82,6 +82,11 @@
18 ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
19 #define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31))
20
21 +#define V4L2_FOURCC_CONV "%c%c%c%c%s"
22 +#define V4L2_FOURCC_CONV_ARGS(fourcc) \
23 + (fourcc) & 0x7f, ((fourcc) >> 8) & 0x7f, ((fourcc) >> 16) & 0x7f, \
24 + ((fourcc) >> 24) & 0x7f, (fourcc) & BIT(31) ? "-BE" : ""
25 +
26 /*
27 * E N U M S
28 */