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

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

?? ibmcam.c

?? 是關于linux2.5.1的完全源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * USB IBM C-It Video Camera driver * * Supports Xirlink C-It Video Camera, IBM PC Camera, * IBM NetCamera and Veo Stingray. * * This driver is based on earlier work of: * * (C) Copyright 1999 Johannes Erdfelt * (C) Copyright 1999 Randy Dunlap * * 5/24/00 Removed optional (and unnecessary) locking of the driver while * the device remains plugged in. Corrected race conditions in ibmcam_open * and ibmcam_probe() routines using this as a guideline: * * (2) The big kernel lock is automatically released when a process sleeps *   in the kernel and is automatically reacquired on reschedule if the *   process had the lock originally.  Any code that can be compiled as *   a module and is entered with the big kernel lock held *MUST* *   increment the use count to activate the indirect module protection *   before doing anything that might sleep. * *   In practice, this means that all routines that live in modules and *   are invoked under the big kernel lock should do MOD_INC_USE_COUNT *   as their very first action.  And all failure paths from that *   routine must do MOD_DEC_USE_COUNT before returning. */#include <linux/kernel.h>#include <linux/sched.h>#include <linux/wrapper.h>#include <linux/module.h>#include <linux/init.h>#include "usbvideo.h"#define IBMCAM_VENDOR_ID	0x0545#define IBMCAM_PRODUCT_ID	0x8080#define NETCAM_PRODUCT_ID	0x8002	/* IBM NetCamera, close to model 2 */#define VEO_800C_PRODUCT_ID	0x800C	/* Veo Stingray, repackaged Model 2 */#define VEO_800D_PRODUCT_ID	0x800D	/* Veo Stingray, repackaged Model 4 */#define MAX_IBMCAM		4	/* How many devices we allow to connect */#define USES_IBMCAM_PUTPIXEL    0       /* 0=Fast/oops 1=Slow/secure *//* Header signatures *//* Model 1 header: 00 FF 00 xx */#define HDRSIG_MODEL1_128x96	0x06	/* U Y V Y ... */#define HDRSIG_MODEL1_176x144	0x0e	/* U Y V Y ... */#define HDRSIG_MODEL1_352x288	0x00	/* V Y U Y ... */#define	IBMCAM_MODEL_1	1	/* XVP-501, 3 interfaces, rev. 0.02 */#define IBMCAM_MODEL_2	2	/* KSX-X9903, 2 interfaces, rev. 3.0a */#define IBMCAM_MODEL_3	3	/* KSX-X9902, 2 interfaces, rev. 3.01 */#define	IBMCAM_MODEL_4	4	/* IBM NetCamera, 0545/8002/3.0a *//* Video sizes supported */#define	VIDEOSIZE_128x96	VIDEOSIZE(128, 96)#define	VIDEOSIZE_176x144	VIDEOSIZE(176,144)#define	VIDEOSIZE_352x288	VIDEOSIZE(352,288)#define	VIDEOSIZE_320x240	VIDEOSIZE(320,240)#define	VIDEOSIZE_352x240	VIDEOSIZE(352,240)#define	VIDEOSIZE_640x480	VIDEOSIZE(640,480)#define	VIDEOSIZE_160x120	VIDEOSIZE(160,120)/* Video sizes supported */enum {	SIZE_128x96 = 0,	SIZE_160x120,	SIZE_176x144,	SIZE_320x240,	SIZE_352x240,	SIZE_352x288,	SIZE_640x480,	/* Add/remove/rearrange items before this line */	SIZE_LastItem};/* * This structure lives in uvd_t->user field. */typedef struct {	int initialized;	/* Had we already sent init sequence? */	int camera_model;	/* What type of IBM camera we got? */	int has_hdr;} ibmcam_t;#define	IBMCAM_T(uvd)	((ibmcam_t *)((uvd)->user_data))usbvideo_t *cams = NULL;static int debug = 0;static int flags = 0; /* FLAGS_DISPLAY_HINTS | FLAGS_OVERLAY_STATS; */static const int min_canvasWidth  = 8;static const int min_canvasHeight = 4;static int lighting = 1; /* Medium */#define SHARPNESS_MIN	0#define SHARPNESS_MAX	6static int sharpness = 4; /* Low noise, good details */#define FRAMERATE_MIN	0#define FRAMERATE_MAX	6static int framerate = -1;static int size = SIZE_352x288;/* * Here we define several initialization variables. They may * be used to automatically set color, hue, brightness and * contrast to desired values. This is particularly useful in * case of webcams (which have no controls and no on-screen * output) and also when a client V4L software is used that * does not have some of those controls. In any case it's * good to have startup values as options. * * These values are all in [0..255] range. This simplifies * operation. Note that actual values of V4L variables may * be scaled up (as much as << 8). User can see that only * on overlay output, however, or through a V4L client. */static int init_brightness = 128;static int init_contrast = 192;static int init_color = 128;static int init_hue = 128;static int hue_correction = 128;/* Settings for camera model 2 */static int init_model2_rg2 = -1;static int init_model2_sat = -1;static int init_model2_yb = -1;/* 01.01.08 - Added for RCA video in support -LO *//* Settings for camera model 3 */static int init_model3_input = 0;MODULE_PARM(debug, "i");MODULE_PARM_DESC(debug, "Debug level: 0-9 (default=0)");MODULE_PARM(flags, "i");MODULE_PARM_DESC(flags, "Bitfield: 0=VIDIOCSYNC, 1=B/W, 2=show hints, 3=show stats, 4=test pattern, 5=separate frames, 6=clean frames");MODULE_PARM(framerate, "i");MODULE_PARM_DESC(framerate, "Framerate setting: 0=slowest, 6=fastest (default=2)");MODULE_PARM(lighting, "i");MODULE_PARM_DESC(lighting, "Photosensitivity: 0=bright, 1=medium (default), 2=low light");MODULE_PARM(sharpness, "i");MODULE_PARM_DESC(sharpness, "Model1 noise reduction: 0=smooth, 6=sharp (default=4)");MODULE_PARM(size, "i");MODULE_PARM_DESC(size, "Image size: 0=128x96 1=160x120 2=176x144 3=320x240 4=352x240 5=352x288 6=640x480  (default=5)");MODULE_PARM(init_brightness, "i");MODULE_PARM_DESC(init_brightness, "Brightness preconfiguration: 0-255 (default=128)");MODULE_PARM(init_contrast, "i");MODULE_PARM_DESC(init_contrast, "Contrast preconfiguration: 0-255 (default=192)");MODULE_PARM(init_color, "i");MODULE_PARM_DESC(init_color, "Color preconfiguration: 0-255 (default=128)");MODULE_PARM(init_hue, "i");MODULE_PARM_DESC(init_hue, "Hue preconfiguration: 0-255 (default=128)");MODULE_PARM(hue_correction, "i");MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128)");MODULE_PARM(init_model2_rg2, "i");MODULE_PARM_DESC(init_model2_rg2, "Model2 preconfiguration: 0-255 (default=47)");MODULE_PARM(init_model2_sat, "i");MODULE_PARM_DESC(init_model2_sat, "Model2 preconfiguration: 0-255 (default=52)");MODULE_PARM(init_model2_yb, "i");MODULE_PARM_DESC(init_model2_yb, "Model2 preconfiguration: 0-255 (default=160)");/* 01.01.08 - Added for RCA video in support -LO */MODULE_PARM(init_model3_input, "i");MODULE_PARM_DESC(init_model3_input, "Model3 input: 0=CCD 1=RCA");MODULE_AUTHOR ("Dmitri");MODULE_DESCRIPTION ("IBM/Xirlink C-it USB Camera Driver for Linux (c) 2000");MODULE_LICENSE("GPL");/* Still mysterious i2c commands */static const unsigned short unknown_88 = 0x0088;static const unsigned short unknown_89 = 0x0089;static const unsigned short bright_3x[3] = { 0x0031, 0x0032, 0x0033 };static const unsigned short contrast_14 = 0x0014;static const unsigned short light_27 = 0x0027;static const unsigned short sharp_13 = 0x0013;/* i2c commands for Model 2 cameras */static const unsigned short mod2_brightness = 0x001a;		/* $5b .. $ee; default=$5a */static const unsigned short mod2_set_framerate = 0x001c;	/* 0 (fast).. $1F (slow) */static const unsigned short mod2_color_balance_rg2 = 0x001e;	/* 0 (red) .. $7F (green) */static const unsigned short mod2_saturation = 0x0020;		/* 0 (b/w) - $7F (full color) */static const unsigned short mod2_color_balance_yb = 0x0022;	/* 0..$7F, $50 is about right */static const unsigned short mod2_hue = 0x0024;			/* 0..$7F, $70 is about right */static const unsigned short mod2_sensitivity = 0x0028;		/* 0 (min) .. $1F (max) */struct struct_initData {	unsigned char req;	unsigned short value;	unsigned short index;};/* * ibmcam_size_to_videosize() * * This procedure converts module option 'size' into the actual * videosize_t that defines the image size in pixels. We need * simplified 'size' because user wants a simple enumerated list * of choices, not an infinite set of possibilities. */static videosize_t ibmcam_size_to_videosize(int size){	videosize_t vs = VIDEOSIZE_352x288;	RESTRICT_TO_RANGE(size, 0, (SIZE_LastItem-1));	switch (size) {	case SIZE_128x96:		vs = VIDEOSIZE_128x96;		break;	case SIZE_160x120:		vs = VIDEOSIZE_160x120;		break;	case SIZE_176x144:		vs = VIDEOSIZE_176x144;		break;	case SIZE_320x240:		vs = VIDEOSIZE_320x240;		break;	case SIZE_352x240:		vs = VIDEOSIZE_352x240;		break;	case SIZE_352x288:		vs = VIDEOSIZE_352x288;		break;	case SIZE_640x480:		vs = VIDEOSIZE_640x480;		break;	default:		err("size=%d. is not valid", size);		break;	}	return vs;}/* * ibmcam_find_header() * * Locate one of supported header markers in the queue. * Once found, remove all preceding bytes AND the marker (4 bytes) * from the data pump queue. Whatever follows must be video lines. * * History: * 1/21/00  Created. */static ParseState_t ibmcam_find_header(uvd_t *uvd) /* FIXME: Add frame here */{	usbvideo_frame_t *frame;	ibmcam_t *icam;	if ((uvd->curframe) < 0 || (uvd->curframe >= USBVIDEO_NUMFRAMES)) {		err("ibmcam_find_header: Illegal frame %d.", uvd->curframe);		return scan_EndParse;	}	icam = IBMCAM_T(uvd);	assert(icam != NULL);	frame = &uvd->frame[uvd->curframe];	icam->has_hdr = 0;	switch (icam->camera_model) {	case IBMCAM_MODEL_1:	{		const int marker_len = 4;		while (RingQueue_GetLength(&uvd->dp) >= marker_len) {			if ((RING_QUEUE_PEEK(&uvd->dp, 0) == 0x00) &&			    (RING_QUEUE_PEEK(&uvd->dp, 1) == 0xFF) &&			    (RING_QUEUE_PEEK(&uvd->dp, 2) == 0x00))			{#if 0				/* This code helps to detect new frame markers */				info("Header sig: 00 FF 00 %02X", RING_QUEUE_PEEK(&uvd->dp, 3));#endif				frame->header = RING_QUEUE_PEEK(&uvd->dp, 3);				if ((frame->header == HDRSIG_MODEL1_128x96) ||				    (frame->header == HDRSIG_MODEL1_176x144) ||				    (frame->header == HDRSIG_MODEL1_352x288))				{#if 0					info("Header found.");#endif					RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, marker_len);					icam->has_hdr = 1;					break;				}			}			/* If we are still here then this doesn't look like a header */			RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, 1);		}		break;	}	case IBMCAM_MODEL_2:case IBMCAM_MODEL_4:	{		int marker_len = 0;		switch (uvd->videosize) {		case VIDEOSIZE_176x144:			marker_len = 10;			break;		default:			marker_len = 2;			break;		}		while (RingQueue_GetLength(&uvd->dp) >= marker_len) {			if ((RING_QUEUE_PEEK(&uvd->dp, 0) == 0x00) &&			    (RING_QUEUE_PEEK(&uvd->dp, 1) == 0xFF))			{#if 0				info("Header found.");#endif				RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, marker_len);				icam->has_hdr = 1;				frame->header = HDRSIG_MODEL1_176x144;				break;			}			/* If we are still here then this doesn't look like a header */			RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, 1);		}		break;	}	case IBMCAM_MODEL_3:	{	/*		 * Headers: (one precedes every frame). nc=no compression,		 * bq=best quality bf=best frame rate.		 *		 * 176x144: 00 FF 02 { 0A=nc CA=bq EA=bf }		 * 320x240: 00 FF 02 { 08=nc 28=bq 68=bf }		 * 640x480: 00 FF 03 { 08=nc 28=bq 68=bf }		 *		 * Bytes '00 FF' seem to indicate header. Other two bytes		 * encode the frame type. This is a set of bit fields that		 * encode image size, compression type etc. These fields		 * do NOT contain frame number because all frames carry		 * the same header.		 */		const int marker_len = 4;		while (RingQueue_GetLength(&uvd->dp) >= marker_len) {			if ((RING_QUEUE_PEEK(&uvd->dp, 0) == 0x00) &&			    (RING_QUEUE_PEEK(&uvd->dp, 1) == 0xFF) &&			    (RING_QUEUE_PEEK(&uvd->dp, 2) != 0xFF))			{				/*				 * Combine 2 bytes of frame type into one				 * easy to use value				 */				unsigned long byte3, byte4;				byte3 = RING_QUEUE_PEEK(&uvd->dp, 2);				byte4 = RING_QUEUE_PEEK(&uvd->dp, 3);				frame->header = (byte3 << 8) | byte4;#if 0				info("Header found.");#endif				RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, marker_len);				icam->has_hdr = 1;				break;			}			/* If we are still here then this doesn't look like a header */			RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, 1);		}		break;	}	default:		break;	}	if (!icam->has_hdr) {		if (uvd->debug > 2)			info("Skipping frame, no header");		return scan_EndParse;	}	/* Header found */	icam->has_hdr = 1;	uvd->stats.header_count++;	frame->scanstate = ScanState_Lines;	frame->curline = 0;	if (flags & FLAGS_FORCE_TESTPATTERN) {		usbvideo_TestPattern(uvd, 1, 1);		return scan_NextFrame;	}	return scan_Continue;}/* * ibmcam_parse_lines() * * Parse one line (interlaced) from the buffer, put * decoded RGB value into the current frame buffer * and add the written number of bytes (RGB) to * the *pcopylen. * * History: * 21-Jan-2000 Created. * 12-Oct-2000 Reworked to reflect interlaced nature of the data. */static ParseState_t ibmcam_parse_lines(	uvd_t *uvd,	usbvideo_frame_t *frame,	long *pcopylen){	unsigned char *f;	ibmcam_t *icam;	unsigned int len, scanLength, scanHeight, order_uv, order_yc;	int v4l_linesize; /* V4L line offset */	const int hue_corr  = (uvd->vpic.hue - 0x8000) >> 10;	/* -32..+31 */	const int hue2_corr = (hue_correction - 128) / 4;		/* -32..+31 */	const int ccm = 128; /* Color correction median - see below */	int y, u, v, i, frame_done=0, color_corr;	static unsigned char lineBuffer[640*3];	unsigned const char *chromaLine, *lumaLine;	assert(uvd != NULL);	assert(frame != NULL);	icam = IBMCAM_T(uvd);	assert(icam != NULL);	color_corr = (uvd->vpic.colour - 0x8000) >> 8; /* -128..+127 = -ccm..+(ccm-1)*/	RESTRICT_TO_RANGE(color_corr, -ccm, ccm+1);	v4l_linesize = VIDEOSIZE_X(frame->request) * V4L_BYTES_PER_PIXEL;	if (IBMCAM_T(uvd)->camera_model == IBMCAM_MODEL_4) {		/* Model 4 frame markers do not carry image size identification */		switch (uvd->videosize) {		case VIDEOSIZE_128x96:		case VIDEOSIZE_160x120:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷综合久久久中文字幕| 91精品国产一区二区三区| 欧美日韩免费观看一区二区三区 | 日韩免费高清av| 91一区二区三区在线观看| 国产馆精品极品| 在线综合视频播放| 日韩免费一区二区| 精品999在线播放| 亚洲一区二区三区在线播放| 国产精品小仙女| av在线播放一区二区三区| 在线不卡一区二区| 日韩女优视频免费观看| 精品精品欲导航| 午夜伊人狠狠久久| 色婷婷精品久久二区二区蜜臂av | 中文av一区特黄| 日韩国产精品91| 另类小说图片综合网| 久久se精品一区精品二区| 色狠狠综合天天综合综合| 亚洲国产成人午夜在线一区| 狠狠狠色丁香婷婷综合激情| 欧美一区二区大片| 日韩成人伦理电影在线观看| 欧美日韩亚洲国产综合| 亚洲国产视频a| 免费的成人av| 制服.丝袜.亚洲.中文.综合| 亚洲成人激情社区| 欧美伊人久久大香线蕉综合69| 欧美日韩亚洲国产综合| 亚洲一区二区免费视频| 色综合久久天天| 亚洲女人****多毛耸耸8| 亚洲成人激情社区| 国产精品乡下勾搭老头1| ww亚洲ww在线观看国产| 狠狠色丁香婷婷综合| 精品国产免费人成在线观看| 国产在线视视频有精品| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美三级电影网站| 久久久久久9999| 五月天精品一区二区三区| 成人免费精品视频| 亚洲精品国产精品乱码不99| 免费在线看成人av| 精品国产一区二区三区四区四| 亚洲欧美电影院| 91国模大尺度私拍在线视频| 国产亚洲一二三区| 99久久精品国产导航| 一区二区三区免费| 91精品国产综合久久精品性色| 日韩一区有码在线| 国产河南妇女毛片精品久久久 | 麻豆精品久久精品色综合| 久久伊人蜜桃av一区二区| 亚洲一区二区在线免费看| 欧美高清你懂得| 亚洲成人黄色影院| 久久这里只精品最新地址| 蜜臀av亚洲一区中文字幕| 久久嫩草精品久久久精品一| 97se亚洲国产综合自在线不卡| 午夜精品久久久久久久久| 色菇凉天天综合网| 日韩毛片高清在线播放| 国产精品伊人色| 一区二区三区视频在线观看| 丰满少妇久久久久久久| 一区二区三区在线观看欧美| 日韩视频在线你懂得| 国产ts人妖一区二区| 日韩在线一二三区| 日韩一区二区在线观看视频| 国产一区二区不卡| 国产欧美综合在线观看第十页| 色婷婷综合视频在线观看| 一区二区三区在线视频播放| 欧美tickling网站挠脚心| 一本久久综合亚洲鲁鲁五月天 | 国产伦理精品不卡| 欧美精品一区二区三区蜜臀 | 亚洲人成网站在线| 欧美成人精品福利| 国产麻豆午夜三级精品| 亚洲国产综合在线| 亚洲视频一区在线| 久久久久久毛片| 成人一区在线看| 蜜桃一区二区三区在线观看| 日韩欧美电影一二三| 91福利区一区二区三区| 污片在线观看一区二区| 欧美韩国日本一区| 精品国产人成亚洲区| 欧美日韩国产综合久久| 色噜噜狠狠一区二区三区果冻| 国产米奇在线777精品观看| 蜜臀精品久久久久久蜜臀 | 毛片av中文字幕一区二区| 亚洲国产婷婷综合在线精品| 欧美日韩国产中文| 欧美体内she精高潮| 色香蕉成人二区免费| gogogo免费视频观看亚洲一| 国产成人综合亚洲91猫咪| 国产乱一区二区| 国产精品一区二区在线观看网站| 免费的成人av| 亚洲人一二三区| 日韩一级大片在线| 成人免费视频视频在线观看免费 | 日韩视频123| 懂色av一区二区三区蜜臀| 韩国理伦片一区二区三区在线播放| 五月天一区二区| 日本不卡一二三| 亚洲色图都市小说| 亚洲视频免费在线观看| 亚洲桃色在线一区| 亚洲午夜免费电影| 国产欧美一区二区三区鸳鸯浴| 精品久久一二三区| 国产女同互慰高潮91漫画| 欧美精品v国产精品v日韩精品| 在线看不卡av| 高清久久久久久| 日本不卡一区二区三区| 美女爽到高潮91| 国产一区二区三区精品欧美日韩一区二区三区 | 丁香婷婷深情五月亚洲| 一区二区三区国产| 中文字幕 久热精品 视频在线 | 亚洲另类中文字| 久久免费国产精品| 欧美丰满少妇xxxbbb| 91免费国产在线观看| 国产一区美女在线| 精品在线你懂的| 日韩专区在线视频| 国产乱妇无码大片在线观看| 成人高清免费在线播放| 欧美日韩你懂得| 久久影院电视剧免费观看| 亚洲精品美国一| 中文字幕一区二区三| 亚洲成人动漫在线免费观看| 一区二区三区欧美日韩| 亚洲欧洲av一区二区三区久久| 久久久国产午夜精品| **性色生活片久久毛片| 国产精品毛片大码女人| 亚洲福利电影网| 岛国av在线一区| 成人免费视频免费观看| 欧美丝袜丝nylons| 国产精品蜜臀av| 日日噜噜夜夜狠狠视频欧美人 | 蜜臀av在线播放一区二区三区| 成人av在线资源| 99久久er热在这里只有精品15 | 亚洲超碰97人人做人人爱| 国产一区二区三区在线观看免费| 久久99国产乱子伦精品免费| 美女视频黄a大片欧美| 91片黄在线观看| 久久在线观看免费| 男女男精品网站| 国产乱码精品一区二区三区av| 欧美影片第一页| 国产精品成人午夜| 亚洲免费在线电影| 国产成人精品三级| www.欧美日韩| 色偷偷88欧美精品久久久| 欧美性猛片xxxx免费看久爱| 国产精品美女视频| 国内精品视频666| 欧美一级欧美三级| 久久综合一区二区| 美国十次了思思久久精品导航| 国产一区在线观看麻豆| 成人精品视频一区二区三区| 精品国产伦一区二区三区观看方式 | 国产一区二区三区免费在线观看| 欧美日韩成人一区| 亚洲综合偷拍欧美一区色| 丝袜亚洲另类欧美综合| 91福利在线看| 精品国一区二区三区| 中文字幕一区二区三区乱码在线| 久久99久久99精品免视看婷婷| 成人av在线电影| 国产精品毛片无遮挡高清| 国产99久久久国产精品免费看| 久久亚洲综合色一区二区三区|