📄 winbond_9967cf.h
字号:
#ifndef __LINUX_WINBOND_H#define __LINUX_WINBOND_H#include <linux/videodev.h>/*** W9967 Video Registers ***/#define W9967_CROP_START_X 0x10#define W9967_CROP_START_Y 0x11#define W9967_CROP_END_X 0x12#define W9967_CROP_END_Y 0x13#define W9967_CAPTURE_WIDTH 0x14#define W9967_CAPTURE_HEIGHT 0x15#define W9967_VIDEO_CAPTURE_REG 0x16#define W9967_USB_FIFO_REG 0x3c#define W9967CF_NUMFRAMES 2 /* (each takes 900k as well) */#define W9967CF_MAX_DATA_SIZE 640*480*3 /* 3 for rgb.. *2 for YUV?*/ #define W9967CF_MAX_FRAME_SIZE W9967CF_MAX_DATA_SIZE#define W9967_ISO_PACKETS 10 /* Future use. Number of packets */ /* USB Vendor Specific requests */#define GET_W9967CF_CONTROL 1 #define SET_W9967CF_CONTROL 0 /* USB Data Video Endpoint */#define W9967_VIDEO_ENDPOINT 1/* Video output formats. (Bits 1-0 in CR16). */enum { W9967CF_YUV422_PACKED=0, W9967CF_YUV420_PACKED=1, W9967CF_YUV422_PLANAR=2, W9967CF_YUV420_PLANAR=3};enum { FRAME_GRABBING, FRAME_DONE, FRAME_UNUSED };typedef struct { short width, height; char capture, capture_mode; char filter, filter_type; /* 0:YUV422Packed, 1:YUV420Packed, 2: YUV442Planar, 3: YUV420Planar */ char vid_dataformat; /* CCIR-601 clamping: Y to 16-240, U and V to 16-235 (i think) */ char ccir_clamp;} w9967cfcam_reg;/* Packet sizes for the USB Isochronous Transfer depending upon the interface selected */int wPacketSize[] = { 1023,959,895,831, 767,703,639,575, 511,447,383,319, 255,191,217,63};/* Main driver structure */typedef struct { struct video_device vdev; struct usb_device *dev; short depth; char *fbuf; /* Buffer */ unsigned char alternateIface; int grabbing, error; w9967cfcam_reg ctrlreg; /* picture settings (v4l) */ short saturation, brightness, hue; short colour, contrast, whiteness; char frame_depth; urb_t *urb; int packet_size; char *tbuf; /* Transfer buffer */ int lock; /* Future use,don't touch */ } w9967cfcam ;/* next lines necessary for the vdev struct below */static void w9967cf_close(struct video_device *vdev);static int w9967cf_open(struct video_device *vdev, int flags);static int w9967cf_ioctl(struct video_device *dev, unsigned int cmd, void *arg);static int w9967cf_init_done(struct video_device *dev);static long w9967cf_read(struct video_device *dev, char *buf, unsigned long count, int noblock);static struct video_device w9967cf_vdev_template = { name: "Winbond W996[78]CF based webcam", type: VID_TYPE_CAPTURE, hardware: 23478, /* Arbitrary for test */ open: w9967cf_open, close: w9967cf_close, read: w9967cf_read, write: NULL, poll: NULL, ioctl: w9967cf_ioctl, //w9967cf_ioctl, mmap: NULL, /* TODO */ initialize: w9967cf_init_done, /* TODO */ priv: NULL, busy: 0, minor: 1 /* set, not variable?! 0's used by my tvcard so 1 */};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -