AnsweredAssumed Answered

Urgent: Issues with camera frame buffer

Question asked by Titus Stalin on Dec 19, 2016

Dear All,


From past two weeks, facing issues with my user-define data type supported camera and iMX.
I've configured the iMX MIPI driver for IPU GENERIC to process the raw data.


I have the MIPI exercisor setup which will send user defined data format image (here, I'm not using my MIPI camera) to iMX MIPI data path.


This is my test scenario:
I've configured the MIPI exercisor to send 1440069 bytes of user defined data format image  (because my actual camera will send the data 1440069bytes)
My user application doesn't know about the width and height but size alone, so I will define the height and width based on the size requested by our user v4l2 application.


Say for ex:
Requested size and Camera user defined data size is 1440069bytes
I will take square root for the given size and make it to 8bit divisible (stride limitation) and assign that value to width and height values.


PS : The problem here is that, I can't use 1200*1200(1440000bytes), if I use that, I lose some of the data (69bytes), so I will configure to next 8bit divisible width and height i.e 1208x1808 resolution.
I will get 1459264bytes data then I will remove the 19295bytes of data (1459264 - 1440069 = 19295)




width_height = int_sqrt(size)
//Code for make it to be 8bit divisible
size = f->fmt->pix.sizeimage; //Setting user defined data size to size
f->fmt->pix.width = width_height; //Setting width
f->fmt->pix.height = width_height; //Setting height


1208*1208 = 1459264bytes (1440069bytes)


After this changes, iMX was able to capture the frames (1459264bytes) but it has data of second frame buffer (i.e mixed of 1st and 2nd frame) due to 1208*1208 configurations.
Do we have any settings to set zero after 1440069bytes (i.e actual data) ?
Or how we can address the problem ?
Or any different approach, any insights on this issue ?


Thanks for your support.

Titus S.