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

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

?? spcaview.c

?? 一個可以實現嵌入式視頻監控系統的最新版客戶端軟件。
?? C
?? 第 1 頁 / 共 5 頁
字號:
	int testbpp=16;	/*********************************/	pictstruct mypict ;	pthread_t waitandshoot_id;	int wstatus ;	/*********************************/	RingBuffer.ptread =0;  	RingBuffer.ptwrite =0;		/* spcaview grabber */			printf ("Initializing SDL.\n");		/* Initialize defaults, Video and Audio */	if ((SDL_Init (SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1)) {		printf ("Could not initialize SDL: %s.\n", SDL_GetError ());		exit (-1);	}			/* Clean up on exit */	atexit (SDL_Quit);	if(!owidth || !oheight){		owidth	= image_width;		oheight	= image_height;		}		printf ("SDL initialized.\n");			/* validate parameters */		printf ("bpp %d format %d\n", bpp, format);		if(!videoOn) {		/* acquire raw data force palette to raw */		printf ("VideoOn = 0\n");			snprintf (fourcc, 5, "RAWD");			format = VIDEO_PALETTE_RAW_JPEG;			}		if(videocomp) {		/* acquire yuv420p and compress diff pixels static huffman */			snprintf (fourcc, 5, "DPSH");			format = VIDEO_PALETTE_YUV420P;			}		if (videodevice == NULL || *videodevice == 0) {			videodevice = "/dev/video0";		}		printf ("Using video device %s.\n", videodevice);		printf ("Initializing v4l.\n");				//v4l init		if ((fd = open (videodevice, O_RDWR)) == -1) {			perror ("ERROR opening V4L interface \n");			exit (1);		}		printf("**************** PROBING CAMERA *********************\n");		if (ioctl (fd, VIDIOCGCAP, &videocap) == -1) {			printf ("wrong device\n");			exit (1);		}				printf("Camera found: %s \n",videocap.name);				if (ioctl (fd, VIDIOCGCHAN, &videochan) == -1) {			printf ("Hmm did not support Video_channel\n");			isVideoChannel = 0;		}		if (isVideoChannel){			videochan.norm = norme;			videochan.channel = channel;			if (ioctl (fd, VIDIOCSCHAN, &videochan) == -1) {				printf ("ERROR setting channel and norme \n");				exit (1);			}			/************ just to be sure *************/			if (ioctl (fd, VIDIOCGCHAN, &videochan) == -1) {				printf ("wrong device\n");				exit (1);			}			printf("Bridge found: %s \n",videochan.name);			streamid = getStreamId (videochan.name);					if (streamid >= 0){				printf("StreamId: %s Camera\n",Plist[streamid].name);				/* look a spca5xx webcam try to set the video param struct */				spcaPrintParam (fd,&videoparam);			} else {				printf("StreamId: %d Unknow Camera\n",streamid);			} 			/* test jpeg capability if not and jpeg ask without raw data 			set default format to YUVP */			if ((format == VIDEO_PALETTE_RAW_JPEG || format == VIDEO_PALETTE_JPEG )&& streamid != JPEG && videoOn) {				printf ("Camera unable to stream in JPEG mode switch to YUV420P\n");				format = VIDEO_PALETTE_YUV420P;			}			if(probeSize(videochan.name,&image_width,&image_height) < 0)				printf("unable to probe size !!\n");			}		printf("*****************************************************\n");		/* Init grab method mmap */		if (grabMethod) {			printf(" grabbing method default MMAP asked \n");			// MMAP VIDEO acquisition			memset (&videombuf, 0, sizeof (videombuf));			if (ioctl (fd, VIDIOCGMBUF, &videombuf) < 0) {				perror (" init VIDIOCGMBUF FAILED\n");			}			printf ("VIDIOCGMBUF size %d  frames %d  offets[0]=%d offsets[1]=%d\n", videombuf.size, videombuf.frames, videombuf.offsets[0], videombuf.offsets[1]);						pFramebuffer =				(unsigned char *) mmap (0, videombuf.size,							PROT_READ | PROT_WRITE,							MAP_SHARED, fd, 0);			mmapsize = videombuf.size;			vmmap.height = image_height;			vmmap.width = image_width;			vmmap.format = format;			for (f = 0; f < videombuf.frames; f++) {				vmmap.frame = f;				if (ioctl (fd, VIDIOCMCAPTURE, &vmmap)) {					perror ("cmcapture");				}			}			vmmap.frame = 0;			/* Compute the estimate frame size we expect that jpeg compress factor 10 			if ((format == VIDEO_PALETTE_RAW_JPEG) && videoOn)				frame_size =					videombuf.size / (10 *							  videombuf.frames);			else				frame_size = videombuf.size / videombuf.frames;			*/		} else {			/* read method */			printf(" grabbing method READ asked \n");			if (ioctl (fd, VIDIOCGWIN, &videowin) < 0)				perror ("VIDIOCGWIN failed \n");			videowin.height = image_height;			videowin.width = image_width;			if (ioctl (fd, VIDIOCSWIN, &videowin) < 0)				perror ("VIDIOCSWIN failed \n");			printf ("VIDIOCGWIN height %d  width %d \n",				videowin.height, videowin.width);					}		switch (format) {				case VIDEO_PALETTE_JPEG:{					frame_size = image_width * image_height;				}				break;				case VIDEO_PALETTE_RAW_JPEG:{					frame_size = image_width *							image_height * 3;					}					break;				case VIDEO_PALETTE_YUV420P:{						frame_size =							(image_width *							 image_height * 3) >> 1;					}					break;				case VIDEO_PALETTE_RGB565:				case VIDEO_PALETTE_RGB24:				case VIDEO_PALETTE_RGB32:{						frame_size =							image_width *							image_height * bpp;					}					break;				default:					break;			}		/* struct video_picture VIDIOCGPICT VIDIOCSPICT */		if (ioctl (fd, VIDIOCGPICT, &videopict) < 0) {			perror ("Couldnt get videopict params with VIDIOCGPICT\n");		}		printf ("VIDIOCGPICT\n");		printf("brightnes=%d hue=%d color=%d contrast=%d whiteness=%d \n" ,		 videopict.brightness, videopict.hue, videopict.colour, videopict.contrast, videopict.whiteness);		printf("depth=%d palette=%d\n", videopict.depth, videopict.palette);				videopict.palette = format;		videopict.depth = bpp * 8;		//videopict.brightness = INIT_BRIGHT;		sleep (1);		setVideoPict (&videopict, fd);		/*		 * Initialize the display 		 */if ( decodeOn && videoOn )			{	/* Display data */		pscreen =			SDL_SetVideoMode (owidth, oheight, testbpp,					  SDL_SWSURFACE);		if (pscreen == NULL) {			printf ("Couldn't set %d*%dx%d video mode: %s\n",				owidth, oheight,3 * 8,				SDL_GetError ());			exit (1);		}//		SDL_WM_SetCaption ("Spcaview Grabber ", NULL);SDL_WM_SetCaption (videocap.name, NULL);}		printf ("\n");		time = SDL_GetTicks ();		prevtime = time;		/* If need open the avi file and alloc jpegbuffer */		if (outputfile) {			jpegData = malloc (frame_size);			dpshDest = malloc(frame_size);			if ((out_fd =			     AVI_open_output_file (outputfile)) == NULL) {				printf ("cannot open write file ? \n");				exit (1);			}			if(interval){			/* picture goes in avi */			AVI_set_video (out_fd, image_width, image_height, 1,				       "MJPG");			mypict.mode = AVIPICT;			mypict.out_fd = out_fd;			} else {			AVI_set_video (out_fd, image_width, image_height, 20,				       fourcc);				       }			if (audioout && !interval) {			/* init the sound recorder if no picture*/			spec.format=AUDIO_FORMAT;  			spec.freq=AUDIO_SAMPLERATE;  			spec.callback=callback_record;  			spec.samples=AUDIO_SAMPLES;  			spec.channels=1;  			spec.userdata=(void*)&RingBuffer;			if(SDL_InitAudioIn()<0)  				{   				 fprintf(stderr,"Couldn't initialize SDL_AudioIn: %s\n",SDL_GetError());    				 SDL_Quit();   				 return(2);  				}			 if(SDL_OpenAudioIn(&spec,&result)<0)  				{   				 fprintf(stderr,"Couldn't open audio input device: %s\n",SDL_GetError());   				 SDL_CloseAudioIn();    				 SDL_Quit();  				}			AVI_set_audio (out_fd, spec.channels, spec.freq,					       16, WAVE_AUDIO_PCM);			//printf ("audio record setting channel %d frequency %d format %d",spec.channels, spec.freq, WAVE_AUDIO_PCM);						// SDL_PauseAudioIn(0); // start record					initAudio = 1;			}		} else		mypict.mode = PICTURE;				/* Allocate tmp buffer for one frame. */		tmp = (unsigned char*)malloc (frame_size);		/* laugth the picture thread */		mypict.data = malloc(frame_size);		mypict.sizeIn = frame_size;		mypict.width = image_width;		mypict.height = image_height;		mypict.formatIn = format;		pthread_mutex_init(&mypict.mutex, NULL);		pthread_cond_init(&mypict.cond, NULL);		wstatus = pthread_create (&waitandshoot_id, NULL, (void *) waitandshoot, &mypict);    		if (wstatus != 0) {			fprintf(stderr,"thread shoot Create error!\n");			exit(-1);		}		 	if (interval && videoOn){			// set_timer(interval);			SDL_SetTimer((Uint32) interval,callback_timer);		 }		i = 0;				while (run && Oneshoot) {			memset(tmp,0x00,frame_size);			intime = SDL_GetTicks ();			pictime = intime - delaytime;			delaytime = intime;			/* Try to synchronize sound with frame rate */			if (initAudio && i > 9){					initAudio = 0;					SDL_PauseAudioIn(0); // start record				}			/* compute bytes sound */			if (pictime < 100) {								bytes_per_read =					((AUDIO_SAMPLERATE / 1000) * 2 * pictime);			}			i++;			if (grabMethod) {				ff = vmmap.frame;				if (ioctl (fd, VIDIOCSYNC, &ff) < 0) {					perror ("cvsync err\n");				}				vmmap.frame = ff;				memcpy (tmp,					pFramebuffer +					videombuf.offsets[vmmap.frame],					frame_size);				if ((status =				     ioctl (fd, VIDIOCMCAPTURE, &vmmap)) < 0) {					perror ("cmcapture");					printf (">>cmcapture err %d\n", status);				}				vmmap.frame =					(vmmap.frame + 1) % videombuf.frames;							} else {				/* read method */				len = read (fd, tmp, frame_size);				// printf ("len %d asked %d \n",len,frame_size);			}			synctime = SDL_GetTicks ();			/*here the frame is in tmp ready to used */			if (pictFlag){			// printf("get Picture condition \n");				wstatus = pthread_mutex_lock (&mypict.mutex);    				if (wstatus != 0) {fprintf(stderr,"Lock error!\n"); exit(-1);}     				memcpy (mypict.data,tmp,frame_size);					//printf("COND OK !!\n");       				wstatus = pthread_cond_signal (&mypict.cond);    				if (wstatus != 0) {fprintf(stderr,"Signal error!\n"); exit(-1);}    				wstatus = pthread_mutex_unlock (&mypict.mutex);    				if (wstatus != 0) {fprintf(stderr,"Unlock error!\n"); exit(-1);}			}			if ((outputfile) && (i > 10) && !interval) {				/* Output video frame with the good format */				switch (format) {					case VIDEO_PALETTE_JPEG:{						int fs = get_jpegsize (tmp , frame_size);							if (AVI_write_frame (out_fd,							     		    (unsigned char *)							     		     tmp,							    		     fs) < 0)									printf ("write error on avi out \n");									method = 0;						}						break;					case VIDEO_PALETTE_RAW_JPEG:{															if (AVI_write_frame							    			(out_fd,							     			(unsigned char *)							     			tmp,							    			 frame_size) < 0)									printf ("write error on avi out \n");													}						break;					case VIDEO_PALETTE_YUV420P:{							if ( videocomp ) {								memcpy( jpegData,tmp,frame_size);								jpegSize=frame_size;								/*jpegData is destroy here */								dpsh_yuv_encode(jpegData, dpshDest, &jpegSize);							// printf ("write DPSH Size %d \n", jpegSize);							if (AVI_write_frame									 (out_fd,									(unsigned char *)									dpshDest, jpegSize) < 0)									printf ("write error on avi out \n");							}else{								if (AVI_write_frame									 (out_fd,									(unsigned char *)									tmp,									image_width *									image_height *									1.5) < 0)									printf ("write error on avi out \n");							}						}						break;					case VIDEO_PALETTE_RGB565:					case VIDEO_PALETTE_RGB24:					case VIDEO_PALETTE_RGB32:{							if (AVI_write_frame							    (out_fd,							     (unsigned char *)							     tmp,							     image_width *							     image_height *							     bpp) < 0)								printf ("write error on avi out \n");						}						break;					default:						break;				}				/* write sound in avi */				if (audioout) {					//printf("bytes per read sound %d \n",bytes_per_read);					SDL_LockAudio();					ptread = RingBuffer.ptread;					ptwrite = RingBuffer.ptwrite;					SDL_UnlockAudio();					if (ptwrite > ptread) {					if (AVI_write_audio						    (out_fd, (char *) RingBuffer.buffer+ptread,						     ptwrite-ptread) < 0)							printf (" write AVI error \n");						 RingBuffer.ptread =  (RingBuffer.ptread + (ptwrite-ptread))%MAXBUFFERSIZE;						} else if (ptwrite < ptread ){					if (AVI_write_audio						    (out_fd, (char *) RingBuffer.buffer+ptread,						     MAXBUFFERSIZE-ptread) < 0)							printf (" write AVI error \n");					if (AVI_write_audio						    (out_fd, (char *) RingBuffer.buffer,						     ptwrite) < 0)							printf (" write AVI error \n");					 RingBuffer.ptread =  (RingBuffer.ptread + ptwrite+(MAXBUFFERSIZE-ptread))%MAXBUFFERSIZE;							}								}							}			compresstime =SDL_GetTicks ();									if ( decodeOn && videoOn && (i > 10))			{	/* Display data */				p = pp = pscreen->pixels;							  refresh_screen ( tmp, p, format,			  image_width,image_height,owidth,oheight,image_width*image_height*bpp,autobright);			  if (autobright)			  	adjust_bright(&videopict, fd);			  decodetime = SDL_GetTicks ();			SDL_UpdateRect (pscreen, 0, 0, 0, 0);	//update the entire screen							} else {			decodetime = SDL_GetTicks ();			}						/* increment the real frame count and update statistics */			framecount++;			total_decode_time += decodetime - synctime;			average_decode_time = total_decode_time / framecount;			if (!autobright && statOn){// \r				printf ("frames:%04d pict:%03dms synch:%03dms write/comp:%03dms decode:%03dms display:%03dms \n",				 framecount, pictime, synctime-intime, compresstime-synctime, decodetime-compresstime,SDL_GetTicks ()-decodetime); 			fflush (stdout);	 			}						if (SDL_PollEvent (&sdlevent) == 1) {				switch (sdlevent.type) {					case SDL_KEYDOWN:						switch (sdlevent.key.keysym.sym) {							case SDLK_b:								videopict.									brightness									-=									0x100;								setVideoPict									(&videopict,									 fd);								break;							case SDLK_n:								videopict.									brightness									+=

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲高清一区二区三区不卡| 91精品国产免费久久综合| 欧美女孩性生活视频| 久久久久九九视频| 亚洲va在线va天堂| 色综合天天综合网天天狠天天 | 欧美一区二区三区不卡| 国产精品美女久久久久久| 日本vs亚洲vs韩国一区三区二区 | 裸体一区二区三区| 播五月开心婷婷综合| 精品国精品国产尤物美女| 亚洲午夜免费电影| 91一区在线观看| 国产精品视频一区二区三区不卡| 蜜桃一区二区三区在线观看| 欧美性高清videossexo| 亚洲欧美日韩国产成人精品影院| 国产伦精品一区二区三区视频青涩 | 一本到一区二区三区| 久久精品一区蜜桃臀影院| 久久91精品久久久久久秒播| 在线不卡一区二区| 亚洲成人精品影院| 欧美日韩国产另类一区| 亚洲免费观看高清完整版在线 | 欧美午夜精品免费| 一区二区三区 在线观看视频| 成人av资源站| 自拍偷在线精品自拍偷无码专区| 国产精品一区二区男女羞羞无遮挡| 51精品国自产在线| 日韩高清不卡一区| 91精品久久久久久久91蜜桃| 日日骚欧美日韩| 欧美高清激情brazzers| 青青草97国产精品免费观看 | 免费国产亚洲视频| 欧美va在线播放| 国产精品一区二区无线| 中文字幕一区三区| 99久久精品国产毛片| 一区二区三区在线视频免费| 91福利在线看| 青娱乐精品在线视频| 精品国产91洋老外米糕| 国产激情一区二区三区四区| 国产精品欧美精品| 色偷偷成人一区二区三区91| 亚洲成人一区在线| 26uuu国产电影一区二区| 成人免费视频一区二区| 亚洲免费观看高清完整版在线观看熊 | 久久99久国产精品黄毛片色诱| 欧美成人一区二区三区片免费| 国内一区二区视频| 亚洲丝袜美腿综合| 7777精品久久久大香线蕉| 精品在线免费观看| 国产精品美女久久久久久久网站| 日本韩国欧美国产| 精品一二三四区| 国产精品不卡视频| 制服丝袜成人动漫| 国产精品一色哟哟哟| 亚洲综合色在线| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 欧美视频日韩视频| 国产一区二区三区观看| 亚洲人成人一区二区在线观看| 欧美日韩另类国产亚洲欧美一级| 国产精一区二区三区| 一区二区三区久久| 欧美www视频| 在线观看一区二区视频| 精品无人区卡一卡二卡三乱码免费卡| 国产欧美在线观看一区| 欧美绝品在线观看成人午夜影视| 国产成人在线免费观看| 五月激情六月综合| 国产精品久久久久影院老司| 欧美一区二区三区色| 99久久综合国产精品| 蜜桃视频在线一区| 一区二区三区在线观看视频| 久久精品亚洲精品国产欧美 | av在线综合网| 另类欧美日韩国产在线| 伊人夜夜躁av伊人久久| 国产婷婷色一区二区三区 | 亚洲综合激情小说| 国产色综合一区| 91精品国产综合久久久蜜臀粉嫩 | 欧美日韩亚洲国产综合| 国产成人午夜高潮毛片| 理论片日本一区| 亚洲成在人线免费| 亚洲免费电影在线| 中文字幕av不卡| 欧美精品一区二区在线播放| 欧美精品 日韩| 欧美性受xxxx| 欧美综合视频在线观看| 99国产精品久久| 成人综合婷婷国产精品久久 | 日韩极品在线观看| 亚洲欧美色综合| 综合欧美亚洲日本| 国产精品萝li| 国产精品免费久久| 中文字幕国产一区二区| 欧美国产激情一区二区三区蜜月| 日韩欧美亚洲另类制服综合在线| 欧美美女视频在线观看| 欧美午夜精品久久久久久超碰 | 粉嫩aⅴ一区二区三区四区五区 | 久久中文娱乐网| 欧美刺激午夜性久久久久久久| 在线观看欧美日本| 欧美日本精品一区二区三区| 欧美综合久久久| 欧美色涩在线第一页| 9191久久久久久久久久久| 制服丝袜一区二区三区| 欧美一区二区在线不卡| 欧美大白屁股肥臀xxxxxx| 精品久久国产字幕高潮| www激情久久| 国产欧美精品一区二区色综合朱莉| 久久久久国色av免费看影院| 中文字幕精品综合| 亚洲精品久久久蜜桃| 日日夜夜免费精品| 国产伦理精品不卡| 91视频国产资源| 精品视频在线看| 精品奇米国产一区二区三区| 国产欧美一区二区在线| 亚洲女厕所小便bbb| 亚洲五月六月丁香激情| 国内精品国产三级国产a久久| 国产ts人妖一区二区| 色天使久久综合网天天| 欧美喷水一区二区| 久久久国产综合精品女国产盗摄| 亚洲欧美在线aaa| 亚洲一区免费视频| 精品一区二区三区免费毛片爱 | 亚洲欧美在线aaa| 午夜视频一区二区三区| 国产综合久久久久影院| 91原创在线视频| 日韩欧美一区二区三区在线| 亚洲国产高清在线| 亚洲国产三级在线| 国产精品66部| 欧美亚洲国产一区二区三区| 久久只精品国产| 亚洲国产色一区| 国产91精品精华液一区二区三区 | 欧美变态tickle挠乳网站| 欧美极品另类videosde| 日日夜夜精品视频天天综合网| 韩国理伦片一区二区三区在线播放| 99久久精品久久久久久清纯| 日韩亚洲欧美成人一区| 自拍偷拍欧美激情| 国产美女一区二区三区| 欧美日韩三级一区二区| 欧美激情自拍偷拍| 青青草国产成人av片免费| 91一区在线观看| 久久精品欧美一区二区三区麻豆| 亚洲免费成人av| 国产成人精品亚洲777人妖 | 91色在线porny| 亚洲精品一区二区三区在线观看| 亚洲午夜私人影院| 91在线观看污| 国产亚洲精品精华液| 日韩vs国产vs欧美| 欧美丝袜丝交足nylons图片| 国产精品久久久久久妇女6080| 韩国一区二区在线观看| 欧美精品自拍偷拍| 亚洲婷婷在线视频| 国产黄人亚洲片| www激情久久| 久久精品国产99久久6| 91麻豆精品国产91久久久使用方法 | 亚洲成a人片在线观看中文| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚州成人在线电影| 欧洲一区二区三区免费视频| 亚洲图片激情小说| 91同城在线观看| 亚洲欧美色图小说| 91蝌蚪porny成人天涯| 中文字幕在线不卡| 91日韩一区二区三区|