请问专家,我的MCU用的是DM368,图像传感器用的是MT9P031,我想文件存储时只取Y数据,我怎样设置ISIF才行啊?
/××××××××××××××××××××××××××××××××××××××××××××××××××××××××××/
printf("Setting format on sink-pad of isif entity. . .\n");
memset(&fmt, 0, sizeof(fmt));
fmt.pad = 0;;
fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
fmt.format.code = ???;
fmt.format.width = width;
fmt.format.height = height;
fmt.format.field = V4L2_FIELD_NONE;
ret = ioctl(fd, VIDIOC_SUBDEV_S_FMT, &fmt);
if(ret) {
printf("failed to set format on isif pad %x\n", fmt.pad);
goto cleanup;
}
else
printf("successfully format is set on isif pad %x\n", fmt.pad);
printf("Setting format on OF-pad of isif entity. . . \n");
memset(&fmt, 0, sizeof(fmt));
fmt.pad = 1;
fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
fmt.format.code = ????;
fmt.format.width = width;
fmt.format.height = height;
fmt.format.field = V4L2_FIELD_NONE;
ret = ioctl(fd, VIDIOC_SUBDEV_S_FMT, &fmt);
if(ret) {
printf("failed to set format on isif pad %x\n", fmt.pad);
goto cleanup;
}
else
printf("successfully format is set on isif pad %x\n", fmt.pad);
/×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××/
上面是我写的应用程序的代码,在代码部分的 “???”处。我的format.code 值填什么才行啊?
Hank Zhao:
你可以把Y数据从ISIF接收到的YUV数据中提取出来使用。