Home | History | Annotate | Line # | Download | only in usb
uvideoreg.h revision 1.2
      1  1.2  jmcneill /*	$NetBSD: uvideoreg.h,v 1.2 2008/09/20 18:17:56 jmcneill Exp $	*/
      2  1.1  jmcneill 
      3  1.1  jmcneill /*
      4  1.1  jmcneill  * Copyright (c) 2008 Patrick Mahoney
      5  1.1  jmcneill  * All rights reserved.
      6  1.1  jmcneill  *
      7  1.1  jmcneill  * This code was written by Patrick Mahoney (pat (at) polycrystal.org) as
      8  1.1  jmcneill  * part of Google Summer of Code 2008.
      9  1.1  jmcneill  *
     10  1.1  jmcneill  * Redistribution and use in source and binary forms, with or without
     11  1.1  jmcneill  * modification, are permitted provided that the following conditions
     12  1.1  jmcneill  * are met:
     13  1.1  jmcneill  * 1. Redistributions of source code must retain the above copyright
     14  1.1  jmcneill  *    notice, this list of conditions and the following disclaimer.
     15  1.1  jmcneill  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  jmcneill  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  jmcneill  *    documentation and/or other materials provided with the distribution.
     18  1.1  jmcneill  * 3. All advertising materials mentioning features or use of this software
     19  1.1  jmcneill  *    must display the following acknowledgement:
     20  1.1  jmcneill  *        This product includes software developed by the NetBSD
     21  1.1  jmcneill  *        Foundation, Inc. and its contributors.
     22  1.1  jmcneill  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1  jmcneill  *    contributors may be used to endorse or promote products derived
     24  1.1  jmcneill  *    from this software without specific prior written permission.
     25  1.1  jmcneill  *
     26  1.1  jmcneill  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1  jmcneill  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1  jmcneill  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1  jmcneill  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1  jmcneill  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1  jmcneill  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1  jmcneill  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1  jmcneill  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1  jmcneill  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1  jmcneill  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1  jmcneill  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1  jmcneill  */
     38  1.1  jmcneill 
     39  1.1  jmcneill #define UVIDEO_VERSION		0x001
     40  1.1  jmcneill 
     41  1.1  jmcneill /* This is the standard GUID / UUID.  In USB, it comes in the usual
     42  1.1  jmcneill  * little-endian packed format. */
     43  1.1  jmcneill 
     44  1.1  jmcneill typedef struct {
     45  1.1  jmcneill 	uDWord		data1;
     46  1.1  jmcneill 	uWord		data2;
     47  1.1  jmcneill 	uWord		data3;
     48  1.1  jmcneill 	uByte		data4[8];
     49  1.1  jmcneill } UPACKED usb_guid_t;
     50  1.1  jmcneill 
     51  1.1  jmcneill typedef struct {
     52  1.1  jmcneill 	uint32_t	data1;
     53  1.1  jmcneill 	uint16_t	data2;
     54  1.1  jmcneill 	uint16_t	data3;
     55  1.1  jmcneill 	uint8_t		data4[8];
     56  1.1  jmcneill } guid_t;
     57  1.1  jmcneill #define GUID_LEN 16
     58  1.1  jmcneill 
     59  1.1  jmcneill /*
     60  1.1  jmcneill  * Video Control descriptors
     61  1.1  jmcneill  */
     62  1.1  jmcneill 
     63  1.1  jmcneill #define UDESC_VC_HEADER		0x01
     64  1.1  jmcneill #define UDESC_INPUT_TERMINAL	0x02
     65  1.1  jmcneill #define UDESC_OUTPUT_TERMINAL	0x03
     66  1.1  jmcneill #define UDESC_SELECTOR_UNIT	0x04
     67  1.1  jmcneill #define UDESC_PROCESSING_UNIT	0x05
     68  1.1  jmcneill #define UDESC_EXTENSION_UNIT	0x06
     69  1.1  jmcneill 
     70  1.1  jmcneill #define UDESC_VC_INTERRUPT_ENDPOINT	0x03
     71  1.1  jmcneill 
     72  1.1  jmcneill /* Terminal Types */
     73  1.1  jmcneill #define UVDIEO_TT_VENDOR_SPECIFIC	0x0100
     74  1.1  jmcneill #define UVIDEO_TT_STREAMING		0x0101
     75  1.1  jmcneill 
     76  1.1  jmcneill /* Input Terminal Types */
     77  1.1  jmcneill #define UVIDEO_ITT_VENDOR_SPECIFIC	0x0200
     78  1.1  jmcneill #define UVIDEO_ITT_CAMERA		0x0201
     79  1.1  jmcneill #define UVIDEO_ITT_MEDIA_TRANSPORT_INPUT 0x0202
     80  1.1  jmcneill 
     81  1.1  jmcneill /* Output Terminal Types */
     82  1.1  jmcneill #define UVIDEO_OTT_VENDOR_SPECIFIC	0x0300
     83  1.1  jmcneill #define UVIDEO_OTT_DISPLAY		0x0301
     84  1.1  jmcneill #define UVIDEO_OTT_MEDIA_TRANSPORT_OUTPUT 0x0302
     85  1.1  jmcneill 
     86  1.1  jmcneill /* generic descriptor with Subtype */
     87  1.1  jmcneill typedef struct {
     88  1.1  jmcneill 	uByte	bLength;
     89  1.1  jmcneill 	uByte	bDescriptorType;
     90  1.1  jmcneill 	uByte	bDescriptorSubtype;
     91  1.1  jmcneill } uvideo_descriptor_t;
     92  1.1  jmcneill 
     93  1.1  jmcneill /* Class-specific Video Control Interface Header Descriptor */
     94  1.1  jmcneill typedef struct {
     95  1.1  jmcneill 	uByte		bLength;
     96  1.1  jmcneill 	uByte		bDescriptorType;
     97  1.1  jmcneill 	uByte		bDescriptorSubtype;
     98  1.1  jmcneill 	uWord		bcdUVC;
     99  1.1  jmcneill 	uWord		wTotalLength;
    100  1.1  jmcneill 	uDWord		dwClockFrequency;
    101  1.1  jmcneill 	uByte		bInCollection;
    102  1.1  jmcneill 	/* followed by n bytes where n is equal to value of bInCollection */
    103  1.1  jmcneill 	uByte		baInterfaceNr[];
    104  1.1  jmcneill } UPACKED uvideo_vc_header_descriptor_t;
    105  1.1  jmcneill 
    106  1.1  jmcneill /* Input Terminal Descriptor */
    107  1.1  jmcneill typedef struct {
    108  1.1  jmcneill 	uByte		bLength;
    109  1.1  jmcneill 	uByte		bDescriptorType;
    110  1.1  jmcneill 	uByte		bDescriptorSubtype;
    111  1.1  jmcneill 	uByte		bTerminalID;
    112  1.1  jmcneill 	uWord		wTerminalType;
    113  1.1  jmcneill 	uByte		bAssocTerminal;
    114  1.1  jmcneill 	uByte		iTerminal;
    115  1.1  jmcneill 	/* possibly more, depending on Terminal type */
    116  1.1  jmcneill } UPACKED uvideo_input_terminal_descriptor_t;
    117  1.1  jmcneill 
    118  1.1  jmcneill /* Output Terminal Descriptor */
    119  1.1  jmcneill typedef struct {
    120  1.1  jmcneill 	uByte		bLength;
    121  1.1  jmcneill 	uByte		bDescriptorType;
    122  1.1  jmcneill 	uByte		bDescriptorSubtype;
    123  1.1  jmcneill 	uByte		bTerminalID;
    124  1.1  jmcneill 	uWord		wTerminalType;
    125  1.1  jmcneill 	uByte		bAssocTerminal;
    126  1.1  jmcneill 	uByte		bSourceID;
    127  1.1  jmcneill 	uByte		iTerminal;
    128  1.1  jmcneill } UPACKED uvideo_output_terminal_descriptor_t;
    129  1.1  jmcneill 
    130  1.1  jmcneill /* Camera Terminal Descriptor */
    131  1.1  jmcneill typedef struct {
    132  1.1  jmcneill 	uByte		bLength;
    133  1.1  jmcneill 	uByte		bDescriptorType;
    134  1.1  jmcneill 	uByte		bDescriptorSubtype; 	/* UDESC_VC_INPUT_TERMINAL */
    135  1.1  jmcneill 	uByte		bTerminalID;
    136  1.1  jmcneill 	uWord		wTerminalType;		/* UVIDEO_ITT_CAMERA */
    137  1.1  jmcneill 	uByte		bAssocTerminal;
    138  1.1  jmcneill 	uByte		iTerminal;
    139  1.1  jmcneill 	uWord		wObjectiveFocalLengthMin;
    140  1.1  jmcneill 	uWord		wObjectiveFocalLengthMax;
    141  1.1  jmcneill 	uWord		wOcularFocalLength;
    142  1.1  jmcneill 	uByte		bControlSize;
    143  1.1  jmcneill 	uByte		bmControls[];
    144  1.1  jmcneill } UPACKED uvideo_camera_terminal_descriptor_t;
    145  1.1  jmcneill 
    146  1.1  jmcneill /* bmControls fields of uvideo_camera_terminal_descriptor_t */
    147  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_SCANNING_MODE		(1<<0)
    148  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_AUTO_EXPOSURE_MODE	(1<<1)
    149  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_AUTO_EXPOSURE_PRIO	(1<<2)
    150  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_EXPOSURE_TIME_ABSOLUTE	(1<<3)
    151  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_EXPOSURE_TIME_RELATIVE	(1<<4)
    152  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_FOCUS_ABSOLUTE		(1<<5)
    153  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_FOCUS_RELATIVE		(1<<6)
    154  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_IRIS_ABSOLUTE		(1<<7)
    155  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_IRIS_RELATIVE		(1<<8)
    156  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_ZOOM_ABSOLUTE		(1<<9)
    157  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_ZOOM_RELATIVE		(1<<10)
    158  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_PANTILT_ABSOLUTE		(1<<11)
    159  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_PANTILT_RELATIVE		(1<<12)
    160  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_ROLL_ABSOLUTE		(1<<13)
    161  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_ROLL_RELATIVE		(1<<14)
    162  1.1  jmcneill /* 15,16 reserved */
    163  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_FOCUS_AUTO		(1<<17)
    164  1.1  jmcneill #define UVIDEO_CAMERA_CONTROL_PRIVACY			(1<<18)
    165  1.1  jmcneill 
    166  1.1  jmcneill typedef struct {
    167  1.1  jmcneill 	uByte		bLength;
    168  1.1  jmcneill 	uByte		bDescriptorType;
    169  1.1  jmcneill 	uByte		bDescriptorSubtype;
    170  1.1  jmcneill 	uByte		bUnitID;
    171  1.1  jmcneill 	uByte		bNrInPins;
    172  1.1  jmcneill 	uByte		baSourceID[];
    173  1.1  jmcneill 	/* The position of the next field is baSourceID[0] + bNrInPins
    174  1.1  jmcneill 	 * and should be accessed via a function. */
    175  1.1  jmcneill /*      uByte           iSelector */
    176  1.1  jmcneill } UPACKED uvideo_selector_unit_descriptor_t;
    177  1.1  jmcneill 
    178  1.1  jmcneill typedef struct {
    179  1.1  jmcneill 	uByte		bLength;
    180  1.1  jmcneill 	uByte		bDescriptorType;
    181  1.1  jmcneill 	uByte		bDescriptorSubtype;
    182  1.1  jmcneill 	uByte		bUnitID;
    183  1.1  jmcneill 	uByte		bSourceID;
    184  1.1  jmcneill 	uWord		wMaxMultiplier;
    185  1.1  jmcneill 	uByte		bControlSize;
    186  1.1  jmcneill 	uByte		bmControls[];
    187  1.1  jmcneill /*      uByte           iProcessing */
    188  1.1  jmcneill /*      uByte           bmVideoStandards */
    189  1.1  jmcneill #define PU_GET_VIDEO_STANDARDS(desc)	\
    190  1.1  jmcneill 	(*((desc)->bmControls + (desc)->bControlSize))
    191  1.1  jmcneill #define UVIDEO_STANDARD_NONE		(1<<0)
    192  1.1  jmcneill #define UVIDEO_STANDARD_NTSC_525_60	(1<<1)
    193  1.1  jmcneill #define UVIDEO_STANDARD_PAL_625_50	(1<<2)
    194  1.1  jmcneill #define UVIDEO_STANDARD_SECAM_625_50	(1<<3)
    195  1.1  jmcneill #define UVIDEO_STANDARD_NTSC_625_50	(1<<4)
    196  1.1  jmcneill #define UVIDEO_STANDARD_PAL_525_60	(1<<5)
    197  1.1  jmcneill } UPACKED uvideo_processing_unit_descriptor_t;
    198  1.1  jmcneill 
    199  1.1  jmcneill typedef struct {
    200  1.1  jmcneill 	uByte		bLength;
    201  1.1  jmcneill 	uByte		bDescriptorType;
    202  1.1  jmcneill 	uByte		bDescriptorSubtype;
    203  1.1  jmcneill 	uByte		bUnitID;
    204  1.1  jmcneill 	usb_guid_t	guidExtensionCode;
    205  1.1  jmcneill 	uByte		bNumControls;
    206  1.1  jmcneill 	uByte		bNrInPins;
    207  1.1  jmcneill 	uByte		baSourceID[];
    208  1.1  jmcneill /*      uByte           bControlSize */
    209  1.1  jmcneill /*      uByte           bmControls */
    210  1.1  jmcneill #define XU_GET_CONTROL_SIZE(desc)			\
    211  1.1  jmcneill 	(*((desc)->baSourceID + (desc)->bNrInPins))
    212  1.1  jmcneill #define XU_GET_CONTROLS(desc)				\
    213  1.1  jmcneill 	((desc)->baSourceID + (desc)->bNrInPins + 1)
    214  1.1  jmcneill /*      uByte           iExtension */
    215  1.1  jmcneill } UPACKED uvideo_extension_unit_descriptor_t;
    216  1.1  jmcneill 
    217  1.1  jmcneill typedef struct {
    218  1.1  jmcneill 	uByte		bLength;
    219  1.1  jmcneill 	uByte		bDescriptorType; /* UDESC_ENDPOINT */
    220  1.1  jmcneill 	uByte		bDescriptorSubtype;
    221  1.1  jmcneill 	uWord		wMaxTransferSize;
    222  1.1  jmcneill } UPACKED uvideo_vc_interrupt_endpoint_descriptor_t;
    223  1.1  jmcneill 
    224  1.1  jmcneill 
    225  1.1  jmcneill 
    226  1.1  jmcneill /*
    227  1.1  jmcneill  * Video Streaming descriptors
    228  1.1  jmcneill  */
    229  1.1  jmcneill 
    230  1.1  jmcneill #define UDESC_VS_INPUT_HEADER		0x01
    231  1.1  jmcneill #define UDESC_VS_OUTPUT_HEADER		0x02
    232  1.1  jmcneill #define UDESC_VS_STILL_IMAGE_FRAME	0x03
    233  1.1  jmcneill #define UDESC_VS_FORMAT_UNCOMPRESSED	0x04
    234  1.1  jmcneill #define UDESC_VS_FRAME_UNCOMPRESSED	0x05
    235  1.1  jmcneill #define UDESC_VS_FORMAT_MJPEG		0x06
    236  1.1  jmcneill #define UDESC_VS_FRAME_MJPEG		0x07
    237  1.1  jmcneill /* reserved in spec v1.1		0x08 */
    238  1.1  jmcneill /* reserved in spec v1.1		0x09 */
    239  1.1  jmcneill #define UDESC_VS_FORMAT_MPEG2TS		0x0A
    240  1.1  jmcneill /* reserved in spec v 1.1		0x0B */
    241  1.1  jmcneill #define UDESC_VS_FORMAT_DV		0x0C
    242  1.1  jmcneill #define UDESC_VS_COLORFORMAT		0x0D
    243  1.1  jmcneill /* reserved in spec v1.1		0x0E */
    244  1.1  jmcneill /* reserved in spec v1.1		0x0F */
    245  1.1  jmcneill #define UDESC_VS_FORMAT_FRAME_BASED	0x10
    246  1.1  jmcneill #define UDESC_VS_FRAME_FRAME_BASED	0x11
    247  1.1  jmcneill #define UDESC_VS_FORMAT_STREAM_BASED	0x12
    248  1.1  jmcneill 
    249  1.1  jmcneill /* Copy protection state */
    250  1.1  jmcneill #define UVIDEO_NO_RESTRICTIONS		0
    251  1.1  jmcneill #define UVIDEO_RESTRICT_DUP		1
    252  1.1  jmcneill 
    253  1.1  jmcneill typedef struct {
    254  1.1  jmcneill 	uByte		bLength;
    255  1.1  jmcneill 	uByte		bDescriptorType;
    256  1.1  jmcneill 	uByte		bDescriptorSubtype;
    257  1.1  jmcneill 	uByte		bNumFormats;
    258  1.1  jmcneill 	uWord		wTotalLength;
    259  1.1  jmcneill 	uByte		bEndpointAddress;
    260  1.1  jmcneill 	uByte		bmInfo;
    261  1.1  jmcneill 	uByte		bTerminalLink;
    262  1.1  jmcneill 	uByte		bStillCaptureMethod;
    263  1.1  jmcneill 	uByte		bTriggerSupport;
    264  1.1  jmcneill 	uByte		bTriggerUsage;
    265  1.1  jmcneill 	uByte		bControlSize;
    266  1.1  jmcneill 	uByte		bmaControls[];
    267  1.1  jmcneill #define UVIDEO_VS_KEYFRAME_RATE	(1<<0)
    268  1.1  jmcneill #define UVIDEO_VS_PFRAME_RATE	(1<<1)
    269  1.1  jmcneill #define UVIDEO_VS_COMP_QUALITY	(1<<2)
    270  1.1  jmcneill #define UVIDEO_VS_COMP_WINDOW_SIZE	(1<<3)
    271  1.1  jmcneill #define UVIDEO_VS_GENERATE_KEYFRAME	(1<<4)
    272  1.1  jmcneill #define UVIDEO_VS_UPDATE_FRAME_SEGMENT	(1<<5)
    273  1.1  jmcneill } UPACKED uvideo_vs_input_header_descriptor_t;
    274  1.1  jmcneill 
    275  1.1  jmcneill typedef struct {
    276  1.1  jmcneill 	uByte		bLength;
    277  1.1  jmcneill 	uByte		bDescriptorType;
    278  1.1  jmcneill 	uByte		bDescriptorSubtype;
    279  1.1  jmcneill 	uByte		bNumFormats;
    280  1.1  jmcneill 	uWord		wTotalLength;
    281  1.1  jmcneill 	uByte		bEndpointAddress;
    282  1.1  jmcneill 	uByte		bTerminalLink;
    283  1.1  jmcneill 	uByte		bControlSize;
    284  1.1  jmcneill 	uByte		bmaControls[];
    285  1.1  jmcneill } UPACKED uvideo_vs_output_header_descriptor_t;
    286  1.1  jmcneill 
    287  1.1  jmcneill 
    288  1.1  jmcneill typedef struct {
    289  1.1  jmcneill 	uWord		wWidth;
    290  1.1  jmcneill 	uWord		wHeight;
    291  1.1  jmcneill } UPACKED uvideo_still_image_frame_dimensions_t;
    292  1.1  jmcneill 
    293  1.1  jmcneill typedef struct {
    294  1.1  jmcneill 	uByte		bLength;
    295  1.1  jmcneill 	uByte		bDescriptorType;
    296  1.1  jmcneill 	uByte		bDescriptorSubtype;
    297  1.1  jmcneill 	uByte		bEndpointAddress;
    298  1.1  jmcneill 	uByte		bNumImageSizePatterns;
    299  1.1  jmcneill 	uvideo_still_image_frame_dimensions_t wwaDimensions[];
    300  1.1  jmcneill 	/* position dependent on size of previous item */
    301  1.1  jmcneill 	/* uByte	bNumCompressionPattern */
    302  1.1  jmcneill 	/* uByte	bCompression[] */
    303  1.1  jmcneill } UPACKED uvideo_still_image_frame_descriptor_t;
    304  1.1  jmcneill 
    305  1.1  jmcneill 
    306  1.1  jmcneill /* Color matching information */
    307  1.1  jmcneill 
    308  1.1  jmcneill /* bColroPrimaries */
    309  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_UNSPECIFIED	0
    310  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_sRGB		1 /* same as BT709 */
    311  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_BT709		1 /* default */
    312  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_BT470_2_M       	2
    313  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_BT470_2_BG      	3
    314  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_SMPTE_170M      	4
    315  1.1  jmcneill #define UVIDEO_COLOR_PRIMARIES_SMPTE_240M      	5
    316  1.1  jmcneill 
    317  1.1  jmcneill /* bTransferCharacteristics */
    318  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_UNSPECIFIED	0
    319  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_BT709		1 /* default */
    320  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_BT470_2_M       	2
    321  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_BT470_2_BG      	3
    322  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_SMPTE_170M      	4
    323  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_SMPTE_240M      	5
    324  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_LINEAR		6
    325  1.1  jmcneill #define UVIDEO_GAMMA_FUNCTION_sRGB		7 /* similar to BT709 */
    326  1.1  jmcneill 
    327  1.1  jmcneill /* bMatrixCoefficients */
    328  1.1  jmcneill #define UVIDEO_LUMA_CHROMA_MATRIX_UNSPECIFIED	0
    329  1.1  jmcneill #define UVIDEO_LUMA_CHROMA_MATRIX_BT709		1
    330  1.1  jmcneill #define UVIDEO_LUMA_CHROMA_MATRIX_FCC       	2
    331  1.1  jmcneill #define UVIDEO_LUMA_CHROMA_MATRIX_BT470_2_BG	3
    332  1.1  jmcneill #define UVIDEO_LUMA_CHROMA_MATRIX_SMPTE_170M	4 /* default */
    333  1.1  jmcneill #define UVIDEO_LUMA_CHROMA_MATRIX_SMPTE_240M	5
    334  1.1  jmcneill 
    335  1.1  jmcneill typedef struct {
    336  1.1  jmcneill 	uByte		bLength;
    337  1.1  jmcneill 	uByte		bDescriptorType;
    338  1.1  jmcneill 	uByte		bDescriptorSubtype;
    339  1.1  jmcneill 	uByte		bColorPrimaries;
    340  1.1  jmcneill 	uByte		bTransferCharacteristics;
    341  1.1  jmcneill 	uByte		bMatrixCoefficients;
    342  1.1  jmcneill } UPACKED uvideo_color_matching_descriptor_t;
    343  1.1  jmcneill 
    344  1.1  jmcneill /*
    345  1.1  jmcneill  * Format and Frame descriptors
    346  1.1  jmcneill  */
    347  1.1  jmcneill 
    348  1.1  jmcneill #define UVIDEO_FRAME_CAP_STILL_IMAGE	1<<0
    349  1.1  jmcneill #define UVIDEO_FRAME_CAP_FIXED_RATE	1<<1
    350  1.1  jmcneill 
    351  1.1  jmcneill #define UVIDEO_FRAME_INTERVAL_CONTINUOUS 0
    352  1.1  jmcneill 
    353  1.1  jmcneill /* TODO: interlace flags */
    354  1.1  jmcneill 
    355  1.1  jmcneill 
    356  1.1  jmcneill typedef struct {
    357  1.1  jmcneill 	uDWord		dwMinFrameInterval;
    358  1.1  jmcneill 	uDWord		dwMaxFrameInterval;
    359  1.1  jmcneill 	uDWord		dwFrameIntervalStep;
    360  1.1  jmcneill } UPACKED uvideo_frame_interval_continuous_t;
    361  1.1  jmcneill 
    362  1.1  jmcneill typedef struct {
    363  1.1  jmcneill 	uDWord	dwFrameInterval[1]; /* length depends on bFrameIntervalType */
    364  1.1  jmcneill } UPACKED uvideo_frame_interval_discrete_t;
    365  1.1  jmcneill 
    366  1.1  jmcneill typedef union {
    367  1.1  jmcneill 	uvideo_frame_interval_continuous_t	continuous;
    368  1.1  jmcneill 	uvideo_frame_interval_discrete_t	discrete;
    369  1.1  jmcneill } uvideo_frame_interval_t;
    370  1.1  jmcneill 
    371  1.1  jmcneill /* generic format descriptor header */
    372  1.1  jmcneill typedef struct {
    373  1.1  jmcneill 	uByte		bLength;
    374  1.1  jmcneill 	uByte		bDescriptorType;
    375  1.1  jmcneill 	uByte		bDescriptorSubtype;
    376  1.1  jmcneill 	uByte		bFormatIndex;
    377  1.1  jmcneill } UPACKED uvideo_vs_format_descriptor_t;
    378  1.1  jmcneill 
    379  1.1  jmcneill /* generic frame descriptor header */
    380  1.1  jmcneill typedef struct {
    381  1.1  jmcneill 	uByte		bLength;
    382  1.1  jmcneill 	uByte		bDescriptorType;
    383  1.1  jmcneill 	uByte		bDescriptorSubtype;
    384  1.1  jmcneill 	uByte		bFrameIndex;
    385  1.1  jmcneill } UPACKED uvideo_vs_frame_descriptor_t;
    386  1.1  jmcneill 
    387  1.1  jmcneill 
    388  1.1  jmcneill /*  uncompressed format and frame descriptors */
    389  1.1  jmcneill static const guid_t uvideo_guid_format_yuy2 = {
    390  1.1  jmcneill 	0x32595559,
    391  1.1  jmcneill 	0x0000,
    392  1.1  jmcneill 	0x0010,
    393  1.1  jmcneill 	{0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
    394  1.1  jmcneill };
    395  1.1  jmcneill 
    396  1.1  jmcneill static const guid_t uvideo_guid_format_nv12 = {
    397  1.1  jmcneill 	0x3231564E,
    398  1.1  jmcneill 	0x0000,
    399  1.1  jmcneill 	0x0010,
    400  1.1  jmcneill 	{0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
    401  1.1  jmcneill };
    402  1.1  jmcneill 
    403  1.2  jmcneill static const guid_t uvideo_guid_format_uyvy = {
    404  1.2  jmcneill 	0x59565955,
    405  1.2  jmcneill 	0x0000,
    406  1.2  jmcneill 	0x0010,
    407  1.2  jmcneill 	{0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
    408  1.2  jmcneill };
    409  1.2  jmcneill 
    410  1.1  jmcneill typedef struct {
    411  1.1  jmcneill 	uByte		bLength;
    412  1.1  jmcneill 	uByte		bDescriptorType;
    413  1.1  jmcneill 	uByte		bDescriptorSubtype;
    414  1.1  jmcneill 	uByte		bFormatIndex;
    415  1.1  jmcneill 	uByte		bNumFrameDescriptors;
    416  1.1  jmcneill 	usb_guid_t	guidFormat;
    417  1.1  jmcneill 	uByte		bBitsPerPixel;
    418  1.1  jmcneill 	uByte		bDefaultFrameIndex;
    419  1.1  jmcneill 	uByte		bAspectRatioX;
    420  1.1  jmcneill 	uByte		bAspectRatioY;
    421  1.1  jmcneill 	uByte		bmInterlaceFlags;
    422  1.1  jmcneill 	uByte		bCopyProtect;
    423  1.1  jmcneill } UPACKED uvideo_vs_format_uncompressed_descriptor_t;
    424  1.1  jmcneill 
    425  1.1  jmcneill typedef struct {
    426  1.1  jmcneill 	uByte		bLength;
    427  1.1  jmcneill 	uByte		bDescriptorType;
    428  1.1  jmcneill 	uByte		bDescriptorSubtype;
    429  1.1  jmcneill 	uByte		bFrameIndex;
    430  1.1  jmcneill 	uByte		bmCapabilities;
    431  1.1  jmcneill 	uWord		wWidth;
    432  1.1  jmcneill 	uWord		wHeight;
    433  1.1  jmcneill 	uDWord		dwMinBitRate;
    434  1.1  jmcneill 	uDWord		dwMaxBitRate;
    435  1.1  jmcneill 	uDWord		dwMaxVideoFrameBufferSize;
    436  1.1  jmcneill 	uDWord		dwDefaultFrameInterval;
    437  1.1  jmcneill 	uByte		bFrameIntervalType;
    438  1.1  jmcneill 	uvideo_frame_interval_t uFrameInterval;
    439  1.1  jmcneill } UPACKED uvideo_vs_frame_uncompressed_descriptor_t;
    440  1.1  jmcneill 
    441  1.1  jmcneill 
    442  1.1  jmcneill /* Frame based Format and Frame descriptors.  This is for generic
    443  1.1  jmcneill  * frame based payloads not covered by other types (e.g, uncompressed
    444  1.1  jmcneill  * or MJPEG). */
    445  1.1  jmcneill 
    446  1.1  jmcneill typedef struct {
    447  1.1  jmcneill 	uByte		bLength;
    448  1.1  jmcneill 	uByte		bDescriptorType;
    449  1.1  jmcneill 	uByte		bDescriptorSubtype;
    450  1.1  jmcneill 	uByte		bFormatIndex;
    451  1.1  jmcneill 	uByte		bNumFrameDescriptors;
    452  1.1  jmcneill 	usb_guid_t	guidFormat;
    453  1.1  jmcneill 	uByte		bBitsPerPixel;
    454  1.1  jmcneill 	uByte		bDefaultFrameIndex;
    455  1.1  jmcneill 	uByte		bAspectRatioX;
    456  1.1  jmcneill 	uByte		bAspectRatioY;
    457  1.1  jmcneill 	uByte		bmInterlaceFlags;
    458  1.1  jmcneill 	uByte		bCopyProtect;
    459  1.1  jmcneill } UPACKED uvideo_format_frame_based_descriptor_t;
    460  1.1  jmcneill 
    461  1.1  jmcneill typedef struct {
    462  1.1  jmcneill 	uByte		bLength;
    463  1.1  jmcneill 	uByte		bDescriptorType;
    464  1.1  jmcneill 	uByte		bDescriptorSubtype;
    465  1.1  jmcneill 	uByte		bFrameIndex;
    466  1.1  jmcneill 	uByte		bmCapabilities;
    467  1.1  jmcneill 	uWord		wWidth;
    468  1.1  jmcneill 	uWord		wHeight;
    469  1.1  jmcneill 	uDWord		dwMinBitRate;
    470  1.1  jmcneill 	uDWord		dwMaxBitRate;
    471  1.1  jmcneill 	uDWord		dwDefaultFrameInterval;
    472  1.1  jmcneill 	uByte		bFrameIntervalType;
    473  1.1  jmcneill 	uDWord		dwBytesPerLine;
    474  1.1  jmcneill 	uvideo_frame_interval_t uFrameInterval;
    475  1.1  jmcneill } UPACKED uvideo_frame_frame_based_descriptor_t;
    476  1.1  jmcneill 
    477  1.1  jmcneill 
    478  1.1  jmcneill /* MJPEG format and frame descriptors */
    479  1.1  jmcneill 
    480  1.1  jmcneill typedef struct {
    481  1.1  jmcneill 	uByte		bLength;
    482  1.1  jmcneill 	uByte		bDescriptorType;
    483  1.1  jmcneill 	uByte		bDescriptorSubtype;
    484  1.1  jmcneill 	uByte		bFormatIndex;
    485  1.1  jmcneill 	uByte		bNumFrameDescriptors;
    486  1.1  jmcneill 	uByte		bmFlags;
    487  1.1  jmcneill #define UVIDEO_NO_FIXED_SIZE_SAMPLES 0
    488  1.1  jmcneill #define UVIDEO_FIXED_SIZE_SAMPLES 1
    489  1.1  jmcneill 	uByte		bDefaultFrameIndex;
    490  1.1  jmcneill 	uByte		bAspectRatioX;
    491  1.1  jmcneill 	uByte		bAspectRatioY;
    492  1.1  jmcneill 	uByte		bmInterlaceFlags;
    493  1.1  jmcneill 	uByte		bCopyProtect;
    494  1.1  jmcneill } UPACKED uvideo_vs_format_mjpeg_descriptor_t;
    495  1.1  jmcneill 
    496  1.1  jmcneill typedef struct {
    497  1.1  jmcneill 	uByte		bLength;
    498  1.1  jmcneill 	uByte		bDescriptorType;
    499  1.1  jmcneill 	uByte		bDescriptorSubtype;
    500  1.1  jmcneill 	uByte		bFrameIndex;
    501  1.1  jmcneill 	uByte		bmCapabilities;
    502  1.1  jmcneill 	uWord		wWidth;
    503  1.1  jmcneill 	uWord		wHeight;
    504  1.1  jmcneill 	uDWord		dwMinBitRate;
    505  1.1  jmcneill 	uDWord		dwMaxBitRate;
    506  1.1  jmcneill 	uDWord		dwMaxVideoFrameBufferSize;
    507  1.1  jmcneill 	uDWord		dwDefaultFrameInterval;
    508  1.1  jmcneill 	uByte		bFrameIntervalType;
    509  1.1  jmcneill 	uvideo_frame_interval_t uFrameInterval;
    510  1.1  jmcneill } UPACKED uvideo_vs_frame_mjpeg_descriptor_t;
    511  1.1  jmcneill 
    512  1.1  jmcneill 
    513  1.1  jmcneill typedef struct {
    514  1.1  jmcneill 	uByte		bLength;
    515  1.1  jmcneill 	uByte		bDescriptorType;
    516  1.1  jmcneill 	uByte		bDescriptorSubtype;
    517  1.1  jmcneill 	uByte		bFormatIndex;
    518  1.1  jmcneill 	uDWord		dwMaxVideoFrameBufferSize;
    519  1.1  jmcneill 	uByte		bFormatType;
    520  1.1  jmcneill #define UVIDEO_GET_DV_FREQ(ubyte) (((ubyte)>>7) & 1)
    521  1.1  jmcneill #define UVIDEO_DV_FORMAT_FREQ_50HZ 0
    522  1.1  jmcneill #define UVIDEO_DV_FORMAT_FREQ_60HZ 1
    523  1.1  jmcneill #define UVIDEO_GET_DV_FORMAT(ubyte) ((ubyte) & 0x3f)
    524  1.1  jmcneill #define UVIDEO_DV_FORMAT_SD_DV	0
    525  1.1  jmcneill #define UVIDEO_DV_FORMAT_SDL_DV	1
    526  1.1  jmcneill #define UVIDEO_DV_FORMAT_HD_DV	2
    527  1.1  jmcneill } UPACKED uvideo_vs_format_dv_descriptor_t;
    528  1.1  jmcneill 
    529  1.1  jmcneill 
    530  1.1  jmcneill 
    531  1.1  jmcneill /*
    532  1.1  jmcneill  * Video Control requests
    533  1.1  jmcneill  */
    534  1.1  jmcneill 
    535  1.1  jmcneill /* Pseudo bitmasks that only work when bitwise OR onto a zeroed value */
    536  1.1  jmcneill #define UVIDEO_REQUEST_TYPE_INTERFACE		(0x0001)
    537  1.1  jmcneill #define UVIDEO_REQUEST_TYPE_ENDPOINT		(0x0010)
    538  1.1  jmcneill #define UVIDEO_REQUEST_TYPE_CLASS_SPECIFIC	(0x01 << 5)
    539  1.1  jmcneill #define UVIDEO_REQUEST_TYPE_SET			(0x0 << 7)
    540  1.1  jmcneill #define UVIDEO_REQUEST_TYPE_GET			(0x1 << 7)
    541  1.1  jmcneill 
    542  1.1  jmcneill typedef enum {
    543  1.1  jmcneill 	UVIDEO_REQUEST_DESC_INTERFACE,
    544  1.1  jmcneill 	UVIDEO_REQUEST_DESC_ENDPOINT
    545  1.1  jmcneill } uvideo_request_descriptor;
    546  1.1  jmcneill 
    547  1.1  jmcneill typedef enum {
    548  1.1  jmcneill 	UR_RC_UNDEFINED = 0x00,
    549  1.1  jmcneill 	UR_SET_CUR	= 0x01,
    550  1.1  jmcneill 	UR_GET_CUR	= 0x81,
    551  1.1  jmcneill 	UR_GET_MIN	= 0x82,
    552  1.1  jmcneill 	UR_GET_MAX	= 0x83,
    553  1.1  jmcneill 	UR_GET_RES	= 0x84,
    554  1.1  jmcneill 	UR_GET_LEN	= 0x85,
    555  1.1  jmcneill 	UR_GET_INFO	= 0x86,
    556  1.1  jmcneill 	UR_GET_DEF	= 0x87,
    557  1.1  jmcneill } uvideo_request;
    558  1.1  jmcneill 
    559  1.1  jmcneill /* camera terminal control selectors */
    560  1.1  jmcneill #define UVIDEO_CT_CONTROL_UNDEFINED		0x00
    561  1.1  jmcneill #define UVIDEO_CT_SCANNING_MODE_CONTROL		0x01
    562  1.1  jmcneill #define UVIDEO_CT_AE_MODE_CONTROL		0x02
    563  1.1  jmcneill #define UVIDEO_CT_EXPOSURE_TIME_ABSOLUTE_CONTROL 0x04
    564  1.1  jmcneill #define UVIDEO_CT_EXPOSURE_TIME_RELATIVE_CONTROL 0x05
    565  1.1  jmcneill #define UVIDEO_CT_FOCUS_ABSOLUTE_CONTROL	0x06
    566  1.1  jmcneill #define UVIDEO_CT_FOCUS_RELATIVE_CONTROL	0x07
    567  1.1  jmcneill #define UVIDEO_CT_IRIS_ABSOLUTE_CONTROL		0x09
    568  1.1  jmcneill #define UVIDEO_CT_IRIS_RELATIVE_CONTROL		0x0A
    569  1.1  jmcneill #define UVIDEO_CT_ZOOM_ABSOLUTE_CONTROL		0x0B
    570  1.1  jmcneill #define UVIDEO_CT_ZOOM_RELATIVE_CONTROL		0x0C
    571  1.1  jmcneill #define UVIDEO_CT_PANTILT_ABSOLUTE_CONTROL	0x0D
    572  1.1  jmcneill #define UVIDEO_CT_PANTILT_RELATIVE_CONTROL	0x0E
    573  1.1  jmcneill #define UVIDEO_CT_ROLL_ABSOLUTE_CONTROL		0x0F
    574  1.1  jmcneill #define UVIDEO_CT_ROLL_RELATIVE_CONTROL		0x10
    575  1.1  jmcneill #define UVIDEO_CT_PRIVACY_CONTROL		0x11
    576  1.1  jmcneill 
    577  1.1  jmcneill /* processing unit control selectors */
    578  1.1  jmcneill #define UVIDEO_PU_CONTROL_UNDEFINED			0x00
    579  1.1  jmcneill #define UVIDEO_PU_BACKLIGHT_COMPENSATION_CONTROL	0x01
    580  1.1  jmcneill #define UVIDEO_PU_BRIGHTNESS_CONTROL			0x02
    581  1.1  jmcneill #define UVIDEO_PU_CONTRAST_CONTROL			0x03
    582  1.1  jmcneill #define UVIDEO_PU_GAIN_CONTROL				0x04
    583  1.1  jmcneill #define UVIDEO_PU_POWER_LINE_FREQUENCY_CONTROL		0x05
    584  1.1  jmcneill #define UVIDEO_PU_HUE_CONTROL				0x06
    585  1.1  jmcneill #define UVIDEO_PU_SATURATION_CONTROL			0x07
    586  1.1  jmcneill #define UVIDEO_PU_SHARPNESS_CONTROL			0x08
    587  1.1  jmcneill #define UVIDEO_PU_GAMMA_CONTROL				0x09
    588  1.1  jmcneill #define UVIDEO_PU_WHITE_BALANCE_TEMPERATURE_CONTROL	0x0A
    589  1.1  jmcneill #define UVIDEO_PU_WHITE_BALANCE_TEMPERATURE_AUTO_CONTROL 0x0B
    590  1.1  jmcneill #define UVIDEO_PU_WHITE_BALANCE_COMPONENT_CONTROL	0x0C
    591  1.1  jmcneill #define UVIDEO_PU_WHITE_BALANCE_COMPONENT_AUTO_CONTROL	0x0D
    592  1.1  jmcneill #define UVIDEO_PU_DIGITAL_MULTIPLIER_CONTROL		0x0E
    593  1.1  jmcneill #define UVIDEO_PU_DIGITAL_MULTIPLIER_LIMIT_CONTROL	0x0F
    594  1.1  jmcneill #define UVIDEO_PU_HUE_AUTO_CONTROL			0x10
    595  1.1  jmcneill #define UVIDEO_PU_ANALOG_VIDEO_STANDARD_CONTROL		0x11
    596  1.1  jmcneill #define UVIDEO_PU_ANALOG_LOCK_STATUS_CONTROL		0x12
    597  1.1  jmcneill 
    598  1.1  jmcneill /* extension unit control selectors */
    599  1.1  jmcneill #define UVIDEO_XU_CONTROL_UNDEFINED	0x00
    600  1.1  jmcneill 
    601  1.1  jmcneill /* VideoStreaming Interface control selectors */
    602  1.1  jmcneill #define UVIDEO_VS_CONTROL_UNDEFINED		0x00
    603  1.1  jmcneill #define UVIDEO_VS_PROBE_CONTROL			0x01
    604  1.1  jmcneill #define UVIDEO_VS_COMMIT_CONTROL		0x02
    605  1.1  jmcneill #define UVIDEO_VS_STILL_PROBE_CONTROL		0x03
    606  1.1  jmcneill #define UVIDEO_VS_STILL_COMMIT_CONTROL		0x04
    607  1.1  jmcneill #define UVIDEO_VS_STILL_IMAGE_TRIGGER_CONTROL	0x05
    608  1.1  jmcneill #define UVIDEO_VS_STREAM_ERROR_CODE_CONTROL	0x06
    609  1.1  jmcneill #define UVIDEO_VS_GENERATE_KEY_FRAME_CONTROL	0x07
    610  1.1  jmcneill #define UVIDEO_VS_UPDATE_FRAME_SEGMENT_CONTROL	0x08
    611  1.1  jmcneill #define UVIDEO_VS_SYNCH_DELAY_CONTROL		0x09
    612  1.1  jmcneill 
    613  1.1  jmcneill /* bitmask result of GET_INFO on a control */
    614  1.1  jmcneill #define UVIDEO_CONTROL_INFO_SUPPORTS_GET	(1<<0)
    615  1.1  jmcneill #define UVIDEO_CONTROL_INFO_SUPPORTS_SET	(1<<1)
    616  1.1  jmcneill #define UVIDEO_CONTROL_INFO_DISABLED		(1<<2)
    617  1.1  jmcneill #define UVIDEO_CONTROL_INFO_AUTOUPDATE		(1<<3)
    618  1.1  jmcneill #define UVIDEO_CONTROL_INFO_ASYNC		(1<<4)
    619  1.1  jmcneill 
    620  1.1  jmcneill 
    621  1.1  jmcneill /* Video Probe and Commit Controls request data */
    622  1.1  jmcneill typedef struct {
    623  1.1  jmcneill 	uWord		bmHint;
    624  1.1  jmcneill #define UVIDEO_HINT_FRAME_INTERVAL	(1<<0)
    625  1.1  jmcneill #define UVIDEO_HINT_KEYFRAME_RATE	(1<<1)
    626  1.1  jmcneill #define UVIDEO_HINT_PFRAME_RATE		(1<<2)
    627  1.1  jmcneill #define UVIDEO_HINT_COMP_QUALITY	(1<<3)
    628  1.1  jmcneill #define UVIDEO_HINT_COMP_WINDOW_SIZE	(1<<4)
    629  1.1  jmcneill 	uByte		bFormatIndex;
    630  1.1  jmcneill 	uByte		bFrameIndex;
    631  1.1  jmcneill 	uDWord		dwFrameInterval;
    632  1.1  jmcneill #define UVIDEO_100NS_PER_MS 10000
    633  1.1  jmcneill #define UVIDEO_FRAME_INTERVAL_UNITS_PER_USB_FRAME UVIDEO_100NS_PER_MS
    634  1.1  jmcneill 	uWord		wKeyFrameRate;
    635  1.1  jmcneill 	uWord		wPFrameRate;
    636  1.1  jmcneill 	uWord		wCompQuality;
    637  1.1  jmcneill 	uWord		wCompWindowSize;
    638  1.1  jmcneill 	uWord		wDelay;
    639  1.1  jmcneill 	uDWord		dwMaxVideoFrameSize;
    640  1.1  jmcneill 	uDWord		dwMaxPayloadTransferSize;
    641  1.1  jmcneill 	/* Following fields are not in v1.0 of UVC.  Will have to do
    642  1.1  jmcneill 	 * UR_GET_LEN to discover the length of this descriptor. */
    643  1.1  jmcneill 	uDWord		dwClockFrequency;
    644  1.1  jmcneill 	uByte		bmFramingInfo;
    645  1.1  jmcneill #define UVIDEO_FRAMING_INFO_FID	(1<<0)
    646  1.1  jmcneill #define UVIDEO_FRAMING_INFO_EOF	(1<<1)
    647  1.1  jmcneill 	uByte		bPreferedVersion;
    648  1.1  jmcneill 	uByte		bMinVersion;
    649  1.1  jmcneill 	uByte		bMaxVersion;
    650  1.1  jmcneill } UPACKED uvideo_probe_and_commit_data_t;
    651  1.1  jmcneill 
    652  1.1  jmcneill /* Video Still Probe and Still Commit Controls request data */
    653  1.1  jmcneill typedef struct {
    654  1.1  jmcneill 	uByte		bFormatIndex;
    655  1.1  jmcneill 	uByte		bFrameIndex;
    656  1.1  jmcneill 	uByte		bCompressionIndex;
    657  1.1  jmcneill 	uDWord		dwMaxVideoFrameSize;
    658  1.1  jmcneill 	uDWord		dwMaxPayloadTransferSize;
    659  1.1  jmcneill } UPACKED uvideo_still_probe_and_still_commit_data_t;
    660  1.1  jmcneill #define UVIDEO_STILL_PROBE_AND_STILL_COMMIT_DATA_SIZE 11;
    661  1.1  jmcneill 
    662  1.1  jmcneill 
    663  1.1  jmcneill 
    664  1.1  jmcneill /* common header for Video Control and Video Stream status */
    665  1.1  jmcneill typedef struct {
    666  1.1  jmcneill 	uByte		bStatusType;
    667  1.1  jmcneill #define UV_STATUS_TYPE_CONTROL	0x02
    668  1.1  jmcneill #define UV_STATUS_TYPE_STREAM	0x04
    669  1.1  jmcneill 	uByte		bOriginator;
    670  1.1  jmcneill } UPACKED uvideo_status_t;
    671  1.1  jmcneill 
    672  1.1  jmcneill typedef struct {
    673  1.1  jmcneill 	uByte		bStatusType;
    674  1.1  jmcneill 	uByte		bOriginator;
    675  1.1  jmcneill 	uByte		bEvent;
    676  1.1  jmcneill #define UV_CONTROL_CHANGE	0x00 /* any other value is Reserved */
    677  1.1  jmcneill 	uByte		bSelector;
    678  1.1  jmcneill 	uByte		bAttribute;
    679  1.1  jmcneill #define UV_CONTROL_VALUE_CHANGE		0x00
    680  1.1  jmcneill #define UV_CONTROL_INFO_CHANGE		0x01
    681  1.1  jmcneill #define UV_CONTROL_FAILURE_CHANGE	0x02
    682  1.1  jmcneill 	uByte		bValue;
    683  1.1  jmcneill } UPACKED uvideo_control_status_t;
    684  1.1  jmcneill 
    685  1.1  jmcneill typedef struct {
    686  1.1  jmcneill 	uByte		bStatusType;
    687  1.1  jmcneill 	uByte		bOriginator;
    688  1.1  jmcneill 	uByte		bEvent;
    689  1.1  jmcneill #define UV_BUTTON_PRESS	0x00 /* any other value is Stream Error */
    690  1.1  jmcneill 	uByte		bValue;
    691  1.1  jmcneill #define UV_BUTTON_RELEASED	0x00
    692  1.1  jmcneill #define UV_BUTTON_PRESSED	0x01
    693  1.1  jmcneill } UPACKED uvideo_streaming_status_t;
    694  1.1  jmcneill 
    695  1.1  jmcneill typedef struct {
    696  1.1  jmcneill 	uByte		bHeaderLength;
    697  1.1  jmcneill 	uByte		bmHeaderInfo;
    698  1.1  jmcneill #define UV_FRAME_ID	1<<0
    699  1.1  jmcneill #define UV_END_OF_FRAME	1<<1
    700  1.1  jmcneill #define UV_PRES_TIME	1<<2
    701  1.1  jmcneill #define UV_SRC_CLOCK	1<<3
    702  1.1  jmcneill /* D4: Reserved */
    703  1.1  jmcneill #define UV_STILL_IMAGE	1<<5
    704  1.1  jmcneill #define UV_ERROR	1<<6
    705  1.1  jmcneill #define UV_END_OF_HDR	1<<7
    706  1.1  jmcneill /* other fields depend on which bits are set above and have no fixed offset */
    707  1.1  jmcneill /*	uDWord		dwPresentationTime; */
    708  1.1  jmcneill #define UVIDEO_PTS_SIZE 4
    709  1.1  jmcneill /*	uByte		scrSourceClock[UVIDEO_SOURCE_CLOCK_SIZE]; */
    710  1.1  jmcneill #define UVIDEO_SOURCE_CLOCK_SIZE 6
    711  1.1  jmcneill #define UV_GET_SOURCE_TIME_CLOCK(sc) (UGETDW(sc))
    712  1.1  jmcneill /* bits 42..32 */
    713  1.1  jmcneill #define UV_GET_SOF_COUNTER(sc) (((sc)[4] | ((sc)[5] << 8)) &0x7ff)
    714  1.1  jmcneill } UPACKED uvideo_payload_header_t;
    715  1.1  jmcneill 
    716  1.1  jmcneill /* Note: this might be larger depending on presence of source clock,
    717  1.1  jmcneill    SOF counter, or other things... bHeaderLength is actual length. */
    718  1.1  jmcneill #define UVIDEO_PAYLOAD_HEADER_SIZE 12
    719  1.1  jmcneill 
    720