1 From 37a1cdda51bc5989510ccfe28ccf149a1e5c3f76 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/725] media: videodev2: Add helper defines for printing
7 New helper defines that allow printing of a FOURCC using
8 printf(V4L2_FOURCC_CONV, V4L2_FOURCC_CONV_ARGS(fourcc));
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 include/uapi/linux/videodev2.h | 5 +++++
13 1 file changed, 5 insertions(+)
15 --- a/include/uapi/linux/videodev2.h
16 +++ b/include/uapi/linux/videodev2.h
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))
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" : ""