aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <guennadi.liakhovetski@intel.com>2017-12-06 10:15:40 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-01-04 06:41:47 -0500
commit088ead25524583e2200aa99111bea2f66a86545a (patch)
tree39118e9e19ec50e11c16583cb502b2097a6a96dc /include/uapi/linux
parent3bc85817d7982ed53fbc9b150b0205beff68ca5c (diff)
media: uvcvideo: Add a metadata device node
Some UVC video cameras contain metadata in their payload headers. This patch extracts that data, adding more clock synchronisation information, on both bulk and isochronous endpoints and makes it available to the user space on a separate video node, using the V4L2_CAP_META_CAPTURE capability and the V4L2_BUF_TYPE_META_CAPTURE buffer queue type. By default, only the V4L2_META_FMT_UVC pixel format is available from those nodes. However, cameras can be added to the device ID table to additionally specify their own metadata format, in which case that format will also become available from the metadata node. [Use put_unaligned instead of __put_unaligned_cpu64] [Use put_unaligned for the sof field as well] Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/uvcvideo.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/uapi/linux/uvcvideo.h b/include/uapi/linux/uvcvideo.h
index e80b4655d8cd..020714d2c5bd 100644
--- a/include/uapi/linux/uvcvideo.h
+++ b/include/uapi/linux/uvcvideo.h
@@ -68,4 +68,30 @@ struct uvc_xu_control_query {
68#define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping) 68#define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping)
69#define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query) 69#define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query)
70 70
71/*
72 * Metadata node
73 */
74
75/**
76 * struct uvc_meta_buf - metadata buffer building block
77 * @ns - system timestamp of the payload in nanoseconds
78 * @sof - USB Frame Number
79 * @length - length of the payload header
80 * @flags - payload header flags
81 * @buf - optional device-specific header data
82 *
83 * UVC metadata nodes fill buffers with possibly multiple instances of this
84 * struct. The first two fields are added by the driver, they can be used for
85 * clock synchronisation. The rest is an exact copy of a UVC payload header.
86 * Only complete objects with complete buffers are included. Therefore it's
87 * always sizeof(meta->ts) + sizeof(meta->sof) + meta->length bytes large.
88 */
89struct uvc_meta_buf {
90 __u64 ns;
91 __u16 sof;
92 __u8 length;
93 __u8 flags;
94 __u8 buf[];
95} __packed;
96
71#endif 97#endif