Skip to content

Commit b2bee2f

Browse files
6by9popcornmix
authored andcommitted
media: videodev2: Add helper defines for printing FOURCCs
New helper defines that allow printing of a FOURCC using printf(V4L2_FOURCC_CONV, V4L2_FOURCC_CONV_ARGS(fourcc)); Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
1 parent f10eb28 commit b2bee2f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/uapi/linux/videodev2.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
8383
#define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1U << 31))
8484

85+
#define V4L2_FOURCC_CONV "%c%c%c%c%s"
86+
#define V4L2_FOURCC_CONV_ARGS(fourcc) \
87+
(fourcc) & 0x7f, ((fourcc) >> 8) & 0x7f, ((fourcc) >> 16) & 0x7f, \
88+
((fourcc) >> 24) & 0x7f, (fourcc) & BIT(31) ? "-BE" : ""
89+
8590
/*
8691
* E N U M S
8792
*/

0 commit comments

Comments
 (0)