1 /* $NetBSD: uvideoreg.h,v 1.1 2008/09/09 01:13:42 jmcneill Exp $ */
4 * Copyright (c) 2008 Patrick Mahoney
7 * This code was written by Patrick Mahoney (pat@polycrystal.org) as
8 * part of Google Summer of Code 2008.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
39 #define UVIDEO_VERSION 0x001
41 /* This is the standard GUID / UUID. In USB, it comes in the usual
42 * little-endian packed format. */
60 * Video Control descriptors
63 #define UDESC_VC_HEADER 0x01
64 #define UDESC_INPUT_TERMINAL 0x02
65 #define UDESC_OUTPUT_TERMINAL 0x03
66 #define UDESC_SELECTOR_UNIT 0x04
67 #define UDESC_PROCESSING_UNIT 0x05
68 #define UDESC_EXTENSION_UNIT 0x06
70 #define UDESC_VC_INTERRUPT_ENDPOINT 0x03
73 #define UVDIEO_TT_VENDOR_SPECIFIC 0x0100
74 #define UVIDEO_TT_STREAMING 0x0101
76 /* Input Terminal Types */
77 #define UVIDEO_ITT_VENDOR_SPECIFIC 0x0200
78 #define UVIDEO_ITT_CAMERA 0x0201
79 #define UVIDEO_ITT_MEDIA_TRANSPORT_INPUT 0x0202
81 /* Output Terminal Types */
82 #define UVIDEO_OTT_VENDOR_SPECIFIC 0x0300
83 #define UVIDEO_OTT_DISPLAY 0x0301
84 #define UVIDEO_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
86 /* generic descriptor with Subtype */
89 uByte bDescriptorType
;
90 uByte bDescriptorSubtype
;
91 } uvideo_descriptor_t
;
93 /* Class-specific Video Control Interface Header Descriptor */
96 uByte bDescriptorType
;
97 uByte bDescriptorSubtype
;
100 uDWord dwClockFrequency
;
102 /* followed by n bytes where n is equal to value of bInCollection */
103 uByte baInterfaceNr
[];
104 } UPACKED uvideo_vc_header_descriptor_t
;
106 /* Input Terminal Descriptor */
109 uByte bDescriptorType
;
110 uByte bDescriptorSubtype
;
113 uByte bAssocTerminal
;
115 /* possibly more, depending on Terminal type */
116 } UPACKED uvideo_input_terminal_descriptor_t
;
118 /* Output Terminal Descriptor */
121 uByte bDescriptorType
;
122 uByte bDescriptorSubtype
;
125 uByte bAssocTerminal
;
128 } UPACKED uvideo_output_terminal_descriptor_t
;
130 /* Camera Terminal Descriptor */
133 uByte bDescriptorType
;
134 uByte bDescriptorSubtype
; /* UDESC_VC_INPUT_TERMINAL */
136 uWord wTerminalType
; /* UVIDEO_ITT_CAMERA */
137 uByte bAssocTerminal
;
139 uWord wObjectiveFocalLengthMin
;
140 uWord wObjectiveFocalLengthMax
;
141 uWord wOcularFocalLength
;
144 } UPACKED uvideo_camera_terminal_descriptor_t
;
146 /* bmControls fields of uvideo_camera_terminal_descriptor_t */
147 #define UVIDEO_CAMERA_CONTROL_SCANNING_MODE (1<<0)
148 #define UVIDEO_CAMERA_CONTROL_AUTO_EXPOSURE_MODE (1<<1)
149 #define UVIDEO_CAMERA_CONTROL_AUTO_EXPOSURE_PRIO (1<<2)
150 #define UVIDEO_CAMERA_CONTROL_EXPOSURE_TIME_ABSOLUTE (1<<3)
151 #define UVIDEO_CAMERA_CONTROL_EXPOSURE_TIME_RELATIVE (1<<4)
152 #define UVIDEO_CAMERA_CONTROL_FOCUS_ABSOLUTE (1<<5)
153 #define UVIDEO_CAMERA_CONTROL_FOCUS_RELATIVE (1<<6)
154 #define UVIDEO_CAMERA_CONTROL_IRIS_ABSOLUTE (1<<7)
155 #define UVIDEO_CAMERA_CONTROL_IRIS_RELATIVE (1<<8)
156 #define UVIDEO_CAMERA_CONTROL_ZOOM_ABSOLUTE (1<<9)
157 #define UVIDEO_CAMERA_CONTROL_ZOOM_RELATIVE (1<<10)
158 #define UVIDEO_CAMERA_CONTROL_PANTILT_ABSOLUTE (1<<11)
159 #define UVIDEO_CAMERA_CONTROL_PANTILT_RELATIVE (1<<12)
160 #define UVIDEO_CAMERA_CONTROL_ROLL_ABSOLUTE (1<<13)
161 #define UVIDEO_CAMERA_CONTROL_ROLL_RELATIVE (1<<14)
163 #define UVIDEO_CAMERA_CONTROL_FOCUS_AUTO (1<<17)
164 #define UVIDEO_CAMERA_CONTROL_PRIVACY (1<<18)
168 uByte bDescriptorType
;
169 uByte bDescriptorSubtype
;
173 /* The position of the next field is baSourceID[0] + bNrInPins
174 * and should be accessed via a function. */
175 /* uByte iSelector */
176 } UPACKED uvideo_selector_unit_descriptor_t
;
180 uByte bDescriptorType
;
181 uByte bDescriptorSubtype
;
184 uWord wMaxMultiplier
;
187 /* uByte iProcessing */
188 /* uByte bmVideoStandards */
189 #define PU_GET_VIDEO_STANDARDS(desc) \
190 (*((desc)->bmControls + (desc)->bControlSize))
191 #define UVIDEO_STANDARD_NONE (1<<0)
192 #define UVIDEO_STANDARD_NTSC_525_60 (1<<1)
193 #define UVIDEO_STANDARD_PAL_625_50 (1<<2)
194 #define UVIDEO_STANDARD_SECAM_625_50 (1<<3)
195 #define UVIDEO_STANDARD_NTSC_625_50 (1<<4)
196 #define UVIDEO_STANDARD_PAL_525_60 (1<<5)
197 } UPACKED uvideo_processing_unit_descriptor_t
;
201 uByte bDescriptorType
;
202 uByte bDescriptorSubtype
;
204 usb_guid_t guidExtensionCode
;
208 /* uByte bControlSize */
209 /* uByte bmControls */
210 #define XU_GET_CONTROL_SIZE(desc) \
211 (*((desc)->baSourceID + (desc)->bNrInPins))
212 #define XU_GET_CONTROLS(desc) \
213 ((desc)->baSourceID + (desc)->bNrInPins + 1)
214 /* uByte iExtension */
215 } UPACKED uvideo_extension_unit_descriptor_t
;
219 uByte bDescriptorType
; /* UDESC_ENDPOINT */
220 uByte bDescriptorSubtype
;
221 uWord wMaxTransferSize
;
222 } UPACKED uvideo_vc_interrupt_endpoint_descriptor_t
;
227 * Video Streaming descriptors
230 #define UDESC_VS_INPUT_HEADER 0x01
231 #define UDESC_VS_OUTPUT_HEADER 0x02
232 #define UDESC_VS_STILL_IMAGE_FRAME 0x03
233 #define UDESC_VS_FORMAT_UNCOMPRESSED 0x04
234 #define UDESC_VS_FRAME_UNCOMPRESSED 0x05
235 #define UDESC_VS_FORMAT_MJPEG 0x06
236 #define UDESC_VS_FRAME_MJPEG 0x07
237 /* reserved in spec v1.1 0x08 */
238 /* reserved in spec v1.1 0x09 */
239 #define UDESC_VS_FORMAT_MPEG2TS 0x0A
240 /* reserved in spec v 1.1 0x0B */
241 #define UDESC_VS_FORMAT_DV 0x0C
242 #define UDESC_VS_COLORFORMAT 0x0D
243 /* reserved in spec v1.1 0x0E */
244 /* reserved in spec v1.1 0x0F */
245 #define UDESC_VS_FORMAT_FRAME_BASED 0x10
246 #define UDESC_VS_FRAME_FRAME_BASED 0x11
247 #define UDESC_VS_FORMAT_STREAM_BASED 0x12
249 /* Copy protection state */
250 #define UVIDEO_NO_RESTRICTIONS 0
251 #define UVIDEO_RESTRICT_DUP 1
255 uByte bDescriptorType
;
256 uByte bDescriptorSubtype
;
259 uByte bEndpointAddress
;
262 uByte bStillCaptureMethod
;
263 uByte bTriggerSupport
;
267 #define UVIDEO_VS_KEYFRAME_RATE (1<<0)
268 #define UVIDEO_VS_PFRAME_RATE (1<<1)
269 #define UVIDEO_VS_COMP_QUALITY (1<<2)
270 #define UVIDEO_VS_COMP_WINDOW_SIZE (1<<3)
271 #define UVIDEO_VS_GENERATE_KEYFRAME (1<<4)
272 #define UVIDEO_VS_UPDATE_FRAME_SEGMENT (1<<5)
273 } UPACKED uvideo_vs_input_header_descriptor_t
;
277 uByte bDescriptorType
;
278 uByte bDescriptorSubtype
;
281 uByte bEndpointAddress
;
285 } UPACKED uvideo_vs_output_header_descriptor_t
;
291 } UPACKED uvideo_still_image_frame_dimensions_t
;
295 uByte bDescriptorType
;
296 uByte bDescriptorSubtype
;
297 uByte bEndpointAddress
;
298 uByte bNumImageSizePatterns
;
299 uvideo_still_image_frame_dimensions_t wwaDimensions
[];
300 /* position dependent on size of previous item */
301 /* uByte bNumCompressionPattern */
302 /* uByte bCompression[] */
303 } UPACKED uvideo_still_image_frame_descriptor_t
;
306 /* Color matching information */
308 /* bColroPrimaries */
309 #define UVIDEO_COLOR_PRIMARIES_UNSPECIFIED 0
310 #define UVIDEO_COLOR_PRIMARIES_sRGB 1 /* same as BT709 */
311 #define UVIDEO_COLOR_PRIMARIES_BT709 1 /* default */
312 #define UVIDEO_COLOR_PRIMARIES_BT470_2_M 2
313 #define UVIDEO_COLOR_PRIMARIES_BT470_2_BG 3
314 #define UVIDEO_COLOR_PRIMARIES_SMPTE_170M 4
315 #define UVIDEO_COLOR_PRIMARIES_SMPTE_240M 5
317 /* bTransferCharacteristics */
318 #define UVIDEO_GAMMA_FUNCTION_UNSPECIFIED 0
319 #define UVIDEO_GAMMA_FUNCTION_BT709 1 /* default */
320 #define UVIDEO_GAMMA_FUNCTION_BT470_2_M 2
321 #define UVIDEO_GAMMA_FUNCTION_BT470_2_BG 3
322 #define UVIDEO_GAMMA_FUNCTION_SMPTE_170M 4
323 #define UVIDEO_GAMMA_FUNCTION_SMPTE_240M 5
324 #define UVIDEO_GAMMA_FUNCTION_LINEAR 6
325 #define UVIDEO_GAMMA_FUNCTION_sRGB 7 /* similar to BT709 */
327 /* bMatrixCoefficients */
328 #define UVIDEO_LUMA_CHROMA_MATRIX_UNSPECIFIED 0
329 #define UVIDEO_LUMA_CHROMA_MATRIX_BT709 1
330 #define UVIDEO_LUMA_CHROMA_MATRIX_FCC 2
331 #define UVIDEO_LUMA_CHROMA_MATRIX_BT470_2_BG 3
332 #define UVIDEO_LUMA_CHROMA_MATRIX_SMPTE_170M 4 /* default */
333 #define UVIDEO_LUMA_CHROMA_MATRIX_SMPTE_240M 5
337 uByte bDescriptorType
;
338 uByte bDescriptorSubtype
;
339 uByte bColorPrimaries
;
340 uByte bTransferCharacteristics
;
341 uByte bMatrixCoefficients
;
342 } UPACKED uvideo_color_matching_descriptor_t
;
345 * Format and Frame descriptors
348 #define UVIDEO_FRAME_CAP_STILL_IMAGE 1<<0
349 #define UVIDEO_FRAME_CAP_FIXED_RATE 1<<1
351 #define UVIDEO_FRAME_INTERVAL_CONTINUOUS 0
353 /* TODO: interlace flags */
357 uDWord dwMinFrameInterval
;
358 uDWord dwMaxFrameInterval
;
359 uDWord dwFrameIntervalStep
;
360 } UPACKED uvideo_frame_interval_continuous_t
;
363 uDWord dwFrameInterval
[1]; /* length depends on bFrameIntervalType */
364 } UPACKED uvideo_frame_interval_discrete_t
;
367 uvideo_frame_interval_continuous_t continuous
;
368 uvideo_frame_interval_discrete_t discrete
;
369 } uvideo_frame_interval_t
;
371 /* generic format descriptor header */
374 uByte bDescriptorType
;
375 uByte bDescriptorSubtype
;
377 } UPACKED uvideo_vs_format_descriptor_t
;
379 /* generic frame descriptor header */
382 uByte bDescriptorType
;
383 uByte bDescriptorSubtype
;
385 } UPACKED uvideo_vs_frame_descriptor_t
;
388 /* uncompressed format and frame descriptors */
389 static const guid_t uvideo_guid_format_yuy2
= {
393 {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
396 static const guid_t uvideo_guid_format_nv12
= {
400 {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
403 static const guid_t uvideo_guid_format_uyvy
= {
407 {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
412 uByte bDescriptorType
;
413 uByte bDescriptorSubtype
;
415 uByte bNumFrameDescriptors
;
416 usb_guid_t guidFormat
;
418 uByte bDefaultFrameIndex
;
421 uByte bmInterlaceFlags
;
423 } UPACKED uvideo_vs_format_uncompressed_descriptor_t
;
427 uByte bDescriptorType
;
428 uByte bDescriptorSubtype
;
430 uByte bmCapabilities
;
435 uDWord dwMaxVideoFrameBufferSize
;
436 uDWord dwDefaultFrameInterval
;
437 uByte bFrameIntervalType
;
438 uvideo_frame_interval_t uFrameInterval
;
439 } UPACKED uvideo_vs_frame_uncompressed_descriptor_t
;
442 /* Frame based Format and Frame descriptors. This is for generic
443 * frame based payloads not covered by other types (e.g, uncompressed
448 uByte bDescriptorType
;
449 uByte bDescriptorSubtype
;
451 uByte bNumFrameDescriptors
;
452 usb_guid_t guidFormat
;
454 uByte bDefaultFrameIndex
;
457 uByte bmInterlaceFlags
;
459 } UPACKED uvideo_format_frame_based_descriptor_t
;
463 uByte bDescriptorType
;
464 uByte bDescriptorSubtype
;
466 uByte bmCapabilities
;
471 uDWord dwDefaultFrameInterval
;
472 uByte bFrameIntervalType
;
473 uDWord dwBytesPerLine
;
474 uvideo_frame_interval_t uFrameInterval
;
475 } UPACKED uvideo_frame_frame_based_descriptor_t
;
478 /* MJPEG format and frame descriptors */
482 uByte bDescriptorType
;
483 uByte bDescriptorSubtype
;
485 uByte bNumFrameDescriptors
;
487 #define UVIDEO_NO_FIXED_SIZE_SAMPLES 0
488 #define UVIDEO_FIXED_SIZE_SAMPLES 1
489 uByte bDefaultFrameIndex
;
492 uByte bmInterlaceFlags
;
494 } UPACKED uvideo_vs_format_mjpeg_descriptor_t
;
498 uByte bDescriptorType
;
499 uByte bDescriptorSubtype
;
501 uByte bmCapabilities
;
506 uDWord dwMaxVideoFrameBufferSize
;
507 uDWord dwDefaultFrameInterval
;
508 uByte bFrameIntervalType
;
509 uvideo_frame_interval_t uFrameInterval
;
510 } UPACKED uvideo_vs_frame_mjpeg_descriptor_t
;
515 uByte bDescriptorType
;
516 uByte bDescriptorSubtype
;
518 uDWord dwMaxVideoFrameBufferSize
;
520 #define UVIDEO_GET_DV_FREQ(ubyte) (((ubyte)>>7) & 1)
521 #define UVIDEO_DV_FORMAT_FREQ_50HZ 0
522 #define UVIDEO_DV_FORMAT_FREQ_60HZ 1
523 #define UVIDEO_GET_DV_FORMAT(ubyte) ((ubyte) & 0x3f)
524 #define UVIDEO_DV_FORMAT_SD_DV 0
525 #define UVIDEO_DV_FORMAT_SDL_DV 1
526 #define UVIDEO_DV_FORMAT_HD_DV 2
527 } UPACKED uvideo_vs_format_dv_descriptor_t
;
532 * Video Control requests
535 /* Pseudo bitmasks that only work when bitwise OR onto a zeroed value */
536 #define UVIDEO_REQUEST_TYPE_INTERFACE (0x0001)
537 #define UVIDEO_REQUEST_TYPE_ENDPOINT (0x0010)
538 #define UVIDEO_REQUEST_TYPE_CLASS_SPECIFIC (0x01 << 5)
539 #define UVIDEO_REQUEST_TYPE_SET (0x0 << 7)
540 #define UVIDEO_REQUEST_TYPE_GET (0x1 << 7)
543 UVIDEO_REQUEST_DESC_INTERFACE
,
544 UVIDEO_REQUEST_DESC_ENDPOINT
545 } uvideo_request_descriptor
;
548 UR_RC_UNDEFINED
= 0x00,
559 /* camera terminal control selectors */
560 #define UVIDEO_CT_CONTROL_UNDEFINED 0x00
561 #define UVIDEO_CT_SCANNING_MODE_CONTROL 0x01
562 #define UVIDEO_CT_AE_MODE_CONTROL 0x02
563 #define UVIDEO_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
564 #define UVIDEO_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
565 #define UVIDEO_CT_FOCUS_ABSOLUTE_CONTROL 0x06
566 #define UVIDEO_CT_FOCUS_RELATIVE_CONTROL 0x07
567 #define UVIDEO_CT_IRIS_ABSOLUTE_CONTROL 0x09
568 #define UVIDEO_CT_IRIS_RELATIVE_CONTROL 0x0A
569 #define UVIDEO_CT_ZOOM_ABSOLUTE_CONTROL 0x0B
570 #define UVIDEO_CT_ZOOM_RELATIVE_CONTROL 0x0C
571 #define UVIDEO_CT_PANTILT_ABSOLUTE_CONTROL 0x0D
572 #define UVIDEO_CT_PANTILT_RELATIVE_CONTROL 0x0E
573 #define UVIDEO_CT_ROLL_ABSOLUTE_CONTROL 0x0F
574 #define UVIDEO_CT_ROLL_RELATIVE_CONTROL 0x10
575 #define UVIDEO_CT_PRIVACY_CONTROL 0x11
577 /* processing unit control selectors */
578 #define UVIDEO_PU_CONTROL_UNDEFINED 0x00
579 #define UVIDEO_PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
580 #define UVIDEO_PU_BRIGHTNESS_CONTROL 0x02
581 #define UVIDEO_PU_CONTRAST_CONTROL 0x03
582 #define UVIDEO_PU_GAIN_CONTROL 0x04
583 #define UVIDEO_PU_POWER_LINE_FREQUENCY_CONTROL 0x05
584 #define UVIDEO_PU_HUE_CONTROL 0x06
585 #define UVIDEO_PU_SATURATION_CONTROL 0x07
586 #define UVIDEO_PU_SHARPNESS_CONTROL 0x08
587 #define UVIDEO_PU_GAMMA_CONTROL 0x09
588 #define UVIDEO_PU_WHITE_BALANCE_TEMPERATURE_CONTROL 0x0A
589 #define UVIDEO_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0B
590 #define UVIDEO_PU_WHITE_BALANCE_COMPONENT_CONTROL 0x0C
591 #define UVIDEO_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL 0x0D
592 #define UVIDEO_PU_DIGITAL_MULTIPLIER_CONTROL 0x0E
593 #define UVIDEO_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL 0x0F
594 #define UVIDEO_PU_HUE_AUTO_CONTROL 0x10
595 #define UVIDEO_PU_ANALOG_VIDEO_STANDARD_CONTROL 0x11
596 #define UVIDEO_PU_ANALOG_LOCK_STATUS_CONTROL 0x12
598 /* extension unit control selectors */
599 #define UVIDEO_XU_CONTROL_UNDEFINED 0x00
601 /* VideoStreaming Interface control selectors */
602 #define UVIDEO_VS_CONTROL_UNDEFINED 0x00
603 #define UVIDEO_VS_PROBE_CONTROL 0x01
604 #define UVIDEO_VS_COMMIT_CONTROL 0x02
605 #define UVIDEO_VS_STILL_PROBE_CONTROL 0x03
606 #define UVIDEO_VS_STILL_COMMIT_CONTROL 0x04
607 #define UVIDEO_VS_STILL_IMAGE_TRIGGER_CONTROL 0x05
608 #define UVIDEO_VS_STREAM_ERROR_CODE_CONTROL 0x06
609 #define UVIDEO_VS_GENERATE_KEY_FRAME_CONTROL 0x07
610 #define UVIDEO_VS_UPDATE_FRAME_SEGMENT_CONTROL 0x08
611 #define UVIDEO_VS_SYNCH_DELAY_CONTROL 0x09
613 /* bitmask result of GET_INFO on a control */
614 #define UVIDEO_CONTROL_INFO_SUPPORTS_GET (1<<0)
615 #define UVIDEO_CONTROL_INFO_SUPPORTS_SET (1<<1)
616 #define UVIDEO_CONTROL_INFO_DISABLED (1<<2)
617 #define UVIDEO_CONTROL_INFO_AUTOUPDATE (1<<3)
618 #define UVIDEO_CONTROL_INFO_ASYNC (1<<4)
621 /* Video Probe and Commit Controls request data */
624 #define UVIDEO_HINT_FRAME_INTERVAL (1<<0)
625 #define UVIDEO_HINT_KEYFRAME_RATE (1<<1)
626 #define UVIDEO_HINT_PFRAME_RATE (1<<2)
627 #define UVIDEO_HINT_COMP_QUALITY (1<<3)
628 #define UVIDEO_HINT_COMP_WINDOW_SIZE (1<<4)
631 uDWord dwFrameInterval
;
632 #define UVIDEO_100NS_PER_MS 10000
633 #define UVIDEO_FRAME_INTERVAL_UNITS_PER_USB_FRAME UVIDEO_100NS_PER_MS
637 uWord wCompWindowSize
;
639 uDWord dwMaxVideoFrameSize
;
640 uDWord dwMaxPayloadTransferSize
;
641 /* Following fields are not in v1.0 of UVC. Will have to do
642 * UR_GET_LEN to discover the length of this descriptor. */
643 uDWord dwClockFrequency
;
645 #define UVIDEO_FRAMING_INFO_FID (1<<0)
646 #define UVIDEO_FRAMING_INFO_EOF (1<<1)
647 uByte bPreferedVersion
;
650 } UPACKED uvideo_probe_and_commit_data_t
;
652 /* Video Still Probe and Still Commit Controls request data */
656 uByte bCompressionIndex
;
657 uDWord dwMaxVideoFrameSize
;
658 uDWord dwMaxPayloadTransferSize
;
659 } UPACKED uvideo_still_probe_and_still_commit_data_t
;
660 #define UVIDEO_STILL_PROBE_AND_STILL_COMMIT_DATA_SIZE 11;
664 /* common header for Video Control and Video Stream status */
667 #define UV_STATUS_TYPE_CONTROL 0x02
668 #define UV_STATUS_TYPE_STREAM 0x04
670 } UPACKED uvideo_status_t
;
676 #define UV_CONTROL_CHANGE 0x00 /* any other value is Reserved */
679 #define UV_CONTROL_VALUE_CHANGE 0x00
680 #define UV_CONTROL_INFO_CHANGE 0x01
681 #define UV_CONTROL_FAILURE_CHANGE 0x02
683 } UPACKED uvideo_control_status_t
;
689 #define UV_BUTTON_PRESS 0x00 /* any other value is Stream Error */
691 #define UV_BUTTON_RELEASED 0x00
692 #define UV_BUTTON_PRESSED 0x01
693 } UPACKED uvideo_streaming_status_t
;
698 #define UV_FRAME_ID 1<<0
699 #define UV_END_OF_FRAME 1<<1
700 #define UV_PRES_TIME 1<<2
701 #define UV_SRC_CLOCK 1<<3
703 #define UV_STILL_IMAGE 1<<5
704 #define UV_ERROR 1<<6
705 #define UV_END_OF_HDR 1<<7
706 /* other fields depend on which bits are set above and have no fixed offset */
707 /* uDWord dwPresentationTime; */
708 #define UVIDEO_PTS_SIZE 4
709 /* uByte scrSourceClock[UVIDEO_SOURCE_CLOCK_SIZE]; */
710 #define UVIDEO_SOURCE_CLOCK_SIZE 6
711 #define UV_GET_SOURCE_TIME_CLOCK(sc) (UGETDW(sc))
713 #define UV_GET_SOF_COUNTER(sc) (((sc)[4] | ((sc)[5] << 8)) &0x7ff)
714 } UPACKED uvideo_payload_header_t
;
716 /* Note: this might be larger depending on presence of source clock,
717 SOF counter, or other things... bHeaderLength is actual length. */
718 #define UVIDEO_PAYLOAD_HEADER_SIZE 12