| From 19c43fac457d30bff2d02211eef1d609821076e5 Mon Sep 17 00:00:00 2001 |
| From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
| Date: Tue, 12 Apr 2016 19:40:46 -0300 |
| Subject: [PATCH] BACKPORT: [media] v4l: Add metadata buffer type and format |
| |
| The metadata buffer type is used to transfer metadata between userspace |
| and kernelspace through a V4L2 buffers queue. It comes with a new |
| metadata capture capability and format description. |
| |
| Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> |
| Tested-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> |
| Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> |
| Acked-by: Hans Verkuil <hans.verkuil@cisco.com> |
| [hans.verkuil@cisco.com: removed left-over 'experimental' note] |
| [hans.verkuil@cisco.com: add newline after _v4l2-meta-format label] |
| |
| Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> |
| (cherry picked from commit fb9ffa6a7f7ef39cc0f14f417b66411be5492512) |
| |
| Conflicts: |
| Documentation/media/uapi/v4l/buffer.rst |
| Documentation/media/uapi/v4l/devices.rst |
| Documentation/media/uapi/v4l/vidioc-querycap.rst |
| Documentation/media/videodev2.h.rst.exceptions |
| drivers/media/v4l2-core/v4l2-dev.c |
| drivers/media/v4l2-core/videobuf2-v4l2.c |
| include/media/v4l2-ioctl.h |
| |
| Deleted the documentation, as 4.4 is before the conversion to rst. |
| |
| BUG=b:66317170 |
| TEST=compile |
| |
| Change-Id: Id43757c0a0b1f34e10d17e5345f89ded25503d13 |
| Signed-off-by: Tomasz Figa <tfiga@chromium.org> |
| Reviewed-on: https://chromium-review.googlesource.com/676767 |
| Reviewed-by: Ricky Liang <jcliang@chromium.org> |
| --- |
| include/uapi/linux/videodev2.h | 13 +++++++++++++ |
| 1 file changed, 13 insertions(+) |
| |
| diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h |
| index d9aec13acce4..b45a23899e65 100644 |
| --- a/include/uapi/linux/videodev2.h |
| +++ b/include/uapi/linux/videodev2.h |
| @@ -146,6 +146,7 @@ enum v4l2_buf_type { |
| 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, |
| /* Deprecated, do not use */ |
| V4L2_BUF_TYPE_PRIVATE = 0x80, |
| }; |
| @@ -438,6 +439,7 @@ struct v4l2_capability { |
| #define V4L2_CAP_SDR_CAPTURE 0x00100000 /* Is a SDR capture device */ |
| #define V4L2_CAP_EXT_PIX_FORMAT 0x00200000 /* Supports the extended pixel format */ |
| #define V4L2_CAP_SDR_OUTPUT 0x00400000 /* Is a SDR output device */ |
| +#define V4L2_CAP_META_CAPTURE 0x00800000 /* Is a metadata capture device */ |
| |
| #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
| #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
| @@ -2038,6 +2040,16 @@ struct v4l2_sdr_format { |
| } __attribute__ ((packed)); |
| |
| /** |
| + * struct v4l2_meta_format - metadata format definition |
| + * @dataformat: little endian four character code (fourcc) |
| + * @buffersize: maximum size in bytes required for data |
| + */ |
| +struct v4l2_meta_format { |
| + __u32 dataformat; |
| + __u32 buffersize; |
| +} __attribute__ ((packed)); |
| + |
| +/** |
| * struct v4l2_format - stream data format |
| * @type: enum v4l2_buf_type; type of the data stream |
| * @pix: definition of an image format |
| @@ -2056,6 +2068,7 @@ struct v4l2_format { |
| struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
| struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
| struct v4l2_sdr_format sdr; /* V4L2_BUF_TYPE_SDR_CAPTURE */ |
| + struct v4l2_meta_format meta; /* V4L2_BUF_TYPE_META_CAPTURE */ |
| __u8 raw_data[200]; /* user-defined */ |
| } fmt; |
| }; |
| -- |
| 2.7.4 |
| |