-/* $OpenBSD: uvideo.h,v 1.30 2008/08/26 21:52:48 mglocker Exp $ */
+/* $OpenBSD: uvideo.h,v 1.31 2008/08/27 17:31:48 mglocker Exp $ */
/*
* Copyright (c) 2007 Robert Nagy <robert@openbsd.org>
uWord wTotalLength;
uDWord dwClockFrequency;
uByte bInCollection;
-};
+} __packed;
struct usb_video_header_desc_all {
struct usb_video_header_desc *fix;
uWord wTerminalType;
uByte bAssocTerminal;
uByte iTerminal;
-};
+} __packed;
/* Table 3-5: Output Terminal Descriptor */
struct usb_video_output_terminal_desc {
uByte bAssocTerminal;
uByte bSourceID;
uByte iTerminal;
-};
+} __packed;
/* Table 3-6: Camera Terminal Descriptor */
struct usb_video_camera_terminal_desc {
uWord wOcularFocalLength;
uByte bControlSize;
uByte *bmControls;
-};
+} __packed;
/* Table 3-8: VC Processing Unit Descriptor */
struct usb_video_vc_processing_desc {
uByte bDescriptorType;
uByte bDescriptorSubtype;
uWord wMaxTransferSize;
-};
+} __packed;
/* Table 3-13: Interface Input Header Descriptor */
struct usb_video_input_header_desc {
uByte bTriggerSupport;
uByte bTriggerUsage;
uByte bControlSize;
-};
+} __packed;
struct usb_video_input_header_desc_all {
struct usb_video_input_header_desc *fix;
/*
* Driver specific private definitions.
*/
-#define UVIDEO_NFRAMES_MAX 40
+struct uvideo_format_desc {
+ uByte bLength;
+ uByte bDescriptorType;
+ uByte bDescriptorSubtype;
+ uByte bFormatIndex;
+ uByte bNumFrameDescriptors;
+ union {
+ /* mjpeg */
+ struct {
+ uByte bmFlags;
+ uByte bDefaultFrameIndex;
+ uByte bAspectRatioX;
+ uByte bAspectRatioY;
+ uByte bmInterlaceFlags;
+ uByte bCopyProtect;
+ } mjpeg;
+ /* uncompressed */
+ struct {
+ uByte guidFormat[16];
+ uByte bBitsPerPixel;
+ uByte bDefaultFrameIndex;
+ uByte bAspectRatioX;
+ uByte bAspectRatioY;
+ uByte bmInterlaceFlags;
+ uByte bCopyProtect;
+ } uc;
+ } u;
+} __packed;
+
+#define UVIDEO_NFRAMES_MAX 40
struct uvideo_vs_iface {
struct uvideo_softc *sc;
usbd_xfer_handle xfer;
};
typedef SIMPLEQ_HEAD(, uvideo_mmap) q_mmap;
-struct uvideo_format_desc {
- uByte bLength;
- uByte bDescriptorType;
- uByte bDescriptorSubtype;
- uByte bFormatIndex;
- uByte bNumFrameDescriptors;
- union {
- /* mjpeg */
- struct {
- uByte bmFlags;
- uByte bDefaultFrameIndex;
- uByte bAspectRatioX;
- uByte bAspectRatioY;
- uByte bmInterlaceFlags;
- uByte bCopyProtect;
- } mjpeg;
-
- /* uncompressed */
- struct {
- uByte guidFormat[16];
- uByte bBitsPerPixel;
- uByte bDefaultFrameIndex;
- uByte bAspectRatioX;
- uByte bAspectRatioY;
- uByte bmInterlaceFlags;
- uByte bCopyProtect;
- } uc;
- } u;
-} __packed;
-
struct uvideo_format_group {
uint32_t pixelformat;
uint8_t format_dfidx;
int width;
int height;
int fidx;
-} __packed;
+};
struct uvideo_controls {
int cid;