From f650a4c7e2bf5d1636d52eab09b086ecab4d1e9f Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Thu, 3 Jan 2019 15:39:26 +0100
Subject: [PATCH 71/76] xlat: provide fallback definitions for V4L2_CAP_*
constants
* xlat/v4l2_device_capabilities_flags.in: Sort, add fallback definitions
for constants.
* configure.ac (AC_CHECK_MEMBERS): Check for struct
v4l2_capability.device_caps.
* v4l2.c (print_v4l2_capability): Change V4L2_CAP_DEVICE_CAPS guard
to HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS.
---
configure.ac | 1 +
v4l2.c | 2 +-
xlat/v4l2_device_capabilities_flags.in | 58 +++++++++++++++++-----------------
3 files changed, 31 insertions(+), 30 deletions(-)
Index: strace-5.1/configure.ac
===================================================================
--- strace-5.1.orig/configure.ac 2020-01-29 12:37:35.136765878 +0100
+++ strace-5.1/configure.ac 2020-01-29 12:39:33.198682164 +0100
@@ -778,6 +778,7 @@
#include <linux/videodev2.h>])
AC_CHECK_MEMBERS(m4_normalize([
+ struct v4l2_capability.device_caps,
struct v4l2_window.global_alpha,
struct v4l2_sdr_format.buffersize
]),,, [#include <sys/time.h>
Index: strace-5.1/v4l2.c
===================================================================
--- strace-5.1.orig/v4l2.c 2020-01-27 19:35:30.949507018 +0100
+++ strace-5.1/v4l2.c 2020-01-29 12:39:33.199682155 +0100
@@ -133,7 +133,7 @@
caps.version & 0xFF);
printflags(v4l2_device_capabilities_flags, caps.capabilities,
"V4L2_CAP_???");
-#ifdef V4L2_CAP_DEVICE_CAPS
+#ifdef HAVE_STRUCT_V4L2_CAPABILITY_DEVICE_CAPS
tprints(", device_caps=");
printflags(v4l2_device_capabilities_flags, caps.device_caps,
"V4L2_CAP_???");
Index: strace-5.1/xlat/v4l2_device_capabilities_flags.in
===================================================================
--- strace-5.1.orig/xlat/v4l2_device_capabilities_flags.in 2019-01-05 22:14:42.000000000 +0100
+++ strace-5.1/xlat/v4l2_device_capabilities_flags.in 2020-01-29 12:39:33.203682118 +0100
@@ -1,29 +1,29 @@
-V4L2_CAP_VIDEO_CAPTURE
-V4L2_CAP_VIDEO_OUTPUT
-V4L2_CAP_VIDEO_OVERLAY
-V4L2_CAP_VBI_CAPTURE
-V4L2_CAP_VBI_OUTPUT
-V4L2_CAP_SLICED_VBI_CAPTURE
-V4L2_CAP_SLICED_VBI_OUTPUT
-V4L2_CAP_RDS_CAPTURE
-V4L2_CAP_VIDEO_OUTPUT_OVERLAY
-V4L2_CAP_HW_FREQ_SEEK
-V4L2_CAP_RDS_OUTPUT
-V4L2_CAP_VIDEO_CAPTURE_MPLANE
-V4L2_CAP_VIDEO_OUTPUT_MPLANE
-V4L2_CAP_VIDEO_M2M
-V4L2_CAP_VIDEO_M2M_MPLANE
-V4L2_CAP_TUNER
-V4L2_CAP_AUDIO
-V4L2_CAP_RADIO
-V4L2_CAP_MODULATOR
-V4L2_CAP_READWRITE
-V4L2_CAP_ASYNCIO
-V4L2_CAP_STREAMING
-V4L2_CAP_META_OUTPUT
-V4L2_CAP_TOUCH
-V4L2_CAP_DEVICE_CAPS
-V4L2_CAP_SDR_CAPTURE
-V4L2_CAP_EXT_PIX_FORMAT
-V4L2_CAP_SDR_OUTPUT
-V4L2_CAP_META_CAPTURE
+V4L2_CAP_VIDEO_CAPTURE 0x00000001
+V4L2_CAP_VIDEO_OUTPUT 0x00000002
+V4L2_CAP_VIDEO_OVERLAY 0x00000004
+V4L2_CAP_VBI_CAPTURE 0x00000010
+V4L2_CAP_VBI_OUTPUT 0x00000020
+V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040
+V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080
+V4L2_CAP_RDS_CAPTURE 0x00000100
+V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200
+V4L2_CAP_HW_FREQ_SEEK 0x00000400
+V4L2_CAP_RDS_OUTPUT 0x00000800
+V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
+V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
+V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
+V4L2_CAP_VIDEO_M2M 0x00008000
+V4L2_CAP_TUNER 0x00010000
+V4L2_CAP_AUDIO 0x00020000
+V4L2_CAP_RADIO 0x00040000
+V4L2_CAP_MODULATOR 0x00080000
+V4L2_CAP_SDR_CAPTURE 0x00100000
+V4L2_CAP_EXT_PIX_FORMAT 0x00200000
+V4L2_CAP_SDR_OUTPUT 0x00400000
+V4L2_CAP_META_CAPTURE 0x00800000
+V4L2_CAP_READWRITE 0x01000000
+V4L2_CAP_ASYNCIO 0x02000000
+V4L2_CAP_STREAMING 0x04000000
+V4L2_CAP_META_OUTPUT 0x08000000
+V4L2_CAP_TOUCH 0x10000000
+V4L2_CAP_DEVICE_CAPS 0x80000000
Index: strace-5.1/xlat/v4l2_device_capabilities_flags.h
===================================================================
--- strace-5.1.orig/xlat/v4l2_device_capabilities_flags.h 2019-05-22 15:08:31.000000000 +0200
+++ strace-5.1/xlat/v4l2_device_capabilities_flags.h 2020-01-29 12:39:50.579522622 +0100
@@ -3,106 +3,251 @@
#include "gcc_compat.h"
#include "static_assert.h"
-
-#ifndef XLAT_MACROS_ONLY
-
-# ifdef IN_MPERS
-
-extern const struct xlat v4l2_device_capabilities_flags[];
-
-# else
-
-# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
-static
-# endif
-const struct xlat v4l2_device_capabilities_flags[] = {
#if defined(V4L2_CAP_VIDEO_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE) && HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE)
- XLAT(V4L2_CAP_VIDEO_CAPTURE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_CAPTURE) == (0x00000001), "V4L2_CAP_VIDEO_CAPTURE != 0x00000001");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_CAPTURE 0x00000001
#endif
#if defined(V4L2_CAP_VIDEO_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT) && HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT)
- XLAT(V4L2_CAP_VIDEO_OUTPUT),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_OUTPUT) == (0x00000002), "V4L2_CAP_VIDEO_OUTPUT != 0x00000002");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_OUTPUT 0x00000002
#endif
#if defined(V4L2_CAP_VIDEO_OVERLAY) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OVERLAY) && HAVE_DECL_V4L2_CAP_VIDEO_OVERLAY)
- XLAT(V4L2_CAP_VIDEO_OVERLAY),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_OVERLAY) == (0x00000004), "V4L2_CAP_VIDEO_OVERLAY != 0x00000004");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_OVERLAY 0x00000004
#endif
#if defined(V4L2_CAP_VBI_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_VBI_CAPTURE) && HAVE_DECL_V4L2_CAP_VBI_CAPTURE)
- XLAT(V4L2_CAP_VBI_CAPTURE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VBI_CAPTURE) == (0x00000010), "V4L2_CAP_VBI_CAPTURE != 0x00000010");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VBI_CAPTURE 0x00000010
#endif
#if defined(V4L2_CAP_VBI_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_VBI_OUTPUT) && HAVE_DECL_V4L2_CAP_VBI_OUTPUT)
- XLAT(V4L2_CAP_VBI_OUTPUT),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VBI_OUTPUT) == (0x00000020), "V4L2_CAP_VBI_OUTPUT != 0x00000020");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VBI_OUTPUT 0x00000020
#endif
#if defined(V4L2_CAP_SLICED_VBI_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_SLICED_VBI_CAPTURE) && HAVE_DECL_V4L2_CAP_SLICED_VBI_CAPTURE)
- XLAT(V4L2_CAP_SLICED_VBI_CAPTURE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_SLICED_VBI_CAPTURE) == (0x00000040), "V4L2_CAP_SLICED_VBI_CAPTURE != 0x00000040");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040
#endif
#if defined(V4L2_CAP_SLICED_VBI_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_SLICED_VBI_OUTPUT) && HAVE_DECL_V4L2_CAP_SLICED_VBI_OUTPUT)
- XLAT(V4L2_CAP_SLICED_VBI_OUTPUT),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_SLICED_VBI_OUTPUT) == (0x00000080), "V4L2_CAP_SLICED_VBI_OUTPUT != 0x00000080");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080
#endif
#if defined(V4L2_CAP_RDS_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_RDS_CAPTURE) && HAVE_DECL_V4L2_CAP_RDS_CAPTURE)
- XLAT(V4L2_CAP_RDS_CAPTURE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_RDS_CAPTURE) == (0x00000100), "V4L2_CAP_RDS_CAPTURE != 0x00000100");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_RDS_CAPTURE 0x00000100
#endif
#if defined(V4L2_CAP_VIDEO_OUTPUT_OVERLAY) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_OVERLAY) && HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_OVERLAY)
- XLAT(V4L2_CAP_VIDEO_OUTPUT_OVERLAY),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_OUTPUT_OVERLAY) == (0x00000200), "V4L2_CAP_VIDEO_OUTPUT_OVERLAY != 0x00000200");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200
#endif
#if defined(V4L2_CAP_HW_FREQ_SEEK) || (defined(HAVE_DECL_V4L2_CAP_HW_FREQ_SEEK) && HAVE_DECL_V4L2_CAP_HW_FREQ_SEEK)
- XLAT(V4L2_CAP_HW_FREQ_SEEK),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_HW_FREQ_SEEK) == (0x00000400), "V4L2_CAP_HW_FREQ_SEEK != 0x00000400");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_HW_FREQ_SEEK 0x00000400
#endif
#if defined(V4L2_CAP_RDS_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_RDS_OUTPUT) && HAVE_DECL_V4L2_CAP_RDS_OUTPUT)
- XLAT(V4L2_CAP_RDS_OUTPUT),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_RDS_OUTPUT) == (0x00000800), "V4L2_CAP_RDS_OUTPUT != 0x00000800");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_RDS_OUTPUT 0x00000800
#endif
#if defined(V4L2_CAP_VIDEO_CAPTURE_MPLANE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE_MPLANE) && HAVE_DECL_V4L2_CAP_VIDEO_CAPTURE_MPLANE)
- XLAT(V4L2_CAP_VIDEO_CAPTURE_MPLANE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_CAPTURE_MPLANE) == (0x00001000), "V4L2_CAP_VIDEO_CAPTURE_MPLANE != 0x00001000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
#endif
#if defined(V4L2_CAP_VIDEO_OUTPUT_MPLANE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_MPLANE) && HAVE_DECL_V4L2_CAP_VIDEO_OUTPUT_MPLANE)
- XLAT(V4L2_CAP_VIDEO_OUTPUT_MPLANE),
-#endif
-#if defined(V4L2_CAP_VIDEO_M2M) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_M2M) && HAVE_DECL_V4L2_CAP_VIDEO_M2M)
- XLAT(V4L2_CAP_VIDEO_M2M),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_OUTPUT_MPLANE) == (0x00002000), "V4L2_CAP_VIDEO_OUTPUT_MPLANE != 0x00002000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
#endif
#if defined(V4L2_CAP_VIDEO_M2M_MPLANE) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_M2M_MPLANE) && HAVE_DECL_V4L2_CAP_VIDEO_M2M_MPLANE)
- XLAT(V4L2_CAP_VIDEO_M2M_MPLANE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_M2M_MPLANE) == (0x00004000), "V4L2_CAP_VIDEO_M2M_MPLANE != 0x00004000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_M2M_MPLANE 0x00004000
+#endif
+#if defined(V4L2_CAP_VIDEO_M2M) || (defined(HAVE_DECL_V4L2_CAP_VIDEO_M2M) && HAVE_DECL_V4L2_CAP_VIDEO_M2M)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_VIDEO_M2M) == (0x00008000), "V4L2_CAP_VIDEO_M2M != 0x00008000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_VIDEO_M2M 0x00008000
#endif
#if defined(V4L2_CAP_TUNER) || (defined(HAVE_DECL_V4L2_CAP_TUNER) && HAVE_DECL_V4L2_CAP_TUNER)
- XLAT(V4L2_CAP_TUNER),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_TUNER) == (0x00010000), "V4L2_CAP_TUNER != 0x00010000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_TUNER 0x00010000
#endif
#if defined(V4L2_CAP_AUDIO) || (defined(HAVE_DECL_V4L2_CAP_AUDIO) && HAVE_DECL_V4L2_CAP_AUDIO)
- XLAT(V4L2_CAP_AUDIO),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_AUDIO) == (0x00020000), "V4L2_CAP_AUDIO != 0x00020000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_AUDIO 0x00020000
#endif
#if defined(V4L2_CAP_RADIO) || (defined(HAVE_DECL_V4L2_CAP_RADIO) && HAVE_DECL_V4L2_CAP_RADIO)
- XLAT(V4L2_CAP_RADIO),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_RADIO) == (0x00040000), "V4L2_CAP_RADIO != 0x00040000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_RADIO 0x00040000
#endif
#if defined(V4L2_CAP_MODULATOR) || (defined(HAVE_DECL_V4L2_CAP_MODULATOR) && HAVE_DECL_V4L2_CAP_MODULATOR)
- XLAT(V4L2_CAP_MODULATOR),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_MODULATOR) == (0x00080000), "V4L2_CAP_MODULATOR != 0x00080000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_MODULATOR 0x00080000
+#endif
+#if defined(V4L2_CAP_SDR_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_SDR_CAPTURE) && HAVE_DECL_V4L2_CAP_SDR_CAPTURE)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_SDR_CAPTURE) == (0x00100000), "V4L2_CAP_SDR_CAPTURE != 0x00100000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_SDR_CAPTURE 0x00100000
+#endif
+#if defined(V4L2_CAP_EXT_PIX_FORMAT) || (defined(HAVE_DECL_V4L2_CAP_EXT_PIX_FORMAT) && HAVE_DECL_V4L2_CAP_EXT_PIX_FORMAT)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_EXT_PIX_FORMAT) == (0x00200000), "V4L2_CAP_EXT_PIX_FORMAT != 0x00200000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_EXT_PIX_FORMAT 0x00200000
+#endif
+#if defined(V4L2_CAP_SDR_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_SDR_OUTPUT) && HAVE_DECL_V4L2_CAP_SDR_OUTPUT)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_SDR_OUTPUT) == (0x00400000), "V4L2_CAP_SDR_OUTPUT != 0x00400000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_SDR_OUTPUT 0x00400000
+#endif
+#if defined(V4L2_CAP_META_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_META_CAPTURE) && HAVE_DECL_V4L2_CAP_META_CAPTURE)
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_META_CAPTURE) == (0x00800000), "V4L2_CAP_META_CAPTURE != 0x00800000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_META_CAPTURE 0x00800000
#endif
#if defined(V4L2_CAP_READWRITE) || (defined(HAVE_DECL_V4L2_CAP_READWRITE) && HAVE_DECL_V4L2_CAP_READWRITE)
- XLAT(V4L2_CAP_READWRITE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_READWRITE) == (0x01000000), "V4L2_CAP_READWRITE != 0x01000000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_READWRITE 0x01000000
#endif
#if defined(V4L2_CAP_ASYNCIO) || (defined(HAVE_DECL_V4L2_CAP_ASYNCIO) && HAVE_DECL_V4L2_CAP_ASYNCIO)
- XLAT(V4L2_CAP_ASYNCIO),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_ASYNCIO) == (0x02000000), "V4L2_CAP_ASYNCIO != 0x02000000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_ASYNCIO 0x02000000
#endif
#if defined(V4L2_CAP_STREAMING) || (defined(HAVE_DECL_V4L2_CAP_STREAMING) && HAVE_DECL_V4L2_CAP_STREAMING)
- XLAT(V4L2_CAP_STREAMING),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_STREAMING) == (0x04000000), "V4L2_CAP_STREAMING != 0x04000000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_STREAMING 0x04000000
#endif
#if defined(V4L2_CAP_META_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_META_OUTPUT) && HAVE_DECL_V4L2_CAP_META_OUTPUT)
- XLAT(V4L2_CAP_META_OUTPUT),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_META_OUTPUT) == (0x08000000), "V4L2_CAP_META_OUTPUT != 0x08000000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_META_OUTPUT 0x08000000
#endif
#if defined(V4L2_CAP_TOUCH) || (defined(HAVE_DECL_V4L2_CAP_TOUCH) && HAVE_DECL_V4L2_CAP_TOUCH)
- XLAT(V4L2_CAP_TOUCH),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_TOUCH) == (0x10000000), "V4L2_CAP_TOUCH != 0x10000000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_TOUCH 0x10000000
#endif
#if defined(V4L2_CAP_DEVICE_CAPS) || (defined(HAVE_DECL_V4L2_CAP_DEVICE_CAPS) && HAVE_DECL_V4L2_CAP_DEVICE_CAPS)
- XLAT(V4L2_CAP_DEVICE_CAPS),
-#endif
-#if defined(V4L2_CAP_SDR_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_SDR_CAPTURE) && HAVE_DECL_V4L2_CAP_SDR_CAPTURE)
- XLAT(V4L2_CAP_SDR_CAPTURE),
-#endif
-#if defined(V4L2_CAP_EXT_PIX_FORMAT) || (defined(HAVE_DECL_V4L2_CAP_EXT_PIX_FORMAT) && HAVE_DECL_V4L2_CAP_EXT_PIX_FORMAT)
- XLAT(V4L2_CAP_EXT_PIX_FORMAT),
-#endif
-#if defined(V4L2_CAP_SDR_OUTPUT) || (defined(HAVE_DECL_V4L2_CAP_SDR_OUTPUT) && HAVE_DECL_V4L2_CAP_SDR_OUTPUT)
- XLAT(V4L2_CAP_SDR_OUTPUT),
-#endif
-#if defined(V4L2_CAP_META_CAPTURE) || (defined(HAVE_DECL_V4L2_CAP_META_CAPTURE) && HAVE_DECL_V4L2_CAP_META_CAPTURE)
- XLAT(V4L2_CAP_META_CAPTURE),
+DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
+static_assert((V4L2_CAP_DEVICE_CAPS) == (0x80000000), "V4L2_CAP_DEVICE_CAPS != 0x80000000");
+DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
+#else
+# define V4L2_CAP_DEVICE_CAPS 0x80000000
#endif
+
+#ifndef XLAT_MACROS_ONLY
+
+# ifdef IN_MPERS
+
+extern const struct xlat v4l2_device_capabilities_flags[];
+
+# else
+
+# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS)
+static
+# endif
+const struct xlat v4l2_device_capabilities_flags[] = {
+ XLAT(V4L2_CAP_VIDEO_CAPTURE),
+ XLAT(V4L2_CAP_VIDEO_OUTPUT),
+ XLAT(V4L2_CAP_VIDEO_OVERLAY),
+ XLAT(V4L2_CAP_VBI_CAPTURE),
+ XLAT(V4L2_CAP_VBI_OUTPUT),
+ XLAT(V4L2_CAP_SLICED_VBI_CAPTURE),
+ XLAT(V4L2_CAP_SLICED_VBI_OUTPUT),
+ XLAT(V4L2_CAP_RDS_CAPTURE),
+ XLAT(V4L2_CAP_VIDEO_OUTPUT_OVERLAY),
+ XLAT(V4L2_CAP_HW_FREQ_SEEK),
+ XLAT(V4L2_CAP_RDS_OUTPUT),
+ XLAT(V4L2_CAP_VIDEO_CAPTURE_MPLANE),
+ XLAT(V4L2_CAP_VIDEO_OUTPUT_MPLANE),
+ XLAT(V4L2_CAP_VIDEO_M2M_MPLANE),
+ XLAT(V4L2_CAP_VIDEO_M2M),
+ XLAT(V4L2_CAP_TUNER),
+ XLAT(V4L2_CAP_AUDIO),
+ XLAT(V4L2_CAP_RADIO),
+ XLAT(V4L2_CAP_MODULATOR),
+ XLAT(V4L2_CAP_SDR_CAPTURE),
+ XLAT(V4L2_CAP_EXT_PIX_FORMAT),
+ XLAT(V4L2_CAP_SDR_OUTPUT),
+ XLAT(V4L2_CAP_META_CAPTURE),
+ XLAT(V4L2_CAP_READWRITE),
+ XLAT(V4L2_CAP_ASYNCIO),
+ XLAT(V4L2_CAP_STREAMING),
+ XLAT(V4L2_CAP_META_OUTPUT),
+ XLAT(V4L2_CAP_TOUCH),
+ XLAT(V4L2_CAP_DEVICE_CAPS),
XLAT_END
};