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

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

?? spcav4l.c

?? serverfox驅(qū)動(dòng)的代碼,對(duì)服務(wù)器/客戶端模式感興趣的可以看看!
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/****************************************************************************#	 	spcav4l: v4l library.				            ##This package work with the spca5xx based webcam with the raw jpeg feature. ##All the decoding is in user space with the help of libjpeg.                ##.                                                                          ## 		Copyright (C) 2003 2004 2005 Michel Xhaard                  ##                                                                           ## This program is free software; you can redistribute it and/or modify      ## it under the terms of the GNU General Public License as published by      ## the Free Software Foundation; either version 2 of the License, or         ## (at your option) any later version.                                       ##                                                                           ## This program is distributed in the hope that it will be useful,           ## but WITHOUT ANY WARRANTY; without even the implied warranty of            ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             ## GNU General Public License for more details.                              ##                                                                           ## You should have received a copy of the GNU General Public License         ## along with this program; if not, write to the Free Software               ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA ##                                                                           #****************************************************************************//* MOFIFIED by MX for Acme FOX Eltrax 100LX and Arm9 only accept jpeg webcam */#include "spcaframe.h"#include "spcav4l.h"#include "utils.h"#define OUTFRMNUMB 4static int debug = 0;static int init_v4l (struct vdIn *vd);#if 0static int checkpalette (struct vdIn *vd);static int check_palettesize(struct vdIn *vd );static int probePalette ( struct vdIn *vd );static int probeSize ( struct vdIn *vd );#endifstatic int isSpcaChip ( const char * BridgeName );/* return Bridge otherwhise -1 */static int GetStreamId ( const char * BridgeName );/* return Stream_id otherwhise -1 */static intGetDepth (int format);static struct bridge_list Blist[]={	{BRIDGE_SPCA505,"SPCA505"},	{BRIDGE_SPCA506,"SPCA506"},	{BRIDGE_SPCA501,"SPCA501"},	{BRIDGE_SPCA508,"SPCA508"},	{BRIDGE_SPCA504,"SPCA504"},	{BRIDGE_SPCA500,"SPCA500"},	{BRIDGE_SPCA504B,"SPCA504B"},	{BRIDGE_SPCA533,"SPCA533"},	{BRIDGE_SPCA504C,"SPCA504C"},	{BRIDGE_SPCA561,"SPCA561"},	{BRIDGE_SPCA536,"SPCA536"},	{BRIDGE_SONIX,"SN9C102"},	{BRIDGE_ZR364XX,"ZR364XX"},	{BRIDGE_ZC3XX,"ZC301-2"},	{BRIDGE_CX11646,"CX11646"},	{BRIDGE_TV8532,"TV8532"},	{BRIDGE_ETOMS,"ET61XX51"},	{BRIDGE_SN9CXXX,"SN9CXXX"},	{BRIDGE_MR97311,"MR97311"},	{BRIDGE_UNKNOW,"UNKNOW"},	{-1,NULL}};#if 0/* Camera type jpeg yuvy yyuv yuyv grey gbrg*/static struct palette_list Plist[] ={	{JPEG,"JPEG"},	{YUVY,"YUVY"},	{YYUV,"YYUV"},	{YUYV,"YUYV"},	{GREY,"GREY"},	{GBRG,"GBRG"},	{SN9C,"SN9C"},	{GBGR,"GBGR"},	{UNOW,"UNOW"},	{-1,NULL}};#endif/*****************************************************************************			Public****************************************************************************/intinit_videoIn (struct vdIn *vd, char *device, int width, int height,	      int format, int grabmethod){  int err = -1;  int i;  if (vd == NULL || device == NULL)    return -1;  if (width == 0 || height == 0)    return -1;  if(grabmethod < 0 || grabmethod > 1)  	grabmethod = 1; //read by default;	// check format   vd->videodevice = NULL;  vd->cameraname = NULL;  vd->videodevice = NULL;  vd->videodevice = (char *) realloc (vd->videodevice, 16);  vd->cameraname = (char *) realloc (vd->cameraname, 32);  snprintf (vd->videodevice, 12, "%s", device);  if(debug) printf("video %s \n",vd->videodevice);  memset (vd->cameraname, 0, sizeof (vd->cameraname));  memset(vd->bridge, 0, sizeof(vd->bridge));   vd->signalquit = 1;  vd->hdrwidth = width;  vd->hdrheight = height;  /*          compute the max frame size   */  vd->formatIn = format;   vd->bppIn = GetDepth (vd->formatIn);  vd->grabMethod = grabmethod;		//mmap or read   vd->pFramebuffer = NULL;  /* init and check all setting */  err = init_v4l (vd);  /* allocate the 4 frames output buffer */  for (i = 0; i < OUTFRMNUMB; i++)    {      vd->ptframe[i] = NULL;      vd->ptframe[i] =	(unsigned char *) realloc (vd->ptframe[i], sizeof(struct frame_t) + (size_t) vd->framesizeIn );      vd->framelock[i] = 0;    }  vd->frame_cour = 0;       pthread_mutex_init (&vd->grabmutex, NULL);  return err;}intclose_v4l (struct vdIn *vd){  int i;  if (vd->grabMethod)    {      if(debug) printf ("unmapping frame buffer\n");      munmap (vd->pFramebuffer, vd->mmapsize);    } else {    	free(vd->pFramebuffer);	vd->pFramebuffer = NULL;    }  if(debug) printf ("close video_device\n");    close (vd->fd);  /* dealloc the whole buffers */  if (vd->videodevice)    {      free (vd->videodevice);      vd->videodevice = NULL;    }  if (vd->cameraname)    {      free (vd->cameraname);      vd->cameraname = NULL;    }  for (i = 0; i < OUTFRMNUMB; i++)    {      if (vd->ptframe[i])	{	  free (vd->ptframe[i]);	  vd->ptframe[i] = NULL;	  vd->framelock[i] = 0;	  if(debug) printf ("freeing output buffer %d\n",i);	}    }     pthread_mutex_destroy (&vd->grabmutex);}int convertframe(unsigned char *dst,unsigned char *src, int width,int height, int formatIn, int size){ 	int jpegsize =0;	switch (formatIn){	case VIDEO_PALETTE_JPEG:	jpegsize = get_jpegsize(src, size);	if (jpegsize < 0) break;	memcpy(dst,src,jpegsize);		break;	default:	break;	}return jpegsize;}int v4lGrab (struct vdIn *vd ){	static	int frame = 0;		  int len;    int size;  int erreur = 0;  int jpegsize = 0;  struct frame_t *headerframe;  double timecourant =0;  double temps = 0;  timecourant = ms_time();  if (vd->grabMethod)    {           vd->vmmap.height = vd->hdrheight;      vd->vmmap.width = vd->hdrwidth;      vd->vmmap.format = vd->formatIn;      if (ioctl (vd->fd, VIDIOCSYNC, &vd->vmmap.frame) < 0)	{	  perror ("cvsync err\n");	  erreur = -1;	}     	/* Is there someone using the frame */      while((vd->framelock[vd->frame_cour] != 0) && vd->signalquit)   	usleep(1000);	pthread_mutex_lock (&vd->grabmutex);		/*	memcpy (vd->ptframe[vd->frame_cour]+ sizeof(struct frame_t), vd->pFramebuffer +	      vd->videombuf.offsets[vd->vmmap.frame] , vd->framesizeIn); 	 jpegsize =jpeg_compress(vd->ptframe[vd->frame_cour]+ sizeof(struct frame_t),vd->framesizeIn,	 vd->pFramebuffer + vd->videombuf.offsets[vd->vmmap.frame] ,vd->hdrwidth, vd->hdrheight, qualite);  	 */	 temps = ms_time();	 jpegsize= convertframe(vd->ptframe[vd->frame_cour]+ sizeof(struct frame_t),	 		vd->pFramebuffer + vd->videombuf.offsets[vd->vmmap.frame],			vd->hdrwidth,vd->hdrheight,vd->formatIn,vd->framesizeIn);		 headerframe=(struct frame_t*)vd->ptframe[vd->frame_cour];	 snprintf(headerframe->header,5,"%s","SPCA"); 	 headerframe->seqtimes = ms_time();	 headerframe->deltatimes=(int)(headerframe->seqtimes-timecourant); 	 headerframe->w = vd->hdrwidth;	 headerframe->h = vd->hdrheight;	 headerframe->size = (( jpegsize < 0)?0:jpegsize);	 headerframe->format = vd->formatIn;	 headerframe->nbframe = frame++; 	// printf("compress frame %d times %f\n",frame, headerframe->seqtimes-temps);		pthread_mutex_unlock (&vd->grabmutex); 	/************************************/	      if ((ioctl (vd->fd, VIDIOCMCAPTURE, &(vd->vmmap))) < 0)	{	  perror ("cmcapture");	  if(debug) printf (">>cmcapture err \n");	  erreur = -1;	}      vd->vmmap.frame = (vd->vmmap.frame + 1) % vd->videombuf.frames;      vd->frame_cour = (vd->frame_cour +1) % OUTFRMNUMB;      //if(debug) printf("frame nb %d\n",vd->vmmap.frame);    }  else    {      /* read method */      size = vd->framesizeIn;      len = read (vd->fd, vd->pFramebuffer, size);      if (len < 0 )	{	  if(debug) printf ("v4l read error\n");	  if(debug) printf ("len %d asked %d \n", len, size);	  return 0;	}	      /* Is there someone using the frame */       while((vd->framelock[vd->frame_cour] != 0)&& vd->signalquit)   	usleep(1000);	pthread_mutex_lock (&vd->grabmutex);	/*	 memcpy (vd->ptframe[vd->frame_cour]+ sizeof(struct frame_t), vd->pFramebuffer, vd->framesizeIn);	 jpegsize =jpeg_compress(vd->ptframe[vd->frame_cour]+ sizeof(struct frame_t),len,	 vd->pFramebuffer, vd->hdrwidth, vd->hdrheight, qualite); 	 */	  temps = ms_time();	 jpegsize= convertframe(vd->ptframe[vd->frame_cour]+ sizeof(struct frame_t),	 		vd->pFramebuffer ,			vd->hdrwidth,vd->hdrheight,vd->formatIn,vd->framesizeIn); 		 headerframe=(struct frame_t*)vd->ptframe[vd->frame_cour];	 snprintf(headerframe->header,5,"%s","SPCA"); 	 headerframe->seqtimes = ms_time();	 headerframe->deltatimes=(int)(headerframe->seqtimes-timecourant); 	 headerframe->w = vd->hdrwidth;	 headerframe->h = vd->hdrheight;	 headerframe->size = (( jpegsize < 0)?0:jpegsize); 	 headerframe->format = vd->formatIn; 	 headerframe->nbframe = frame++; 	 //  if(debug) printf("compress frame %d times %f\n",frame, headerframe->seqtimes-temps);		vd->frame_cour = (vd->frame_cour +1) % OUTFRMNUMB;  	pthread_mutex_unlock (&vd->grabmutex);       /************************************/         }  return erreur;}/****************************************************************************** 				Private******************************************************************************/static intGetVideoPict (struct vdIn *vd){  if (ioctl (vd->fd, VIDIOCGPICT, &vd->videopict) < 0)    exit_fatal ("Couldnt get videopict params with VIDIOCGPICT");  if(debug) printf ("VIDIOCGPICT brightnes=%d hue=%d color=%d contrast=%d whiteness=%d"	  "depth=%d palette=%d\n", vd->videopict.brightness,	  vd->videopict.hue, vd->videopict.colour, vd->videopict.contrast,	  vd->videopict.whiteness, vd->videopict.depth,	  vd->videopict.palette);  return 0;}static intSetVideoPict (struct vdIn *vd){  if (ioctl (vd->fd, VIDIOCSPICT, &vd->videopict) < 0)    exit_fatal ("Couldnt set videopict params with VIDIOCSPICT");  if(debug) printf ("VIDIOCSPICT brightnes=%d hue=%d color=%d contrast=%d whiteness=%d"	  "depth=%d palette=%d\n", vd->videopict.brightness,	  vd->videopict.hue, vd->videopict.colour, vd->videopict.contrast,	  vd->videopict.whiteness, vd->videopict.depth,	  vd->videopict.palette);  return 0;}static void spcaPrintParam (int fd,struct video_param *videoparam);static void spcaSetTimeInterval(int fd, struct video_param *videoparam, unsigned short dtime);static void spcaSetQuality(int fd, struct video_param *videoparam, unsigned char qindex);static intinit_v4l (struct vdIn *vd){  int f;  int erreur = 0;  if ((vd->fd = open (vd->videodevice, O_RDWR)) == -1)    exit_fatal ("ERROR opening V4L interface");  if (ioctl (vd->fd, VIDIOCGCAP, &(vd->videocap)) == -1)    exit_fatal ("Couldn't get videodevice capability");  if(debug) printf ("Camera found: %s \n", vd->videocap.name);  snprintf (vd->cameraname, 32, "%s", vd->videocap.name);  erreur = GetVideoPict (vd);   if (ioctl (vd->fd, VIDIOCGCHAN, &vd->videochan) == -1)    {      if(debug) printf ("Hmm did not support Video_channel\n");      vd->cameratype = UNOW;    }  else    {    if (vd->videochan.name){      if(debug) printf ("Bridge found: %s \n", vd->videochan.name);      snprintf (vd->bridge, 9, "%s", vd->videochan.name);      vd->cameratype = GetStreamId (vd->videochan.name);       spcaPrintParam (vd->fd,&vd->videoparam);      }      else      {       if(debug) printf ("Bridge not found not a spca5xx Webcam Probing the hardware !!\n");      vd->cameratype = UNOW;      }    }/* Only jpeg webcam allowed */if(vd->cameratype != JPEG) {	exit_fatal ("Not a JPEG webcam sorry Abort !");}   if(debug) printf ("StreamId: %d  Camera\n", vd->cameratype);/* probe all available palette and size Not need on the FOX always jpeg   if (probePalette(vd ) < 0) {	  exit_fatal ("could't probe video palette Abort !");	  }   if (probeSize(vd ) < 0) {	  exit_fatal ("could't probe video size Abort !");	  }	 err = check_palettesize(vd);	 if(debug) printf (" Format asked %d check %d\n",vd->formatIn, err);*/	 	  vd->videopict.palette = vd->formatIn;  vd->videopict.depth = GetDepth (vd->formatIn);  vd->bppIn = GetDepth (vd->formatIn);     //vd->framesizeIn = (vd->hdrwidth * vd->hdrheight * vd->bppIn) >> 3; // here alloc the output ringbuffer    vd->framesizeIn = (vd->hdrwidth * vd->hdrheight >> 2 ); // here alloc the output ringbuffer jpeg only  erreur = SetVideoPict (vd);  erreur = GetVideoPict (vd);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美肥大bbwbbw高潮| 亚洲欧洲日韩一区二区三区| 在线观看一区不卡| 99在线精品视频| 99热国产精品| 一本到不卡免费一区二区| 色呦呦国产精品| 欧洲av一区二区嗯嗯嗯啊| 欧美亚洲综合网| 欧洲视频一区二区| 欧美三级资源在线| 欧美日韩成人一区二区| 3d动漫精品啪啪| 欧美草草影院在线视频| 26uuu欧美| 国产精品久久久一本精品| 日韩一区日韩二区| 亚洲午夜精品一区二区三区他趣| 一区二区三区不卡视频在线观看| 亚洲第一主播视频| 麻豆国产91在线播放| 国产伦精品一区二区三区视频青涩 | 91欧美一区二区| 日本久久一区二区| 欧美一级专区免费大片| 久久久久久97三级| 1000部国产精品成人观看| 一区二区三区欧美| 首页亚洲欧美制服丝腿| 国内精品国产成人| av福利精品导航| 欧美日韩在线一区二区| 日韩精品一区国产麻豆| 中文字幕乱码日本亚洲一区二区 | 亚洲精品欧美二区三区中文字幕| 一区二区国产视频| 免费看欧美女人艹b| 成人性色生活片| 欧美在线不卡一区| 久久综合成人精品亚洲另类欧美| 国产精品麻豆99久久久久久| 亚洲一区二区三区小说| 激情伊人五月天久久综合| 成人精品一区二区三区中文字幕| 在线观看一区日韩| 久久影院视频免费| 亚洲黄色免费电影| 国产乱对白刺激视频不卡| 色哟哟亚洲精品| 欧美精品一区二区三区一线天视频 | 国产免费观看久久| 亚洲成精国产精品女| 国产米奇在线777精品观看| 欧美在线不卡视频| 国产日韩欧美麻豆| 午夜精品久久久久久久久| 国产91对白在线观看九色| 欧美午夜精品免费| 国产人久久人人人人爽| 午夜精品福利一区二区三区蜜桃| 国产成人啪免费观看软件| 欧美高清性hdvideosex| 综合激情网...| 国产一区二区三区免费播放 | 国产欧美一区视频| 男女激情视频一区| 91国模大尺度私拍在线视频| 国产亚洲精品bt天堂精选| 午夜国产精品一区| 91丨九色丨尤物| 国产欧美一区二区三区网站| 天使萌一区二区三区免费观看| www.亚洲在线| 久久久久九九视频| 久久国产欧美日韩精品| 欧美日韩国产综合一区二区| 亚洲人妖av一区二区| 成人综合在线视频| 久久综合色天天久久综合图片| 日韩av午夜在线观看| 在线观看日韩毛片| 亚洲欧美国产三级| aaa欧美日韩| 国产亚洲视频系列| 国产精品自产自拍| 久久亚洲综合色一区二区三区| 香蕉加勒比综合久久| 欧美三级三级三级| 亚洲国产美国国产综合一区二区 | 亚洲欧美另类久久久精品| 国产999精品久久久久久绿帽| 久久综合色一综合色88| 麻豆91在线播放免费| 欧美一级高清片在线观看| 青青国产91久久久久久| 日韩一区二区在线免费观看| 日韩国产一二三区| 91精品国产综合久久久蜜臀图片| 亚洲国产aⅴ天堂久久| 欧美性感一区二区三区| 亚洲一二三区在线观看| 欧美性极品少妇| 亚洲国产一二三| 7799精品视频| 热久久国产精品| 精品国产自在久精品国产| 伦理电影国产精品| 久久女同精品一区二区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 麻豆精品一区二区av白丝在线| 欧美色大人视频| 秋霞电影网一区二区| 精品欧美一区二区久久| 国产乱码精品一区二区三区av| 欧美激情在线免费观看| 99麻豆久久久国产精品免费| 亚洲欧美日韩一区二区| 欧洲一区在线观看| 日韩成人免费电影| 久久亚洲精精品中文字幕早川悠里| 国产一区二区在线影院| 国产日韩综合av| 色综合天天综合网天天狠天天| 洋洋成人永久网站入口| 欧美日韩激情一区二区| 精品中文av资源站在线观看| 国产亚洲精品免费| 色婷婷综合久久久久中文一区二区 | 中文字幕在线一区| 欧美色图片你懂的| 狠狠色狠狠色综合| 亚洲欧洲成人自拍| 欧美一区二区三区在线| 国产九色sp调教91| 夜夜操天天操亚洲| 精品国产凹凸成av人网站| 99久久精品国产导航| 午夜欧美大尺度福利影院在线看| 日韩欧美一级在线播放| 丁香激情综合国产| 亚洲gay无套男同| 26uuu色噜噜精品一区| 色拍拍在线精品视频8848| 另类调教123区 | 不卡一区二区中文字幕| 亚洲成人自拍一区| 久久久青草青青国产亚洲免观| 97se亚洲国产综合在线| 免费av网站大全久久| 亚洲欧洲日产国码二区| 欧美肥妇毛茸茸| av一区二区三区四区| 五月综合激情婷婷六月色窝| 国产亚洲欧美日韩在线一区| 精品视频在线免费观看| 懂色av中文字幕一区二区三区| 亚洲午夜日本在线观看| 中文字幕巨乱亚洲| 91超碰这里只有精品国产| 成人av免费在线播放| 蜜桃av噜噜一区| 亚洲欧美色图小说| 国产偷国产偷精品高清尤物| 欧美日韩午夜影院| 99久久99久久精品免费观看| 精品中文av资源站在线观看| 亚洲午夜一区二区三区| 中文字幕一区二区三区蜜月| 日韩欧美一区二区三区在线| 色国产精品一区在线观看| 国产一区二区三区观看| 丝袜诱惑制服诱惑色一区在线观看| 国产精品久久午夜| 2023国产精品自拍| 3d成人动漫网站| 色香色香欲天天天影视综合网| 国产精品99久久久久久宅男| 免费成人在线观看| 偷拍亚洲欧洲综合| 亚洲综合偷拍欧美一区色| 国产精品国产三级国产普通话蜜臀 | 日韩欧美国产电影| 欧美日韩国产中文| 色综合网色综合| jlzzjlzz国产精品久久| 国产曰批免费观看久久久| 日韩电影一区二区三区| 夜夜精品视频一区二区| 亚洲色图丝袜美腿| 最新不卡av在线| 国产精品不卡一区二区三区| 久久久久国产成人精品亚洲午夜| 欧美一级久久久| 欧美一区二区福利在线| 91麻豆精品国产91久久久 | 亚洲成人综合在线| 亚洲电影第三页| 天天av天天翘天天综合网色鬼国产 | 国产丝袜在线精品| 久久精品一区二区|