Skip to content

Commit ba98c51

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 8e64bfd commit ba98c51

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
@@ -15,6 +15,7 @@ These formats are used for the :ref:`metadata` interface only.
1515
pixfmt-meta-d4xx
1616
pixfmt-meta-intel-ipu3
1717
pixfmt-meta-rkisp1
18+
pixfmt-meta-sensor-data
1819
pixfmt-meta-uvc
1920
pixfmt-meta-vsp1-hgo
2021
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
@@ -1369,6 +1369,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
13691369
case V4L2_META_FMT_VIVID: descr = "Vivid Metadata"; break;
13701370
case V4L2_META_FMT_RK_ISP1_PARAMS: descr = "Rockchip ISP1 3A Parameters"; break;
13711371
case V4L2_META_FMT_RK_ISP1_STAT_3A: descr = "Rockchip ISP1 3A Statistics"; break;
1372+
case V4L2_META_FMT_SENSOR_DATA: descr = "Sensor Ancillary Metadata"; break;
13721373

13731374
default:
13741375
/* Compressed formats */

‎include/uapi/linux/videodev2.h‎

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

779780
/* Vendor specific - used for RK_ISP1 camera sub-system */
780781
#define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */

0 commit comments

Comments
 (0)