?? test-wgo.c
字號(hào):
/* 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;}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -