Page 1 of 1

EGL image to ISP component input port (MMAL)

Posted: Fri Dec 21, 2018 3:05 am
by aire39
GPU (vcsm) -> input_port (isp component).

I use the EGL_IMAGE_BRCM_VCSM when generating a buffer that I eventually turn into an opengl texture that is attached to a frame buffer object (fbo) in opengl. I render into this fbo which renders into the vcsm buffer.

After a frame rendered with the gpu has been completed is it possible to use the vcsm_info.handle to set the MMAL_BUFFER_HEADER_T::data parameter and send this buffer off to the isp component input port?

I use this particular instance of the isp component to do a color conversion from rgba to I420 (yuv).

Some insight into this would be appreciated!

Re: EGL image to ISP component input port (MMAL)

Posted: Fri Dec 21, 2018 11:46 am
by 6by9
If you have a vcsm handle, then

Code: Select all

buffer->data = vcsm_vc_hdl_from_hdl(vcsm_handle);
should do what you want.

There was a thread fairly recently about a similar intent - viewtopic.php?f=68&t=222930 looks likely.

https://github.com/6by9/yavta/blob/master/yavta.c does a fairly similar thing where it has exported dmabufs from V4L2, and then imports them into vcsm to get a vcsm handle. That handle is then passed to vcsm_vc_hdl_from_hdl to get the vc handle to populate the MMAL buffer header.

Re: EGL image to ISP component input port (MMAL)

Posted: Fri Dec 21, 2018 7:28 pm
by aire39
Great but if I have a 2048x1024 vcsm buffer but my incoming camera frame is only 1280x720 am I able to tell the input port to assume a 1280x720 buffer?

In the post you linked to the openmax data structure used specifies a stride and width where the stride is the size of the vcsm and width is what the actual frame size is. Would the equivalent of this be handled by using the mmal_parameter_set function to set a crop on the input port?