blob: 0ceabe7f79d011c547b0a7dc7d6e0340e63b4f21 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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
Ben Cheng655a7c02013-10-16 16:09:24 -070023#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
Christopher Ferris106b3a82016-08-24 12:15:38 -070027#define UVC_PC_PROTOCOL_15 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
29#define UVC_VC_HEADER 0x01
30#define UVC_VC_INPUT_TERMINAL 0x02
Christopher Ferris106b3a82016-08-24 12:15:38 -070031#define UVC_VC_OUTPUT_TERMINAL 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define UVC_VC_SELECTOR_UNIT 0x04
33#define UVC_VC_PROCESSING_UNIT 0x05
34#define UVC_VC_EXTENSION_UNIT 0x06
Christopher Ferris106b3a82016-08-24 12:15:38 -070035#define UVC_VS_UNDEFINED 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define UVC_VS_INPUT_HEADER 0x01
37#define UVC_VS_OUTPUT_HEADER 0x02
38#define UVC_VS_STILL_IMAGE_FRAME 0x03
Christopher Ferris106b3a82016-08-24 12:15:38 -070039#define UVC_VS_FORMAT_UNCOMPRESSED 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define UVC_VS_FRAME_UNCOMPRESSED 0x05
41#define UVC_VS_FORMAT_MJPEG 0x06
42#define UVC_VS_FRAME_MJPEG 0x07
Christopher Ferris106b3a82016-08-24 12:15:38 -070043#define UVC_VS_FORMAT_MPEG2TS 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define UVC_VS_FORMAT_DV 0x0c
45#define UVC_VS_COLORFORMAT 0x0d
46#define UVC_VS_FORMAT_FRAME_BASED 0x10
Christopher Ferris106b3a82016-08-24 12:15:38 -070047#define UVC_VS_FRAME_FRAME_BASED 0x11
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define UVC_VS_FORMAT_STREAM_BASED 0x12
49#define UVC_EP_UNDEFINED 0x00
50#define UVC_EP_GENERAL 0x01
Christopher Ferris106b3a82016-08-24 12:15:38 -070051#define UVC_EP_ENDPOINT 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define UVC_EP_INTERRUPT 0x03
53#define UVC_RC_UNDEFINED 0x00
54#define UVC_SET_CUR 0x01
Christopher Ferris106b3a82016-08-24 12:15:38 -070055#define UVC_GET_CUR 0x81
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define UVC_GET_MIN 0x82
57#define UVC_GET_MAX 0x83
58#define UVC_GET_RES 0x84
Christopher Ferris106b3a82016-08-24 12:15:38 -070059#define UVC_GET_LEN 0x85
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define UVC_GET_INFO 0x86
61#define UVC_GET_DEF 0x87
62#define UVC_VC_CONTROL_UNDEFINED 0x00
Christopher Ferris106b3a82016-08-24 12:15:38 -070063#define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02
65#define UVC_TE_CONTROL_UNDEFINED 0x00
66#define UVC_SU_CONTROL_UNDEFINED 0x00
Christopher Ferris106b3a82016-08-24 12:15:38 -070067#define UVC_SU_INPUT_SELECT_CONTROL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define UVC_CT_CONTROL_UNDEFINED 0x00
69#define UVC_CT_SCANNING_MODE_CONTROL 0x01
70#define UVC_CT_AE_MODE_CONTROL 0x02
Christopher Ferris106b3a82016-08-24 12:15:38 -070071#define UVC_CT_AE_PRIORITY_CONTROL 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -070072#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
Christopher Ferris106b3a82016-08-24 12:15:38 -070075#define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define UVC_CT_FOCUS_AUTO_CONTROL 0x08
77#define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09
78#define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a
Christopher Ferris106b3a82016-08-24 12:15:38 -070079#define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c
81#define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d
82#define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e
Christopher Ferris106b3a82016-08-24 12:15:38 -070083#define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
85#define UVC_CT_PRIVACY_CONTROL 0x11
86#define UVC_PU_CONTROL_UNDEFINED 0x00
Christopher Ferris106b3a82016-08-24 12:15:38 -070087#define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070088#define UVC_PU_BRIGHTNESS_CONTROL 0x02
89#define UVC_PU_CONTRAST_CONTROL 0x03
90#define UVC_PU_GAIN_CONTROL 0x04
Christopher Ferris106b3a82016-08-24 12:15:38 -070091#define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define UVC_PU_HUE_CONTROL 0x06
93#define UVC_PU_SATURATION_CONTROL 0x07
94#define UVC_PU_SHARPNESS_CONTROL 0x08
Christopher Ferris106b3a82016-08-24 12:15:38 -070095#define UVC_PU_GAMMA_CONTROL 0x09
Ben Cheng655a7c02013-10-16 16:09:24 -070096#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
Christopher Ferris106b3a82016-08-24 12:15:38 -070099#define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
101#define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
102#define UVC_PU_HUE_AUTO_CONTROL 0x10
Christopher Ferris106b3a82016-08-24 12:15:38 -0700103#define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
105#define UVC_VS_CONTROL_UNDEFINED 0x00
106#define UVC_VS_PROBE_CONTROL 0x01
Christopher Ferris106b3a82016-08-24 12:15:38 -0700107#define UVC_VS_COMMIT_CONTROL 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#define UVC_VS_STILL_PROBE_CONTROL 0x03
109#define UVC_VS_STILL_COMMIT_CONTROL 0x04
110#define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
Christopher Ferris106b3a82016-08-24 12:15:38 -0700111#define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#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
Christopher Ferris106b3a82016-08-24 12:15:38 -0700115#define UVC_TT_VENDOR_SPECIFIC 0x0100
Ben Cheng655a7c02013-10-16 16:09:24 -0700116#define UVC_TT_STREAMING 0x0101
117#define UVC_ITT_VENDOR_SPECIFIC 0x0200
118#define UVC_ITT_CAMERA 0x0201
Christopher Ferris106b3a82016-08-24 12:15:38 -0700119#define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202
Ben Cheng655a7c02013-10-16 16:09:24 -0700120#define UVC_OTT_VENDOR_SPECIFIC 0x0300
121#define UVC_OTT_DISPLAY 0x0301
122#define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
Christopher Ferris106b3a82016-08-24 12:15:38 -0700123#define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400
Ben Cheng655a7c02013-10-16 16:09:24 -0700124#define UVC_COMPOSITE_CONNECTOR 0x0401
125#define UVC_SVIDEO_CONNECTOR 0x0402
126#define UVC_COMPONENT_CONNECTOR 0x0403
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127#define UVC_STATUS_TYPE_CONTROL 1
Ben Cheng655a7c02013-10-16 16:09:24 -0700128#define UVC_STATUS_TYPE_STREAMING 2
129#define UVC_STREAM_EOH (1 << 7)
130#define UVC_STREAM_ERR (1 << 6)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131#define UVC_STREAM_STI (1 << 5)
Ben Cheng655a7c02013-10-16 16:09:24 -0700132#define UVC_STREAM_RES (1 << 4)
133#define UVC_STREAM_SCR (1 << 3)
134#define UVC_STREAM_PTS (1 << 2)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135#define UVC_STREAM_EOF (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700136#define UVC_STREAM_FID (1 << 0)
137#define UVC_CONTROL_CAP_GET (1 << 0)
138#define UVC_CONTROL_CAP_SET (1 << 1)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139#define UVC_CONTROL_CAP_DISABLED (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
141#define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000142enum uvc_color_primaries_values {
143 UVC_COLOR_PRIMARIES_UNSPECIFIED,
144 UVC_COLOR_PRIMARIES_BT_709_SRGB,
145 UVC_COLOR_PRIMARIES_BT_470_2_M,
146 UVC_COLOR_PRIMARIES_BT_470_2_B_G,
147 UVC_COLOR_PRIMARIES_SMPTE_170M,
148 UVC_COLOR_PRIMARIES_SMPTE_240M,
149};
150enum uvc_transfer_characteristics_values {
151 UVC_TRANSFER_CHARACTERISTICS_UNSPECIFIED,
152 UVC_TRANSFER_CHARACTERISTICS_BT_709,
153 UVC_TRANSFER_CHARACTERISTICS_BT_470_2_M,
154 UVC_TRANSFER_CHARACTERISTICS_BT_470_2_B_G,
155 UVC_TRANSFER_CHARACTERISTICS_SMPTE_170M,
156 UVC_TRANSFER_CHARACTERISTICS_SMPTE_240M,
157 UVC_TRANSFER_CHARACTERISTICS_LINEAR,
158 UVC_TRANSFER_CHARACTERISTICS_SRGB,
159};
160enum uvc_matrix_coefficients {
161 UVC_MATRIX_COEFFICIENTS_UNSPECIFIED,
162 UVC_MATRIX_COEFFICIENTS_BT_709,
163 UVC_MATRIX_COEFFICIENTS_FCC,
164 UVC_MATRIX_COEFFICIENTS_BT_470_2_B_G,
165 UVC_MATRIX_COEFFICIENTS_SMPTE_170M,
166 UVC_MATRIX_COEFFICIENTS_SMPTE_240M,
167};
Ben Cheng655a7c02013-10-16 16:09:24 -0700168struct uvc_descriptor_header {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700169 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800170 __u8 bDescriptorType;
171 __u8 bDescriptorSubType;
Ben Cheng655a7c02013-10-16 16:09:24 -0700172} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700173struct uvc_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800174 __u8 bLength;
175 __u8 bDescriptorType;
176 __u8 bDescriptorSubType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800177 __le16 bcdUVC;
178 __le16 wTotalLength;
179 __le32 dwClockFrequency;
Tao Baod7db5942015-01-28 10:07:51 -0800180 __u8 bInCollection;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700181 __u8 baInterfaceNr[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700182} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800183#define UVC_DT_HEADER_SIZE(n) (12 + (n))
184#define UVC_HEADER_DESCRIPTOR(n) uvc_header_descriptor_ ##n
Christopher Ferris86a48372019-01-10 14:14:59 -0800185#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]; \
Tao Baod7db5942015-01-28 10:07:51 -0800186} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700187struct uvc_input_terminal_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800188 __u8 bLength;
189 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700190 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u8 bTerminalID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800192 __le16 wTerminalType;
Tao Baod7db5942015-01-28 10:07:51 -0800193 __u8 bAssocTerminal;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700194 __u8 iTerminal;
Ben Cheng655a7c02013-10-16 16:09:24 -0700195} __attribute__((__packed__));
196#define UVC_DT_INPUT_TERMINAL_SIZE 8
197struct uvc_output_terminal_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700198 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u8 bDescriptorType;
200 __u8 bDescriptorSubType;
201 __u8 bTerminalID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800202 __le16 wTerminalType;
Tao Baod7db5942015-01-28 10:07:51 -0800203 __u8 bAssocTerminal;
204 __u8 bSourceID;
205 __u8 iTerminal;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700206} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700207#define UVC_DT_OUTPUT_TERMINAL_SIZE 9
208struct uvc_camera_terminal_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700210 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800211 __u8 bDescriptorSubType;
212 __u8 bTerminalID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800213 __le16 wTerminalType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700214 __u8 bAssocTerminal;
Tao Baod7db5942015-01-28 10:07:51 -0800215 __u8 iTerminal;
Christopher Ferris86a48372019-01-10 14:14:59 -0800216 __le16 wObjectiveFocalLengthMin;
217 __le16 wObjectiveFocalLengthMax;
218 __le16 wOcularFocalLength;
Tao Baod7db5942015-01-28 10:07:51 -0800219 __u8 bControlSize;
220 __u8 bmControls[3];
Ben Cheng655a7c02013-10-16 16:09:24 -0700221} __attribute__((__packed__));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700222#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15 + (n))
Ben Cheng655a7c02013-10-16 16:09:24 -0700223struct uvc_selector_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800224 __u8 bLength;
225 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700226 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800227 __u8 bUnitID;
228 __u8 bNrInPins;
229 __u8 baSourceID[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700230 __u8 iSelector;
Ben Cheng655a7c02013-10-16 16:09:24 -0700231} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800232#define UVC_DT_SELECTOR_UNIT_SIZE(n) (6 + (n))
233#define UVC_SELECTOR_UNIT_DESCRIPTOR(n) uvc_selector_unit_descriptor_ ##n
234#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; \
235} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700236struct uvc_processing_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800237 __u8 bLength;
238 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700239 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800240 __u8 bUnitID;
241 __u8 bSourceID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800242 __le16 wMaxMultiplier;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700243 __u8 bControlSize;
Tao Baod7db5942015-01-28 10:07:51 -0800244 __u8 bmControls[2];
245 __u8 iProcessing;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000246 __u8 bmVideoStandards;
Ben Cheng655a7c02013-10-16 16:09:24 -0700247} __attribute__((__packed__));
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000248#define UVC_DT_PROCESSING_UNIT_SIZE(n) (10 + (n))
Ben Cheng655a7c02013-10-16 16:09:24 -0700249struct uvc_extension_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800250 __u8 bLength;
251 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700252 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800253 __u8 bUnitID;
254 __u8 guidExtensionCode[16];
255 __u8 bNumControls;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700256 __u8 bNrInPins;
Tao Baod7db5942015-01-28 10:07:51 -0800257 __u8 baSourceID[0];
258 __u8 bControlSize;
259 __u8 bmControls[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700260 __u8 iExtension;
Ben Cheng655a7c02013-10-16 16:09:24 -0700261} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800262#define UVC_DT_EXTENSION_UNIT_SIZE(p,n) (24 + (p) + (n))
263#define UVC_EXTENSION_UNIT_DESCRIPTOR(p,n) uvc_extension_unit_descriptor_ ##p_ ##n
264#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; \
265} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700266struct uvc_control_endpoint_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800267 __u8 bLength;
268 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700269 __u8 bDescriptorSubType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800270 __le16 wMaxTransferSize;
Ben Cheng655a7c02013-10-16 16:09:24 -0700271} __attribute__((__packed__));
272#define UVC_DT_CONTROL_ENDPOINT_SIZE 5
Christopher Ferris106b3a82016-08-24 12:15:38 -0700273struct uvc_input_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800274 __u8 bLength;
275 __u8 bDescriptorType;
276 __u8 bDescriptorSubType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700277 __u8 bNumFormats;
Christopher Ferris86a48372019-01-10 14:14:59 -0800278 __le16 wTotalLength;
Tao Baod7db5942015-01-28 10:07:51 -0800279 __u8 bEndpointAddress;
280 __u8 bmInfo;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700281 __u8 bTerminalLink;
Tao Baod7db5942015-01-28 10:07:51 -0800282 __u8 bStillCaptureMethod;
283 __u8 bTriggerSupport;
284 __u8 bTriggerUsage;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700285 __u8 bControlSize;
Tao Baod7db5942015-01-28 10:07:51 -0800286 __u8 bmaControls[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700287} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800288#define UVC_DT_INPUT_HEADER_SIZE(n,p) (13 + (n * p))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700289#define UVC_INPUT_HEADER_DESCRIPTOR(n,p) uvc_input_header_descriptor_ ##n_ ##p
Christopher Ferris86a48372019-01-10 14:14:59 -0800290#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]; \
Tao Baod7db5942015-01-28 10:07:51 -0800291} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700292struct uvc_output_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800293 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700294 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800295 __u8 bDescriptorSubType;
296 __u8 bNumFormats;
Christopher Ferris86a48372019-01-10 14:14:59 -0800297 __le16 wTotalLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700298 __u8 bEndpointAddress;
Tao Baod7db5942015-01-28 10:07:51 -0800299 __u8 bTerminalLink;
300 __u8 bControlSize;
301 __u8 bmaControls[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700302} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800303#define UVC_DT_OUTPUT_HEADER_SIZE(n,p) (9 + (n * p))
304#define UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) uvc_output_header_descriptor_ ##n_ ##p
Christopher Ferris86a48372019-01-10 14:14:59 -0800305#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]; \
Tao Baod7db5942015-01-28 10:07:51 -0800306} __attribute__((packed))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700307struct uvc_color_matching_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800308 __u8 bLength;
309 __u8 bDescriptorType;
310 __u8 bDescriptorSubType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700311 __u8 bColorPrimaries;
Tao Baod7db5942015-01-28 10:07:51 -0800312 __u8 bTransferCharacteristics;
313 __u8 bMatrixCoefficients;
Ben Cheng655a7c02013-10-16 16:09:24 -0700314} __attribute__((__packed__));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700315#define UVC_DT_COLOR_MATCHING_SIZE 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700316struct uvc_streaming_control {
Tao Baod7db5942015-01-28 10:07:51 -0800317 __u16 bmHint;
318 __u8 bFormatIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700319 __u8 bFrameIndex;
Tao Baod7db5942015-01-28 10:07:51 -0800320 __u32 dwFrameInterval;
321 __u16 wKeyFrameRate;
322 __u16 wPFrameRate;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700323 __u16 wCompQuality;
Tao Baod7db5942015-01-28 10:07:51 -0800324 __u16 wCompWindowSize;
325 __u16 wDelay;
326 __u32 dwMaxVideoFrameSize;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700327 __u32 dwMaxPayloadTransferSize;
Tao Baod7db5942015-01-28 10:07:51 -0800328 __u32 dwClockFrequency;
329 __u8 bmFramingInfo;
330 __u8 bPreferedVersion;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700331 __u8 bMinVersion;
Tao Baod7db5942015-01-28 10:07:51 -0800332 __u8 bMaxVersion;
Ben Cheng655a7c02013-10-16 16:09:24 -0700333} __attribute__((__packed__));
334struct uvc_format_uncompressed {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700335 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800336 __u8 bDescriptorType;
337 __u8 bDescriptorSubType;
338 __u8 bFormatIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700339 __u8 bNumFrameDescriptors;
Tao Baod7db5942015-01-28 10:07:51 -0800340 __u8 guidFormat[16];
341 __u8 bBitsPerPixel;
342 __u8 bDefaultFrameIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700343 __u8 bAspectRatioX;
Tao Baod7db5942015-01-28 10:07:51 -0800344 __u8 bAspectRatioY;
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800345 __u8 bmInterlaceFlags;
Tao Baod7db5942015-01-28 10:07:51 -0800346 __u8 bCopyProtect;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700347} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700348#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
349struct uvc_frame_uncompressed {
Tao Baod7db5942015-01-28 10:07:51 -0800350 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700351 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800352 __u8 bDescriptorSubType;
353 __u8 bFrameIndex;
354 __u8 bmCapabilities;
Christopher Ferris86a48372019-01-10 14:14:59 -0800355 __le16 wWidth;
356 __le16 wHeight;
357 __le32 dwMinBitRate;
358 __le32 dwMaxBitRate;
359 __le32 dwMaxVideoFrameBufferSize;
360 __le32 dwDefaultFrameInterval;
Tao Baod7db5942015-01-28 10:07:51 -0800361 __u8 bFrameIntervalType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800362 __le32 dwFrameInterval[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700363} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800364#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26 + 4 * (n))
365#define UVC_FRAME_UNCOMPRESSED(n) uvc_frame_uncompressed_ ##n
Christopher Ferris86a48372019-01-10 14:14:59 -0800366#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]; \
Tao Baod7db5942015-01-28 10:07:51 -0800367} __attribute__((packed))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700368struct uvc_format_mjpeg {
Tao Baod7db5942015-01-28 10:07:51 -0800369 __u8 bLength;
370 __u8 bDescriptorType;
371 __u8 bDescriptorSubType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700372 __u8 bFormatIndex;
Tao Baod7db5942015-01-28 10:07:51 -0800373 __u8 bNumFrameDescriptors;
374 __u8 bmFlags;
375 __u8 bDefaultFrameIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700376 __u8 bAspectRatioX;
Tao Baod7db5942015-01-28 10:07:51 -0800377 __u8 bAspectRatioY;
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800378 __u8 bmInterlaceFlags;
Tao Baod7db5942015-01-28 10:07:51 -0800379 __u8 bCopyProtect;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700380} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700381#define UVC_DT_FORMAT_MJPEG_SIZE 11
382struct uvc_frame_mjpeg {
Tao Baod7db5942015-01-28 10:07:51 -0800383 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700384 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800385 __u8 bDescriptorSubType;
386 __u8 bFrameIndex;
387 __u8 bmCapabilities;
Christopher Ferris86a48372019-01-10 14:14:59 -0800388 __le16 wWidth;
389 __le16 wHeight;
390 __le32 dwMinBitRate;
391 __le32 dwMaxBitRate;
392 __le32 dwMaxVideoFrameBufferSize;
393 __le32 dwDefaultFrameInterval;
Tao Baod7db5942015-01-28 10:07:51 -0800394 __u8 bFrameIntervalType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800395 __le32 dwFrameInterval[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700396} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800397#define UVC_DT_FRAME_MJPEG_SIZE(n) (26 + 4 * (n))
398#define UVC_FRAME_MJPEG(n) uvc_frame_mjpeg_ ##n
Christopher Ferris86a48372019-01-10 14:14:59 -0800399#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]; \
Tao Baod7db5942015-01-28 10:07:51 -0800400} __attribute__((packed))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700401#endif