gpalsingh / mesa

Mesa 3D graphics library (mirror; no pull requests here please)
http://mesa3d.org
4 stars 0 forks source link

Import EGLImage at registration time #8

Open CapOM opened 7 years ago

CapOM commented 7 years ago

When setting up the pipeline the client calls OMX_UseEGLImage a few times to register their handle. Later on the component can retrieve these eglimage handles by calling tiz_krn_claim_eglimage.

Currently the component calls vl_video_buffer_create_ex2 (eglimage_resource) after that the pipeline is setup. This has a cost to slow down the pipeline for the first frames. Instead this should be called at registration time, i.e. in the eglimage hook (egl_image_validation_hook). This will also allows to fail earlier if vl_video_buffer_create_ex2 fails and a chance to the pipeline to fallback to another method eventually.

But the problem is that we do not get the h264d_prc_t as parameter from entrypoint.c::egl_image_validation_hook

We could try to use the last void* args parameter:

const tiz_eglimage_hook_t egl_validation_hook = { OMX_VID_DEC_AVC_OUTPUT_PORT_INDEX, egl_image_validation_hook, NULL // we can pass a pointer here };

And this pointer will be passed below as ap_args, but we need to confirm. static OMX_BOOL egl_image_validation_hook (const OMX_HANDLETYPE ap_hdl, OMX_U32 pid, OMX_PTR ap_eglimage, void *ap_args)

But I am not sure it will be enough.