Hi,
I am trying to setup CSI to generate test image (the checkboard pattern) and capture it using Gstreamer.
I am using Kernel 3.10.17 on i.MX6DL. The reference document I am using is Freescale's "i.MX 6 BSP Porting Guide" section "7.1.3 Configuring the CSI Unit in Test Mode".
What I have done so far in kernel (mostly based on the reference document):
1. Enabled CSI related modules in kernel menuconfig under Device Drivers > Multimedia > V4L2
2. Modified ov5640.c driver to remove codes related to I2C and regulators
3. Modified ov5640.c to set the sensor format from YUYV to RGB565 (ov5640_data.pix.pixelformat = V4L2_PIX_FMT_RGB565)
4. Modified ipu_capture.c to setup CSI in CST_TEST mode. The diff is attached.
5. Changed all IPU_PIX_FMT_UYVY to IPU_PIX_FMT_RGB565 in ipu_bg_overlay_sdc.c (didn't have any effect though)
6. Changed "CSI IC MEM" to "CSI MEM" in struct mxc_capture_inputs inside mxc_v4l2_capture.c
After these modifications, I can capture the checkboard pattern using GStreamer:
gst-launch mfw_v4lsrc num-buffers=1 ! jpegenc ! filesink location=sample.jpg
The color format of captured images is not correct. I have attached some samples for different RGB value settings.
Is there anything I am missing in the settings that causes this issue?
RGB=(0,0,0) | RGB=(255,0,0) | RGB=(0,255,0) | RGB=(0,0,255) | RGB=(255,255,255) |
---|---|---|---|---|
Original Attachment has been moved to: ipu_capture.c.diff.zip
Hi Issac,
For RGB565 data, you should capture it by GENERIC mode .
please refter to this link !
https://community.freescale.com/docs/DOC-97981
Regards,
weidong