00f394387b968f4ddab7335c57c3f404860dcd02
[openwrt/staging/jow.git] /
1 From f776604fdd061358ccdc420ba8babcc6fbe76baa 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/703] 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 */