From 779b2c5368829049e02f9d23ba38687f0a110b65 Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Thu, 3 Jan 2019 15:40:36 +0100 Subject: [PATCH] xlat: update V4L2_BUF_TYPE_* constants * 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 | 3 +++ v4l2.c | 10 +++------- xlat/v4l2_buf_types.in | 30 ++++++++++++++++-------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index fca95c7c..5c47268e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/v4l2.c b/v4l2.c index cc3d5fd8..58cab3f9 100644 --- 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="); diff --git a/xlat/v4l2_buf_types.in b/xlat/v4l2_buf_types.in index 29049a31..1492d5e8 100644 --- a/xlat/v4l2_buf_types.in +++ b/xlat/v4l2_buf_types.in @@ -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 */ -- 2.40.0