AnsweredAssumed Answered

Camera frames handling

Question asked by Titus Stalin on Dec 9, 2016
Latest reply on Dec 14, 2016 by Titus Stalin

Dear All,

I've a custom camera which will give the frame size what we requested.

Say for ex, if we request frames in 1000bytes, then it will give you the 1000bytes on the MIPI data channel.

Now, I'm requesting the 1440000bytes (800x600x3) data from camera, it give and able to receive as a frame in buffer.

 

In driver, I took square root of 1440000 and assigned the value to both width and height of image.

 

drivers/media/platform/mxc/capture/mxc_v4l2_capture.c

Function: mxc_v4l2_s_fmt

        case V4L2_PIX_FMT_BAYER:
//            size = f->fmt.pix.width * f->fmt.pix.height * 3;
            printk("V4L2_PIX_FMT_BAYER  %d:\n",f->fmt.pix.sizeimage);//Size is set by user v4l2 app code i.e 1440000
            size = f->fmt.pix.sizeimage;
            f->fmt.pix.width = f->fmt.pix.height = (int_sqrt(size));
//            bytesperline = f->fmt.pix.width * 3;
            break;

 

By using the above change, able to get the complete frame for 1440000bytes of data, but not for if I increase 1 bytes (1440001)

 

And if I have requested 1440055bytes from camera, it gives data to the iMX MIPI channel then its able to get data but misaligned.

How can I get the correct data ?

I'm using Bayer camera sensor so I've used IPU_PIX_FMT_GENERIC option and setting the RAW sensor settings in registers by seeing the other posts.

 

Any insights or pointers on this problem, how we can apply workaround for this case.

I appreciate your help on this.

Thanks for your help.

 

Regards,

Titus S.

Outcomes