1.ioctl(fd, VIDIOC_QUERYBUF, &dev.buffer)出错
修改内核文件v4l2_ioctl.c(drivers/media/video/v4l2-ioctl.c)
修改:CMDINSIZE(QUERYBUF, buffer, type);
为:CMDINSIZE(QUERYBUF, buffer, memory);
2.对于dev.buffer返回长度为0的问题:
在上层应用中加入:
format.fmt.pix.priv = 1;这个.
如下:
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
format.fmt.pix.width = 320;
format.fmt.pix.height = 240;
format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
format.fmt.pix.field = V4L2_FIELD_INTERLACED;
format.fmt.pix.priv = 1;