aire39
Posts: 11
Joined: Sat Sep 23, 2017 10:43 am

EGL image to ISP component input port (MMAL)

Fri Dec 21, 2018 3:05 am

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!

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6327
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

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

Fri Dec 21, 2018 11:46 am

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.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aire39
Posts: 11
Joined: Sat Sep 23, 2017 10:43 am

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

Fri Dec 21, 2018 7:28 pm

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?

Return to “Graphics programming”