⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ov511.h

📁 基于S3CEB2410平台LINUX操作系统下 USB驱动源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
	LED_AUTO,};/* Raw frame formats */enum {	RAWFMT_INVALID,	RAWFMT_YUV400,	RAWFMT_YUV420,	RAWFMT_YUV422,	RAWFMT_GBR422,};/* Unsigned short option numbers */enum {	OV511_USOPT_INVALID,	OV511_USOPT_BRIGHT,	OV511_USOPT_SAT,	OV511_USOPT_HUE,	OV511_USOPT_CONTRAST,};/* Unsigned int option numbers */enum {	OV511_UIOPT_INVALID,	OV511_UIOPT_POWER_FREQ,	OV511_UIOPT_BFILTER,	OV511_UIOPT_LED,	OV511_UIOPT_DEBUG,	OV511_UIOPT_COMPRESS,};struct ov511_ushort_opt {	int optnum;		/* Specific option number */	unsigned short val;};struct ov511_uint_opt {	int optnum;		/* Specific option number */	unsigned int val;};struct ov511_i2c_struct {	unsigned char slave; /* Write slave ID (read ID - 1) */	unsigned char reg;   /* Index of register */	unsigned char value; /* User sets this w/ write, driver does w/ read */	unsigned char mask;  /* Bits to be changed. Not used with read ops */};/* ioctls */#define OV511IOC_GINTVER  _IOR('v', BASE_VIDIOCPRIVATE + 0, int)#define OV511IOC_GUSHORT _IOWR('v', BASE_VIDIOCPRIVATE + 1, \			       struct ov511_ushort_opt)#define OV511IOC_SUSHORT  _IOW('v', BASE_VIDIOCPRIVATE + 2, \			       struct ov511_ushort_opt)#define OV511IOC_GUINT   _IOWR('v', BASE_VIDIOCPRIVATE + 3, \			       struct ov511_uint_opt)#define OV511IOC_SUINT    _IOW('v', BASE_VIDIOCPRIVATE + 4, \			       struct ov511_uint_opt)#define OV511IOC_WI2C     _IOW('v', BASE_VIDIOCPRIVATE + 5, \			       struct ov511_i2c_struct)#define OV511IOC_RI2C    _IOWR('v', BASE_VIDIOCPRIVATE + 6, \			       struct ov511_i2c_struct)/* ------------- End IOCTL interface -------------- */struct ov511_sbuf {	char *data;	urb_t *urb;};enum {	FRAME_UNUSED,		/* Unused (no MCAPTURE) */	FRAME_READY,		/* Ready to start grabbing */	FRAME_GRABBING,		/* In the process of being grabbed into */	FRAME_DONE,		/* Finished grabbing, but not been synced yet */	FRAME_ERROR,		/* Something bad happened while processing */};struct ov511_regvals {	enum {		OV511_DONE_BUS,		OV511_REG_BUS,		OV511_I2C_BUS,	} bus;	unsigned char reg;	unsigned char val;};struct ov511_frame {	int framenum;		/* Index of this frame */	char *data;		/* Frame buffer */	char *tempdata;		/* Temp buffer for multi-stage conversions */	char *rawdata;		/* Raw camera data buffer */	int depth;		/* Bytes per pixel */	int width;		/* Width application is expecting */	int height;		/* Height application is expecting */	int rawwidth;		/* Actual width of frame sent from camera */	int rawheight;		/* Actual height of frame sent from camera */	int sub_flag;		/* Sub-capture mode for this frame? */	unsigned int format;	/* Format for this frame */	int compressed;		/* Is frame compressed? */	volatile int grabstate;	/* State of grabbing */	int scanstate;		/* State of scanning */	int bytes_recvd;	/* Number of image bytes received from camera */	long bytes_read;	/* Amount that has been read() */	wait_queue_head_t wq;	/* Processes waiting */	int snapshot;		/* True if frame was a snapshot */};#define DECOMP_INTERFACE_VER 2/* Compression module operations */struct ov51x_decomp_ops {	int (*decomp_400)(unsigned char *, unsigned char *, int, int, int);	int (*decomp_420)(unsigned char *, unsigned char *, int, int, int);	int (*decomp_422)(unsigned char *, unsigned char *, int, int, int);	void (*decomp_lock)(void);	void (*decomp_unlock)(void);};#define OV511_NUMFRAMES	2#if OV511_NUMFRAMES > VIDEO_MAX_FRAME#error "OV511_NUMFRAMES is too high"#endif#define OV511_NUMSBUF		2struct usb_ov511 {	struct video_device vdev;	/* Device structure */	struct usb_device *dev;	int customid;	int desc;	unsigned char iface;	/* Determined by sensor type */	int maxwidth;	int maxheight;	int minwidth;	int minheight;	int brightness;	int colour;	int contrast;	int hue;	int whiteness;	int exposure;	int auto_brt;		/* Auto brightness enabled flag */	int auto_gain;		/* Auto gain control enabled flag */	int auto_exp;		/* Auto exposure enabled flag */	int backlight;		/* Backlight exposure algorithm flag */	int led_policy;		/* LED: off|on|auto; OV511+ only */	struct semaphore lock;	/* Serializes user-accessible operations */	int user;		/* user count for exclusive use */	int streaming;		/* Are we streaming Isochronous? */	int grabbing;		/* Are we grabbing? */	int compress;		/* Should the next frame be compressed? */	int compress_inited;	/* Are compression params uploaded? */	int lightfreq;		/* Power (lighting) frequency */	int bandfilt;		/* Banding filter enabled flag */	char *fbuf;		/* Videodev buffer area */	char *tempfbuf;		/* Temporary (intermediate) buffer area */	char *rawfbuf;		/* Raw camera data buffer area */	int sub_flag;		/* Pix Array subcapture on flag */	int subx;		/* Pix Array subcapture x offset */	int suby;		/* Pix Array subcapture y offset */	int subw;		/* Pix Array subcapture width */	int subh;		/* Pix Array subcapture height */	int curframe;		/* Current receiving sbuf */	struct ov511_frame frame[OV511_NUMFRAMES];		struct ov511_sbuf sbuf[OV511_NUMSBUF];	wait_queue_head_t wq;	/* Processes waiting */	int snap_enabled;	/* Snapshot mode enabled */		int bridge;		/* Type of bridge (BRG_*) */	int bclass;		/* Class of bridge (BCL_*) */	int sensor;		/* Type of image sensor chip (SEN_*) */	int sclass;		/* Type of image sensor chip (SCL_*) */	int tuner;		/* Type of TV tuner */	int packet_size;	/* Frame size per isoc desc */	struct semaphore param_lock;	/* params lock for this camera */	/* /proc entries, relative to /proc/video/ov511/ */	struct proc_dir_entry *proc_devdir;   /* Per-device proc directory */	struct proc_dir_entry *proc_info;     /* <minor#>/info entry */	struct proc_dir_entry *proc_button;   /* <minor#>/button entry */	struct proc_dir_entry *proc_control;  /* <minor#>/control entry */	/* Framebuffer/sbuf management */	int buf_state;	struct semaphore buf_lock;	struct timer_list buf_timer;	struct ov51x_decomp_ops *decomp_ops;	/* Stop streaming while changing picture settings */	int stop_during_set;	int stopped;		/* Streaming is temporarily paused */	/* Video decoder stuff */	int input;		/* Composite, S-VIDEO, etc... */	int num_inputs;		/* Number of inputs */	int norm; 		/* NTSC / PAL / SECAM */	int has_decoder;	/* Device has a video decoder */	int has_tuner;		/* Device has a TV tuner */	int has_audio_proc;	/* Device has an audio processor */	int freq;		/* Current tuner frequency */	int tuner_type;		/* Specific tuner model */	/* I2C interface to kernel */	struct semaphore i2c_lock;	  /* Protect I2C controller regs */	unsigned char primary_i2c_slave;  /* I2C write id of sensor */};struct cam_list {	int id;	char *description;};struct palette_list {	int num;	char *name;};struct mode_list_518 {	int width;	int height;	u8 reg28;	u8 reg29;	u8 reg2a;	u8 reg2c;	u8 reg2e;	u8 reg24;	u8 reg25;};/* Compression stuff */#define OV511_QUANTABLESIZE	64#define OV518_QUANTABLESIZE	32#define OV511_YQUANTABLE { \	0, 1, 1, 2, 2, 3, 3, 4, \	1, 1, 1, 2, 2, 3, 4, 4, \	1, 1, 2, 2, 3, 4, 4, 4, \	2, 2, 2, 3, 4, 4, 4, 4, \	2, 2, 3, 4, 4, 5, 5, 5, \	3, 3, 4, 4, 5, 5, 5, 5, \	3, 4, 4, 4, 5, 5, 5, 5, \	4, 4, 4, 4, 5, 5, 5, 5  \}#define OV511_UVQUANTABLE { \	0, 2, 2, 3, 4, 4, 4, 4, \	2, 2, 2, 4, 4, 4, 4, 4, \	2, 2, 3, 4, 4, 4, 4, 4, \	3, 4, 4, 4, 4, 4, 4, 4, \	4, 4, 4, 4, 4, 4, 4, 4, \	4, 4, 4, 4, 4, 4, 4, 4, \	4, 4, 4, 4, 4, 4, 4, 4, \	4, 4, 4, 4, 4, 4, 4, 4  \}#define OV518_YQUANTABLE { \	5, 4, 5, 6, 6, 7, 7, 7, \	5, 5, 5, 5, 6, 7, 7, 7, \	6, 6, 6, 6, 7, 7, 7, 8, \	7, 7, 6, 7, 7, 7, 8, 8  \}#define OV518_UVQUANTABLE { \	6, 6, 6, 7, 7, 7, 7, 7, \	6, 6, 6, 7, 7, 7, 7, 7, \	6, 6, 6, 7, 7, 7, 7, 8, \	7, 7, 7, 7, 7, 7, 8, 8  \}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -