Hi
I'm trying to configure the camera capture to single shot mode and get the camera data. I'm using 2.6.32.17 kernel and sdk 4.2 on DM 365 leopard board.As you might be aware that it is interfaced through ISIF.
When previewer and resizer are chained everything works fine but does not work when single shot mode is enabled
when i changed to single shot mode, the VIDIOC_S_STD ioctl fails, In below code if the vpfe is not chained the pix format is not set and returns error.
/* At CCDC we need to set pix format based on source. */
if (vpfe_dev->imp_chained) {
if (vpfe_dev->current_subdev->is_camera)
pix_fmt =
V4L2_PIX_FMT_SBGGR16;
else if (pix_fmt ==
V4L2_PIX_FMT_NV12)
pix_fmt =
V4L2_PIX_FMT_UYVY;
}
if (ccdc_dev->hw_ops.set_pixel_format(pix_fmt) < 0) {
v4l2_err(&vpfe_dev->v4l2_dev,
"couldn't set pix format in ccdc\n");
return -EINVAL;
}
I tried to hard code the pixel format to V4L2_PIX_FMT_SBGGR16 and check if it
works but it did not work since vpfe_dev->imp_chained is not chained i,,e
the previewer and resizer are configured in single shot mode ?
The following are my observations and assumptions
After going through the driver code and the comments, i could understand that VIDIOC_S_STD should NOT be called if the camera data is coming through the ISIF and VIDIOC_S_STD should be called only when it is from a TV decoder chip. So I commented the calling of this ioctl in my application.
VIDIOC_S_FMT ioctl is called with PIX_FMT being , V4L2_PIX_FMT_NV12. When i call the VIDIO_G_FMT after setting it , the format that i received is V4L2_PIX_FMT_SBGGR16 but not V4L2_PIX_FMT_SBGGR16.
conclusion:
When i went through the code, 16 bit bayer i/p is converted to v4l2_pix_fmt_nv12 when it is chained and this does not happen when it is non-chained. which means that the camera data that is received is in BAYER format and not NV12 format.
Is my conclusion right ? i,,e in single shot mode we get 16 bit RAW bayer after which we need to do resizing and format conversion to NV12 is application ?
Assuming that my conclusion is right, i configured the resizer to do format conversion from 16 bit bayer to NV12. I see that the picture in green and blue color i,,e there is movement of image but not in right format.
Is there any demo application which configures the camera capture in SINGLE SHOT mode and gets the camera data in NV12 format ??