|
10# 亚瑟王
救命!还是毕设:已经用网络摄像机测试过摄像头证明驱动没问题;
图像采集:摄像头,zc301 zc303 在pc机上fedora9仿真没问题,但下到开发板花屏:提示:
v4l_grab_sync: Invalid argument
v4l_grab_frame: Invalid argument
v4l_grab_sync: Invalid argument
v4l_grab_frame: Invalid argument
v4l_grab_sync: Invalid argument
采用的是v4l 编程接口编程:v4l_grab_sync: v4l_grab_frame 两个函数如下:
int v4l_grab_frame(v4l_device *vd, int frame)
{
if (vd->frame_using[frame])
{
fprintf(stderr, "v4l_grab_frame: frame %d is already used.\n", frame); return -1;
}
vd->mmap.frame = frame;
if ( ioctl(vd->fd, VIDIOCMCAPTURE, &(vd->mmap ) ) < 0 )
{
perror( "v4l_grab_frame" );
return -1;
}
vd->frame_using[frame] = 1;
vd->frame_current = frame;
return 0;
}
int v4l_grab_sync(v4l_device *vd)
{
// printf("enter grab_sync\n");
if (ioctl(vd->fd, VIDIOCSYNC, &(vd->frame_current)) < 0)
{
perror("v4l_grab_sync");
}
vd->frame_using[vd->frame_current] = 0; // printf("leave grab_sync\n");
return 0;
}
能不能帮忙看一下呢?之前我有个同学基于mini2440 的2.16.13内核成功运行,但我的是TQ2440 内核为2.6.30.4 花屏了 很快就得答辩了 还整不出来 完了! |
|