blob: cd2ede906e3bdf96ddbad264e898ea140ff7fb54 [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)
142struct uvc_descriptor_header {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u8 bDescriptorType;
145 __u8 bDescriptorSubType;
Ben Cheng655a7c02013-10-16 16:09:24 -0700146} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147struct uvc_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800148 __u8 bLength;
149 __u8 bDescriptorType;
150 __u8 bDescriptorSubType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800151 __le16 bcdUVC;
152 __le16 wTotalLength;
153 __le32 dwClockFrequency;
Tao Baod7db5942015-01-28 10:07:51 -0800154 __u8 bInCollection;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155 __u8 baInterfaceNr[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700156} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800157#define UVC_DT_HEADER_SIZE(n) (12 + (n))
158#define UVC_HEADER_DESCRIPTOR(n) uvc_header_descriptor_ ##n
Christopher Ferris86a48372019-01-10 14:14:59 -0800159#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 -0800160} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700161struct uvc_input_terminal_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u8 bLength;
163 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700164 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800165 __u8 bTerminalID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800166 __le16 wTerminalType;
Tao Baod7db5942015-01-28 10:07:51 -0800167 __u8 bAssocTerminal;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168 __u8 iTerminal;
Ben Cheng655a7c02013-10-16 16:09:24 -0700169} __attribute__((__packed__));
170#define UVC_DT_INPUT_TERMINAL_SIZE 8
171struct uvc_output_terminal_descriptor {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700172 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800173 __u8 bDescriptorType;
174 __u8 bDescriptorSubType;
175 __u8 bTerminalID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800176 __le16 wTerminalType;
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u8 bAssocTerminal;
178 __u8 bSourceID;
179 __u8 iTerminal;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700180} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700181#define UVC_DT_OUTPUT_TERMINAL_SIZE 9
182struct uvc_camera_terminal_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800183 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700184 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800185 __u8 bDescriptorSubType;
186 __u8 bTerminalID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800187 __le16 wTerminalType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188 __u8 bAssocTerminal;
Tao Baod7db5942015-01-28 10:07:51 -0800189 __u8 iTerminal;
Christopher Ferris86a48372019-01-10 14:14:59 -0800190 __le16 wObjectiveFocalLengthMin;
191 __le16 wObjectiveFocalLengthMax;
192 __le16 wOcularFocalLength;
Tao Baod7db5942015-01-28 10:07:51 -0800193 __u8 bControlSize;
194 __u8 bmControls[3];
Ben Cheng655a7c02013-10-16 16:09:24 -0700195} __attribute__((__packed__));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700196#define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15 + (n))
Ben Cheng655a7c02013-10-16 16:09:24 -0700197struct uvc_selector_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800198 __u8 bLength;
199 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800201 __u8 bUnitID;
202 __u8 bNrInPins;
203 __u8 baSourceID[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700204 __u8 iSelector;
Ben Cheng655a7c02013-10-16 16:09:24 -0700205} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800206#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))
Ben Cheng655a7c02013-10-16 16:09:24 -0700210struct uvc_processing_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800211 __u8 bLength;
212 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700213 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800214 __u8 bUnitID;
215 __u8 bSourceID;
Christopher Ferris86a48372019-01-10 14:14:59 -0800216 __le16 wMaxMultiplier;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700217 __u8 bControlSize;
Tao Baod7db5942015-01-28 10:07:51 -0800218 __u8 bmControls[2];
219 __u8 iProcessing;
Ben Cheng655a7c02013-10-16 16:09:24 -0700220} __attribute__((__packed__));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700221#define UVC_DT_PROCESSING_UNIT_SIZE(n) (9 + (n))
Ben Cheng655a7c02013-10-16 16:09:24 -0700222struct uvc_extension_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800223 __u8 bLength;
224 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700225 __u8 bDescriptorSubType;
Tao Baod7db5942015-01-28 10:07:51 -0800226 __u8 bUnitID;
227 __u8 guidExtensionCode[16];
228 __u8 bNumControls;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700229 __u8 bNrInPins;
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u8 baSourceID[0];
231 __u8 bControlSize;
232 __u8 bmControls[0];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700233 __u8 iExtension;
Ben Cheng655a7c02013-10-16 16:09:24 -0700234} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800235#define UVC_DT_EXTENSION_UNIT_SIZE(p,n) (24 + (p) + (n))
236#define UVC_EXTENSION_UNIT_DESCRIPTOR(p,n) uvc_extension_unit_descriptor_ ##p_ ##n
237#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; \
238} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700239struct uvc_control_endpoint_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800240 __u8 bLength;
241 __u8 bDescriptorType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700242 __u8 bDescriptorSubType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800243 __le16 wMaxTransferSize;
Ben Cheng655a7c02013-10-16 16:09:24 -0700244} __attribute__((__packed__));
245#define UVC_DT_CONTROL_ENDPOINT_SIZE 5
Christopher Ferris106b3a82016-08-24 12:15:38 -0700246struct uvc_input_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800247 __u8 bLength;
248 __u8 bDescriptorType;
249 __u8 bDescriptorSubType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700250 __u8 bNumFormats;
Christopher Ferris86a48372019-01-10 14:14:59 -0800251 __le16 wTotalLength;
Tao Baod7db5942015-01-28 10:07:51 -0800252 __u8 bEndpointAddress;
253 __u8 bmInfo;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700254 __u8 bTerminalLink;
Tao Baod7db5942015-01-28 10:07:51 -0800255 __u8 bStillCaptureMethod;
256 __u8 bTriggerSupport;
257 __u8 bTriggerUsage;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700258 __u8 bControlSize;
Tao Baod7db5942015-01-28 10:07:51 -0800259 __u8 bmaControls[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700260} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800261#define UVC_DT_INPUT_HEADER_SIZE(n,p) (13 + (n * p))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700262#define UVC_INPUT_HEADER_DESCRIPTOR(n,p) uvc_input_header_descriptor_ ##n_ ##p
Christopher Ferris86a48372019-01-10 14:14:59 -0800263#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 -0800264} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700265struct uvc_output_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800266 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700267 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800268 __u8 bDescriptorSubType;
269 __u8 bNumFormats;
Christopher Ferris86a48372019-01-10 14:14:59 -0800270 __le16 wTotalLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700271 __u8 bEndpointAddress;
Tao Baod7db5942015-01-28 10:07:51 -0800272 __u8 bTerminalLink;
273 __u8 bControlSize;
274 __u8 bmaControls[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700275} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800276#define UVC_DT_OUTPUT_HEADER_SIZE(n,p) (9 + (n * p))
277#define UVC_OUTPUT_HEADER_DESCRIPTOR(n,p) uvc_output_header_descriptor_ ##n_ ##p
Christopher Ferris86a48372019-01-10 14:14:59 -0800278#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 -0800279} __attribute__((packed))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700280struct uvc_color_matching_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800281 __u8 bLength;
282 __u8 bDescriptorType;
283 __u8 bDescriptorSubType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700284 __u8 bColorPrimaries;
Tao Baod7db5942015-01-28 10:07:51 -0800285 __u8 bTransferCharacteristics;
286 __u8 bMatrixCoefficients;
Ben Cheng655a7c02013-10-16 16:09:24 -0700287} __attribute__((__packed__));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700288#define UVC_DT_COLOR_MATCHING_SIZE 6
Ben Cheng655a7c02013-10-16 16:09:24 -0700289struct uvc_streaming_control {
Tao Baod7db5942015-01-28 10:07:51 -0800290 __u16 bmHint;
291 __u8 bFormatIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700292 __u8 bFrameIndex;
Tao Baod7db5942015-01-28 10:07:51 -0800293 __u32 dwFrameInterval;
294 __u16 wKeyFrameRate;
295 __u16 wPFrameRate;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700296 __u16 wCompQuality;
Tao Baod7db5942015-01-28 10:07:51 -0800297 __u16 wCompWindowSize;
298 __u16 wDelay;
299 __u32 dwMaxVideoFrameSize;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700300 __u32 dwMaxPayloadTransferSize;
Tao Baod7db5942015-01-28 10:07:51 -0800301 __u32 dwClockFrequency;
302 __u8 bmFramingInfo;
303 __u8 bPreferedVersion;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700304 __u8 bMinVersion;
Tao Baod7db5942015-01-28 10:07:51 -0800305 __u8 bMaxVersion;
Ben Cheng655a7c02013-10-16 16:09:24 -0700306} __attribute__((__packed__));
307struct uvc_format_uncompressed {
Christopher Ferris106b3a82016-08-24 12:15:38 -0700308 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800309 __u8 bDescriptorType;
310 __u8 bDescriptorSubType;
311 __u8 bFormatIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700312 __u8 bNumFrameDescriptors;
Tao Baod7db5942015-01-28 10:07:51 -0800313 __u8 guidFormat[16];
314 __u8 bBitsPerPixel;
315 __u8 bDefaultFrameIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700316 __u8 bAspectRatioX;
Tao Baod7db5942015-01-28 10:07:51 -0800317 __u8 bAspectRatioY;
318 __u8 bmInterfaceFlags;
319 __u8 bCopyProtect;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700320} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700321#define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
322struct uvc_frame_uncompressed {
Tao Baod7db5942015-01-28 10:07:51 -0800323 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700324 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800325 __u8 bDescriptorSubType;
326 __u8 bFrameIndex;
327 __u8 bmCapabilities;
Christopher Ferris86a48372019-01-10 14:14:59 -0800328 __le16 wWidth;
329 __le16 wHeight;
330 __le32 dwMinBitRate;
331 __le32 dwMaxBitRate;
332 __le32 dwMaxVideoFrameBufferSize;
333 __le32 dwDefaultFrameInterval;
Tao Baod7db5942015-01-28 10:07:51 -0800334 __u8 bFrameIntervalType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800335 __le32 dwFrameInterval[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700336} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800337#define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26 + 4 * (n))
338#define UVC_FRAME_UNCOMPRESSED(n) uvc_frame_uncompressed_ ##n
Christopher Ferris86a48372019-01-10 14:14:59 -0800339#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 -0800340} __attribute__((packed))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700341struct uvc_format_mjpeg {
Tao Baod7db5942015-01-28 10:07:51 -0800342 __u8 bLength;
343 __u8 bDescriptorType;
344 __u8 bDescriptorSubType;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700345 __u8 bFormatIndex;
Tao Baod7db5942015-01-28 10:07:51 -0800346 __u8 bNumFrameDescriptors;
347 __u8 bmFlags;
348 __u8 bDefaultFrameIndex;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700349 __u8 bAspectRatioX;
Tao Baod7db5942015-01-28 10:07:51 -0800350 __u8 bAspectRatioY;
351 __u8 bmInterfaceFlags;
352 __u8 bCopyProtect;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700353} __attribute__((__packed__));
Ben Cheng655a7c02013-10-16 16:09:24 -0700354#define UVC_DT_FORMAT_MJPEG_SIZE 11
355struct uvc_frame_mjpeg {
Tao Baod7db5942015-01-28 10:07:51 -0800356 __u8 bLength;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700357 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800358 __u8 bDescriptorSubType;
359 __u8 bFrameIndex;
360 __u8 bmCapabilities;
Christopher Ferris86a48372019-01-10 14:14:59 -0800361 __le16 wWidth;
362 __le16 wHeight;
363 __le32 dwMinBitRate;
364 __le32 dwMaxBitRate;
365 __le32 dwMaxVideoFrameBufferSize;
366 __le32 dwDefaultFrameInterval;
Tao Baod7db5942015-01-28 10:07:51 -0800367 __u8 bFrameIntervalType;
Christopher Ferris86a48372019-01-10 14:14:59 -0800368 __le32 dwFrameInterval[];
Christopher Ferris106b3a82016-08-24 12:15:38 -0700369} __attribute__((__packed__));
Tao Baod7db5942015-01-28 10:07:51 -0800370#define UVC_DT_FRAME_MJPEG_SIZE(n) (26 + 4 * (n))
371#define UVC_FRAME_MJPEG(n) uvc_frame_mjpeg_ ##n
Christopher Ferris86a48372019-01-10 14:14:59 -0800372#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 -0800373} __attribute__((packed))
Christopher Ferris106b3a82016-08-24 12:15:38 -0700374#endif