Go to the documentation of this file.
14 #ifndef __LINUX_USB_VIDEO_H
15 #define __LINUX_USB_VIDEO_H
17 #include <linux/types.h>
24 #define UVC_SC_UNDEFINED 0x00
25 #define UVC_SC_VIDEOCONTROL 0x01
26 #define UVC_SC_VIDEOSTREAMING 0x02
27 #define UVC_SC_VIDEO_INTERFACE_COLLECTION 0x03
30 #define UVC_PC_PROTOCOL_UNDEFINED 0x00
33 #define UVC_VC_DESCRIPTOR_UNDEFINED 0x00
34 #define UVC_VC_HEADER 0x01
35 #define UVC_VC_INPUT_TERMINAL 0x02
36 #define UVC_VC_OUTPUT_TERMINAL 0x03
37 #define UVC_VC_SELECTOR_UNIT 0x04
38 #define UVC_VC_PROCESSING_UNIT 0x05
39 #define UVC_VC_EXTENSION_UNIT 0x06
42 #define UVC_VS_UNDEFINED 0x00
43 #define UVC_VS_INPUT_HEADER 0x01
44 #define UVC_VS_OUTPUT_HEADER 0x02
45 #define UVC_VS_STILL_IMAGE_FRAME 0x03
46 #define UVC_VS_FORMAT_UNCOMPRESSED 0x04
47 #define UVC_VS_FRAME_UNCOMPRESSED 0x05
48 #define UVC_VS_FORMAT_MJPEG 0x06
49 #define UVC_VS_FRAME_MJPEG 0x07
50 #define UVC_VS_FORMAT_MPEG2TS 0x0a
51 #define UVC_VS_FORMAT_DV 0x0c
52 #define UVC_VS_COLORFORMAT 0x0d
53 #define UVC_VS_FORMAT_FRAME_BASED 0x10
54 #define UVC_VS_FRAME_FRAME_BASED 0x11
55 #define UVC_VS_FORMAT_STREAM_BASED 0x12
58 #define UVC_EP_UNDEFINED 0x00
59 #define UVC_EP_GENERAL 0x01
60 #define UVC_EP_ENDPOINT 0x02
61 #define UVC_EP_INTERRUPT 0x03
64 #define UVC_RC_UNDEFINED 0x00
65 #define UVC_SET_CUR 0x01
66 #define UVC_GET_CUR 0x81
67 #define UVC_GET_MIN 0x82
68 #define UVC_GET_MAX 0x83
69 #define UVC_GET_RES 0x84
70 #define UVC_GET_LEN 0x85
71 #define UVC_GET_INFO 0x86
72 #define UVC_GET_DEF 0x87
75 #define UVC_VC_CONTROL_UNDEFINED 0x00
76 #define UVC_VC_VIDEO_POWER_MODE_CONTROL 0x01
77 #define UVC_VC_REQUEST_ERROR_CODE_CONTROL 0x02
80 #define UVC_TE_CONTROL_UNDEFINED 0x00
83 #define UVC_SU_CONTROL_UNDEFINED 0x00
84 #define UVC_SU_INPUT_SELECT_CONTROL 0x01
87 #define UVC_CT_CONTROL_UNDEFINED 0x00
88 #define UVC_CT_SCANNING_MODE_CONTROL 0x01
89 #define UVC_CT_AE_MODE_CONTROL 0x02
90 #define UVC_CT_AE_PRIORITY_CONTROL 0x03
91 #define UVC_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
92 #define UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
93 #define UVC_CT_FOCUS_ABSOLUTE_CONTROL 0x06
94 #define UVC_CT_FOCUS_RELATIVE_CONTROL 0x07
95 #define UVC_CT_FOCUS_AUTO_CONTROL 0x08
96 #define UVC_CT_IRIS_ABSOLUTE_CONTROL 0x09
97 #define UVC_CT_IRIS_RELATIVE_CONTROL 0x0a
98 #define UVC_CT_ZOOM_ABSOLUTE_CONTROL 0x0b
99 #define UVC_CT_ZOOM_RELATIVE_CONTROL 0x0c
100 #define UVC_CT_PANTILT_ABSOLUTE_CONTROL 0x0d
101 #define UVC_CT_PANTILT_RELATIVE_CONTROL 0x0e
102 #define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
103 #define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
104 #define UVC_CT_PRIVACY_CONTROL 0x11
107 #define UVC_PU_CONTROL_UNDEFINED 0x00
108 #define UVC_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
109 #define UVC_PU_BRIGHTNESS_CONTROL 0x02
110 #define UVC_PU_CONTRAST_CONTROL 0x03
111 #define UVC_PU_GAIN_CONTROL 0x04
112 #define UVC_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
113 #define UVC_PU_HUE_CONTROL 0x06
114 #define UVC_PU_SATURATION_CONTROL 0x07
115 #define UVC_PU_SHARPNESS_CONTROL 0x08
116 #define UVC_PU_GAMMA_CONTROL 0x09
117 #define UVC_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0a
118 #define UVC_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0b
119 #define UVC_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0c
120 #define UVC_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0d
121 #define UVC_PU_DIGITAL_MULTIPLIER_CONTROL 0x0e
122 #define UVC_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0f
123 #define UVC_PU_HUE_AUTO_CONTROL 0x10
124 #define UVC_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
125 #define UVC_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
128 #define UVC_VS_CONTROL_UNDEFINED 0x00
129 #define UVC_VS_PROBE_CONTROL 0x01
130 #define UVC_VS_COMMIT_CONTROL 0x02
131 #define UVC_VS_STILL_PROBE_CONTROL 0x03
132 #define UVC_VS_STILL_COMMIT_CONTROL 0x04
133 #define UVC_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
134 #define UVC_VS_STREAM_ERROR_CODE_CONTROL 0x06
135 #define UVC_VS_GENERATE_KEY_FRAME_CONTROL 0x07
136 #define UVC_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
137 #define UVC_VS_SYNC_DELAY_CONTROL 0x09
140 #define UVC_TT_VENDOR_SPECIFIC 0x0100
141 #define UVC_TT_STREAMING 0x0101
144 #define UVC_ITT_VENDOR_SPECIFIC 0x0200
145 #define UVC_ITT_CAMERA 0x0201
146 #define UVC_ITT_MEDIA_TRANSPORT_INPUT 0x0202
149 #define UVC_OTT_VENDOR_SPECIFIC 0x0300
150 #define UVC_OTT_DISPLAY 0x0301
151 #define UVC_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
154 #define UVC_EXTERNAL_VENDOR_SPECIFIC 0x0400
155 #define UVC_COMPOSITE_CONNECTOR 0x0401
156 #define UVC_SVIDEO_CONNECTOR 0x0402
157 #define UVC_COMPONENT_CONNECTOR 0x0403
160 #define UVC_STATUS_TYPE_CONTROL 1
161 #define UVC_STATUS_TYPE_STREAMING 2
164 #define UVC_STREAM_EOH (1 << 7)
165 #define UVC_STREAM_ERR (1 << 6)
166 #define UVC_STREAM_STI (1 << 5)
167 #define UVC_STREAM_RES (1 << 4)
168 #define UVC_STREAM_SCR (1 << 3)
169 #define UVC_STREAM_PTS (1 << 2)
170 #define UVC_STREAM_EOF (1 << 1)
171 #define UVC_STREAM_FID (1 << 0)
174 #define UVC_CONTROL_CAP_GET (1 << 0)
175 #define UVC_CONTROL_CAP_SET (1 << 1)
176 #define UVC_CONTROL_CAP_DISABLED (1 << 2)
177 #define UVC_CONTROL_CAP_AUTOUPDATE (1 << 3)
178 #define UVC_CONTROL_CAP_ASYNCHRONOUS (1 << 4)
203 #define UVC_DT_HEADER_SIZE(n) (12+(n))
205 #define UVC_HEADER_DESCRIPTOR(n) \
206 uvc_header_descriptor_##n
208 #define DECLARE_UVC_HEADER_DESCRIPTOR(n) \
209 struct UVC_HEADER_DESCRIPTOR(n) { \
211 __u8 bDescriptorType; \
212 __u8 bDescriptorSubType; \
214 __u16 wTotalLength; \
215 __u32 dwClockFrequency; \
216 __u8 bInCollection; \
217 __u8 baInterfaceNr[n]; \
218 } __attribute__ ((packed))
231 #define UVC_DT_INPUT_TERMINAL_SIZE 8
245 #define UVC_DT_OUTPUT_TERMINAL_SIZE 9
263 #define UVC_DT_CAMERA_TERMINAL_SIZE(n) (15+(n))
276 #define UVC_DT_SELECTOR_UNIT_SIZE(n) (6+(n))
278 #define UVC_SELECTOR_UNIT_DESCRIPTOR(n) \
279 uvc_selector_unit_descriptor_##n
281 #define DECLARE_UVC_SELECTOR_UNIT_DESCRIPTOR(n) \
282 struct UVC_SELECTOR_UNIT_DESCRIPTOR(n) { \
284 __u8 bDescriptorType; \
285 __u8 bDescriptorSubType; \
288 __u8 baSourceID[n]; \
290 } __attribute__ ((packed))
305 #define UVC_DT_PROCESSING_UNIT_SIZE(n) (9+(n))
322 #define UVC_DT_EXTENSION_UNIT_SIZE(p, n) (24+(p)+(n))
324 #define UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
325 uvc_extension_unit_descriptor_##p_##n
327 #define DECLARE_UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) \
328 struct UVC_EXTENSION_UNIT_DESCRIPTOR(p, n) { \
330 __u8 bDescriptorType; \
331 __u8 bDescriptorSubType; \
333 __u8 guidExtensionCode[16]; \
336 __u8 baSourceID[p]; \
338 __u8 bmControls[n]; \
340 } __attribute__ ((packed))
350 #define UVC_DT_CONTROL_ENDPOINT_SIZE 5
369 #define UVC_DT_INPUT_HEADER_SIZE(n, p) (13+(n*p))
371 #define UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
372 uvc_input_header_descriptor_##n_##p
374 #define DECLARE_UVC_INPUT_HEADER_DESCRIPTOR(n, p) \
375 struct UVC_INPUT_HEADER_DESCRIPTOR(n, p) { \
377 __u8 bDescriptorType; \
378 __u8 bDescriptorSubType; \
380 __u16 wTotalLength; \
381 __u8 bEndpointAddress; \
383 __u8 bTerminalLink; \
384 __u8 bStillCaptureMethod; \
385 __u8 bTriggerSupport; \
386 __u8 bTriggerUsage; \
388 __u8 bmaControls[p][n]; \
389 } __attribute__ ((packed))
404 #define UVC_DT_OUTPUT_HEADER_SIZE(n, p) (9+(n*p))
406 #define UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
407 uvc_output_header_descriptor_##n_##p
409 #define DECLARE_UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) \
410 struct UVC_OUTPUT_HEADER_DESCRIPTOR(n, p) { \
412 __u8 bDescriptorType; \
413 __u8 bDescriptorSubType; \
415 __u16 wTotalLength; \
416 __u8 bEndpointAddress; \
417 __u8 bTerminalLink; \
419 __u8 bmaControls[p][n]; \
420 } __attribute__ ((packed))
432 #define UVC_DT_COLOR_MATCHING_SIZE 6
470 #define UVC_DT_FORMAT_UNCOMPRESSED_SIZE 27
489 #define UVC_DT_FRAME_UNCOMPRESSED_SIZE(n) (26+4*(n))
491 #define UVC_FRAME_UNCOMPRESSED(n) \
492 uvc_frame_uncompressed_##n
494 #define DECLARE_UVC_FRAME_UNCOMPRESSED(n) \
495 struct UVC_FRAME_UNCOMPRESSED(n) { \
497 __u8 bDescriptorType; \
498 __u8 bDescriptorSubType; \
500 __u8 bmCapabilities; \
503 __u32 dwMinBitRate; \
504 __u32 dwMaxBitRate; \
505 __u32 dwMaxVideoFrameBufferSize; \
506 __u32 dwDefaultFrameInterval; \
507 __u8 bFrameIntervalType; \
508 __u32 dwFrameInterval[n]; \
509 } __attribute__ ((packed))
526 #define UVC_DT_FORMAT_MJPEG_SIZE 11
545 #define UVC_DT_FRAME_MJPEG_SIZE(n) (26+4*(n))
547 #define UVC_FRAME_MJPEG(n) \
550 #define DECLARE_UVC_FRAME_MJPEG(n) \
551 struct UVC_FRAME_MJPEG(n) { \
553 __u8 bDescriptorType; \
554 __u8 bDescriptorSubType; \
556 __u8 bmCapabilities; \
559 __u32 dwMinBitRate; \
560 __u32 dwMaxBitRate; \
561 __u32 dwMaxVideoFrameBufferSize; \
562 __u32 dwDefaultFrameInterval; \
563 __u8 bFrameIntervalType; \
564 __u32 dwFrameInterval[n]; \
565 } __attribute__ ((packed))