1 /* 2 * Copyright 2011, Haiku Inc. All Rights Reserved. 3 * Copyright 2009, Ithamar Adema, <ithamar.adema@team-embedded.nl>. 4 * Distributed under the terms of the MIT License. 5 */ 6 #ifndef _USB_VIDEO_H 7 #define _USB_VIDEO_H 8 9 10 #define VC_CONTROL_UNDEFINED 0x0 11 #define VC_VIDEO_POWER_MODE_CONTROL 0x1 12 #define VC_REQUEST_ERROR_CODE_CONTROL 0x2 13 14 typedef struct usbvc_class_descriptor { 15 uint8 length; 16 uint8 descriptorType; 17 uint8 descriptorSubtype; 18 } _PACKED usbvc_class_descriptor; 19 20 typedef uint8 usbvc_guid[16]; 21 22 struct usbvc_format_descriptor { 23 uint8 length; 24 uint8 descriptorType; 25 uint8 descriptorSubtype; 26 uint8 formatIndex; 27 uint8 numFrameDescriptors; 28 union { 29 struct { 30 usbvc_guid format; 31 uint8 bytesPerPixel; 32 uint8 defaultFrameIndex; 33 uint8 aspectRatioX; 34 uint8 aspectRatioY; 35 uint8 interlaceFlags; 36 uint8 copyProtect; 37 } uncompressed; 38 struct { 39 uint8 flags; 40 uint8 defaultFrameIndex; 41 uint8 aspectRatioX; 42 uint8 aspectRatioY; 43 uint8 interlaceFlags; 44 uint8 copyProtect; 45 } mjpeg; 46 }; 47 } _PACKED; 48 49 struct usbvc_interface_header_descriptor { 50 uint8 length; 51 uint8 descriptorType; 52 uint8 descriptorSubtype; 53 uint16 version; 54 uint16 totalLength; 55 uint32 clockFrequency; 56 uint8 numInterfacesNumbers; 57 uint8 interfaceNumbers[0]; 58 } _PACKED; 59 60 struct usbvc_input_terminal_descriptor { 61 uint8 length; 62 uint8 descriptorType; 63 uint8 descriptorSubtype; 64 uint8 terminalID; 65 uint16 terminalType; 66 uint8 associatedTerminal; 67 uint8 terminal; 68 } _PACKED; 69 70 71 #endif /* _USB_VIDEO_H */ 72