⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test-wgo.c

📁 华邦的W996[78]cf芯片组的摄象头驱动程序
💻 C
字号:
/* Test for driver WebCam GO */#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/ioctl.h>#include <sys/mman.h>#include <fcntl.h>#include <stdlib.h>#include <videodev.h>int main() {	int f,f0;	char buf[355*288];	if ( (f0=open("prova.yuv",O_RDWR | O_CREAT)) == -1) {		printf("Cannot-open tmpfilen");		return -1;	}		printf("Testing device open ... ");	if ( (f = open("/dev/video",O_RDWR)) == -1) {		printf("Cannot-open /dev/video\n");		return -1;	}		/* Sleep a while */	sleep(2);	/* Read some data and write to file */	read(f,buf,355*288);	write(f0,buf,355*288);	sleep(2);	close(f0);	printf("Testing device close ...\n");	close(f);	printf("Ok!!!");	return 1;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -