open gl surface as source ?

Matthew Waters ystreet00 at gmail.com
Thu Nov 27 13:58:18 PST 2014


On 28/11/14 05:31, stic at free.fr wrote:
> Thanks a lot for your answer, you give me a clue :)
> But it's a bit hard for me to see clearly how things should be done.
> Do you know if there is somewhere a little example to give a better idea of how it should work, at least for the GstGLMemory part ?

buf = gst_buffer_new ();
gst_gl_memory_setup_buffer (context, buf, video_info); /* adds new
GstGLMemory to the buffer */
gst_video_frame_map (gl_frame, video_info, buf, GST_MAP_READ | GST_MAP_GL);
tex_id = *(guint *)gl_frame.data[0];

/* draw to texture */

gst_video_frame_unmap (gl_frame);

Or in order to reuse buffers, you can use a GstGLBufferPool.

One thing to keep in mind is that you'll need to share your GL context
with the pipeline so that there will not be a download and upload of the
GL texture you send from appsrc.  That is done using the GstContext
mechanism.  As for examples, you probably want to to have a look at the
gltestsrc, glfilter or glmixer elements for inspiration.

> Cheers.
>
> ----- Mail original -----
> De: "Matthew Waters" <ystreet00 at gmail.com>
> À: gstreamer-devel at lists.freedesktop.org
> Envoyé: Jeudi 13 Novembre 2014 12:33:17
> Objet: Re: open gl surface as source ?
>
> On 13/11/14 19:34, stic at free.fr wrote:
>> Hi gstreamer friends,
>>
>> I would like to know if there is a possibility to get an open gl surface as source with the available plugins in gstreamer ?
>> Something like a glimagesrc instead of glimagesink ?
> If you mean s/surface/texture/g then yes it is possible but not with the
> current plugins.  If you are willing to write come code, it should be
> possible using appsrc and GstGLMemory filled buffers.
>
> Cheers
> Matt
>
>> Thanks.
>> Regards.
>>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141128/45a5a5cb/attachment.sig>


More information about the gstreamer-devel mailing list