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

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

?? w9968cf.c

?? 優(yōu)龍2410linux2.6.8內(nèi)核源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
		if (!(cam->transfer_buffer[i] =		      kmalloc(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;		}		memset(cam->transfer_buffer[i], 0, W9968CF_ISO_PACKETS*p_size);	}	/* 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;	}	/* "(*f)" will be used instead of "cam->frame_current" */	f = &cam->frame_current;	/* If a frame has been requested and we are grabbing into  	   the temporary frame, we'll switch to that requested frame */	if ((*f) == &cam->frame_tmp && *cam->requested_frame) {		if (cam->frame_tmp.status == F_GRABBING) {			w9968cf_pop_frame(cam, &cam->frame_current);			(*f)->status = F_GRABBING;			(*f)->length = cam->frame_tmp.length;			memcpy((*f)->buffer, cam->frame_tmp.buffer,			       (*f)->length);			DBG(6, "Switched from temp. frame to frame #%d", 			    (*f)->number)		}	}	for (i = 0; i < urb->number_of_packets; i++) {		len = urb->iso_frame_desc[i].actual_length;		status = urb->iso_frame_desc[i].status;		pos = urb->iso_frame_desc[i].offset + urb->transfer_buffer;		if (status && len != 0) {			DBG(4, "URB failed, error in data packet "			       "(error #%u, %s)",			    status, symbolic(urb_errlist, status))			(*f)->status = F_ERROR;			continue;		}		if (len) { /* start of frame */			if ((*f)->status == F_UNUSED) {				(*f)->status = F_GRABBING;				(*f)->length = 0;			}			/* Buffer overflows shouldn't happen, however...*/			if ((*f)->length + len > (*f)->size) {				DBG(4, "Buffer overflow: bad data packets")				(*f)->status = F_ERROR;			}			if ((*f)->status == F_GRABBING) {				memcpy((*f)->buffer + (*f)->length, pos, len);				(*f)->length += len;			}		} else if ((*f)->status == F_GRABBING) { /* end of frame */			DBG(6, "Frame #%d successfully grabbed", (*f)->number)			if (cam->vpp_flag & VPP_DECOMPRESSION) {				err = w9968cf_vpp->check_headers((*f)->buffer,				                                 (*f)->length);				if (err) {					DBG(4, "Skip corrupted frame: %s",					    symbolic(decoder_errlist, err))					(*f)->status = F_UNUSED;					continue; /* grab this frame again */				}			}			(*f)->status = F_READY;			(*f)->queued = 0;			/* Take a pointer to the new frame from the FIFO list.			   If the list is empty,we'll use the temporary frame*/			if (*cam->requested_frame)				w9968cf_pop_frame(cam, &cam->frame_current);			else {				cam->frame_current = &cam->frame_tmp;				(*f)->status = F_UNUSED;			}		} else if ((*f)->status == F_ERROR)			(*f)->status = F_UNUSED; /* grab it again */		PDBGG("Frame length %lu | pack.#%u | pack.len. %u | state %d",		      (unsigned long)(*f)->length, i, len, (*f)->status)	} /* end for */	/* Resubmit this URB */	urb->dev = cam->usbdev;	urb->status = 0;	spin_lock(&cam->urb_lock);	if (cam->streaming)		if ((err = usb_submit_urb(urb, GFP_ATOMIC))) {			cam->misconfigured = 1;			DBG(1, "Couldn't resubmit the URB: error %d, %s",			    err, symbolic(urb_errlist, err))		}	spin_unlock(&cam->urb_lock);	/* Wake up the user process */	wake_up_interruptible(&cam->wait_queue);}/*---------------------------------------------------------------------------  Setup the URB structures for the isochronous transfer.  Submit the URBs so that the data transfer begins.  Return 0 on success, a negative number otherwise.  ---------------------------------------------------------------------------*/static int w9968cf_start_transfer(struct w9968cf_device* cam){	struct usb_device *udev = cam->usbdev;	struct urb* urb;	const u16 p_size = wMaxPacketSize[cam->altsetting-1];	u16 w, h, d;	int vidcapt;	u32 t_size;	int err = 0;	s8 i, j;	for (i = 0; i < W9968CF_URBS; i++) {		urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL);		cam->urb[i] = urb;		if (!urb) {			for (j = 0; j < i; j++)				usb_free_urb(cam->urb[j]);			DBG(1, "Couldn't allocate the URB structures")			return -ENOMEM;		}		urb->dev = udev;		urb->context = (void*)cam;		urb->pipe = usb_rcvisocpipe(udev, 1);		urb->transfer_flags = URB_ISO_ASAP;		urb->number_of_packets = W9968CF_ISO_PACKETS;		urb->complete = w9968cf_urb_complete;		urb->transfer_buffer = cam->transfer_buffer[i];		urb->transfer_buffer_length = p_size*W9968CF_ISO_PACKETS;		urb->interval = 1;		for (j = 0; j < W9968CF_ISO_PACKETS; j++) {			urb->iso_frame_desc[j].offset = p_size*j;			urb->iso_frame_desc[j].length = p_size;		}	}	/* Transfer size per frame, in WORD ! */	d = cam->hw_depth;	w = cam->hw_width;	h = cam->hw_height;	t_size = (w*h*d)/16;	err = w9968cf_write_reg(cam, 0xbf17, 0x00); /* reset everything */	err += w9968cf_write_reg(cam, 0xbf10, 0x00); /* normal operation */	/* Transfer size */	err += w9968cf_write_reg(cam, t_size & 0xffff, 0x3d); /* low bits */	err += w9968cf_write_reg(cam, t_size >> 16, 0x3e);    /* high bits */	if (cam->vpp_flag & VPP_DECOMPRESSION)		err += w9968cf_upload_quantizationtables(cam);	vidcapt = w9968cf_read_reg(cam, 0x16); /* read picture settings */	err += w9968cf_write_reg(cam, vidcapt|0x8000, 0x16); /* capt. enable */	err += usb_set_interface(udev, 0, cam->altsetting);	err += w9968cf_write_reg(cam, 0x8a05, 0x3c); /* USB FIFO enable */	if (err || (vidcapt < 0)) {		for (i = 0; i < W9968CF_URBS; i++)			usb_free_urb(cam->urb[i]);		DBG(1, "Couldn't tell the camera to start the data transfer")		return err;	}	w9968cf_init_framelist(cam);	/* Begin to grab into the temporary buffer */	cam->frame_tmp.status = F_UNUSED;	cam->frame_tmp.queued = 0;	cam->frame_current = &cam->frame_tmp;	if (!(cam->vpp_flag & VPP_DECOMPRESSION))		DBG(5, "Isochronous transfer size: %lu bytes/frame", 		    (unsigned long)t_size*2)	DBG(5, "Starting the isochronous transfer...")	cam->streaming = 1;	/* Submit the URBs */	for (i = 0; i < W9968CF_URBS; i++) {		err = usb_submit_urb(cam->urb[i], GFP_KERNEL);		if (err) {			cam->streaming = 0;			for (j = i-1; j >= 0; j--) {				usb_kill_urb(cam->urb[j]);				usb_free_urb(cam->urb[j]);			}			DBG(1, "Couldn't send a transfer request to the "			       "USB core (error #%d, %s)", err, 			    symbolic(urb_errlist, err))			return err;		}	}	return 0;}/*--------------------------------------------------------------------------  Stop the isochronous transfer and set alternate setting to 0 (0Mb/s).  Return 0 on success, a negative number otherwise.  --------------------------------------------------------------------------*/static int w9968cf_stop_transfer(struct w9968cf_device* cam){	struct usb_device *udev = cam->usbdev;	unsigned long lock_flags;	int err = 0;	s8 i;	if (!cam->streaming)		return 0;	/* This avoids race conditions with usb_submit_urb() 	   in the URB completition handler */	spin_lock_irqsave(&cam->urb_lock, lock_flags);	cam->streaming = 0;	spin_unlock_irqrestore(&cam->urb_lock, lock_flags);	for (i = W9968CF_URBS-1; i >= 0; i--)		if (cam->urb[i]) {			usb_kill_urb(cam->urb[i]);			usb_free_urb(cam->urb[i]);			cam->urb[i] = NULL;		}	if (cam->disconnected)		goto exit;	err = w9968cf_write_reg(cam, 0x0a05, 0x3c); /* stop USB transfer */	err += usb_set_interface(udev, 0, 0); /* 0 Mb/s */	err += w9968cf_write_reg(cam, 0x0000, 0x39); /* disable JPEG encoder */	err += w9968cf_write_reg(cam, 0x0000, 0x16); /* stop video capture */	if (err) {		DBG(2, "Failed to tell the camera to stop the isochronous "		       "transfer. However this is not a critical error.")		return -EIO;	}exit:	DBG(5, "Isochronous transfer stopped")	return 0;}/*--------------------------------------------------------------------------  Write a W9968CF register.   Return 0 on success, -1 otherwise.  --------------------------------------------------------------------------*/static int w9968cf_write_reg(struct w9968cf_device* cam, u16 value, u16 index){	struct usb_device* udev = cam->usbdev;	int res;	res = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0,	                      USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE,	                      value, index, NULL, 0, W9968CF_USB_CTRL_TIMEOUT);	if (res < 0)		DBG(4, "Failed to write a register "		       "(value 0x%04X, index 0x%02X, error #%d, %s)",

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆国产精品官网| 国产精品久久久久桃色tv| 久久国产精品区| 国产精品久久久久影院老司 | 国产自产高清不卡| 亚洲欧美乱综合| 精品久久五月天| 成人一区在线观看| 国产精品色噜噜| eeuss国产一区二区三区| 久久综合999| 日韩av网站在线观看| 欧美日韩精品福利| 一区二区免费在线| 91国在线观看| 天天影视涩香欲综合网| 一本久道中文字幕精品亚洲嫩| 一区二区三区 在线观看视频 | 免费高清成人在线| 亚洲人精品午夜| 精品粉嫩超白一线天av| 欧美无砖专区一中文字| 99热在这里有精品免费| 精品在线一区二区| 久久精品国产亚洲a| 图片区小说区国产精品视频| 最近日韩中文字幕| 中文字幕国产一区| 久久伊人中文字幕| 欧美xxxxxxxxx| 51精品秘密在线观看| 91电影在线观看| 99久久久无码国产精品| 国产成人av电影| 国产综合成人久久大片91| 久久精品国产99久久6| 日韩中文字幕亚洲一区二区va在线| 中文字幕av不卡| 国产日韩v精品一区二区| 久久免费国产精品| 欧美精品一区二区三区蜜桃| 日韩一级精品视频在线观看| 69久久夜色精品国产69蝌蚪网| 91久久久免费一区二区| 欧美中文字幕一区二区三区 | 日本一区二区三区在线观看| 日韩欧美一区二区在线视频| 欧美一级生活片| 成人激情动漫在线观看| 成人精品电影在线观看| 91一区二区在线| 一本久久精品一区二区| 日本久久一区二区三区| 欧美日韩一区二区三区高清| 欧美午夜影院一区| 欧美剧情电影在线观看完整版免费励志电影| 欧美日韩在线一区二区| 欧美日韩国产片| 91精品国产欧美一区二区18 | 欧美一级一区二区| 中文字幕精品一区| 精品美女在线播放| 欧美一区二区久久| 欧美怡红院视频| 99re6这里只有精品视频在线观看| 捆绑变态av一区二区三区| 男女男精品网站| 一区二区三区在线观看欧美| 日韩极品在线观看| 在线成人小视频| 色婷婷亚洲婷婷| 制服丝袜一区二区三区| 欧美一区二区免费视频| 国产肉丝袜一区二区| 亚洲少妇中出一区| 五月婷婷激情综合| 国产精品18久久久久久vr| 99免费精品在线| 欧美色图第一页| 久久久久国产精品麻豆ai换脸| 国产精品三级av| 亚洲大片一区二区三区| 激情久久五月天| 一本色道久久综合亚洲aⅴ蜜桃| 欧美日韩高清一区二区不卡| 欧美精品一区二区久久婷婷| 国产精品欧美久久久久无广告 | 亚洲欧美日韩一区二区| 午夜国产不卡在线观看视频| 国内一区二区在线| 色婷婷国产精品久久包臀| 精品乱人伦一区二区三区| 亚洲视频一区二区在线观看| 天堂久久久久va久久久久| a在线播放不卡| 欧美一区二区三区四区五区| 欧美国产综合色视频| 午夜国产精品一区| 成人高清av在线| 91精品国产综合久久久久久久久久| 欧美国产一区二区| 亚洲va韩国va欧美va| 国产福利一区在线观看| 欧美日韩国产首页| 国产精品毛片久久久久久| 天天综合网 天天综合色| 成人av在线观| 精品国产一二三区| 亚洲成人你懂的| 色综合网站在线| 欧美精品一区男女天堂| 午夜精品影院在线观看| av在线综合网| 久久久亚洲精品一区二区三区| 三级精品在线观看| 日本乱码高清不卡字幕| 在线观看一区二区精品视频| 一色屋精品亚洲香蕉网站| 成人高清免费在线播放| 日日摸夜夜添夜夜添亚洲女人| 99久久久久久| 亚洲天堂网中文字| 国产麻豆精品在线观看| 在线91免费看| 久久66热re国产| 精品国产亚洲在线| 国产精品18久久久久| 中文成人av在线| 欧美卡1卡2卡| 欧美一个色资源| 中文字幕综合网| 99精品偷自拍| 亚洲色图.com| 色呦呦一区二区三区| 国产精品家庭影院| eeuss影院一区二区三区| 中文字幕五月欧美| 91视频在线看| 一区二区三区成人在线视频| 色狠狠桃花综合| 亚洲综合成人网| 欧美日韩一级片网站| 午夜免费欧美电影| 日韩写真欧美这视频| 国产资源在线一区| 日本一区二区三区国色天香| 福利一区二区在线观看| 国产精品福利在线播放| 色又黄又爽网站www久久| 午夜视频久久久久久| 日韩免费观看高清完整版在线观看| 精品一区二区免费看| 国产精品素人一区二区| 色综合色综合色综合色综合色综合| 一区二区久久久| 7777精品伊人久久久大香线蕉 | 91色.com| 亚洲精品成a人| 欧美日韩成人高清| 蜜桃精品视频在线| 精品欧美一区二区久久| 卡一卡二国产精品 | 午夜精品一区在线观看| 在线一区二区三区| 日韩av一区二| 精品视频在线视频| 日韩成人av影视| 久久久亚洲综合| 成人白浆超碰人人人人| 亚洲综合激情网| 久久综合九色综合97婷婷 | 欧美性受极品xxxx喷水| 亚洲妇女屁股眼交7| 91精品国产综合久久香蕉的特点| 国产美女在线观看一区| 中国色在线观看另类| 欧洲亚洲精品在线| 国产精品免费网站在线观看| 日韩三级免费观看| 亚洲欧美日韩中文字幕一区二区三区 | 最新不卡av在线| 专区另类欧美日韩| 欧美经典一区二区| 欧美大尺度电影在线| 亚洲精品一区二区三区影院 | 久久久99精品免费观看| 中文字幕成人av| 石原莉奈在线亚洲二区| www..com久久爱| 亚洲午夜久久久久久久久电影院 | 激情小说欧美图片| 欧美激情资源网| 欧美一区二区在线播放| 高清不卡一二三区| 亚洲午夜在线视频| 中文字幕免费不卡| 91浏览器打开| 国产精品一区三区| 日本少妇一区二区| 国产精品久久久久aaaa|