Skip to content

Commit b50fbc8

Browse files
naushirpopcornmix
authored andcommitted
media: uapi: v4l2-core: Add sensor ancillary data V4L2 foucc type.
Add V4L2_META_FMT_SENSOR_DATA format 4CC. This new format will be used by the BCM2835 Unicam device to return out camera sensor embedded data. Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
1 parent 7e09a3b commit b50fbc8

4 files changed

Lines changed: 35 additions & 0 deletions

File tree

‎Documentation/userspace-api/media/v4l/meta-formats.rst‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ These formats are used for the :ref:`metadata` interface only.
2121

2222
pixfmt-meta-d4xx
2323
pixfmt-meta-intel-ipu3
24+
pixfmt-meta-sensor-data
2425
pixfmt-meta-uvc
2526
pixfmt-meta-vsp1-hgo
2627
pixfmt-meta-vsp1-hgt
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.. Permission is granted to copy, distribute and/or modify this
2+
.. document under the terms of the GNU Free Documentation License,
3+
.. Version 1.1 or any later version published by the Free Software
4+
.. Foundation, with no Invariant Sections, no Front-Cover Texts
5+
.. and no Back-Cover Texts. A copy of the license is included at
6+
.. Documentation/media/uapi/fdl-appendix.rst.
7+
..
8+
.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9+
10+
.. _v4l2-meta-fmt-sensor-data:
11+
12+
***********************************
13+
V4L2_META_FMT_SENSOR_DATA ('SENS')
14+
***********************************
15+
16+
Sensor Ancillary Metadata
17+
18+
Description
19+
===========
20+
21+
This format describes ancillary data generated by a camera sensor and
22+
transmitted over a stream on the camera bus. Sensor vendors generally have their
23+
own custom format for this ancillary data. Some vendors follow a generic
24+
CSI-2/SMIA embedded data format as described in the `CSI-2 specification.
25+
<https://mipi.org/specifications/csi-2>`_
26+
27+
The size of the embedded buffer is defined as a single line with a pixel width
28+
width specified in bytes. This is obtained by a call to the
29+
:c:type:`VIDIOC_SUBDEV_G_FMT` ioctl on the sensor subdevice where the ``pad``
30+
field in :c:type:`v4l2_subdev_format` is set to 1. Note that this size is fixed
31+
and cannot be modified with a call to :c:type:`VIDIOC_SUBDEV_S_FMT`.
32+

‎drivers/media/v4l2-core/v4l2-ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
14041404
case V4L2_META_FMT_UVC: descr = "UVC Payload Header Metadata"; break;
14051405
case V4L2_META_FMT_D4XX: descr = "Intel D4xx UVC Metadata"; break;
14061406
case V4L2_META_FMT_VIVID: descr = "Vivid Metadata"; break;
1407+
case V4L2_META_FMT_SENSOR_DATA: descr = "Sensor Ancillary Metadata"; break;
14071408

14081409
default:
14091410
/* Compressed formats */

‎include/uapi/linux/videodev2.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ struct v4l2_pix_format {
778778
#define V4L2_META_FMT_UVC v4l2_fourcc('U', 'V', 'C', 'H') /* UVC Payload Header metadata */
779779
#define V4L2_META_FMT_D4XX v4l2_fourcc('D', '4', 'X', 'X') /* D4XX Payload Header metadata */
780780
#define V4L2_META_FMT_VIVID v4l2_fourcc('V', 'I', 'V', 'D') /* Vivid Metadata */
781+
#define V4L2_META_FMT_SENSOR_DATA v4l2_fourcc('S', 'E', 'N', 'S') /* Sensor Ancillary metadata */
781782

782783
/* priv field value to indicates that subsequent fields are valid. */
783784
#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe

0 commit comments

Comments
 (0)