- 论坛徽章:
- 0
|
本帖最后由 changqiong0606 于 2012-12-03 10:07 编辑
我在嵌入式系统上运行的v4l2程序,用ioctl(dev, VIDIOC_ENUM_FMT, &fmt)查询输出格式,
枚举摄像头支持的格式:
while ((ret = ioctl(dev, VIDIOC_ENUM_FMT, &fmt)) == 0) {
fmt.index++;
printf("{ pixelformat = '%c%c%c%c', description = '%s' ,fmt.index = %d}\n",
fmt.pixelformat & 0xFF, (fmt.pixelformat >> 8 ) & 0xFF,
(fmt.pixelformat >> 16) & 0xFF, (fmt.pixelformat >> 24) & 0xFF,
fmt.description,fmt.index);
ret = enum_frame_sizes(dev, fmt.pixelformat);
if (ret != 0)
printf(" Unable to enumerate frame sizes. \n ");
}
奇怪的是在板子上只能查询到yuyv格式的,但是在pc上同样的程序查询,却可以查到mjpg格式和yuyv格式,我的摄像头是两种格式都支持的。那为什么在嵌入式系统上只能查到yuyv呢??
pc上操作系统内核是2.6.32
嵌入式系统内核2.6.30 |
|