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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ibmcam.c

?? linux 內(nèi)核源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
/* * 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: */#include <linux/kernel.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->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))static struct usbvideo *cams;static int debug;static int flags; /* = 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_param(debug, int, 0);MODULE_PARM_DESC(debug, "Debug level: 0-9 (default=0)");module_param(flags, int, 0);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_param(framerate, int, 0);MODULE_PARM_DESC(framerate, "Framerate setting: 0=slowest, 6=fastest (default=2)");module_param(lighting, int, 0);MODULE_PARM_DESC(lighting, "Photosensitivity: 0=bright, 1=medium (default), 2=low light");module_param(sharpness, int, 0);MODULE_PARM_DESC(sharpness, "Model1 noise reduction: 0=smooth, 6=sharp (default=4)");module_param(size, int, 0);MODULE_PARM_DESC(size, "Image size: 0=128x96 1=160x120 2=176x144 3=320x240 4=352x240 5=352x288 6=640x480  (default=5)");module_param(init_brightness, int, 0);MODULE_PARM_DESC(init_brightness, "Brightness preconfiguration: 0-255 (default=128)");module_param(init_contrast, int, 0);MODULE_PARM_DESC(init_contrast, "Contrast preconfiguration: 0-255 (default=192)");module_param(init_color, int, 0);MODULE_PARM_DESC(init_color, "Color preconfiguration: 0-255 (default=128)");module_param(init_hue, int, 0);MODULE_PARM_DESC(init_hue, "Hue preconfiguration: 0-255 (default=128)");module_param(hue_correction, int, 0);MODULE_PARM_DESC(hue_correction, "YUV colorspace regulation: 0-255 (default=128)");module_param(init_model2_rg2, int, 0);MODULE_PARM_DESC(init_model2_rg2, "Model2 preconfiguration: 0-255 (default=47)");module_param(init_model2_sat, int, 0);MODULE_PARM_DESC(init_model2_sat, "Model2 preconfiguration: 0-255 (default=52)");module_param(init_model2_yb, int, 0);MODULE_PARM_DESC(init_model2_yb, "Model2 preconfiguration: 0-255 (default=160)");/* 01.01.08 - Added for RCA video in support -LO */module_param(init_model3_input, int, 0);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 enum ParseState ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame here */{	struct usbvideo_frame *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 enum ParseState ibmcam_parse_lines(	struct uvd *uvd,	struct usbvideo_frame *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:		case VIDEOSIZE_176x144:			scanLength = VIDEOSIZE_X(uvd->videosize);			scanHeight = VIDEOSIZE_Y(uvd->videosize);			break;		default:			err("ibmcam_parse_lines: Wrong mode.");			return scan_Out;		}		order_yc = 1;	/* order_yc: true=Yc false=cY ('c'=either U or V) */		order_uv = 1;	/* Always true in this algorithm */	} else {		switch (frame->header) {		case HDRSIG_MODEL1_128x96:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久一区| 视频一区在线视频| 日韩精品一区二区三区四区视频| 国产精品中文字幕日韩精品| 久久久久久毛片| 欧美一区在线视频| 欧美精品aⅴ在线视频| 国产白丝网站精品污在线入口| 午夜精品一区二区三区电影天堂 | 自拍偷在线精品自拍偷无码专区| 4438亚洲最大| 欧美福利电影网| 欧美性极品少妇| 99精品在线免费| 成人网页在线观看| 日韩一区欧美二区| 亚洲婷婷在线视频| 久久色成人在线| 欧美精品一区二区三区高清aⅴ| 欧美日韩视频一区二区| 在线观看日产精品| 91在线一区二区三区| 国产乱子轮精品视频| 美女视频免费一区| 久久爱www久久做| 国内精品嫩模私拍在线| 九九九久久久精品| 狠狠色丁香久久婷婷综| 欧美最猛性xxxxx直播| 欧美日韩视频在线观看一区二区三区 | 国产综合久久久久影院| 国产精品99久久久久久久女警 | 久久精品国产久精国产| 日韩精品一级二级| 久久99精品一区二区三区 | 亚洲啪啪综合av一区二区三区| 国产精品一品二品| 日韩专区在线视频| 久久精品国产澳门| 国产精品亚洲一区二区三区在线| 国产91精品久久久久久久网曝门 | 日韩精品在线看片z| 亚洲高清视频的网址| 日韩精品免费专区| 麻豆国产精品777777在线| 国产98色在线|日韩| 欧美精品久久一区| 国产欧美一二三区| 亚洲国产你懂的| 色哟哟欧美精品| 欧美日韩另类国产亚洲欧美一级| 欧美老女人在线| 国产精品国产自产拍高清av王其 | 亚洲另类春色国产| 在线一区二区三区做爰视频网站| 久久久综合激的五月天| 亚洲视频一区二区免费在线观看| 久久成人精品无人区| 色综合色综合色综合色综合色综合 | 日韩福利视频导航| 日本道色综合久久| 国产精品二三区| 国产精品1区2区| 精品少妇一区二区三区视频免付费| 亚洲欧美日韩电影| www.亚洲国产| 中文文精品字幕一区二区| 日本欧美久久久久免费播放网| 精品视频1区2区| 亚洲精品大片www| 成人精品小蝌蚪| 久久看人人爽人人| 国产一区二区三区精品视频| 日韩欧美国产一二三区| 日韩福利电影在线| 男女男精品网站| 91精品国产综合久久久久久久久久| 国产精品白丝在线| 在线视频观看一区| 国产一区二区精品久久99| 日韩三级伦理片妻子的秘密按摩| 亚洲福利视频三区| 日韩欧美一区二区视频| 香蕉久久夜色精品国产使用方法| 欧美三区在线观看| 久久成人综合网| 久久精品一区四区| 成人av电影在线| 亚洲欧美一区二区三区国产精品| 91亚洲男人天堂| 亚洲精品午夜久久久| 欧美精品精品一区| 国产成人免费在线观看| 亚洲国产成人va在线观看天堂| 91精品一区二区三区在线观看| 精品一区二区三区在线视频| 亚洲精品视频一区二区| 大陆成人av片| 一区二区三区中文字幕| 日韩一区二区在线看片| voyeur盗摄精品| 激情久久五月天| 香蕉成人啪国产精品视频综合网 | 国内不卡的二区三区中文字幕| 成人欧美一区二区三区小说| 日韩亚洲欧美一区| 欧洲一区在线观看| 99久久精品一区二区| 国产成人免费高清| 精品一区二区三区的国产在线播放| 亚洲欧美日韩国产手机在线| 久久久精品国产免大香伊| 日韩精品一区国产麻豆| 5月丁香婷婷综合| 91.xcao| 91麻豆精品国产91久久久久久| 日本高清成人免费播放| 色域天天综合网| 日本高清免费不卡视频| 91极品视觉盛宴| 欧美在线视频日韩| 91黄色激情网站| 在线国产电影不卡| 欧洲国内综合视频| 欧美日韩五月天| 欧美成人欧美edvon| 日韩一卡二卡三卡四卡| 日韩美女一区二区三区四区| 欧美大尺度电影在线| 久久久一区二区| 亚洲色图另类专区| 婷婷六月综合网| 久久精品久久99精品久久| 国产剧情一区二区三区| 99久久国产综合精品色伊| 欧美色窝79yyyycom| 7777精品伊人久久久大香线蕉超级流畅 | 成人高清伦理免费影院在线观看| 欧美视频在线观看一区| 久久精品视频网| 韩国精品主播一区二区在线观看| 欧美日韩你懂得| 亚洲高清在线精品| 婷婷综合五月天| 久久国产尿小便嘘嘘尿| jvid福利写真一区二区三区| 欧美色图在线观看| 国产精品福利一区| 麻豆精品一区二区综合av| 一本色道久久综合亚洲aⅴ蜜桃| 久久精品亚洲麻豆av一区二区| 一区二区欧美精品| 国产成人在线视频网站| 欧美不卡在线视频| 丝袜美腿高跟呻吟高潮一区| 91丨porny丨首页| 久久久久国产精品人| 日一区二区三区| 欧美区在线观看| 亚洲国产成人高清精品| 一本久久综合亚洲鲁鲁五月天| 国产欧美日韩视频一区二区| 精品一区二区在线看| 91麻豆精品国产91久久久资源速度 | 国产精品国产精品国产专区不蜜 | 欧美日韩国产高清一区二区| 欧美三级一区二区| 国产欧美日本一区二区三区| 亚洲黄色av一区| jizzjizzjizz欧美| 捆绑紧缚一区二区三区视频| 欧美电影影音先锋| 天堂一区二区在线| 欧美日本一区二区在线观看| 亚洲一区二区高清| 欧美亚洲国产一区二区三区| 玉米视频成人免费看| 欧美亚洲图片小说| 亚洲电影一区二区| 精品日韩欧美一区二区| 国产美女在线精品| 国产精品电影一区二区| 91麻豆国产在线观看| 亚洲一区免费观看| 91精品国产综合久久精品| 极品少妇xxxx精品少妇偷拍| 久久精品夜夜夜夜久久| 一本一道久久a久久精品 | 色哟哟精品一区| 日韩和欧美一区二区| 国产色婷婷亚洲99精品小说| 成人免费看黄yyy456| 亚洲成a人v欧美综合天堂| 精品国产一区二区三区av性色| 国产伦精品一区二区三区免费迷 | 午夜伦理一区二区| 久久亚洲春色中文字幕久久久| 99久久夜色精品国产网站| 午夜激情久久久| 国产精品短视频|