亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? w9968cf.c

?? V4l driver for DVB HD
?? C
?? 第 1 頁 / 共 5 頁
字號:
 ****************************************************************************//* Video4linux interface */static struct file_operations w9968cf_fops;static int w9968cf_open(struct inode*, struct file*);static int w9968cf_release(struct inode*, struct file*);static int w9968cf_mmap(struct file*, struct vm_area_struct*);static int w9968cf_ioctl(struct inode*, struct file*, unsigned, unsigned long);static ssize_t w9968cf_read(struct file*, char __user *, size_t, loff_t*);static int w9968cf_v4l_ioctl(struct inode*, struct file*, unsigned int,			     void __user *);/* USB-specific */static int w9968cf_start_transfer(struct w9968cf_device*);static int w9968cf_stop_transfer(struct w9968cf_device*);static int w9968cf_write_reg(struct w9968cf_device*, u16 value, u16 index);static int w9968cf_read_reg(struct w9968cf_device*, u16 index);static int w9968cf_write_fsb(struct w9968cf_device*, u16* data);static int w9968cf_write_sb(struct w9968cf_device*, u16 value);static int w9968cf_read_sb(struct w9968cf_device*);static int w9968cf_upload_quantizationtables(struct w9968cf_device*);static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs);/* Low-level I2C (SMBus) I/O */static int w9968cf_smbus_start(struct w9968cf_device*);static int w9968cf_smbus_stop(struct w9968cf_device*);static int w9968cf_smbus_write_byte(struct w9968cf_device*, u8 v);static int w9968cf_smbus_read_byte(struct w9968cf_device*, u8* v);static int w9968cf_smbus_write_ack(struct w9968cf_device*);static int w9968cf_smbus_read_ack(struct w9968cf_device*);static int w9968cf_smbus_refresh_bus(struct w9968cf_device*);static int w9968cf_i2c_adap_read_byte(struct w9968cf_device* cam,				      u16 address, u8* value);static int w9968cf_i2c_adap_read_byte_data(struct w9968cf_device*, u16 address,					   u8 subaddress, u8* value);static int w9968cf_i2c_adap_write_byte(struct w9968cf_device*,				       u16 address, u8 subaddress);static int w9968cf_i2c_adap_fastwrite_byte_data(struct w9968cf_device*,						u16 address, u8 subaddress,						u8 value);/* I2C interface to kernel */static int w9968cf_i2c_init(struct w9968cf_device*);static int w9968cf_i2c_smbus_xfer(struct i2c_adapter*, u16 addr,				  unsigned short flags, char read_write,				  u8 command, int size, union i2c_smbus_data*);static u32 w9968cf_i2c_func(struct i2c_adapter*);static int w9968cf_i2c_attach_inform(struct i2c_client*);static int w9968cf_i2c_detach_inform(struct i2c_client*);static int w9968cf_i2c_control(struct i2c_adapter*, unsigned int cmd,			       unsigned long arg);/* Memory management */static void* rvmalloc(unsigned long size);static void rvfree(void *mem, unsigned long size);static void w9968cf_deallocate_memory(struct w9968cf_device*);static int  w9968cf_allocate_memory(struct w9968cf_device*);/* High-level image sensor control functions */static int w9968cf_sensor_set_control(struct w9968cf_device*,int cid,int val);static int w9968cf_sensor_get_control(struct w9968cf_device*,int cid,int *val);static int w9968cf_sensor_cmd(struct w9968cf_device*,			      unsigned int cmd, void *arg);static int w9968cf_sensor_init(struct w9968cf_device*);static int w9968cf_sensor_update_settings(struct w9968cf_device*);static int w9968cf_sensor_get_picture(struct w9968cf_device*);static int w9968cf_sensor_update_picture(struct w9968cf_device*,					 struct video_picture pict);/* Other helper functions */static void w9968cf_configure_camera(struct w9968cf_device*,struct usb_device*,				     enum w9968cf_model_id,				     const unsigned short dev_nr);static void w9968cf_adjust_configuration(struct w9968cf_device*);static int w9968cf_turn_on_led(struct w9968cf_device*);static int w9968cf_init_chip(struct w9968cf_device*);static inline u16 w9968cf_valid_palette(u16 palette);static inline u16 w9968cf_valid_depth(u16 palette);static inline u8 w9968cf_need_decompression(u16 palette);static int w9968cf_set_picture(struct w9968cf_device*, struct video_picture);static int w9968cf_set_window(struct w9968cf_device*, struct video_window);static int w9968cf_postprocess_frame(struct w9968cf_device*,				     struct w9968cf_frame_t*);static int w9968cf_adjust_window_size(struct w9968cf_device*, u16* w, u16* h);static void w9968cf_init_framelist(struct w9968cf_device*);static void w9968cf_push_frame(struct w9968cf_device*, u8 f_num);static void w9968cf_pop_frame(struct w9968cf_device*,struct w9968cf_frame_t**);static void w9968cf_release_resources(struct w9968cf_device*);/**************************************************************************** * Symbolic names                                                           * ****************************************************************************//* Used to represent a list of values and their respective symbolic names */struct w9968cf_symbolic_list {	const int num;	const char *name;};/*--------------------------------------------------------------------------  Returns the name of the matching element in the symbolic_list array. The  end of the list must be marked with an element that has a NULL name.  --------------------------------------------------------------------------*/static inline const char *symbolic(struct w9968cf_symbolic_list list[], const int num){	int i;	for (i = 0; list[i].name != NULL; i++)		if (list[i].num == num)			return (list[i].name);	return "Unknown";}static struct w9968cf_symbolic_list camlist[] = {	{ W9968CF_MOD_GENERIC, "W996[87]CF JPEG USB Dual Mode Camera" },	{ W9968CF_MOD_CLVBWGP, "Creative Labs Video Blaster WebCam Go Plus" },	/* Other cameras (having the same descriptors as Generic W996[87]CF) */	{ W9968CF_MOD_ADPVDMA, "Aroma Digi Pen VGA Dual Mode ADG-5000" },	{ W9986CF_MOD_AAU, "AVerMedia AVerTV USB" },	{ W9968CF_MOD_CLVBWG, "Creative Labs Video Blaster WebCam Go" },	{ W9968CF_MOD_LL, "Lebon LDC-035A" },	{ W9968CF_MOD_EEEMC, "Ezonics EZ-802 EZMega Cam" },	{ W9968CF_MOD_OOE, "OmniVision OV8610-EDE" },	{ W9968CF_MOD_ODPVDMPC, "OPCOM Digi Pen VGA Dual Mode Pen Camera" },	{ W9968CF_MOD_PDPII, "Pretec Digi Pen-II" },	{ W9968CF_MOD_PDP480, "Pretec DigiPen-480" },	{  -1, NULL }};static struct w9968cf_symbolic_list senlist[] = {	{ CC_OV76BE,   "OV76BE" },	{ CC_OV7610,   "OV7610" },	{ CC_OV7620,   "OV7620" },	{ CC_OV7620AE, "OV7620AE" },	{ CC_OV6620,   "OV6620" },	{ CC_OV6630,   "OV6630" },	{ CC_OV6630AE, "OV6630AE" },	{ CC_OV6630AF, "OV6630AF" },	{ -1, NULL }};/* Video4Linux1 palettes */static struct w9968cf_symbolic_list v4l1_plist[] = {	{ VIDEO_PALETTE_GREY,    "GREY" },	{ VIDEO_PALETTE_HI240,   "HI240" },	{ VIDEO_PALETTE_RGB565,  "RGB565" },	{ VIDEO_PALETTE_RGB24,   "RGB24" },	{ VIDEO_PALETTE_RGB32,   "RGB32" },	{ VIDEO_PALETTE_RGB555,  "RGB555" },	{ VIDEO_PALETTE_YUV422,  "YUV422" },	{ VIDEO_PALETTE_YUYV,    "YUYV" },	{ VIDEO_PALETTE_UYVY,    "UYVY" },	{ VIDEO_PALETTE_YUV420,  "YUV420" },	{ VIDEO_PALETTE_YUV411,  "YUV411" },	{ VIDEO_PALETTE_RAW,     "RAW" },	{ VIDEO_PALETTE_YUV422P, "YUV422P" },	{ VIDEO_PALETTE_YUV411P, "YUV411P" },	{ VIDEO_PALETTE_YUV420P, "YUV420P" },	{ VIDEO_PALETTE_YUV410P, "YUV410P" },	{ -1, NULL }};/* Decoder error codes: */static struct w9968cf_symbolic_list decoder_errlist[] = {	{ W9968CF_DEC_ERR_CORRUPTED_DATA, "Corrupted data" },	{ W9968CF_DEC_ERR_BUF_OVERFLOW,   "Buffer overflow" },	{ W9968CF_DEC_ERR_NO_SOI,         "SOI marker not found" },	{ W9968CF_DEC_ERR_NO_SOF0,        "SOF0 marker not found" },	{ W9968CF_DEC_ERR_NO_SOS,         "SOS marker not found" },	{ W9968CF_DEC_ERR_NO_EOI,         "EOI marker not found" },	{ -1, NULL }};/* URB error codes: */static struct w9968cf_symbolic_list urb_errlist[] = {	{ -ENOMEM,    "No memory for allocation of internal structures" },	{ -ENOSPC,    "The host controller's bandwidth is already consumed" },	{ -ENOENT,    "URB was canceled by unlink_urb" },	{ -EXDEV,     "ISO transfer only partially completed" },	{ -EAGAIN,    "Too match scheduled for the future" },	{ -ENXIO,     "URB already queued" },	{ -EFBIG,     "Too much ISO frames requested" },	{ -ENOSR,     "Buffer error (overrun)" },	{ -EPIPE,     "Specified endpoint is stalled (device not responding)"},	{ -EOVERFLOW, "Babble (bad cable?)" },	{ -EPROTO,    "Bit-stuff error (bad cable?)" },	{ -EILSEQ,    "CRC/Timeout" },	{ -ETIMEDOUT, "NAK (device does not respond)" },	{ -1, NULL }};/**************************************************************************** * Memory management functions                                              * ****************************************************************************/static void* rvmalloc(unsigned long size){	void* mem;	unsigned long adr;	size = PAGE_ALIGN(size);	mem = vmalloc_32(size);	if (!mem)		return NULL;	memset(mem, 0, size); /* Clear the ram out, no junk to the user */	adr = (unsigned long) mem;	while (size > 0) {		SetPageReserved(vmalloc_to_page((void *)adr));		adr += PAGE_SIZE;		size -= PAGE_SIZE;	}	return mem;}static void rvfree(void* mem, unsigned long size){	unsigned long adr;	if (!mem)		return;	adr = (unsigned long) mem;	while ((long) size > 0) {		ClearPageReserved(vmalloc_to_page((void *)adr));		adr += PAGE_SIZE;		size -= PAGE_SIZE;	}	vfree(mem);}/*--------------------------------------------------------------------------  Deallocate previously allocated memory.  --------------------------------------------------------------------------*/static void w9968cf_deallocate_memory(struct w9968cf_device* cam){	u8 i;	/* Free the isochronous transfer buffers */	for (i = 0; i < W9968CF_URBS; i++) {		kfree(cam->transfer_buffer[i]);		cam->transfer_buffer[i] = NULL;	}	/* Free temporary frame buffer */	if (cam->frame_tmp.buffer) {		rvfree(cam->frame_tmp.buffer, cam->frame_tmp.size);		cam->frame_tmp.buffer = NULL;	}	/* Free helper buffer */	if (cam->frame_vpp.buffer) {		rvfree(cam->frame_vpp.buffer, cam->frame_vpp.size);		cam->frame_vpp.buffer = NULL;	}	/* Free video frame buffers */	if (cam->frame[0].buffer) {		rvfree(cam->frame[0].buffer, cam->nbuffers*cam->frame[0].size);		cam->frame[0].buffer = NULL;	}	cam->nbuffers = 0;	DBG(5, "Memory successfully deallocated")}/*--------------------------------------------------------------------------  Allocate memory buffers for USB transfers and video frames.  This function is called by open() only.  Return 0 on success, a negative number otherwise.  --------------------------------------------------------------------------*/static int w9968cf_allocate_memory(struct w9968cf_device* cam){	const u16 p_size = wMaxPacketSize[cam->altsetting-1];	void* buff = NULL;	unsigned long hw_bufsize, vpp_bufsize;	u8 i, bpp;	/* NOTE: Deallocation is done elsewhere in case of error */	/* Calculate the max amount of raw data per frame from the device */	hw_bufsize = cam->maxwidth*cam->maxheight*2;	/* Calculate the max buf. size needed for post-processing routines */	bpp = (w9968cf_vpp) ? 4 : 2;	if (cam->upscaling)		vpp_bufsize = max(W9968CF_MAX_WIDTH*W9968CF_MAX_HEIGHT*bpp,				  cam->maxwidth*cam->maxheight*bpp);	else		vpp_bufsize = cam->maxwidth*cam->maxheight*bpp;	/* Allocate memory for the isochronous transfer buffers */	for (i = 0; i < W9968CF_URBS; i++) {		if (!(cam->transfer_buffer[i] =		      kzalloc(W9968CF_ISO_PACKETS*p_size, GFP_KERNEL))) {			DBG(1, "Couldn't allocate memory for the isochronous "			       "transfer buffers (%u bytes)",			    p_size * W9968CF_ISO_PACKETS)			return -ENOMEM;		}	}	/* Allocate memory for the temporary frame buffer */	if (!(cam->frame_tmp.buffer = rvmalloc(hw_bufsize))) {		DBG(1, "Couldn't allocate memory for the temporary "		       "video frame buffer (%lu bytes)", hw_bufsize)		return -ENOMEM;	}	cam->frame_tmp.size = hw_bufsize;	cam->frame_tmp.number = -1;	/* Allocate memory for the helper buffer */	if (w9968cf_vpp) {		if (!(cam->frame_vpp.buffer = rvmalloc(vpp_bufsize))) {			DBG(1, "Couldn't allocate memory for the helper buffer"			       " (%lu bytes)", vpp_bufsize)			return -ENOMEM;		}		cam->frame_vpp.size = vpp_bufsize;	} else		cam->frame_vpp.buffer = NULL;	/* Allocate memory for video frame buffers */	cam->nbuffers = cam->max_buffers;	while (cam->nbuffers >= 2) {		if ((buff = rvmalloc(cam->nbuffers * vpp_bufsize)))			break;		else			cam->nbuffers--;	}	if (!buff) {		DBG(1, "Couldn't allocate memory for the video frame buffers")		cam->nbuffers = 0;		return -ENOMEM;	}	if (cam->nbuffers != cam->max_buffers)		DBG(2, "Couldn't allocate memory for %u video frame buffers. "		       "Only memory for %u buffers has been allocated",		    cam->max_buffers, cam->nbuffers)	for (i = 0; i < cam->nbuffers; i++) {		cam->frame[i].buffer = buff + i*vpp_bufsize;		cam->frame[i].size = vpp_bufsize;		cam->frame[i].number = i;		/* Circular list */		if (i != cam->nbuffers-1)			cam->frame[i].next = &cam->frame[i+1];		else			cam->frame[i].next = &cam->frame[0];		cam->frame[i].status = F_UNUSED;	}	DBG(5, "Memory successfully allocated")	return 0;}/**************************************************************************** * USB-specific functions                                                   * ****************************************************************************//*--------------------------------------------------------------------------  This is an handler function which is called after the URBs are completed.  It collects multiple data packets coming from the camera by putting them  into frame buffers: one or more zero data length data packets are used to  mark the end of a video frame; the first non-zero data packet is the start  of the next video frame; if an error is encountered in a packet, the entire  video frame is discarded and grabbed again.  If there are no requested frames in the FIFO list, packets are collected into  a temporary buffer.  --------------------------------------------------------------------------*/static void w9968cf_urb_complete(struct urb *urb, struct pt_regs *regs){	struct w9968cf_device* cam = (struct w9968cf_device*)urb->context;	struct w9968cf_frame_t** f;	unsigned int len, status;	void* pos;	u8 i;	int err = 0;	if ((!cam->streaming) || cam->disconnected) {		DBG(4, "Got interrupt, but not streaming")		return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆91小视频| 777a∨成人精品桃花网| 欧美日韩mp4| 国产精品视频麻豆| 蜜臀av亚洲一区中文字幕| 色国产综合视频| 国产精品热久久久久夜色精品三区| 午夜日韩在线电影| 色国产综合视频| 国产精品久久久久久久久快鸭| 蜜臀av在线播放一区二区三区| 在线免费精品视频| 亚洲美女电影在线| 成人激情电影免费在线观看| 欧美白人最猛性xxxxx69交| 午夜影视日本亚洲欧洲精品| 97久久超碰国产精品电影| 久久久91精品国产一区二区三区| 麻豆91在线观看| 日韩免费观看高清完整版| 午夜av区久久| 欧美日韩高清一区二区| 一区二区三区欧美视频| 91在线视频免费91| 最新不卡av在线| av在线不卡观看免费观看| 国产精品久久久久桃色tv| 国产成人免费视| 欧美精彩视频一区二区三区| 国产一区二区三区美女| 国产亚洲精品久| 成人sese在线| 亚洲免费色视频| 欧洲一区二区三区免费视频| 亚洲免费在线观看| 欧美亚洲动漫另类| 丝瓜av网站精品一区二区| 欧美日本国产视频| 日本视频一区二区| 欧美成人a在线| 国产一区二区视频在线| 国产日韩欧美综合在线| 成人综合婷婷国产精品久久免费| 国产日韩欧美麻豆| 99国产一区二区三精品乱码| 亚洲免费在线播放| 91精品国产日韩91久久久久久| 免费成人av在线播放| 久久午夜羞羞影院免费观看| 国产成人精品三级| 一区二区三区毛片| 日韩你懂的电影在线观看| 国产mv日韩mv欧美| 亚洲一区二区在线播放相泽| 欧美一区二区观看视频| 国产69精品久久久久777| 亚洲少妇最新在线视频| 欧美日韩一区二区三区免费看 | 777亚洲妇女| 精品一区二区三区久久| 国产精品传媒在线| 欧美日韩国产高清一区| 韩国女主播成人在线观看| 国产精品麻豆久久久| 欧美日韩国产另类一区| 极品瑜伽女神91| 亚洲人午夜精品天堂一二香蕉| 欧美中文字幕一二三区视频| 麻豆国产欧美日韩综合精品二区| 国产精品国产三级国产普通话99| 欧美三级中文字| 国产馆精品极品| 亚洲6080在线| 自拍偷自拍亚洲精品播放| 欧美一二三四区在线| 91视频在线观看| 国产精品一区专区| 亚洲成av人片| 亚洲欧洲三级电影| 欧美精品一区二区三区在线播放| 91免费在线视频观看| 国产综合久久久久影院| 亚洲第一成年网| 国产精品传媒视频| 久久香蕉国产线看观看99| 欧美日韩国产区一| 99久久婷婷国产精品综合| 久久99国产精品成人| 亚洲成人在线免费| 亚洲欧美日韩国产综合在线| 久久久亚洲精品一区二区三区| 欧美精选一区二区| 91成人在线免费观看| 成人动漫一区二区| 久久精品国产亚洲aⅴ| 亚洲成a人v欧美综合天堂| |精品福利一区二区三区| 久久久一区二区| 精品国产区一区| 日韩一区二区免费在线观看| 欧美亚洲国产一区在线观看网站 | 91精品办公室少妇高潮对白| 国产不卡在线一区| 国产一二三精品| 九九在线精品视频| 日本欧美韩国一区三区| 亚洲成av人片| 日韩高清在线一区| 日韩中文字幕不卡| 日韩国产高清影视| 麻豆91在线播放免费| 蜜桃精品视频在线观看| 天堂在线亚洲视频| 青青草91视频| 韩国欧美国产一区| 国产一区二区免费视频| 国产精品123区| 大白屁股一区二区视频| 成人动漫av在线| 色综合久久天天| 欧洲av一区二区嗯嗯嗯啊| 欧洲精品一区二区| 正在播放亚洲一区| 日韩亚洲欧美在线| 久久综合九色综合97婷婷| 久久丝袜美腿综合| 中文字幕欧美国产| 亚洲欧美视频在线观看| 一区二区理论电影在线观看| 亚洲福利一二三区| 蜜桃久久久久久久| 国产不卡视频一区| 在线免费亚洲电影| 日韩精品中文字幕在线一区| 久久久久国产精品麻豆ai换脸 | ww久久中文字幕| 国产午夜精品久久久久久久| 亚洲人精品一区| 视频一区在线播放| 国产一区二区电影| 91麻豆国产在线观看| 欧美午夜不卡在线观看免费| 欧美一级片在线| 国产欧美精品一区aⅴ影院| 亚洲精品日日夜夜| 美女免费视频一区二区| 99精品久久久久久| 91精品国产乱码久久蜜臀| 久久新电视剧免费观看| 一区二区三区精品久久久| 美腿丝袜亚洲一区| 94-欧美-setu| 精品欧美一区二区三区精品久久| 国产精品久久久久四虎| 三级一区在线视频先锋| 国产激情精品久久久第一区二区 | 99久久久久免费精品国产| 91麻豆精品久久久久蜜臀| 中文字幕免费不卡| 美洲天堂一区二卡三卡四卡视频| 成人黄色a**站在线观看| 欧美日韩不卡一区二区| 国产精品国产三级国产普通话三级 | 欧美日韩中文一区| 亚洲国产精品成人综合| 亚洲aⅴ怡春院| 成人av在线观| 精品少妇一区二区三区在线视频 | 久99久精品视频免费观看| 色国产综合视频| 国产日本欧洲亚洲| 青草av.久久免费一区| 在线观看av不卡| 国产精品美女久久久久久2018 | 91成人免费电影| 国产欧美日本一区二区三区| 日韩精品一级中文字幕精品视频免费观看 | 欧洲色大大久久| 亚洲欧美一区二区三区国产精品| 韩国精品在线观看| 日韩无一区二区| 亚洲mv在线观看| 在线区一区二视频| 一区二区三区四区在线播放| 99精品国产91久久久久久| 国产精品久久久久影院老司 | 国内国产精品久久| 欧美一区二区三区思思人| 婷婷激情综合网| 欧美主播一区二区三区美女| 1000精品久久久久久久久| www.66久久| ●精品国产综合乱码久久久久| 成人午夜视频在线| 国产精品网站一区| jlzzjlzz亚洲女人18| 国产精品久久久久久妇女6080| 国产成人精品免费一区二区| 国产精品免费网站在线观看| 粉嫩av一区二区三区在线播放|