xref: /OK3568_Linux_fs/kernel/Documentation/userspace-api/media/v4l/pixfmt-meta-d4xx.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun.. _v4l2-meta-fmt-d4xx:
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun*******************************
6*4882a593SmuzhiyunV4L2_META_FMT_D4XX ('D4XX')
7*4882a593Smuzhiyun*******************************
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunIntel D4xx UVC Cameras Metadata
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunDescription
13*4882a593Smuzhiyun===========
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunIntel D4xx (D435 and other) cameras include per-frame metadata in their UVC
16*4882a593Smuzhiyunpayload headers, following the Microsoft(R) UVC extension proposal [1_]. That
17*4882a593Smuzhiyunmeans, that the private D4XX metadata, following the standard UVC header, is
18*4882a593Smuzhiyunorganised in blocks. D4XX cameras implement several standard block types,
19*4882a593Smuzhiyunproposed by Microsoft, and several proprietary ones. Supported standard metadata
20*4882a593Smuzhiyuntypes are MetadataId_CaptureStats (ID 3), MetadataId_CameraExtrinsics (ID 4),
21*4882a593Smuzhiyunand MetadataId_CameraIntrinsics (ID 5). For their description see [1_]. This
22*4882a593Smuzhiyundocument describes proprietary metadata types, used by D4xx cameras.
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunV4L2_META_FMT_D4XX buffers follow the metadata buffer layout of
25*4882a593SmuzhiyunV4L2_META_FMT_UVC with the only difference, that it also includes proprietary
26*4882a593Smuzhiyunpayload header data. D4xx cameras use bulk transfers and only send one payload
27*4882a593Smuzhiyunper frame, therefore their headers cannot be larger than 255 bytes.
28*4882a593Smuzhiyun
29*4882a593SmuzhiyunBelow are proprietary Microsoft style metadata types, used by D4xx cameras,
30*4882a593Smuzhiyunwhere all fields are in little endian order:
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun.. flat-table:: D4xx metadata
36*4882a593Smuzhiyun    :widths: 1 2
37*4882a593Smuzhiyun    :header-rows:  1
38*4882a593Smuzhiyun    :stub-columns: 0
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun    * - **Field**
41*4882a593Smuzhiyun      - **Description**
42*4882a593Smuzhiyun    * - :cspan:`1` *Depth Control*
43*4882a593Smuzhiyun    * - __u32 ID
44*4882a593Smuzhiyun      - 0x80000000
45*4882a593Smuzhiyun    * - __u32 Size
46*4882a593Smuzhiyun      - Size in bytes (currently 56)
47*4882a593Smuzhiyun    * - __u32 Version
48*4882a593Smuzhiyun      - Version of this structure. The documentation herein corresponds to
49*4882a593Smuzhiyun        version xxx. The version number will be incremented when new fields are
50*4882a593Smuzhiyun        added.
51*4882a593Smuzhiyun    * - __u32 Flags
52*4882a593Smuzhiyun      - A bitmask of flags: see [2_] below
53*4882a593Smuzhiyun    * - __u32 Gain
54*4882a593Smuzhiyun      - Gain value in internal units, same as the V4L2_CID_GAIN control, used to
55*4882a593Smuzhiyun	capture the frame
56*4882a593Smuzhiyun    * - __u32 Exposure
57*4882a593Smuzhiyun      - Exposure time (in microseconds) used to capture the frame
58*4882a593Smuzhiyun    * - __u32 Laser power
59*4882a593Smuzhiyun      - Power of the laser LED 0-360, used for depth measurement
60*4882a593Smuzhiyun    * - __u32 AE mode
61*4882a593Smuzhiyun      - 0: manual; 1: automatic exposure
62*4882a593Smuzhiyun    * - __u32 Exposure priority
63*4882a593Smuzhiyun      - Exposure priority value: 0 - constant frame rate
64*4882a593Smuzhiyun    * - __u32 AE ROI left
65*4882a593Smuzhiyun      - Left border of the AE Region of Interest (all ROI values are in pixels
66*4882a593Smuzhiyun	and lie between 0 and maximum width or height respectively)
67*4882a593Smuzhiyun    * - __u32 AE ROI right
68*4882a593Smuzhiyun      - Right border of the AE Region of Interest
69*4882a593Smuzhiyun    * - __u32 AE ROI top
70*4882a593Smuzhiyun      - Top border of the AE Region of Interest
71*4882a593Smuzhiyun    * - __u32 AE ROI bottom
72*4882a593Smuzhiyun      - Bottom border of the AE Region of Interest
73*4882a593Smuzhiyun    * - __u32 Preset
74*4882a593Smuzhiyun      - Preset selector value, default: 0, unless changed by the user
75*4882a593Smuzhiyun    * - __u32 Laser mode
76*4882a593Smuzhiyun      - 0: off, 1: on
77*4882a593Smuzhiyun    * - :cspan:`1` *Capture Timing*
78*4882a593Smuzhiyun    * - __u32 ID
79*4882a593Smuzhiyun      - 0x80000001
80*4882a593Smuzhiyun    * - __u32 Size
81*4882a593Smuzhiyun      - Size in bytes (currently 40)
82*4882a593Smuzhiyun    * - __u32 Version
83*4882a593Smuzhiyun      - Version of this structure. The documentation herein corresponds to
84*4882a593Smuzhiyun        version xxx. The version number will be incremented when new fields are
85*4882a593Smuzhiyun        added.
86*4882a593Smuzhiyun    * - __u32 Flags
87*4882a593Smuzhiyun      - A bitmask of flags: see [3_] below
88*4882a593Smuzhiyun    * - __u32 Frame counter
89*4882a593Smuzhiyun      - Monotonically increasing counter
90*4882a593Smuzhiyun    * - __u32 Optical time
91*4882a593Smuzhiyun      - Time in microseconds from the beginning of a frame till its middle
92*4882a593Smuzhiyun    * - __u32 Readout time
93*4882a593Smuzhiyun      - Time, used to read out a frame in microseconds
94*4882a593Smuzhiyun    * - __u32 Exposure time
95*4882a593Smuzhiyun      - Frame exposure time in microseconds
96*4882a593Smuzhiyun    * - __u32 Frame interval
97*4882a593Smuzhiyun      - In microseconds = 1000000 / framerate
98*4882a593Smuzhiyun    * - __u32 Pipe latency
99*4882a593Smuzhiyun      - Time in microseconds from start of frame to data in USB buffer
100*4882a593Smuzhiyun    * - :cspan:`1` *Configuration*
101*4882a593Smuzhiyun    * - __u32 ID
102*4882a593Smuzhiyun      - 0x80000002
103*4882a593Smuzhiyun    * - __u32 Size
104*4882a593Smuzhiyun      - Size in bytes (currently 40)
105*4882a593Smuzhiyun    * - __u32 Version
106*4882a593Smuzhiyun      - Version of this structure. The documentation herein corresponds to
107*4882a593Smuzhiyun        version xxx. The version number will be incremented when new fields are
108*4882a593Smuzhiyun        added.
109*4882a593Smuzhiyun    * - __u32 Flags
110*4882a593Smuzhiyun      - A bitmask of flags: see [4_] below
111*4882a593Smuzhiyun    * - __u8 Hardware type
112*4882a593Smuzhiyun      - Camera hardware version [5_]
113*4882a593Smuzhiyun    * - __u8 SKU ID
114*4882a593Smuzhiyun      - Camera hardware configuration [6_]
115*4882a593Smuzhiyun    * - __u32 Cookie
116*4882a593Smuzhiyun      - Internal synchronisation
117*4882a593Smuzhiyun    * - __u16 Format
118*4882a593Smuzhiyun      - Image format code [7_]
119*4882a593Smuzhiyun    * - __u16 Width
120*4882a593Smuzhiyun      - Width in pixels
121*4882a593Smuzhiyun    * - __u16 Height
122*4882a593Smuzhiyun      - Height in pixels
123*4882a593Smuzhiyun    * - __u16 Framerate
124*4882a593Smuzhiyun      - Requested frame rate per second
125*4882a593Smuzhiyun    * - __u16 Trigger
126*4882a593Smuzhiyun      - Byte 0: bit 0: depth and RGB are synchronised, bit 1: external trigger
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun.. _1:
129*4882a593Smuzhiyun
130*4882a593Smuzhiyun[1] https://docs.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5
131*4882a593Smuzhiyun
132*4882a593Smuzhiyun.. _2:
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun[2] Depth Control flags specify which fields are valid: ::
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun  0x00000001 Gain
137*4882a593Smuzhiyun  0x00000002 Exposure
138*4882a593Smuzhiyun  0x00000004 Laser power
139*4882a593Smuzhiyun  0x00000008 AE mode
140*4882a593Smuzhiyun  0x00000010 Exposure priority
141*4882a593Smuzhiyun  0x00000020 AE ROI
142*4882a593Smuzhiyun  0x00000040 Preset
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun.. _3:
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun[3] Capture Timing flags specify which fields are valid: ::
147*4882a593Smuzhiyun
148*4882a593Smuzhiyun  0x00000001 Frame counter
149*4882a593Smuzhiyun  0x00000002 Optical time
150*4882a593Smuzhiyun  0x00000004 Readout time
151*4882a593Smuzhiyun  0x00000008 Exposure time
152*4882a593Smuzhiyun  0x00000010 Frame interval
153*4882a593Smuzhiyun  0x00000020 Pipe latency
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun.. _4:
156*4882a593Smuzhiyun
157*4882a593Smuzhiyun[4] Configuration flags specify which fields are valid: ::
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun  0x00000001 Hardware type
160*4882a593Smuzhiyun  0x00000002 SKU ID
161*4882a593Smuzhiyun  0x00000004 Cookie
162*4882a593Smuzhiyun  0x00000008 Format
163*4882a593Smuzhiyun  0x00000010 Width
164*4882a593Smuzhiyun  0x00000020 Height
165*4882a593Smuzhiyun  0x00000040 Framerate
166*4882a593Smuzhiyun  0x00000080 Trigger
167*4882a593Smuzhiyun  0x00000100 Cal count
168*4882a593Smuzhiyun
169*4882a593Smuzhiyun.. _5:
170*4882a593Smuzhiyun
171*4882a593Smuzhiyun[5] Camera model: ::
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun  0 DS5
174*4882a593Smuzhiyun  1 IVCAM2
175*4882a593Smuzhiyun
176*4882a593Smuzhiyun.. _6:
177*4882a593Smuzhiyun
178*4882a593Smuzhiyun[6] 8-bit camera hardware configuration bitfield: ::
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun  [1:0] depthCamera
181*4882a593Smuzhiyun	00: no depth
182*4882a593Smuzhiyun	01: standard depth
183*4882a593Smuzhiyun	10: wide depth
184*4882a593Smuzhiyun	11: reserved
185*4882a593Smuzhiyun  [2]   depthIsActive - has a laser projector
186*4882a593Smuzhiyun  [3]   RGB presence
187*4882a593Smuzhiyun  [4]   Inertial Measurement Unit (IMU) presence
188*4882a593Smuzhiyun  [5]   projectorType
189*4882a593Smuzhiyun	0: HPTG
190*4882a593Smuzhiyun	1: Princeton
191*4882a593Smuzhiyun  [6]   0: a projector, 1: an LED
192*4882a593Smuzhiyun  [7]   reserved
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun.. _7:
195*4882a593Smuzhiyun
196*4882a593Smuzhiyun[7] Image format codes per video streaming interface:
197*4882a593Smuzhiyun
198*4882a593SmuzhiyunDepth: ::
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun  1 Z16
201*4882a593Smuzhiyun  2 Z
202*4882a593Smuzhiyun
203*4882a593SmuzhiyunLeft sensor: ::
204*4882a593Smuzhiyun
205*4882a593Smuzhiyun  1 Y8
206*4882a593Smuzhiyun  2 UYVY
207*4882a593Smuzhiyun  3 R8L8
208*4882a593Smuzhiyun  4 Calibration
209*4882a593Smuzhiyun  5 W10
210*4882a593Smuzhiyun
211*4882a593SmuzhiyunFish Eye sensor: ::
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun  1 RAW8
214