8fd25d4afa2b98f16cca19c2f141b01ba0b39960
[openwrt/staging/linusw.git] /
1 From 460f1e1402d28105f9f3d6e8b8739dcd89bff18e 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] 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) | (1U << 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 */