|
也没有/dev/v4l/video0呃,就是不知道如何判断摄像头已经在工作了?根据内核信息,驱动模块已加载成功。
参考其他帖子,有说手动建立设备节点:mknod /dev/video0 c 81 0
我用其他的测试程序(基于v4l2)根本打不开这个设备。看了测试程序的源码,打开设备部分为:
fd = open (dev_name, O_RDWR | O_NONBLOCK, 0);
if (-1 == fd) {
fprintf (stderr, "Cannot open '%s': %d, %s\n",
dev_name, errno, strerror (errno));
exit (EXIT_FAILURE);
}
参考了文档:
When the O_NONBLOCK flag is given, the read() function and the VIDIOC_DQBUF ioctl will return the EAGAIN error code when no data is available or no buffer is in the driver outgoing queue, otherwise these functions block until data becomes available. All V4L2 drivers exchanging data with applications must support the O_NONBLOCK flag.
我猜测这个我创建的设备文件里面没有视频流数据,可能摄像头没有工作起来。
可是驱动已加载成功,我要怎样才能让摄像头工作起来呢?照理说如果设备工作起来了,它会自动在/dev/目录下创建设备节点。
请教亚瑟王了。 |
|