如题, V4L2采集格式设置
struct v4l2_format fmt;
memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = WIDTH;
fmt.fmt.pix.height = HEIGHT;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
if (::ioctl(fd, VIDIOC_S_FMT, &fmt) == -1)
{
printf("Camara set fmt is errror.\n");
return -1;
}
printf("width: d%\n", fmt.fmt.pix.width);
printf("height: d%\n", fmt.fmt.pix.height);
return 0;
}
程序运行时能看到图像,但是终端输出的是width: d%,height: d%,为何没有输出具体的值呢,在程序开头已经
#define WIDTH 160
#define HEIGHT 120
在这卡了好久了,导致后面也进行不下去,急求各位大侠帮忙,不胜感激!
[ 此帖被yncxzdy在2014-03-14 10:22重新编辑 ]