2 * Copyright 2016, Adrien Destugues, pulkomandy@pulkomandy.tk
3 * Distributed under terms of the MIT license.
11 // Based on specification for UVC version 1.5.
14 #include <SupportDefs.h>
17 #define USB_VIDEO_DEVICE_CLASS 0x0E
19 enum { // Video Interface Subclasses
20 USB_VIDEO_INTERFACE_UNDEFINED_SUBCLASS
= 0x00,
21 USB_VIDEO_INTERFACE_VIDEOCONTROL_SUBCLASS
= 0x01,
22 USB_VIDEO_INTERFACE_VIDEOSTREAMING_SUBCLASS
,
23 USB_VIDEO_INTERFACE_COLLECTION_SUBCLASS
,
27 enum { // Video Interface Protocol Codes
28 USB_VIDEO_PROTOCOL_UNDEFINED
= 0x00,
29 USB_VIDEO_PROTOCOL_15
= 0x01,
33 enum { // Video Interface Class-Specific Descriptor Types
34 USB_VIDEO_CS_UNDEFINED
= 0x20,
35 USB_VIDEO_CS_DEVICE
= 0x21,
36 USB_VIDEO_CS_CONFIGURATION
= 0x22,
37 USB_VIDEO_CS_STRING
= 0x23,
38 USB_VIDEO_CS_INTERFACE
= 0x24,
39 USB_VIDEO_CS_ENDPOINT
= 0x25,
43 enum { // Video Class-Specific VideoControl Interface descriptor subtypes
44 USB_VIDEO_VC_DESCRIPTOR_UNDEFINED
= 0x00,
45 USB_VIDEO_VC_HEADER
= 0x01,
46 USB_VIDEO_VC_INPUT_TERMINAL
= 0x02,
47 USB_VIDEO_VC_OUTPUT_TERMINAL
= 0x03,
48 USB_VIDEO_VC_SELECTOR_UNIT
= 0x04,
49 USB_VIDEO_VC_PROCESSING_UNIT
= 0x05,
50 USB_VIDEO_VC_EXTENSION_UNIT
= 0x06,
51 USB_VIDEO_VC_ENCODING_UNIT
= 0x07,
55 enum { // Video Class-Specific VideoStreaming Interface descriptor subtypes
56 USB_VIDEO_VS_UNDEFINED
= 0x00,
57 USB_VIDEO_VS_INPUT_HEADER
= 0x01,
58 USB_VIDEO_VS_OUTPUT_HEADER
= 0x02,
59 USB_VIDEO_VS_STILL_IMAGE_FRAME
= 0x03,
60 USB_VIDEO_VS_FORMAT_UNCOMPRESSED
= 0x04,
61 USB_VIDEO_VS_FRAME_UNCOMPRESSED
= 0x05,
62 USB_VIDEO_VS_FORMAT_MJPEG
= 0x06,
63 USB_VIDEO_VS_FRAME_MJPEG
= 0x07,
64 USB_VIDEO_VS_FORMAT_MPEG2TS
= 0x0a,
65 USB_VIDEO_VS_FORMAT_DV
= 0x0c,
66 USB_VIDEO_VS_COLORFORMAT
= 0x0d,
67 USB_VIDEO_VS_FORMAT_FRAME_BASED
= 0x10,
68 USB_VIDEO_VS_FRAME_FRAME_BASED
= 0x11,
69 USB_VIDEO_VS_FORMAT_STREAM_BASED
= 0x12,
70 USB_VIDEO_VS_FORMAT_H264
= 0x13,
71 USB_VIDEO_VS_FRAME_H264
= 0x14,
72 USB_VIDEO_VS_FORMAT_H264_SIMULCAST
= 0x15,
73 USB_VIDEO_VS_FORMAT_VP8
= 0x16,
74 USB_VIDEO_VS_FRAME_VP8
= 0x17,
75 USB_VIDEO_VS_FORMAT_VP8_SIMULCAST
= 0x18,
81 USB_VIDEO_VENDOR_USB_IO
= 0x100,
82 USB_VIDEO_STREAMING_USB_IO
= 0x101,
83 // Input terminal types
84 USB_VIDEO_VENDOR_IN
= 0x200,
85 USB_VIDEO_CAMERA_IN
= 0x201,
86 USB_VIDEO_MEDIA_TRANSPORT_IN
= 0x202,
87 // Output terminal types
88 USB_VIDEO_VENDOR_OUT
= 0x300,
89 USB_VIDEO_DISPLAY_OUT
= 0x301,
90 USB_VIDEO_MEDIA_TRANSPORT_OUT
= 0x302,
91 // External terminal types
92 USB_VIDEO_VENDOR_EXT
= 0x400,
93 USB_VIDEO_COMPOSITE_EXT
= 0x401,
94 USB_VIDEO_SVIDEO_EXT
= 0x402,
95 USB_VIDEO_COMPONENT_EXT
= 0x403,
100 EP_SUBTYPE_UNDEFINED
= 0x00,
101 EP_SUBTYPE_GENERAL
= 0x01,
102 EP_SUBTYPE_ENDPOINT
= 0x02,
103 EP_SUBTYPE_INTERRUPT
= 0x03,
107 // Class Specific Video Control Interface Header
108 // 1.5: Table 3-3 p.48
111 uint8 descriptor_type
; // USB_AUDIO_CS_INTERFACE
112 uint8 descriptor_subtype
; // USB_AUDIO_AC_HEADER
113 uint16 bcd_release_no
;
115 uint32 clock_frequency
;
117 uint8 interface_numbers
[0];
118 } _PACKED usb_videocontrol_header_descriptor
;
121 // Input Terminal Descriptor
122 // 1.5: Table 3-4, page 50
125 uint8 descriptor_type
; // USB_VIDEO_CS_INTERFACE
126 uint8 descriptor_subtype
; // USB_VIDEO_VC_INPUT_TERMINAL
128 uint16 terminal_type
;
129 uint8 assoc_terminal
;
134 uint16 focal_length_min
;
135 uint16 focal_length_max
;
141 } _PACKED usb_video_input_terminal_descriptor
;
144 // Output terminal descriptor
145 // 1.5: Table 3-5, page 51
148 uint8 descriptor_type
; // USB_VIDEO_CS_INTERFACE
149 uint8 descriptor_subtype
; // USB_VIDEO_VC_OUTPUT_TERMINAL
151 uint16 terminal_type
;
152 uint8 assoc_terminal
;
155 } _PACKED usb_video_output_terminal_descriptor
;
158 // Processing unit descriptor
159 // 1.5: Table 3-8, page 54
162 uint8 descriptor_type
;
163 uint8 descriptor_subtype
;
166 uint16 max_multiplier
;
170 uint8 video_standards
;
171 } _PACKED usb_video_processing_unit_descriptor
;
174 struct usb_video_frame_descriptor
{
176 uint8 descriptor_type
;
177 uint8 descriptor_subtype
;
184 uint32 max_video_frame_buffer_size
;
185 uint32 default_frame_interval
;
186 uint8 frame_interval_type
;
189 uint32 min_frame_interval
;
190 uint32 max_frame_tnterval
;
191 uint32 frame_interval_step
;
193 uint32 discrete_frame_intervals
[0];
198 #endif /* !USB_VIDEO_H */