blob: b45badafeab2b3afa8ea7398d3e46237e3510d70 [file] [log] [blame]
Colin Cross07a58322022-02-08 19:45:27 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_USB_VIDEO_H
20#define __LINUX_USB_VIDEO_H
21#include <linux/types.h>
22#define UVC_SC_UNDEFINED 0x00
23#define UVC_SC_VIDEOCONTROL 0x01
24#define UVC_SC_VIDEOSTREAMING 0x02
25#define UVC_SC_VIDEO_INTERFACE_COLLECTION 0x03
26#define UVC_PC_PROTOCOL_UNDEFINED 0x00
27#define UVC_PC_PROTOCOL_15 0x01
28#define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
29#define UVC_VC_HEADER 0x01
30#define UVC_VC_INPUT_TERMINAL 0x02
31#define UVC_VC_OUTPUT_TERMINAL 0x03
32#define UVC_VC_SELECTOR_UNIT 0x04
33#define UVC_VC_PROCESSING_UNIT 0x05
34#define UVC_VC_EXTENSION_UNIT 0x06
35#define UVC_VS_UNDEFINED 0x00
36#define UVC_VS_INPUT_HEADER 0x01
37#define UVC_VS_OUTPUT_HEADER 0x02
38#define UVC_VS_STILL_IMAGE_FRAME 0x03
39#define UVC_VS_FORMAT_UNCOMPRESSED 0x04
40#define UVC_VS_FRAME_UNCOMPRESSED 0x05
41#define UVC_VS_FORMAT_MJPEG 0x06
42#define UVC_VS_FRAME_MJPEG 0x07
43#define UVC_VS_FORMAT_MPEG2TS 0x0a
44#define UVC_VS_FORMAT_DV 0x0c
45#define UVC_VS_COLORFORMAT 0x0d
46#define UVC_VS_FORMAT_FRAME_BASED 0x10
47#define UVC_VS_FRAME_FRAME_BASED 0x11
48#define UVC_VS_FORMAT_STREAM_BASED 0x12
49#define UVC_EP_UNDEFINED 0x00
50#define UVC_EP_GENERAL 0x01
51#define UVC_EP_ENDPOINT 0x02
52#define UVC_EP_INTERRUPT 0x03
53#define UVC_RC_UNDEFINED 0x00
54#define UVC_SET_CUR 0x01
55#define UVC_GET_CUR 0x81
56#define UVC_GET_MIN 0x82
57#define UVC_GET_MAX 0x83
58#define UVC_GET_RES 0x84
59#define UVC_GET_LEN 0x85
60#define UVC_GET_INFO 0x86
61#define UVC_GET_DEF 0x87
62#define UVC_VC_CONTROL_UNDEFINED 0x00
63#define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01
64#define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02
65#define UVC_TE_CONTROL_UNDEFINED 0x00
66#define UVC_SU_CONTROL_UNDEFINED 0x00
67#define UVC_SU_INPUT_SELECT_CONTROL 0x01
68#define UVC_CT_CONTROL_UNDEFINED 0x00
69#define UVC_CT_SCANNING_MODE_CONTROL 0x01
70#define UVC_CT_AE_MODE_CONTROL 0x02
71#define UVC_CT_AE_PRIORITY_CONTROL 0x03
72#define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
73#define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
74#define UVC_CT_FOCUS_ABSOLUTE_CONTROL 0x06
75#define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07
76#define UVC_CT_FOCUS_AUTO_CONTROL 0x08
77#define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09
78#define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a
79#define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b
80#define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c
81#define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d
82#define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e
83#define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
84#define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
85#define UVC_CT_PRIVACY_CONTROL 0x11
86#define UVC_PU_CONTROL_UNDEFINED 0x00
87#define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
88#define UVC_PU_BRIGHTNESS_CONTROL 0x02
89#define UVC_PU_CONTRAST_CONTROL 0x03
90#define UVC_PU_GAIN_CONTROL 0x04
91#define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
92#define UVC_PU_HUE_CONTROL 0x06
93#define UVC_PU_SATURATION_CONTROL 0x07
94#define UVC_PU_SHARPNESS_CONTROL 0x08
95#define UVC_PU_GAMMA_CONTROL 0x09
96#define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
97#define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
98#define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
99#define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
100#define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
101#define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
102#define UVC_PU_HUE_AUTO_CONTROL 0x10
103#define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
104#define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
105#define UVC_VS_CONTROL_UNDEFINED 0x00
106#define UVC_VS_PROBE_CONTROL 0x01
107#define UVC_VS_COMMIT_CONTROL 0x02
108#define UVC_VS_STILL_PROBE_CONTROL 0x03
109#define UVC_VS_STILL_COMMIT_CONTROL 0x04
110#define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
111#define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06
112#define UVC_VS_GENERATE_KEY_FRAME_CONTROL 0x07
113#define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
114#define UVC_VS_SYNC_DELAY_CONTROL 0x09
115#define UVC_TT_VENDOR_SPECIFIC 0x0100
116#define UVC_TT_STREAMING 0x0101
117#define UVC_ITT_VENDOR_SPECIFIC 0x0200
118#define UVC_ITT_CAMERA 0x0201
119#define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202
120#define UVC_OTT_VENDOR_SPECIFIC 0x0300
121#define UVC_OTT_DISPLAY 0x0301
122#define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
123#define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400
124#define UVC_COMPOSITE_CONNECTOR 0x0401
125#define UVC_SVIDEO_CONNECTOR 0x0402
126#define UVC_COMPONENT_CONNECTOR 0x0403
127#define UVC_STATUS_TYPE_CONTROL 1
128#define UVC_STATUS_TYPE_STREAMING 2
129#define UVC_STREAM_EOH (1 << 7)
130#define UVC_STREAM_ERR (1 << 6)
131#define UVC_STREAM_STI (1 << 5)
132#define UVC_STREAM_RES (1 << 4)
133#define UVC_STREAM_SCR (1 << 3)
134#define UVC_STREAM_PTS (1 << 2)
135#define UVC_STREAM_EOF (1 << 1)
136#define UVC_STREAM_FID (1 << 0)
137#define UVC_CONTROL_CAP_GET (1 << 0)
138#define UVC_CONTROL_CAP_SET (1 << 1)
139#define UVC_CONTROL_CAP_DISABLED (1 << 2)
140#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
141#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
142struct uvc_descriptor_header {
143 __u8 bLength;
144 __u8 bDescriptorType;
145 __u8 bDescriptorSubType;
146} __attribute__((packed));
147struct uvc_header_descriptor {
148 __u8 bLength;
149 __u8 bDescriptorType;
150 __u8 bDescriptorSubType;
151 __le16 bcdUVC;
152 __le16 wTotalLength;
153 __le32 dwClockFrequency;
154 __u8 bInCollection;
155 __u8 baInterfaceNr[];
156} __attribute__((__packed__));
157#define UVC_DT_HEADER_SIZE(n) (12 + (n))
158#define UVC_HEADER_DESCRIPTOR(n) uvc_header_descriptor_ ##n
159#define DECLARE_UVC_HEADER_DESCRIPTOR(n) struct UVC_HEADER_DESCRIPTOR(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __le16 bcdUVC; __le16 wTotalLength; __le32 dwClockFrequency; __u8 bInCollection; __u8 baInterfaceNr[n]; \
160} __attribute__((packed))
161struct uvc_input_terminal_descriptor {
162 __u8 bLength;
163 __u8 bDescriptorType;
164 __u8 bDescriptorSubType;
165 __u8 bTerminalID;
166 __le16 wTerminalType;
167 __u8 bAssocTerminal;
168 __u8 iTerminal;
169} __attribute__((__packed__));
170#define UVC_DT_INPUT_TERMINAL_SIZE 8
171struct uvc_output_terminal_descriptor {
172 __u8 bLength;
173 __u8 bDescriptorType;
174 __u8 bDescriptorSubType;
175 __u8 bTerminalID;
176 __le16 wTerminalType;
177 __u8 bAssocTerminal;
178 __u8 bSourceID;
179 __u8 iTerminal;
180} __attribute__((__packed__));
181#define UVC_DT_OUTPUT_TERMINAL_SIZE 9
182struct uvc_camera_terminal_descriptor {
183 __u8 bLength;
184 __u8 bDescriptorType;
185 __u8 bDescriptorSubType;
186 __u8 bTerminalID;
187 __le16 wTerminalType;
188 __u8 bAssocTerminal;
189 __u8 iTerminal;
190 __le16 wObjectiveFocalLengthMin;
191 __le16 wObjectiveFocalLengthMax;
192 __le16 wOcularFocalLength;
193 __u8 bControlSize;
194 __u8 bmControls[3];
195} __attribute__((__packed__));
196#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15 + (n))
197struct uvc_selector_unit_descriptor {
198 __u8 bLength;
199 __u8 bDescriptorType;
200 __u8 bDescriptorSubType;
201 __u8 bUnitID;
202 __u8 bNrInPins;
203 __u8 baSourceID[0];
204 __u8 iSelector;
205} __attribute__((__packed__));
206#define UVC_DT_SELECTOR_UNIT_SIZE(n) (6 + (n))
207#define UVC_SELECTOR_UNIT_DESCRIPTOR(n) uvc_selector_unit_descriptor_ ##n
208#define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bUnitID; __u8 bNrInPins; __u8 baSourceID[n]; __u8 iSelector; \
209} __attribute__((packed))
210struct uvc_processing_unit_descriptor {
211 __u8 bLength;
212 __u8 bDescriptorType;
213 __u8 bDescriptorSubType;
214 __u8 bUnitID;
215 __u8 bSourceID;
216 __le16 wMaxMultiplier;
217 __u8 bControlSize;
218 __u8 bmControls[2];
219 __u8 iProcessing;
220 __u8 bmVideoStandards;
221} __attribute__((__packed__));
222#define UVC_DT_PROCESSING_UNIT_SIZE(n) (10 + (n))
223struct uvc_extension_unit_descriptor {
224 __u8 bLength;
225 __u8 bDescriptorType;
226 __u8 bDescriptorSubType;
227 __u8 bUnitID;
228 __u8 guidExtensionCode[16];
229 __u8 bNumControls;
230 __u8 bNrInPins;
231 __u8 baSourceID[0];
232 __u8 bControlSize;
233 __u8 bmControls[0];
234 __u8 iExtension;
235} __attribute__((__packed__));
236#define UVC_DT_EXTENSION_UNIT_SIZE(p,n) (24 + (p) + (n))
237#define UVC_EXTENSION_UNIT_DESCRIPTOR(p,n) uvc_extension_unit_descriptor_ ##p_ ##n
238#define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p,n) struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bUnitID; __u8 guidExtensionCode[16]; __u8 bNumControls; __u8 bNrInPins; __u8 baSourceID[p]; __u8 bControlSize; __u8 bmControls[n]; __u8 iExtension; \
239} __attribute__((packed))
240struct uvc_control_endpoint_descriptor {
241 __u8 bLength;
242 __u8 bDescriptorType;
243 __u8 bDescriptorSubType;
244 __le16 wMaxTransferSize;
245} __attribute__((__packed__));
246#define UVC_DT_CONTROL_ENDPOINT_SIZE 5
247struct uvc_input_header_descriptor {
248 __u8 bLength;
249 __u8 bDescriptorType;
250 __u8 bDescriptorSubType;
251 __u8 bNumFormats;
252 __le16 wTotalLength;
253 __u8 bEndpointAddress;
254 __u8 bmInfo;
255 __u8 bTerminalLink;
256 __u8 bStillCaptureMethod;
257 __u8 bTriggerSupport;
258 __u8 bTriggerUsage;
259 __u8 bControlSize;
260 __u8 bmaControls[];
261} __attribute__((__packed__));
262#define UVC_DT_INPUT_HEADER_SIZE(n,p) (13 + (n * p))
263#define UVC_INPUT_HEADER_DESCRIPTOR(n,p) uvc_input_header_descriptor_ ##n_ ##p
264#define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n,p) struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __le16 wTotalLength; __u8 bEndpointAddress; __u8 bmInfo; __u8 bTerminalLink; __u8 bStillCaptureMethod; __u8 bTriggerSupport; __u8 bTriggerUsage; __u8 bControlSize; __u8 bmaControls[p][n]; \
265} __attribute__((packed))
266struct uvc_output_header_descriptor {
267 __u8 bLength;
268 __u8 bDescriptorType;
269 __u8 bDescriptorSubType;
270 __u8 bNumFormats;
271 __le16 wTotalLength;
272 __u8 bEndpointAddress;
273 __u8 bTerminalLink;
274 __u8 bControlSize;
275 __u8 bmaControls[];
276} __attribute__((__packed__));
277#define UVC_DT_OUTPUT_HEADER_SIZE(n,p) (9 + (n * p))
278#define UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) uvc_output_header_descriptor_ ##n_ ##p
279#define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bNumFormats; __le16 wTotalLength; __u8 bEndpointAddress; __u8 bTerminalLink; __u8 bControlSize; __u8 bmaControls[p][n]; \
280} __attribute__((packed))
281struct uvc_color_matching_descriptor {
282 __u8 bLength;
283 __u8 bDescriptorType;
284 __u8 bDescriptorSubType;
285 __u8 bColorPrimaries;
286 __u8 bTransferCharacteristics;
287 __u8 bMatrixCoefficients;
288} __attribute__((__packed__));
289#define UVC_DT_COLOR_MATCHING_SIZE 6
290struct uvc_streaming_control {
291 __u16 bmHint;
292 __u8 bFormatIndex;
293 __u8 bFrameIndex;
294 __u32 dwFrameInterval;
295 __u16 wKeyFrameRate;
296 __u16 wPFrameRate;
297 __u16 wCompQuality;
298 __u16 wCompWindowSize;
299 __u16 wDelay;
300 __u32 dwMaxVideoFrameSize;
301 __u32 dwMaxPayloadTransferSize;
302 __u32 dwClockFrequency;
303 __u8 bmFramingInfo;
304 __u8 bPreferedVersion;
305 __u8 bMinVersion;
306 __u8 bMaxVersion;
307} __attribute__((__packed__));
308struct uvc_format_uncompressed {
309 __u8 bLength;
310 __u8 bDescriptorType;
311 __u8 bDescriptorSubType;
312 __u8 bFormatIndex;
313 __u8 bNumFrameDescriptors;
314 __u8 guidFormat[16];
315 __u8 bBitsPerPixel;
316 __u8 bDefaultFrameIndex;
317 __u8 bAspectRatioX;
318 __u8 bAspectRatioY;
319 __u8 bmInterfaceFlags;
320 __u8 bCopyProtect;
321} __attribute__((__packed__));
322#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
323struct uvc_frame_uncompressed {
324 __u8 bLength;
325 __u8 bDescriptorType;
326 __u8 bDescriptorSubType;
327 __u8 bFrameIndex;
328 __u8 bmCapabilities;
329 __le16 wWidth;
330 __le16 wHeight;
331 __le32 dwMinBitRate;
332 __le32 dwMaxBitRate;
333 __le32 dwMaxVideoFrameBufferSize;
334 __le32 dwDefaultFrameInterval;
335 __u8 bFrameIntervalType;
336 __le32 dwFrameInterval[];
337} __attribute__((__packed__));
338#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26 + 4 * (n))
339#define UVC_FRAME_UNCOMPRESSED(n) uvc_frame_uncompressed_ ##n
340#define DECLARE_UVC_FRAME_UNCOMPRESSED(n) struct UVC_FRAME_UNCOMPRESSED(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __le16 wWidth; __le16 wHeight; __le32 dwMinBitRate; __le32 dwMaxBitRate; __le32 dwMaxVideoFrameBufferSize; __le32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __le32 dwFrameInterval[n]; \
341} __attribute__((packed))
342struct uvc_format_mjpeg {
343 __u8 bLength;
344 __u8 bDescriptorType;
345 __u8 bDescriptorSubType;
346 __u8 bFormatIndex;
347 __u8 bNumFrameDescriptors;
348 __u8 bmFlags;
349 __u8 bDefaultFrameIndex;
350 __u8 bAspectRatioX;
351 __u8 bAspectRatioY;
352 __u8 bmInterfaceFlags;
353 __u8 bCopyProtect;
354} __attribute__((__packed__));
355#define UVC_DT_FORMAT_MJPEG_SIZE 11
356struct uvc_frame_mjpeg {
357 __u8 bLength;
358 __u8 bDescriptorType;
359 __u8 bDescriptorSubType;
360 __u8 bFrameIndex;
361 __u8 bmCapabilities;
362 __le16 wWidth;
363 __le16 wHeight;
364 __le32 dwMinBitRate;
365 __le32 dwMaxBitRate;
366 __le32 dwMaxVideoFrameBufferSize;
367 __le32 dwDefaultFrameInterval;
368 __u8 bFrameIntervalType;
369 __le32 dwFrameInterval[];
370} __attribute__((__packed__));
371#define UVC_DT_FRAME_MJPEG_SIZE(n) (26 + 4 * (n))
372#define UVC_FRAME_MJPEG(n) uvc_frame_mjpeg_ ##n
373#define DECLARE_UVC_FRAME_MJPEG(n) struct UVC_FRAME_MJPEG(n) { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubType; __u8 bFrameIndex; __u8 bmCapabilities; __le16 wWidth; __le16 wHeight; __le32 dwMinBitRate; __le32 dwMaxBitRate; __le32 dwMaxVideoFrameBufferSize; __le32 dwDefaultFrameInterval; __u8 bFrameIntervalType; __le32 dwFrameInterval[n]; \
374} __attribute__((packed))
375#endif