1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** USBX Component                                                        */
17 /**                                                                       */
18 /**   Video Class                                                         */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  COMPONENT DEFINITION                                   RELEASE        */
27 /*                                                                        */
28 /*    ux_device_class_video.h                             PORTABLE C      */
29 /*                                                           6.2.0        */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Chaoqiong Xiao, Microsoft Corporation                               */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file contains all the header and extern functions used by the  */
37 /*    USBX device video class.                                            */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  04-25-2022     Chaoqiong Xiao           Initial Version 6.1.11        */
44 /*  10-31-2022     Chaoqiong Xiao           Modified comment(s),          */
45 /*                                            added standalone support,   */
46 /*                                            resulting in version 6.2.0  */
47 /*                                                                        */
48 /**************************************************************************/
49 
50 #ifndef UX_DEVICE_CLASS_VIDEO_H
51 #define UX_DEVICE_CLASS_VIDEO_H
52 
53 /* Determine if a C++ compiler is being used.  If so, ensure that standard
54    C is used to process the API information.  */
55 
56 #ifdef   __cplusplus
57 
58 /* Yes, C++ compiler is present.  Use standard C.  */
59 extern   "C" {
60 
61 #endif
62 
63 /* Define options.  */
64 
65 #define UX_DEVICE_CLASS_VIDEO_THREAD_STACK_SIZE                                              UX_THREAD_STACK_SIZE
66 
67 /* Define external static data.  */
68 
69 extern UCHAR _ux_system_device_class_video_name[];
70 
71 
72 /* Define IOCTL code.
73      ux_device_class_video_ioctl(video, IOCTL_CODE, parameter).
74  */
75 
76 #define UX_DEVICE_CLASS_VIDEO_IOCTL_GET_ARG                                                  0x01
77 
78 
79 /* Define Video Class main constants.  */
80 
81 #define UX_DEVICE_CLASS_VIDEO_CLASS                                                          0x0e
82 #define UX_DEVICE_CLASS_VIDEO_SUBCLASS_UNDEFINED                                             0
83 #define UX_DEVICE_CLASS_VIDEO_SUBCLASS_CONTROL                                               1
84 #define UX_DEVICE_CLASS_VIDEO_SUBCLASS_STREAMING                                             2
85 #define UX_DEVICE_CLASS_VIDEO_SUBCLASS_INTERFACE_COLLECTION                                  3
86 
87 /* Class Code (CC).  */
88 #define UX_DEVICE_CLASS_VIDEO_CC_VIDEO                                                       0x0e
89 
90 /* Subclass Code (SC).  */
91 #define UX_DEVICE_CLASS_VIDEO_SC_UNDEFINED                                                   0
92 #define UX_DEVICE_CLASS_VIDEO_SC_CONTROL                                                     1
93 #define UX_DEVICE_CLASS_VIDEO_SC_STREAMING                                                   2
94 #define UX_DEVICE_CLASS_VIDEO_SC_INTERFACE_COLLECTION                                        3
95 
96 /* Protocol Code.  */
97 #define UX_DEVICE_CLASS_VIDEO_PC_PROTOCOL_UNDEFINED                                          0
98 #define UX_DEVICE_CLASS_VIDEO_PC_PROTOCOL_15                                                 0
99 
100 
101 /* Define Video Class-Specific (CS) descriptor types.  */
102 #define UX_DEVICE_CLASS_VIDEO_CS_UNDEFINED                                                   0x20
103 #define UX_DEVICE_CLASS_VIDEO_CS_DEVICE                                                      0x21
104 #define UX_DEVICE_CLASS_VIDEO_CS_CONFIGURATION                                               0x22
105 #define UX_DEVICE_CLASS_VIDEO_CS_STRING                                                      0x23
106 #define UX_DEVICE_CLASS_VIDEO_CS_INTERFACE                                                   0x24
107 #define UX_DEVICE_CLASS_VIDEO_CS_ENDPOINT                                                    0x25
108 
109 
110 /* Define Video Class specific Video Control (VC) interface descriptor subtypes.  */
111 #define UX_DEVICE_CLASS_VIDEO_VC_DESCRIPTOR_UNDEFINED                                        0x00
112 #define UX_DEVICE_CLASS_VIDEO_VC_HEADER                                                      0x01
113 #define UX_DEVICE_CLASS_VIDEO_VC_INPUT_TERMINAL                                              0x02
114 #define UX_DEVICE_CLASS_VIDEO_VC_OUTPUT_TERMINAL                                             0x03
115 #define UX_DEVICE_CLASS_VIDEO_VC_SELECTOR_UNIT                                               0x04
116 #define UX_DEVICE_CLASS_VIDEO_VC_PROCESSING_UNIT                                             0x05
117 #define UX_DEVICE_CLASS_VIDEO_VC_EXTENSION_UNIT                                              0x06
118 #define UX_DEVICE_CLASS_VIDEO_VC_ENCODING_UNIT                                               0x07
119 
120 
121 /* Define Video Class specific Video Stream (VS) interface descriptor subtypes.  */
122 #define UX_DEVICE_CLASS_VIDEO_VS_UNDEFINED                                                   0x00
123 #define UX_DEVICE_CLASS_VIDEO_VS_INPUT_HEADER                                                0x01
124 #define UX_DEVICE_CLASS_VIDEO_VS_OUTPUT_HEADER                                               0x02
125 #define UX_DEVICE_CLASS_VIDEO_VS_STILL_IMAGE_FRAME                                           0x03
126 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_UNCOMPRESSED                                         0x04
127 #define UX_DEVICE_CLASS_VIDEO_VS_FRAME_UNCOMPRESSED                                          0x05
128 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_MJPEG                                                0x06
129 #define UX_DEVICE_CLASS_VIDEO_VS_FRAME_MJPEG                                                 0x07
130 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_MPEG2TS                                              0x0A
131 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_DV                                                   0x0C
132 #define UX_DEVICE_CLASS_VIDEO_VS_COLORFORMAT                                                 0x0D
133 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_FRAME_BASED                                          0x10
134 #define UX_DEVICE_CLASS_VIDEO_VS_FRAME_FRAME_BASED                                           0x11
135 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_STREAM_BASED                                         0x12
136 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_H264                                                 0x13
137 #define UX_DEVICE_CLASS_VIDEO_VS_FRAME_H264                                                  0x14
138 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_H264_SIMULCAST                                       0x15
139 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_VP8                                                  0x16
140 #define UX_DEVICE_CLASS_VIDEO_VS_FRAME_VP8                                                   0x17
141 #define UX_DEVICE_CLASS_VIDEO_VS_FORMAT_VP8_SIMULCAST                                        0x18
142 
143 
144 /* Define Video Class specific Endpoint (EP) descriptor subtypes.  */
145 #define UX_DEVICE_CLASS_VIDEO_EP_UNDEFINED                                                   0x00
146 #define UX_DEVICE_CLASS_VIDEO_EP_GENERAL                                                     0x01
147 #define UX_DEVICE_CLASS_VIDEO_EP_ENDPOINT                                                    0x02
148 #define UX_DEVICE_CLASS_VIDEO_EP_INTERRUPT                                                   0x03
149 
150 
151 /* Define Video Control Selector Codes.  */
152 
153 /* Define VideoControl (VC) Interface Control Selector Codes.  */
154 #define UX_DEVICE_CLASS_VIDEO_VC_CONTROL_UNDEFINED                                           0x00
155 #define UX_DEVICE_CLASS_VIDEO_VC_VIDEO_POWER_MODE_CONTROL                                    0x01
156 #define UX_DEVICE_CLASS_VIDEO_VC_REQUEST_ERROR_CODE_CONTROL                                  0x02
157 
158 /* Define Terminal Control (TE) Selectors.  */
159 #define UX_DEVICE_CLASS_VIDEO_TE_CONTROL_UNDEFINED                                           0x00
160 
161 /* Define Selector Unit (SU) Control Selectors.  */
162 #define UX_DEVICE_CLASS_VIDEO_SU_CONTROL_UNDEFINED                                           0x00
163 #define UX_DEVICE_CLASS_VIDEO_SU_INPUT_SELECT_CONTROL                                        0x01
164 
165 /* Define Camera Terminal (CT) Control Selectors.  */
166 #define UX_DEVICE_CLASS_VIDEO_CT_CONTROL_UNDEFINED                                           0x00
167 #define UX_DEVICE_CLASS_VIDEO_CT_SCANNING_MODE_CONTROL                                       0x01
168 #define UX_DEVICE_CLASS_VIDEO_CT_AE_MODE_CONTROL                                             0x02
169 #define UX_DEVICE_CLASS_VIDEO_CT_AE_PRIORITY_CONTROL                                         0x03
170 #define UX_DEVICE_CLASS_VIDEO_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL                              0x04
171 #define UX_DEVICE_CLASS_VIDEO_CT_EXPOSURE_TIME_RELATIVE_CONTROL                              0x05
172 #define UX_DEVICE_CLASS_VIDEO_CT_FOCUS_ABSOLUTE_CONTROL                                      0x06
173 #define UX_DEVICE_CLASS_VIDEO_CT_FOCUS_RELATIVE_CONTROL                                      0x07
174 #define UX_DEVICE_CLASS_VIDEO_CT_FOCUS_AUTO_CONTROL                                          0x08
175 #define UX_DEVICE_CLASS_VIDEO_CT_IRIS_ABSOLUTE_CONTROL                                       0x09
176 #define UX_DEVICE_CLASS_VIDEO_CT_IRIS_RELATIVE_CONTROL                                       0x0A
177 #define UX_DEVICE_CLASS_VIDEO_CT_ZOOM_ABSOLUTE_CONTROL                                       0x0B
178 #define UX_DEVICE_CLASS_VIDEO_CT_ZOOM_RELATIVE_CONTROL                                       0x0C
179 #define UX_DEVICE_CLASS_VIDEO_CT_PANTILT_ABSOLUTE_CONTROL                                    0x0D
180 #define UX_DEVICE_CLASS_VIDEO_CT_PANTILT_RELATIVE_CONTROL                                    0x0E
181 #define UX_DEVICE_CLASS_VIDEO_CT_ROLL_ABSOLUTE_CONTROL                                       0x0F
182 #define UX_DEVICE_CLASS_VIDEO_CT_ROLL_RELATIVE_CONTROL                                       0x10
183 #define UX_DEVICE_CLASS_VIDEO_CT_PRIVACY_CONTROL                                             0x11
184 #define UX_DEVICE_CLASS_VIDEO_CT_FOCUS_SIMPLE_CONTROL                                        0x12
185 #define UX_DEVICE_CLASS_VIDEO_CT_WINDOW_CONTROL                                              0x13
186 #define UX_DEVICE_CLASS_VIDEO_CT_REGION_OF_INTEREST_CONTROL                                  0x14
187 
188 /* Define Processing Unit (PU) Control Selectors.  */
189 #define UX_DEVICE_CLASS_VIDEO_PU_CONTROL_UNDEFINED                                           0x00
190 #define UX_DEVICE_CLASS_VIDEO_PU_BACKLIGHT_COMPENSATION_CONTROL                              0x01
191 #define UX_DEVICE_CLASS_VIDEO_PU_BRIGHTNESS_CONTROL                                          0x02
192 #define UX_DEVICE_CLASS_VIDEO_PU_CONTRAST_CONTROL                                            0x03
193 #define UX_DEVICE_CLASS_VIDEO_PU_GAIN_CONTROL                                                0x04
194 #define UX_DEVICE_CLASS_VIDEO_PU_POWER_LINE_FREQUENCY_CONTROL                                0x05
195 #define UX_DEVICE_CLASS_VIDEO_PU_HUE_CONTROL                                                 0x06
196 #define UX_DEVICE_CLASS_VIDEO_PU_SATURATION_CONTROL                                          0x07
197 #define UX_DEVICE_CLASS_VIDEO_PU_SHARPNESS_CONTROL                                           0x08
198 #define UX_DEVICE_CLASS_VIDEO_PU_GAMMA_CONTROL                                               0x09
199 #define UX_DEVICE_CLASS_VIDEO_PU_WHITE_BALANCE_TEMPERATURE_CONTROL                           0x0A
200 #define UX_DEVICE_CLASS_VIDEO_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL                      0x0B
201 #define UX_DEVICE_CLASS_VIDEO_PU_WHITE_BALANCE_COMPONENT_CONTROL                             0x0C
202 #define UX_DEVICE_CLASS_VIDEO_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL                        0x0D
203 #define UX_DEVICE_CLASS_VIDEO_PU_DIGITAL_MULTIPLIER_CONTROL                                  0x0E
204 #define UX_DEVICE_CLASS_VIDEO_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL                            0x0F
205 #define UX_DEVICE_CLASS_VIDEO_PU_HUE_AUTO_CONTROL                                            0x10
206 #define UX_DEVICE_CLASS_VIDEO_PU_ANALOG_VIDEO_STANDARD_CONTROL                               0x11
207 #define UX_DEVICE_CLASS_VIDEO_PU_ANALOG_LOCK_STATUS_CONTROL                                  0x12
208 #define UX_DEVICE_CLASS_VIDEO_PU_CONTRAST_AUTO_CONTROL                                       0x13
209 
210 /* Define eXtension Unit (XU) Control Selectors.  */
211 #define UX_DEVICE_CLASS_VIDEO_XU_CONTROL_UNDEFINED                                           0x00
212 
213 /* Define VideoStreaming (VS) Interface Control Selectors.  */
214 #define UX_DEVICE_CLASS_VIDEO_VS_CONTROL_UNDEFINED                                           0x00
215 #define UX_DEVICE_CLASS_VIDEO_VS_PROBE_CONTROL                                               0x01
216 #define UX_DEVICE_CLASS_VIDEO_VS_COMMIT_CONTROL                                              0x02
217 #define UX_DEVICE_CLASS_VIDEO_VS_STILL_PROBE_CONTROL                                         0x03
218 #define UX_DEVICE_CLASS_VIDEO_VS_STILL_COMMIT_CONTROL                                        0x04
219 #define UX_DEVICE_CLASS_VIDEO_VS_STILL_IMAGE_TRIGGER_CONTROL                                 0x05
220 #define UX_DEVICE_CLASS_VIDEO_VS_STREAM_ERROR_CODE_CONTROL                                   0x06
221 #define UX_DEVICE_CLASS_VIDEO_VS_GENERATE_KEY_FRAME_CONTROL                                  0x07
222 #define UX_DEVICE_CLASS_VIDEO_VS_UPDATE_FRAME_SEGMENT_CONTROL                                0x08
223 #define UX_DEVICE_CLASS_VIDEO_VS_SYNCH_DELAY_CONTROL                                         0x09
224 
225 
226 /* Define USB Video Class terminal types.  */
227 
228 /* Define USB Terminal Types (TT).  */
229 #define UX_DEVICE_CLASS_VIDEO_TT_VENDOR_SPECIFIC                                             0x0100
230 #define UX_DEVICE_CLASS_VIDEO_TT_STREAMING                                                   0x0101
231 
232 /* Define USB Input Terminal Types (ITT).  */
233 #define UX_DEVICE_CLASS_VIDEO_ITT_VENDOR_SPECIFIC                                            0x0200
234 #define UX_DEVICE_CLASS_VIDEO_ITT_CAMERA                                                     0x0201
235 #define UX_DEVICE_CLASS_VIDEO_ITT_MEDIA_TRANSPORT_INPUT                                      0x0202
236 
237 /* Define USB Output Terminal Types (OTT).  */
238 #define UX_DEVICE_CLASS_VIDEO_OTT_VENDOR_SPECIFIC                                            0x0300
239 #define UX_DEVICE_CLASS_VIDEO_OTT_DISPLAY                                                    0x0301
240 #define UX_DEVICE_CLASS_VIDEO_OTT_MEDIA_TRANSPORT_OUTPUT                                     0x0302
241 
242 /* Define USB External Terminal Types (XTT).  */
243 #define UX_DEVICE_CLASS_VIDEO_XTT_EXTERNAL_VENDOR_SPECIFIC                                   0x0400
244 #define UX_DEVICE_CLASS_VIDEO_XTT_COMPOSITE_CONNECTOR                                        0x0401
245 #define UX_DEVICE_CLASS_VIDEO_XTT_SVIDEO_CONNECTOR                                           0x0402
246 #define UX_DEVICE_CLASS_VIDEO_XTT_COMPONENT_CONNECTOR                                        0x0403
247 
248 
249 /* Video Class GET_INFO Capabilities and status structs and definitions.  */
250 
251 #define UX_DEVICE_CLASS_VIDEO_INFO_GET_REQUEST_SUPPORT                                       (1u << 0)
252 #define UX_DEVICE_CLASS_VIDEO_INFO_SET_REQUEST_SUPPORT                                       (1u << 1)
253 #define UX_DEVICE_CLASS_VIDEO_INFO_DISABLED_DUE_TO_AUTO_MODE                                 (1u << 2)
254 #define UX_DEVICE_CLASS_VIDEO_INFO_AUTOUPDATE_CONTROL                                        (1u << 3)
255 #define UX_DEVICE_CLASS_VIDEO_INFO_ASYNCHRONOUS_CONTROL                                      (1u << 4)
256 #define UX_DEVICE_CLASS_VIDEO_INFO_DISABLED_DUE_TO_STATE                                     (1u << 5)
257 
258 
259 /* Video Class Probe and Commit Controls structs and definitions.  */
260 typedef struct UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_STRUCT
261 {
262     union UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_bmHint_UNION {
263         USHORT                                  value;
264         struct UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_bmHint_STRUCT {
265             USHORT                              dwFrameInterval:1;
266             USHORT                              wKeyFrameRate:1;
267             USHORT                              wPFrameRate:1;
268             USHORT                              wCompQuality:1;
269             USHORT                              wCompWindowSize:1;
270         }                                       bm;
271     }                                           bmHint;
272     UCHAR                                       bFormatIndex;
273     UCHAR                                       bFrameIndex;
274     ULONG                                       dwFrameInterval;
275     USHORT                                      wKeyFrameRate;
276     USHORT                                      wPFrameRate;
277     USHORT                                      wCompQuality;
278     USHORT                                      wCompWindowSize;
279     USHORT                                      wDelay;
280     UCHAR                                       dwMaxVideoFrameSize[4]; /* Not alignend from now on.  */
281     UCHAR                                       dwMaxPayloadTransferSize[4];
282     UCHAR                                       dwClockFrequency[4];
283     union UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_bmFramingInfo_UNION {
284         UCHAR                                   value;
285         struct UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_bmFramingInfo_STRUCT {
286             UCHAR                               FID_required:1;
287             UCHAR                               EOF_may_present:1;
288             UCHAR                               EOS_may_present:1;
289         }                                       bm;
290     }                                           bmFramingInfo;
291     UCHAR                                       bPreferedVersion;
292     UCHAR                                       bMinVersion;
293     UCHAR                                       bMaxVersion;
294 
295     /* Start from offset 34, additional fields introduced in UVC 1.5.  */
296     UCHAR                                       bUsage;
297     UCHAR                                       bBitDepthLuma;
298     UCHAR                                       bmSettings;
299     UCHAR                                       bMaxNumberOfRefFramesPlus1;
300     union UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_bmRateControlModes_UNION {
301         USHORT                                  value;
302         struct UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_bmRateControlModes_STRUCT {
303             USHORT                              rate_ctrl_mode_0:4;
304             USHORT                              rate_ctrl_mode_1:4;
305             USHORT                              rate_ctrl_mode_2:4;
306             USHORT                              rate_ctrl_mode_3:4;
307         }                                       bm;
308     }                                           bmRateControlModes;
309     UCHAR                                       bmLayoutPerStream;
310 } UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL;
311 
312 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_HINT_OFFSET                      0
313 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_HINT_FRAME_INTERVAL              (1U<<0)
314 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_HINT_KEY_FRAME_RATE              (1U<<1)
315 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_HINT_KEY_P_FRAME_RATE            (1U<<2)
316 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_HINT_COMP_QUALITY                (1U<<3)
317 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_HINT_COMP_WINDOW_SIZE            (1U<<4)
318 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FORMAT_INDEX_OFFSET              2
319 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FRAME_INDEX_OFFSET               3
320 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FRAME_INTERVAL_OFFSET            4
321 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_KEY_FRAME_RATE_OFFSET            8
322 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_P_FRAME_RATE_OFFSET              10
323 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_COMP_QUALITY_OFFSET              12
324 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_COMP_WINDOW_SIZE_OFFSET          14
325 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_DELAY_OFFSET                     16
326 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_MAX_VIDEO_FRAME_SIZE_OFFSET      18
327 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_MAX_PAYLOAD_TRANSFER_SIZE_OFFSET 22
328 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_CLOCK_FREQUENCY_OFFSET           26
329 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FRAMING_INFO_OFFSET              30
330 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FRAMING_INFO_FID_REQUIRED        (1U<<0)
331 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FRAMING_INFO_EOF_MAY_PRESENT     (1U<<1)
332 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_FRAMING_INFO_EOS_MAY_PRESENT     (1U<<2)
333 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_PREFERED_VERSION_OFFSET          31
334 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_MIN_VERSION_OFFSET               32
335 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_MAX_VERSION_OFFSET               33
336 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_USAGE_OFFSET                     34
337 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_BIT_DEPTH_LUMA_OFFSET            35
338 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_SETTINGS_OFFSET                  36
339 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_MAX_N_OF_FRAMES_PLUS1_OFFSET     37
340 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODES_OFFSET        38
341 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_NOT_APPLICABLE             0U
342 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_VBR_WITH_UNDERFLOW         1U
343 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_CBR                        2U
344 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_CONSTANT_QP                3U
345 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_GLOBAL_VBR_WITH_UNDERFLOW  4U
346 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_VBR                        5U
347 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_RATE_CONTROL_MODE_GLOBAL_VBR                 6U
348 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CONTROL_LAYOUT_PER_STREAM_OFFSET         40
349 
350 
351 /* Video Class Still Probe and Commit Controls structs and definitions.  */
352 typedef struct UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL_STRUCT
353 {
354     UCHAR                                   bFormatIndex;
355     UCHAR                                   bFrameIndex;
356     UCHAR                                   bCompressionIndex;
357     UCHAR                                   dwMaxVideoFrameSize[4]; /* Not aligned from now.  */
358     UCHAR                                   dwMaxPayloadTransferSize[4];
359 } UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL;
360 #define UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL_FORMAT_INDEX_OFFSET                0
361 #define UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL_FRAME_INDEX_OFFSET                 1
362 #define UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL_COMPRESSION_INDEX_OFFSET           2
363 #define UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL_MAX_VIDEO_FRAME_SIZE_OFFSET        3
364 #define UX_DEVICE_CLASS_VIDEO_STILL_PROBE_COMMIT_CONTROL_MAX_PAYLOAD_TRANSFER_SIZE_OFFSET   7
365 
366 
367 /* Video Class Status Packet structs and definitions.  */
368 
369 /* Offsets and possible values.  */
370 typedef struct UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_HEADER_STRUCT
371 {
372    UCHAR                                    bStatusType;
373    UCHAR                                    bOriginator;
374 } UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_HEADER;
375 typedef struct UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VC_STRUCT
376 {
377    UCHAR                                     bStatusType;
378    UCHAR                                     bOriginator;
379    UCHAR                                     bEvent;
380    UCHAR                                     bSelector;
381    UCHAR                                     bAttribute;
382    UCHAR                                     bValue[1];     /* varies on bAttribute.  */
383 } UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VC;
384 typedef struct UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VS_STRUCT
385 {
386    UCHAR                                     bStatusType;
387    UCHAR                                     bOriginator;
388    UCHAR                                     bEvent;
389    UCHAR                                     bValue[1];     /* varies on bEvent.  */
390 } UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VS;
391 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_TYPE_OFFSET                                      0
392 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_TYPE_VC                                          1
393 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_TYPE_VS                                          2
394 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_ORIGINATOR_OFFSET                                1
395 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_EVENT_OFFSET                                     2
396 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VC_SELECTOR_OFFSET                               3
397 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VC_ATTRIBUTE_OFFSET                              4
398 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VC_VALUE_OFFSET                                  5
399 #define UX_DEVICE_CLASS_VIDEO_STATUS_PACKET_VS_VALUE_OFFSET                                  3
400 
401 
402 /* Define Video Class Payload Header structs and definitions.  */
403 typedef struct UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_STRUCT
404 {
405    UCHAR                                     bHeaderLength;
406    union UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_INFO_UNION {
407       UCHAR                                  value;
408       struct UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_INFO_STRUCT {
409          UCHAR                               bFID:1; /* Frame ID.  */
410          UCHAR                               bEOF:1; /* End of Frame.  */
411          UCHAR                               bPTS:1; /* Presentation Time.  */
412          UCHAR                               bSCR:1; /* Source Clock Reference.  */
413          UCHAR                               bRES:1; /* Reserved, Payload Specific.  */
414          UCHAR                               bSTI:1; /* Still Image.  */
415          UCHAR                               bERR:1; /* Error.  */
416          UCHAR                               bEOH:1; /* End of Header.  */
417       }                                      bm;
418    }                                         bmHeaderInfo;
419    UCHAR                                     dwPresentationTime[4];
420    union UX_DEVICE_CLASS_VIDEO_PAYLOAD_SCR_UNION {
421       UCHAR                                  byte_array[6];
422       struct UX_DEVICE_CLASS_VIDEO_PAYLOAD_SCR_STRUCT {
423          UCHAR                               STC[4];  /* SourceTimeClock.  */
424          USHORT                              SCR;     /* 1KHz SOF token counter.  */
425       }                                      bm;
426    }                                         scrSourceClock;
427 } UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER;
428 #define UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_LENGTH_OFFSET                                   0
429 #define UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_INFO_OFFSET                                     1
430 #define UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_PRESENTATION_TIME_OFFSET                        4
431 #define UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_PTS_OFFSET                                      4
432 #define UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_SCR_SOURCE_CLOCK_OFFSET                         6
433 #define UX_DEVICE_CLASS_VIDEO_PAYLOAD_HEADER_SCR_OFFSET                                      6
434 
435 
436 /* Define Video Class specific request codes.  */
437 #define UX_DEVICE_CLASS_VIDEO_REQUEST_CODE_UNDEFINED                                         0x00
438 #define UX_DEVICE_CLASS_VIDEO_RC_UNDEFINED                                                   0x00
439 #define UX_DEVICE_CLASS_VIDEO_SET_CUR                                                        0x01
440 #define UX_DEVICE_CLASS_VIDEO_GET_CUR                                                        0x81
441 #define UX_DEVICE_CLASS_VIDEO_GET_MIN                                                        0x82
442 #define UX_DEVICE_CLASS_VIDEO_GET_MAX                                                        0x83
443 #define UX_DEVICE_CLASS_VIDEO_GET_RES                                                        0x84
444 #define UX_DEVICE_CLASS_VIDEO_GET_INFO                                                       0x86
445 #define UX_DEVICE_CLASS_VIDEO_GET_DEF                                                        0x87
446 #define UX_DEVICE_CLASS_VIDEO_GET_CUR_ALL                                                    0x91
447 #define UX_DEVICE_CLASS_VIDEO_GET_MIN_ALL                                                    0x92
448 #define UX_DEVICE_CLASS_VIDEO_GET_MAX_ALL                                                    0x93
449 #define UX_DEVICE_CLASS_VIDEO_GET_RES_ALL                                                    0x94
450 #define UX_DEVICE_CLASS_VIDEO_GET_GET_DEF_ALL                                                0x97
451 
452 
453 /* Define Video Class Device Power Modes.  */
454 #define UX_DEVICE_CLASS_VIDEO_POWER_MODE_MASK                                                0x0Fu
455 #define UX_DEVICE_CLASS_VIDEO_POWER_MODE_FULL                                                0x00u
456 #define UX_DEVICE_CLASS_VIDEO_POWER_MODE_DEVICE_DEPENDENT                                    0x01u
457 #define UX_DEVICE_CLASS_VIDEO_POWER_DEPENDENT_MODE_SUPPORTED                                 0x10u
458 #define UX_DEVICE_CLASS_VIDEO_POWER_USES_USB                                                 0x20u
459 #define UX_DEVICE_CLASS_VIDEO_POWER_USES_BATTERY                                             0x40u
460 #define UX_DEVICE_CLASS_VIDEO_POWER_USES_AC                                                  0x80u
461 
462 
463 /* Define Video Class Request Error Codes.  */
464 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_NO_ERROR                                    0x00
465 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_NOT_READY                                   0x01
466 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_WRONG_STATE                                 0x02
467 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_POWER                                       0x03
468 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_OUT_OF_RANGE                                0x04
469 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_INVALID_INPUT                               0x05
470 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_INVALID_CONTROL                             0x06
471 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_INVALID_REQUEST                             0x07
472 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_INVALID_VALUE_WITHIN_RANGE                  0x08
473 #define UX_DEVICE_CLASS_VIDEO_REQUEST_ERROR_CODE_UNKNOWN                                     0xFF
474 
475 
476 /* Define Video Class Probe and Commit Controls */
477 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_LENGTH_1_1                                        34
478 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_LENGTH_1_5                                        48
479 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_HINT_OFFSET                                       0
480 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_FORMAT_INDEX_OFFSET                               2
481 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_FRAME_INDEX_OFFSET                                3
482 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_FRAME_INTERVAL_OFFSET                             4
483 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_KEY_FRAME_RATE_OFFSET                             8
484 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_PFRAME_RAE_OFFSET                                 10
485 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_COMP_QUALITY_OFFSET                               12
486 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_COMP_WINDOW_SIZE_OFFSET                           14
487 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_DELAY_OFFSET                                      16
488 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_MAX_VIDEO_FRAME_SIZE_OFFSET                       18
489 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_MAX_PAYLOAD_TRANSFER_SIZE_OFFSET                  22
490 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_CLOCK_FREQUENCY_OFFSET                            26
491 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_FRAMING_INFO_OFFSET                               30
492 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_PREFERED_VERSION_OFFSET                           31
493 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_MIN_VERSION_OFFSET                                32
494 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_MAX_VERSION_OFFSET                                33
495 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_USAGE_OFFSET                                      34
496 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_BIT_DEPTH_LUMA_OFFSET                             35
497 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_SETTINGS_OFFSET                                   36
498 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_MAX_NUMBER_OF_REF_FRAMES_PLUS1_OFFSET             37
499 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_RATE_CONTROL_MODES_OFFSET                         38
500 #define UX_DEVICE_CLASS_VIDEO_PROBE_COMMIT_LAYOUT_PER_STREAM_OFFSET                          40
501 
502 
503 /* Define Video Class Stream Error Codes.  */
504 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_NO_ERROR                                     0
505 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_PROTECTED_CONTENT                            1
506 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_INPUT_BUFFER_UNDERRUN                        2
507 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_DATA_DISCONTINUITY                           3
508 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_OUTPUT_BUFFER_UNDERRUN                       4
509 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_OUTPUT_BUFFER_OVERRUN                        5
510 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_FORMAT_CHANGE                                6
511 #define UX_DEVICE_CLASS_VIDEO_STREAM_ERROR_CODE_STILL_IMAGE_CAPTURE_ERROR                    7
512 
513 
514 /* Define Video Class Task states.  */
515 #define UX_DEVICE_CLASS_VIDEO_STREAM_RW_STOP            (UX_STATE_RESET)
516 #define UX_DEVICE_CLASS_VIDEO_STREAM_RW_START           (UX_STATE_STEP + 1)
517 #define UX_DEVICE_CLASS_VIDEO_STREAM_RW_WAIT            (UX_STATE_STEP + 2)
518 
519 
520 /* Define Video Class callback structure.  */
521 
522 struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT;
523 struct UX_DEVICE_CLASS_VIDEO_STRUCT;
524 
525 typedef struct UX_DEVICE_CLASS_VIDEO_CALLBACKS_STRUCT
526 {
527 
528     VOID        (*ux_slave_class_video_instance_activate)(VOID *);
529     VOID        (*ux_slave_class_video_instance_deactivate)(VOID *);
530     UINT        (*ux_device_class_video_request)(struct UX_DEVICE_CLASS_VIDEO_STRUCT *, UX_SLAVE_TRANSFER *);
531     VOID         *ux_device_class_video_arg;
532 } UX_DEVICE_CLASS_VIDEO_CALLBACKS;
533 
534 typedef struct UX_DEVICE_CLASS_VIDEO_STREAM_CALLBACKS_STRUCT
535 {
536     VOID        (*ux_device_class_video_stream_change)(struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT *, ULONG);
537     UINT        (*ux_device_class_video_stream_request)(struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT *, UX_SLAVE_TRANSFER *);
538     VOID        (*ux_device_class_video_stream_payload_done)(struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT *, ULONG);
539 } UX_DEVICE_CLASS_VIDEO_STREAM_CALLBACKS;
540 
541 
542 /* Define Video Class Calling Parameter structure */
543 
544 typedef struct UX_DEVICE_CLASS_VIDEO_PAYLOAD_STRUCT
545 {
546 
547     ULONG                                   ux_device_class_video_payload_length;
548     UCHAR                                   ux_device_class_video_payload_data[4]; /* Actually size of length.  */
549 } UX_DEVICE_CLASS_VIDEO_PAYLOAD;
550 
551 typedef struct UX_DEVICE_CLASS_VIDEO_STREAM_PARAMETER_STRUCT
552 {
553 #if defined(UX_DEVICE_STANDALONE)
554     UINT                                   (*ux_device_class_video_stream_parameter_task_function)(struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT*);
555 #else
556     ULONG                                    ux_device_class_video_stream_parameter_thread_stack_size;
557     VOID                                   (*ux_device_class_video_stream_parameter_thread_entry)(ULONG id);
558 #endif
559     UX_DEVICE_CLASS_VIDEO_STREAM_CALLBACKS   ux_device_class_video_stream_parameter_callbacks;
560 
561     ULONG                                    ux_device_class_video_stream_parameter_max_payload_buffer_size;
562     ULONG                                    ux_device_class_video_stream_parameter_max_payload_buffer_nb;
563 } UX_DEVICE_CLASS_VIDEO_STREAM_PARAMETER;
564 
565 typedef struct UX_DEVICE_CLASS_VIDEO_PARAMETER_STRUCT
566 {
567     ULONG                                    ux_device_class_video_parameter_master_interface;
568     UX_DEVICE_CLASS_VIDEO_CALLBACKS          ux_device_class_video_parameter_callbacks;
569 
570     ULONG                                    ux_device_class_video_parameter_streams_nb;
571     UX_DEVICE_CLASS_VIDEO_STREAM_PARAMETER  *ux_device_class_video_parameter_streams;
572 } UX_DEVICE_CLASS_VIDEO_PARAMETER;
573 
574 typedef struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT
575 {
576 
577     struct UX_DEVICE_CLASS_VIDEO_STRUCT     *ux_device_class_video_stream_video;
578     UX_SLAVE_INTERFACE                      *ux_device_class_video_stream_interface;
579     UX_SLAVE_ENDPOINT                       *ux_device_class_video_stream_endpoint;
580 
581     ULONG                                    ux_device_class_video_stream_error;
582 
583     UX_DEVICE_CLASS_VIDEO_STREAM_CALLBACKS   ux_device_class_video_stream_callbacks;
584 
585 #if !defined(UX_DEVICE_STANDALONE)
586     UCHAR                                   *ux_device_class_video_stream_thread_stack;
587     UX_THREAD                                ux_device_class_video_stream_thread;
588 #else
589     UINT                                   (*ux_device_class_video_stream_task_function)(struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT*);
590     UINT                                    ux_device_class_video_stream_task_state;
591     UINT                                    ux_device_class_video_stream_task_status;
592 #endif
593 
594     ULONG                                   ux_device_class_video_stream_buffer_error_count;
595     UCHAR                                   *ux_device_class_video_stream_buffer;
596     ULONG                                    ux_device_class_video_stream_buffer_size;
597     ULONG                                    ux_device_class_video_stream_payload_buffer_size;
598 
599     UX_DEVICE_CLASS_VIDEO_PAYLOAD           *ux_device_class_video_stream_transfer_pos;
600     UX_DEVICE_CLASS_VIDEO_PAYLOAD           *ux_device_class_video_stream_access_pos;
601 } UX_DEVICE_CLASS_VIDEO_STREAM;
602 #define _ux_device_class_video_stream_error_set(s,e) do {                       \
603     (s)->ux_device_class_video_stream_error = (e);                              \
604 } while(0)
605 
606 typedef struct UX_DEVICE_CLASS_VIDEO_STRUCT
607 {
608 
609     UX_SLAVE_CLASS                          *ux_device_class_video_class;
610     UX_SLAVE_DEVICE                         *ux_device_class_video_device;
611     UX_SLAVE_INTERFACE                      *ux_device_class_video_interface;
612 
613     ULONG                                    ux_device_class_video_error;
614 
615     UX_DEVICE_CLASS_VIDEO_CALLBACKS          ux_device_class_video_callbacks;
616 
617     ULONG                                    ux_device_class_video_streams_nb;
618     UX_DEVICE_CLASS_VIDEO_STREAM            *ux_device_class_video_streams;
619 
620 } UX_DEVICE_CLASS_VIDEO;
621 #define _ux_device_class_video_request_error_set(v,e) do {                      \
622     (v)->ux_device_class_video_error = (e);                                     \
623 } while(0)
624 
625 
626 /* Define Video Class function prototypes.  */
627 
628 UINT    _ux_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command);
629 UINT    _ux_device_class_video_uninitialize(UX_SLAVE_CLASS_COMMAND *command);
630 UINT    _ux_device_class_video_activate(UX_SLAVE_CLASS_COMMAND *command);
631 UINT    _ux_device_class_video_change(UX_SLAVE_CLASS_COMMAND *command);
632 UINT    _ux_device_class_video_deactivate(UX_SLAVE_CLASS_COMMAND *command);
633 UINT    _ux_device_class_video_control_request(UX_SLAVE_CLASS_COMMAND *command);
634 
635 UINT    _ux_device_class_video_entry(UX_SLAVE_CLASS_COMMAND *command);
636 
637 UINT    _ux_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function,
638                                      VOID *parameter);
639 
640 UINT    _ux_device_class_video_stream_get(UX_DEVICE_CLASS_VIDEO *video, ULONG stream_index, UX_DEVICE_CLASS_VIDEO_STREAM **stream);
641 
642 VOID    _ux_device_class_video_write_thread_entry(ULONG video_stream);
643 VOID    _ux_device_class_video_read_thread_entry(ULONG video_stream);
644 
645 ULONG   _ux_device_class_video_max_payload_length(UX_DEVICE_CLASS_VIDEO_STREAM *video);
646 
647 UINT    _ux_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *video);
648 
649 UINT    _ux_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *video, UCHAR **payload_data, ULONG *payload_length);
650 UINT    _ux_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *video);
651 
652 UINT    _ux_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *video);
653 
654 UINT    _ux_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *video, UCHAR **buffer, ULONG *max_length);
655 UINT    _ux_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *video, ULONG length);
656 
657 UINT    _ux_device_class_video_tasks_run(VOID *instance);
658 UINT    _ux_device_class_video_read_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream);
659 UINT    _ux_device_class_video_write_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream);
660 
661 /* Define Video Class API prototypes.  */
662 
663 #define ux_device_class_video_entry                   _ux_device_class_video_entry
664 
665 #define ux_device_class_video_read_thread_entry       _ux_device_class_video_read_thread_entry
666 #define ux_device_class_video_write_thread_entry      _ux_device_class_video_write_thread_entry
667 
668 #define ux_device_class_video_request_error_set       _ux_device_class_video_request_error_set
669 #define ux_device_class_video_stream_error_set        _ux_device_class_video_stream_error_set
670 
671 #define ux_device_class_video_stream_get              _ux_device_class_video_stream_get
672 
673 #define ux_device_class_video_max_payload_length      _ux_device_class_video_max_payload_length
674 
675 #define ux_device_class_video_reception_start         _ux_device_class_video_reception_start
676 
677 #define ux_device_class_video_read_payload_get        _ux_device_class_video_read_payload_get
678 #define ux_device_class_video_read_payload_free       _ux_device_class_video_read_payload_free
679 
680 #define ux_device_class_video_transmission_start      _ux_device_class_video_transmission_start
681 
682 #define ux_device_class_video_write_payload_get       _ux_device_class_video_write_payload_get
683 #define ux_device_class_video_write_payload_commit    _ux_device_class_video_write_payload_commit
684 
685 #define ux_device_class_video_ioctl                   _ux_device_class_video_ioctl
686 
687 #define ux_device_class_video_read_task_function      _ux_device_class_video_read_task_function
688 #define ux_device_class_video_write_task_function     _ux_device_class_video_write_task_function
689 
690 
691 /* Determine if a C++ compiler is being used.  If so, complete the standard
692    C conditional started above.  */
693 #ifdef __cplusplus
694 }
695 #endif
696 
697 #endif
698