Zero copy to OpenGLES texture

Chris Tapp opensource at keylevel.com
Sun Mar 9 04:57:35 PDT 2014


Hi Sebastian,

On 1 Mar 2014, at 14:53, Sebastian Dröge <sebastian at centricular.com> wrote:

> On Fr, 2014-02-28 at 23:38 +0000, Chris Tapp wrote:
>> Hi Sebastian,
>> 
>> On 26 Feb 2014, at 08:57, Chris Tapp <opensource at keylevel.com> wrote:
>> 
>>> Hi Sebastian,
>>> 
>>> On 25 Feb 2014, at 22:27, Sebastian Dröge <sebastian at centricular.com> wrote:
>>> 
>>>> On Di, 2014-02-25 at 21:58 +0000, Chris Tapp wrote:
>>>>> Are there any examples showing how to use a video frame as an OpenGLES 2 texture without copying the image using glTexImage2d?
>>>>> 
>>>>> I've got access to the egl image extensions (eglCreateImageKHR), etc., but I can't work out how to convert the buffer into a texture.
>>>>> 
>>>>> As a further complication, it looks as if the target hardware doesn't support pixmaps - if it did, eglCreatePixmapSurfaceHI would probably be the way to go.
>>>>> 
>>>>> Is there some way to wrap a pointer to the frame in a buffer to give either a pbuffer or VGImage which I can then pass to eglCreateImageKHR?
>>>>> 
>>>>> I'm using Gstreamer 0.10 as 1.0 isn't available for the target.
>>>> 
>>>> Take a look at gst-omx and eglglessink (from gst-plugins-bad). On the
>>>> Raspberry Pi those together can exchange EGLImages and render them
>>>> zero-copy.
>>> 
>>> Thanks, I'll have a look at those.
>>> 
>>>> In general this will be fairly straightforward with 1.x these days, in
>>>> 0.10 it's going to be rather painful unfortunately.
>>> 
>>> I'll first have a good look to see if 1.x is possible on my platform then ;-)
>> 
>> The good news (for me) is that 1.x is now available :-)
>> 
>> What should I be looking at to get zero copy to texture going?
> 
> As said, take a look at eglglessink and gst-omx's video decoder code :)
> And in general the libgstegl lib from gst-plugins-bad too.

I've had a look at this, but there's nothing jumping out at me - probably because I'm still quite a novice when it comes to GStreamer internals ;-)

> There's a GstMemory subclass that wraps a EGLImage and can be passed
> between GStreamer elements if all of them support that. And the sink can
> use glEGLImageTargetTexture2DOES() on that, or alternatively the decoder
> could also put the GstVideoGLTextureUploadMeta on the buffers containing
> the EGLImage memory.

Can I just set the memory allocator on the caps to get EGLImage out? e.g. by using

   video/x-raw(memory:EGLImage)

in the pipeline. I could then just glEGLImageTargetTexture2DOES() the frames as I want them.

> -- 
> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
> Expertise, Straight from the Source
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

Chris Tapp

opensource at keylevel.com
www.keylevel.com





More information about the gstreamer-devel mailing list