]> granicus.if.org Git - strace/commitdiff
xlat: update V4L2_BUF_TYPE_* constants
authorEugene Syromyatnikov <evgsyr@gmail.com>
Thu, 3 Jan 2019 14:40:36 +0000 (15:40 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 22 Oct 2019 17:44:08 +0000 (17:44 +0000)
* xlat/v4l2_buf_types.in: Add fallback definitions for constants,
mention V4L2_BUF_TYPE_PRIVATE in comment, add #value_indexed.
* configure.ac (AC_CHECK_MEMBERS): Add checks for
struct v4l2_format.fmt.pix_mp, struct v4l2_format.fmt.sdr, and
struct v4l2_format.fmt.sliced.
* v4l2.c (print_v4l2_format_fmt): Use the relevant HAVE_STRUCT_* macros
instead of HAVE_DECL_V4L2_BUF_TYPE_*.

configure.ac
v4l2.c
xlat/v4l2_buf_types.in

index fca95c7c3463a9b46d28a531b892179f0a8d812a..5c47268e16bd6c753d802df8c2e9856131465d58 100644 (file)
@@ -804,6 +804,9 @@ AC_CHECK_DECLS(m4_normalize([
 
 AC_CHECK_MEMBERS(m4_normalize([
        struct v4l2_capability.device_caps,
+       struct v4l2_format.fmt.pix_mp,
+       struct v4l2_format.fmt.sdr,
+       struct v4l2_format.fmt.sliced,
        struct v4l2_window.global_alpha,
        struct v4l2_sdr_format.buffersize
 ]),,, [#include <sys/time.h>
diff --git a/v4l2.c b/v4l2.c
index cc3d5fd887b975febf21aef9e8cc170fc033e313..58cab3f9169ff680f7e7fe3b1a9c79eb76a4b01b 100644 (file)
--- a/v4l2.c
+++ b/v4l2.c
@@ -204,7 +204,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
                          "V4L2_COLORSPACE_???");
                tprints("}");
                break;
-#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
+#if HAVE_STRUCT_V4L2_FORMAT_FMT_PIX_MP
        case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
        case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: {
                unsigned int i, max;
@@ -235,9 +235,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
        }
 #endif
        /* OUTPUT_OVERLAY since Linux v2.6.22-rc1~1118^2~179 */
-#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
        case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
-#endif
        case V4L2_BUF_TYPE_VIDEO_OVERLAY: {
                struct_v4l2_clip clip;
                tprints(prefix);
@@ -272,7 +270,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
                tprints("}");
                break;
        /* both since Linux v2.6.14-rc2~64 */
-#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
+#if HAVE_STRUCT_V4L2_FORMAT_FMT_SLICED
        case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
        case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: {
                unsigned int i, j;
@@ -301,12 +299,10 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
                break;
        }
 #endif
+#if HAVE_STRUCT_V4L2_FORMAT_FMT_SDR
        /* since Linux v4.4-rc1~118^2~14 */
-#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT
        case V4L2_BUF_TYPE_SDR_OUTPUT:
-#endif
        /* since Linux v3.15-rc1~85^2~213 */
-#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE
        case V4L2_BUF_TYPE_SDR_CAPTURE:
                tprints(prefix);
                tprints("fmt.sdr={pixelformat=");
index 29049a31faab479075bf65f96821af42db76ff5f..1492d5e8e63982e4b28103bbb0a3de4c4dd7de42 100644 (file)
@@ -1,14 +1,16 @@
-V4L2_BUF_TYPE_VIDEO_CAPTURE
-V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
-V4L2_BUF_TYPE_VIDEO_OUTPUT
-V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE
-V4L2_BUF_TYPE_VIDEO_OVERLAY
-V4L2_BUF_TYPE_VBI_CAPTURE
-V4L2_BUF_TYPE_VBI_OUTPUT
-V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
-V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
-V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
-V4L2_BUF_TYPE_SDR_CAPTURE
-V4L2_BUF_TYPE_SDR_OUTPUT
-V4L2_BUF_TYPE_META_CAPTURE
-V4L2_BUF_TYPE_META_OUTPUT
+#value_indexed
+V4L2_BUF_TYPE_VIDEO_CAPTURE            1
+V4L2_BUF_TYPE_VIDEO_OUTPUT             2
+V4L2_BUF_TYPE_VIDEO_OVERLAY            3
+V4L2_BUF_TYPE_VBI_CAPTURE              4
+V4L2_BUF_TYPE_VBI_OUTPUT               5
+V4L2_BUF_TYPE_SLICED_VBI_CAPTURE       6
+V4L2_BUF_TYPE_SLICED_VBI_OUTPUT                7
+V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY     8
+V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE     9
+V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE      10
+V4L2_BUF_TYPE_SDR_CAPTURE              11
+V4L2_BUF_TYPE_SDR_OUTPUT               12
+V4L2_BUF_TYPE_META_CAPTURE             13
+V4L2_BUF_TYPE_META_OUTPUT              14
+/* V4L2_BUF_TYPE_PRIVATE               0x80 */