|
小弟在学USB驱动,买了一个网眼 V2000的摄像头。在linux2.4.20-8中带有OV511的驱动(ov511.c;ov511.h),我想先用一下是否好用,就改了一个测试程序来看看,结果一运行测试程序,程序就退出了,大虾们帮我简单看看我的测试程序是什么问题啊
- #include "spcav4l.h"
- int main (int argc, const char* argv[])
- {
- char videodevice[] = "/dev/v4l/video0";
- char jpegfile[] = "1.bmp";
- int grabmethod = 0;
- int format = VIDEO_PALETTE_JPEG;
- int width = 240;
- int height = 320;
- int i;
- printf("here 3!\n");
- memset(&videoIn, 0, sizeof (struct vdIn));
- if(init_videoIn(&videoIn, videodevice, width, height, format,grabmethod) == 0)
- {
- printf("init is ok!\n");
- }
- else printf("init is wrong!\n");
- sleep(2);
- printf("here 1!\n");
- v4lGrab(&videoIn, jpegfile);
- sleep(2);
-
- close_v4l (&videoIn);
- return 0;
- }
复制代码
点击浏览该文件uu
压缩包里面是程序的全部代码 |
|