How to print the camera frame buffer?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to print the camera frame buffer?

2,023 次查看
titusstalin
Contributor V

Dear All,

Can you please tell me how to print the content of camera frame buffer ?

Want to print the camera frame buffer in kernel driver for debugging purposes.

May be need to add some code in below code, don't know how to access.

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

Thanks for your support.

Regards,

Titus S.

标签 (2)
5 回复数

1,890 次查看
rogerio_silva
NXP Employee
NXP Employee

Hi Titus,

You can check this user application example:

v4l2-examples/example2.c at master · rogeriorps/v4l2-examples · GitHub 

It's based on /unit_tests/mxc_v4l2_tvin.out

On lines 397 and 399 it makes a memcopy to copy the image between input and output buffers. The camera buffer is available at "capture_buffers[capture_buf.index].start" in this example.

Best regards,

Rogerio

1,890 次查看
titusstalin
Contributor V

Thanks.

But I'm able to do this already in userspace.

I want to do it in kernel driver.

Can you please help me on this ?

Regards,

Titus S.

0 项奖励
回复

1,890 次查看
rogerio_silva
NXP Employee
NXP Employee

Supposing you're using an i.MX with IPU, in kernel drivers, the starting address of framebuffers are registered on EBA0 (and in case of double buffer also in EBA1) registers inside each IDMAC CPMEM Parameters. I think it will be easier to work on IPU drivers instead V4L2. They're located at linix/drivers/mxc/ipu3/. 

1,890 次查看
titusstalin
Contributor V

Thanks Rogerio.

I'm able to print the contents of frame buffer.

       
char *pTmp = (char *) cam->frame[0].vaddress;
printk("\n ####################### Titus Start 0x%x 0x%x ####################\n",buf->m.offset,cam->frame[0].vaddress);   
    for(i=0;i<100;i++)
    {
    printk(" i -> %d, 0x%x ",i,*pTmp++);
    }

1,890 次查看
rogerio_silva
NXP Employee
NXP Employee

Very good! Thanks for the feedback.

Rogerio

0 项奖励
回复