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

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

?? w9968cf.c

?? V4l driver for DVB HD
?? C
?? 第 1 頁 / 共 5 頁
字號:
 * Helper functions                                                         * ****************************************************************************//*--------------------------------------------------------------------------  Turn on the LED on some webcams. A beep should be heard too.  Return 0 on success, a negative number otherwise.  --------------------------------------------------------------------------*/static int w9968cf_turn_on_led(struct w9968cf_device* cam){	int err = 0;	err += w9968cf_write_reg(cam, 0xff00, 0x00); /* power-down */	err += w9968cf_write_reg(cam, 0xbf17, 0x00); /* reset everything */	err += w9968cf_write_reg(cam, 0xbf10, 0x00); /* normal operation */	err += w9968cf_write_reg(cam, 0x0010, 0x01); /* serial bus, SDS high */	err += w9968cf_write_reg(cam, 0x0000, 0x01); /* serial bus, SDS low */	err += w9968cf_write_reg(cam, 0x0010, 0x01); /* ..high 'beep-beep' */	if (err)		DBG(2, "Couldn't turn on the LED")	DBG(5, "LED turned on")	return err;}/*--------------------------------------------------------------------------  Write some registers for the device initialization.  This function is called once on open().  Return 0 on success, a negative number otherwise.  --------------------------------------------------------------------------*/static int w9968cf_init_chip(struct w9968cf_device* cam){	unsigned long hw_bufsize = cam->maxwidth*cam->maxheight*2,		      y0 = 0x0000,		      u0 = y0 + hw_bufsize/2,		      v0 = u0 + hw_bufsize/4,		      y1 = v0 + hw_bufsize/4,		      u1 = y1 + hw_bufsize/2,		      v1 = u1 + hw_bufsize/4;	int err = 0;	err += w9968cf_write_reg(cam, 0xff00, 0x00); /* power off */	err += w9968cf_write_reg(cam, 0xbf10, 0x00); /* power on */	err += w9968cf_write_reg(cam, 0x405d, 0x03); /* DRAM timings */	err += w9968cf_write_reg(cam, 0x0030, 0x04); /* SDRAM timings */	err += w9968cf_write_reg(cam, y0 & 0xffff, 0x20); /* Y buf.0, low */	err += w9968cf_write_reg(cam, y0 >> 16, 0x21);    /* Y buf.0, high */	err += w9968cf_write_reg(cam, u0 & 0xffff, 0x24); /* U buf.0, low */	err += w9968cf_write_reg(cam, u0 >> 16, 0x25);    /* U buf.0, high */	err += w9968cf_write_reg(cam, v0 & 0xffff, 0x28); /* V buf.0, low */	err += w9968cf_write_reg(cam, v0 >> 16, 0x29);    /* V buf.0, high */	err += w9968cf_write_reg(cam, y1 & 0xffff, 0x22); /* Y buf.1, low */	err += w9968cf_write_reg(cam, y1 >> 16, 0x23);    /* Y buf.1, high */	err += w9968cf_write_reg(cam, u1 & 0xffff, 0x26); /* U buf.1, low */	err += w9968cf_write_reg(cam, u1 >> 16, 0x27);    /* U buf.1, high */	err += w9968cf_write_reg(cam, v1 & 0xffff, 0x2a); /* V buf.1, low */	err += w9968cf_write_reg(cam, v1 >> 16, 0x2b);    /* V buf.1, high */	err += w9968cf_write_reg(cam, y1 & 0xffff, 0x32); /* JPEG buf 0 low */	err += w9968cf_write_reg(cam, y1 >> 16, 0x33);    /* JPEG buf 0 high */	err += w9968cf_write_reg(cam, y1 & 0xffff, 0x34); /* JPEG buf 1 low */	err += w9968cf_write_reg(cam, y1 >> 16, 0x35);    /* JPEG bug 1 high */	err += w9968cf_write_reg(cam, 0x0000, 0x36);/* JPEG restart interval */	err += w9968cf_write_reg(cam, 0x0804, 0x37);/*JPEG VLE FIFO threshold*/	err += w9968cf_write_reg(cam, 0x0000, 0x38);/* disable hw up-scaling */	err += w9968cf_write_reg(cam, 0x0000, 0x3f); /* JPEG/MCTL test data */	err += w9968cf_set_picture(cam, cam->picture); /* this before */	err += w9968cf_set_window(cam, cam->window);	if (err)		DBG(1, "Chip initialization failed")	else		DBG(5, "Chip successfully initialized")	return err;}/*--------------------------------------------------------------------------  Return non-zero if the palette is supported, 0 otherwise.  --------------------------------------------------------------------------*/static inline u16 w9968cf_valid_palette(u16 palette){	u8 i = 0;	while (w9968cf_formatlist[i].palette != 0) {		if (palette == w9968cf_formatlist[i].palette)			return palette;		i++;	}	return 0;}/*--------------------------------------------------------------------------  Return the depth corresponding to the given palette.  Palette _must_ be supported !  --------------------------------------------------------------------------*/static inline u16 w9968cf_valid_depth(u16 palette){	u8 i=0;	while (w9968cf_formatlist[i].palette != palette)		i++;	return w9968cf_formatlist[i].depth;}/*--------------------------------------------------------------------------  Return non-zero if the format requires decompression, 0 otherwise.  --------------------------------------------------------------------------*/static inline u8 w9968cf_need_decompression(u16 palette){	u8 i = 0;	while (w9968cf_formatlist[i].palette != 0) {		if (palette == w9968cf_formatlist[i].palette)			return w9968cf_formatlist[i].compression;		i++;	}	return 0;}/*--------------------------------------------------------------------------  Change the picture settings of the camera.  Return 0 on success, a negative number otherwise.  --------------------------------------------------------------------------*/static intw9968cf_set_picture(struct w9968cf_device* cam, struct video_picture pict){	u16 fmt, hw_depth, hw_palette, reg_v = 0x0000;	int err = 0;	/* Make sure we are using a valid depth */	pict.depth = w9968cf_valid_depth(pict.palette);	fmt = pict.palette;	hw_depth = pict.depth; /* depth used by the winbond chip */	hw_palette = pict.palette; /* palette used by the winbond chip */	/* VS & HS polarities */	reg_v = (cam->vs_polarity << 12) | (cam->hs_polarity << 11);	switch (fmt)	{		case VIDEO_PALETTE_UYVY:			reg_v |= 0x0000;			cam->vpp_flag = VPP_NONE;			break;		case VIDEO_PALETTE_YUV422P:			reg_v |= 0x0002;			cam->vpp_flag = VPP_DECOMPRESSION;			break;		case VIDEO_PALETTE_YUV420:		case VIDEO_PALETTE_YUV420P:			reg_v |= 0x0003;			cam->vpp_flag = VPP_DECOMPRESSION;			break;		case VIDEO_PALETTE_YUYV:		case VIDEO_PALETTE_YUV422:			reg_v |= 0x0000;			cam->vpp_flag = VPP_SWAP_YUV_BYTES;			hw_palette = VIDEO_PALETTE_UYVY;			break;		/* Original video is used instead of RGBX palettes.		   Software conversion later. */		case VIDEO_PALETTE_GREY:		case VIDEO_PALETTE_RGB555:		case VIDEO_PALETTE_RGB565:		case VIDEO_PALETTE_RGB24:		case VIDEO_PALETTE_RGB32:			reg_v |= 0x0000; /* UYVY 16 bit is used */			hw_depth = 16;			hw_palette = VIDEO_PALETTE_UYVY;			cam->vpp_flag = VPP_UYVY_TO_RGBX;			break;	}	/* NOTE: due to memory issues, it is better to disable the hardware		 double buffering during compression */	if (cam->double_buffer && !(cam->vpp_flag & VPP_DECOMPRESSION))		reg_v |= 0x0080;	if (cam->clamping)		reg_v |= 0x0020;	if (cam->filter_type == 1)		reg_v |= 0x0008;	else if (cam->filter_type == 2)		reg_v |= 0x000c;	if ((err = w9968cf_write_reg(cam, reg_v, 0x16)))		goto error;	if ((err = w9968cf_sensor_update_picture(cam, pict)))		goto error;	/* If all went well, update the device data structure */	memcpy(&cam->picture, &pict, sizeof(pict));	cam->hw_depth = hw_depth;	cam->hw_palette = hw_palette;	/* Settings changed, so we clear the frame buffers */	memset(cam->frame[0].buffer, 0, cam->nbuffers*cam->frame[0].size);	DBG(4, "Palette is %s, depth is %u bpp",	    symbolic(v4l1_plist, pict.palette), pict.depth)	return 0;error:	DBG(1, "Failed to change picture settings")	return err;}/*--------------------------------------------------------------------------  Change the capture area size of the camera.  This function _must_ be called _after_ w9968cf_set_picture().  Return 0 on success, a negative number otherwise.  --------------------------------------------------------------------------*/static intw9968cf_set_window(struct w9968cf_device* cam, struct video_window win){	u16 x, y, w, h, scx, scy, cw, ch, ax, ay;	unsigned long fw, fh;	struct ovcamchip_window s_win;	int err = 0;	/* Work around to avoid FP arithmetics */	#define __SC(x) ((x) << 10)	#define __UNSC(x) ((x) >> 10)	/* Make sure we are using a supported resolution */	if ((err = w9968cf_adjust_window_size(cam, (u16*)&win.width,					      (u16*)&win.height)))		goto error;	/* Scaling factors */	fw = __SC(win.width) / cam->maxwidth;	fh = __SC(win.height) / cam->maxheight;	/* Set up the width and height values used by the chip */	if ((win.width > cam->maxwidth) || (win.height > cam->maxheight)) {		cam->vpp_flag |= VPP_UPSCALE;		/* Calculate largest w,h mantaining the same w/h ratio */		w = (fw >= fh) ? cam->maxwidth : __SC(win.width)/fh;		h = (fw >= fh) ? __SC(win.height)/fw : cam->maxheight;		if (w < cam->minwidth) /* just in case */			w = cam->minwidth;		if (h < cam->minheight) /* just in case */			h = cam->minheight;	} else {		cam->vpp_flag &= ~VPP_UPSCALE;		w = win.width;		h = win.height;	}	/* x,y offsets of the cropped area */	scx = cam->start_cropx;	scy = cam->start_cropy;	/* Calculate cropped area manteining the right w/h ratio */	if (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE)) {		cw = (fw >= fh) ? cam->maxwidth : __SC(win.width)/fh;		ch = (fw >= fh) ? __SC(win.height)/fw : cam->maxheight;	} else {		cw = w;		ch = h;	}	/* Setup the window of the sensor */	s_win.format = VIDEO_PALETTE_UYVY;	s_win.width = cam->maxwidth;	s_win.height = cam->maxheight;	s_win.quarter = 0; /* full progressive video */	/* Center it */	s_win.x = (s_win.width - cw) / 2;	s_win.y = (s_win.height - ch) / 2;	/* Clock divisor */	if (cam->clockdiv >= 0)		s_win.clockdiv = cam->clockdiv; /* manual override */	else		switch (cam->sensor) {			case CC_OV6620:				s_win.clockdiv = 0;				break;			case CC_OV6630:				s_win.clockdiv = 0;				break;			case CC_OV76BE:			case CC_OV7610:			case CC_OV7620:				s_win.clockdiv = 0;				break;			default:				s_win.clockdiv = W9968CF_DEF_CLOCKDIVISOR;		}	/* We have to scale win.x and win.y offsets */	if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE))	     || (cam->vpp_flag & VPP_UPSCALE) ) {		ax = __SC(win.x)/fw;		ay = __SC(win.y)/fh;	} else {		ax = win.x;		ay = win.y;	}	if ((ax + cw) > cam->maxwidth)		ax = cam->maxwidth - cw;	if ((ay + ch) > cam->maxheight)		ay = cam->maxheight - ch;	/* Adjust win.x, win.y */	if ( (cam->largeview && !(cam->vpp_flag & VPP_UPSCALE))	     || (cam->vpp_flag & VPP_UPSCALE) ) {		win.x = __UNSC(ax*fw);		win.y = __UNSC(ay*fh);	} else {		win.x = ax;		win.y = ay;	}	/* Offsets used by the chip */	x = ax + s_win.x;	y = ay + s_win.y;	/* Go ! */	if ((err = w9968cf_sensor_cmd(cam, OVCAMCHIP_CMD_S_MODE, &s_win)))		goto error;	err += w9968cf_write_reg(cam, scx + x, 0x10);	err += w9968cf_write_reg(cam, scy + y, 0x11);	err += w9968cf_write_reg(cam, scx + x + cw, 0x12);	err += w9968cf_write_reg(cam, scy + y + ch, 0x13);	err += w9968cf_write_reg(cam, w, 0x14);	err += w9968cf_write_reg(cam, h, 0x15);	/* JPEG width & height */	err += w9968cf_write_reg(cam, w, 0x30);	err += w9968cf_write_reg(cam, h, 0x31);	/* Y & UV frame buffer strides (in WORD) */	if (cam->vpp_flag & VPP_DECOMPRESSION) {		err += w9968cf_write_reg(cam, w/2, 0x2c);		err += w9968cf_write_reg(cam, w/4, 0x2d);	} else		err += w9968cf_write_reg(cam, w, 0x2c);	if (err)		goto error;	/* If all went well, update the device data structure */	memcpy(&cam->window, &win, sizeof(win));	cam->hw_width = w;	cam->hw_height = h;	/* Settings changed, so we clear the frame buffers */	memset(cam->frame[0].buffer, 0, cam->nbuffers*cam->frame[0].size);	DBG(4, "The capture area is %dx%d, Offset (x,y)=(%u,%u)",	    win.width, win.height, win.x, win.y)	PDBGG("x=%u ,y=%u, w=%u, h=%u, ax=%u, ay=%u, s_win.x=%u, s_win.y=%u, "	      "cw=%u, ch=%u, win.x=%u, win.y=%u, win.width=%u, win.height=%u",	      x, y, w, h, ax, ay, s_win.x, s_win.y, cw, ch, win.x, win.y,	      win.width, win.height)	return 0;error:	DBG(1, "Failed to change the capture area size")	return err;}/*--------------------------------------------------------------------------  Adjust the asked values for window width and height.  Return 0 on success, -1 otherwise.  --------------------------------------------------------------------------*/static intw9968cf_adjust_window_size(struct w9968cf_device* cam, u16* width, u16* height){	u16 maxw, maxh;	if ((*width < cam->minwidth) || 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产精品免费观看动漫| 亚洲色图.com| 欧美性一级生活| 不卡的av在线播放| 99精品久久只有精品| eeuss鲁片一区二区三区| 国产**成人网毛片九色 | 91福利精品第一导航| av在线综合网| 在线看日韩精品电影| 欧美区在线观看| 精品国一区二区三区| 国产夜色精品一区二区av| 国产午夜亚洲精品午夜鲁丝片| 国产精品污www在线观看| 亚洲人成在线播放网站岛国| 亚洲午夜电影在线观看| 视频一区二区三区入口| 日韩高清不卡在线| 国产综合色精品一区二区三区| 国产成人综合视频| 91官网在线免费观看| 日韩一级精品视频在线观看| 国产女人水真多18毛片18精品视频| 国产女人18水真多18精品一级做| 一区在线中文字幕| 日本91福利区| 波多野结衣中文字幕一区二区三区| 91在线精品一区二区| 91精品久久久久久久91蜜桃| 久久人人超碰精品| 亚洲已满18点击进入久久| 美脚の诱脚舐め脚责91| av资源网一区| 日韩女优毛片在线| 亚洲精品v日韩精品| 国产自产v一区二区三区c| 99精品欧美一区| 精品国产乱码久久久久久老虎| 日韩美女精品在线| 久久国产精品露脸对白| av不卡在线观看| 日韩欧美激情一区| 亚洲精品成人精品456| 国产一二三精品| 67194成人在线观看| 国产精品国产三级国产专播品爱网| 石原莉奈一区二区三区在线观看| 丁香激情综合五月| 欧美一区二区免费视频| 亚洲三级在线播放| 久久国产综合精品| 欧美日韩二区三区| 国产精品伦一区| 国产呦萝稀缺另类资源| 91精品国产综合久久国产大片| 亚洲欧美视频在线观看| 国产精选一区二区三区| 欧美变态tickling挠脚心| 一片黄亚洲嫩模| 色综合视频在线观看| 欧美国产精品v| 国产一区二区日韩精品| 欧美成人r级一区二区三区| 亚洲成人免费电影| 在线观看免费成人| 亚洲午夜av在线| 欧美午夜精品一区| 亚洲综合色区另类av| 色综合咪咪久久| 亚洲综合激情网| 精品视频在线视频| 亚洲国产精品一区二区久久恐怖片| 91女人视频在线观看| 亚洲日本护士毛茸茸| 91网页版在线| 亚洲精品中文字幕在线观看| 91免费看片在线观看| 亚洲精品视频免费看| 欧美亚洲综合久久| 五月天丁香久久| 欧美专区在线观看一区| 丝袜国产日韩另类美女| 欧美一区二区三区日韩| 精品一二三四区| 国产性色一区二区| av资源站一区| 亚洲午夜视频在线观看| 日韩一区二区不卡| 国产99精品国产| 亚洲精品国产高清久久伦理二区| 欧美日韩免费观看一区三区| 麻豆极品一区二区三区| 中文在线资源观看网站视频免费不卡| 成人的网站免费观看| 亚洲成人av电影| 精品国产一区二区在线观看| 成人三级伦理片| 亚洲韩国一区二区三区| 精品久久久久久无| 91小视频在线| 免费成人在线观看| 中文字幕在线不卡视频| 欧美高清视频www夜色资源网| 国产综合色在线| 亚洲伊人色欲综合网| 久久视频一区二区| 色av成人天堂桃色av| 国模少妇一区二区三区| 亚洲一区av在线| 久久久精品tv| 欧美精三区欧美精三区| 成人网在线播放| 亚洲国产你懂的| 中文字幕第一区二区| 欧美日本一区二区在线观看| 成人性生交大片免费看中文| 五月天久久比比资源色| 国产精品麻豆99久久久久久| 欧美电影免费观看高清完整版 | 成人免费在线播放视频| 91精品国产综合久久久久| a在线播放不卡| 激情国产一区二区 | 91精品综合久久久久久| av欧美精品.com| 国产一区二区美女| 日韩高清一级片| 亚洲国产欧美日韩另类综合| 国产精品欧美一级免费| 精品国产一区二区三区不卡| 色婷婷综合五月| www.av亚洲| 国产福利91精品一区| 久久精品国产亚洲高清剧情介绍| 亚洲综合偷拍欧美一区色| 亚洲欧美自拍偷拍| 国产亚洲欧美一级| 久久综合网色—综合色88| 欧美一个色资源| 欧美精品777| 欧美日韩高清一区| 欧美在线制服丝袜| 在线视频中文字幕一区二区| 91在线小视频| 97精品久久久午夜一区二区三区| 国产成人av在线影院| 国产高清不卡一区二区| 国产精品一区二区三区网站| 国产在线一区二区| 韩国三级中文字幕hd久久精品| 久久精品免费观看| 激情文学综合丁香| 国产精品自在欧美一区| 高清国产一区二区三区| 成人性生交大片免费看视频在线| 国产a视频精品免费观看| 粉嫩嫩av羞羞动漫久久久| 成人成人成人在线视频| 91视视频在线直接观看在线看网页在线看| 岛国av在线一区| 91浏览器打开| 欧美熟乱第一页| 日韩三级视频在线看| xnxx国产精品| 国产精品免费丝袜| 亚洲自拍欧美精品| 日本不卡视频一二三区| 国精品**一区二区三区在线蜜桃| 丁香亚洲综合激情啪啪综合| 91在线视频免费91| 欧美精品在线视频| 亚洲精品一区二区三区99| 中文字幕一区在线观看| 亚洲一区二区在线播放相泽| 蜜臀91精品一区二区三区 | 色哟哟精品一区| 欧美精品欧美精品系列| 精品久久久影院| 亚洲三级在线观看| 久久国产综合精品| 99久久精品99国产精品| 欧美精品日韩一本| 中文在线资源观看网站视频免费不卡| 一区二区三区在线不卡| 激情图片小说一区| 色婷婷综合久久久久中文一区二区| 欧美日韩视频在线一区二区| 久久先锋影音av| 亚洲最新视频在线播放| 国产一区二区电影| 欧美日韩国产一二三| 国产精品美女久久久久av爽李琼| 亚洲成av人片观看| 99亚偷拍自图区亚洲| 日韩欧美高清一区| 亚洲国产成人av网| 北条麻妃国产九九精品视频| 欧美一区二区三区男人的天堂| 亚洲男人的天堂在线aⅴ视频|