xref: /haiku/src/add-ons/media/media-add-ons/usb_webcam/addons/uvc/USB_video.h (revision d05ff048a28b96e0667db13c18cbbd62e8a4933b)
119b602bcSIthamar R. Adema /*
2*26a912cdSJérôme Duval  * Copyright 2011, Haiku Inc. All Rights Reserved.
319b602bcSIthamar R. Adema  * Copyright 2009, Ithamar Adema, <ithamar.adema@team-embedded.nl>.
419b602bcSIthamar R. Adema  * Distributed under the terms of the MIT License.
519b602bcSIthamar R. Adema  */
619b602bcSIthamar R. Adema #ifndef _USB_VIDEO_H
719b602bcSIthamar R. Adema #define _USB_VIDEO_H
819b602bcSIthamar R. Adema 
9*26a912cdSJérôme Duval 
1019b602bcSIthamar R. Adema #define VC_CONTROL_UNDEFINED		0x0
1119b602bcSIthamar R. Adema #define VC_VIDEO_POWER_MODE_CONTROL	0x1
1219b602bcSIthamar R. Adema #define VC_REQUEST_ERROR_CODE_CONTROL	0x2
1319b602bcSIthamar R. Adema 
14*26a912cdSJérôme Duval typedef struct usbvc_class_descriptor {
15*26a912cdSJérôme Duval 	uint8	length;
16*26a912cdSJérôme Duval 	uint8	descriptorType;
17*26a912cdSJérôme Duval 	uint8	descriptorSubtype;
18*26a912cdSJérôme Duval } _PACKED usbvc_class_descriptor;
19*26a912cdSJérôme Duval 
20*26a912cdSJérôme Duval typedef uint8 usbvc_guid[16];
21*26a912cdSJérôme Duval 
22*26a912cdSJérôme Duval struct usbvc_format_descriptor {
23*26a912cdSJérôme Duval 	uint8	length;
24*26a912cdSJérôme Duval 	uint8	descriptorType;
25*26a912cdSJérôme Duval 	uint8	descriptorSubtype;
26*26a912cdSJérôme Duval 	uint8	formatIndex;
27*26a912cdSJérôme Duval 	uint8	numFrameDescriptors;
28*26a912cdSJérôme Duval 	union {
29*26a912cdSJérôme Duval 		struct {
30*26a912cdSJérôme Duval 			usbvc_guid format;
31*26a912cdSJérôme Duval 			uint8	bytesPerPixel;
32*26a912cdSJérôme Duval 			uint8	defaultFrameIndex;
33*26a912cdSJérôme Duval 			uint8	aspectRatioX;
34*26a912cdSJérôme Duval 			uint8	aspectRatioY;
35*26a912cdSJérôme Duval 			uint8	interlaceFlags;
36*26a912cdSJérôme Duval 			uint8	copyProtect;
37*26a912cdSJérôme Duval 		} uncompressed;
38*26a912cdSJérôme Duval 		struct {
39*26a912cdSJérôme Duval 			uint8	flags;
40*26a912cdSJérôme Duval 			uint8	defaultFrameIndex;
41*26a912cdSJérôme Duval 			uint8	aspectRatioX;
42*26a912cdSJérôme Duval 			uint8	aspectRatioY;
43*26a912cdSJérôme Duval 			uint8	interlaceFlags;
44*26a912cdSJérôme Duval 			uint8	copyProtect;
45*26a912cdSJérôme Duval 		} mjpeg;
46*26a912cdSJérôme Duval 	};
47*26a912cdSJérôme Duval } _PACKED;
48*26a912cdSJérôme Duval 
49*26a912cdSJérôme Duval struct usbvc_interface_header_descriptor {
50*26a912cdSJérôme Duval 	uint8	length;
51*26a912cdSJérôme Duval 	uint8	descriptorType;
52*26a912cdSJérôme Duval 	uint8	descriptorSubtype;
53*26a912cdSJérôme Duval 	uint16	version;
54*26a912cdSJérôme Duval 	uint16	totalLength;
55*26a912cdSJérôme Duval 	uint32	clockFrequency;
56*26a912cdSJérôme Duval 	uint8	numInterfacesNumbers;
57*26a912cdSJérôme Duval 	uint8	interfaceNumbers[0];
58*26a912cdSJérôme Duval } _PACKED;
59*26a912cdSJérôme Duval 
60*26a912cdSJérôme Duval struct usbvc_input_terminal_descriptor {
61*26a912cdSJérôme Duval 	uint8	length;
62*26a912cdSJérôme Duval 	uint8	descriptorType;
63*26a912cdSJérôme Duval 	uint8	descriptorSubtype;
64*26a912cdSJérôme Duval 	uint8	terminalID;
65*26a912cdSJérôme Duval 	uint16	terminalType;
66*26a912cdSJérôme Duval 	uint8	associatedTerminal;
67*26a912cdSJérôme Duval 	uint8	terminal;
68*26a912cdSJérôme Duval } _PACKED;
69*26a912cdSJérôme Duval 
70*26a912cdSJérôme Duval 
7119b602bcSIthamar R. Adema #endif /* _USB_VIDEO_H */
72