Retrieve EGLImage backed texture from glupload

Is it possible to ensure or direct glupload to create an EGL_IMAGE_EXTERNAL texture in glupload? I’m wanting to interface with a pipeline such as:

filesrc location=vid.mp4 ! qtdemux name=v v.video_0 ! queue ! h265parse ! v4l2h265dec capture-io-mode=dmabuf ! glupload ! fakesink

to obtain GL textures backed by EGLImage (GL_OES_EGL_image_external extension).

Do I need to set some properties on the fakesink to have glupload make the texture EGLImage based, then just get a texture ID using gst_gl_memory_get_texture_id ?

Answering my own question –

Yes, if you pass a DMA buffer based GstMemory to glupload it will attempt to generate an EGL_image_external based texture from it, provided it’s supported on the platform of course. If you turn on LOG level output from glupload it will show output like

0:0:0.28f2fe7f 2d1f 0xffff109a1b3c DEBUG             gleglimage gsteglimage.c:276:_drm_direct_fourcc_from_info: Getting DRM fourcc for YUY2
0:0:0.28f380df 2d1f 0xffff109a1b3c LOG               gleglimage gsteglimage.c:3e1:gst_egl_image_from_dmabuf_direct_target: attr 0: 3057      EGL_WIDTH
0:0:0.28f3d940 2d1f 0xffff109a1b3c LOG               gleglimage gsteglimage.c:3e1:gst_egl_image_from_dmabuf_direct_target: attr 1: c8        200
0:0:0.28f42e37 2d1f 0xffff109a1b3c LOG               gleglimage gsteglimage.c:3e1:gst_egl_image_from_dmabuf_direct_target: attr 2: 3056      EGL_HEIGHT
0:0:0.28f4803f 2d1f 0xffff109a1b3c LOG               gleglimage gsteglimage.c:3e1:gst_egl_image_from_dmabuf_direct_target: attr 3: c8        200
0:0:0.28f4d43c 2d1f 0xffff109a1b3c LOG               gleglimage gsteglimage.c:3e1:gst_egl_image_from_dmabuf_direct_target: attr 4: 3271      FOURCC
0:0:0.28f5273f 2d1f 0xffff109a1b3c LOG               gleglimage gsteglimage.c:3e1:gst_egl_image_from_dmabuf_direct_target: attr 5: 56595559  YUYV

describing the eglCreateImage attributes being used.

I’ve annotated the attributes on the far right; the enum names are not shown, just the numeric values

I’m having some issues (driver errors, perhaps?) sampling the resultant texture with the particular platform I’m using, but it’s kind of working despite the problems. I get some of the image data I’m expecting.