History

media: v4l: Add a UVC Metadata format

Add a pixel format, used by the UVC driver to stream metadata.

Guennadi Liakhovetski committed 9 years ago

Commit 563a01e1 parent 94c53e24 files · +54 −0Browse files

Unified · Split

4 files
  1. Documentation/media/uapi/v4l/meta-formats.rst +1 −0
  2. Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst +51 −0
  3. drivers/media/v4l2-core/v4l2-ioctl.c +1 −0
  4. include/uapi/linux/videodev2.h +1 −0
Documentation/media/uapi/v4l/meta-formats.rst+1−0
@@ -12,5 +12,6 @@ These formats are used for the :ref:`metadata` interface only. · 11 unmodified lines
12.. toctree::12.. toctree::
13 :maxdepth: 113 :maxdepth: 1
14 14
15 pixfmt-meta-uvc
15 pixfmt-meta-vsp1-hgo16 pixfmt-meta-vsp1-hgo
16 pixfmt-meta-vsp1-hgt17 pixfmt-meta-vsp1-hgt
Documentation/media/uapi/v4l/pixfmt-meta-uvc.rst+51−0
@@ -0,0 +1,51 @@
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _v4l2-meta-fmt-uvc:
4
5*******************************
6V4L2_META_FMT_UVC ('UVCH')
7*******************************
8
9UVC Payload Header Data
10
11
12Description
13===========
14
15This format describes standard UVC metadata, extracted from UVC packet headers
16and provided by the UVC driver through metadata video nodes. That data includes
17exact copies of the standard part of UVC Payload Header contents and auxiliary
18timing information, required for precise interpretation of timestamps, contained
19in those headers. See section "2.4.3.3 Video and Still Image Payload Headers" of
20the "UVC 1.5 Class specification" for details.
21
22Each UVC payload header can be between 2 and 12 bytes large. Buffers can
23contain multiple headers, if multiple such headers have been transmitted by the
24camera for the respective frame. However, the driver may drop headers when the
25buffer is full, when they contain no useful information (e.g. those without the
26SCR field or with that field identical to the previous header), or generally to
27perform rate limiting when the device sends a large number of headers.
28
29Each individual block contains the following fields:
30
31.. flat-table:: UVC Metadata Block
32 :widths: 1 4
33 :header-rows: 1
34 :stub-columns: 0
35
36 * - Field
37 - Description
38 * - __u64 ts;
39 - system timestamp in host byte order, measured by the driver upon
40 reception of the payload
41 * - __u16 sof;
42 - USB Frame Number in host byte order, also obtained by the driver as
43 close as possible to the above timestamp to enable correlation between
44 them
45 * - :cspan:`1` *The rest is an exact copy of the UVC payload header:*
46 * - __u8 length;
47 - length of the rest of the block, including this field
48 * - __u8 flags;
49 - Flags, indicating presence of other standard UVC fields
50 * - __u8 buf[];
51 - The rest of the header, possibly including UVC PTS and SCR fields
drivers/media/v4l2-core/v4l2-ioctl.c+1−0
@@ -1250,6 +1250,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) · 1249 unmodified lines
1250 case V4L2_TCH_FMT_TU08: descr = "8-bit unsigned touch data"; break;1250 case V4L2_TCH_FMT_TU08: descr = "8-bit unsigned touch data"; break;
1251 case V4L2_META_FMT_VSP1_HGO: descr = "R-Car VSP1 1-D Histogram"; break;1251 case V4L2_META_FMT_VSP1_HGO: descr = "R-Car VSP1 1-D Histogram"; break;
1252 case V4L2_META_FMT_VSP1_HGT: descr = "R-Car VSP1 2-D Histogram"; break;1252 case V4L2_META_FMT_VSP1_HGT: descr = "R-Car VSP1 2-D Histogram"; break;
1253 case V4L2_META_FMT_UVC: descr = "UVC payload header metadata"; break;
1253 1254
1254 default:1255 default:
1255 /* Compressed formats */1256 /* Compressed formats */
include/uapi/linux/videodev2.h+1−0
@@ -694,6 +694,7 @@ struct v4l2_pix_format { · 693 unmodified lines
694/* Meta-data formats */694/* Meta-data formats */
695#define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */695#define V4L2_META_FMT_VSP1_HGO v4l2_fourcc('V', 'S', 'P', 'H') /* R-Car VSP1 1-D Histogram */
696#define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */696#define V4L2_META_FMT_VSP1_HGT v4l2_fourcc('V', 'S', 'P', 'T') /* R-Car VSP1 2-D Histogram */
697#define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
697 698
698/* priv field value to indicates that subsequent fields are valid. */699/* priv field value to indicates that subsequent fields are valid. */
699#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe700#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe