[gst-devel] video sink to update OpenGL texture?

Florent fthiery at gmail.com
Sat Mar 21 22:22:12 CET 2009


Hi,

> Thanks Jan, I installed gst-plugins-gl from git and did some first
> experiments. This seems to be what I'm looking for. Is it correct that
> I would use 'glimagesink' and do the drawing using the
> client-draw-callback? I'm not experienced with OpenGL, is it safe to
> just redraw the part of the scene that shows the video in the
> callback?

If i'm not mistaken glimagesink isn't what you are looking for, except
if your opengl application supports composite redirection (when
glimagesink's textures are redirected inside your own opengl app): the
glimagesink will be a dedicated, separate window and gl context. If
you need to display gst-gl-originating frames inside your own opengl
canvas, then you need to develop some form of a gstreamer sink for
your canvas.

This is what has been done in both pigment (with pgmimagesink) and
clutter (cluttergstsink).

The clutter section in gst-gl examples directory shows a
gst-gl-originating texture redirection inside a clutter application
(using composite redirection).

> I'm wondering as this callback function is called by a
> gstreamer thread and if the application is doing other OpenGL stuff or
> contains more than one video display, multiple threads are doing
> OpenGL drawing operations simultaneously.

Your application should take care of the draws sync so that no
conflict between opengl operations exists. Also, sharing opengl
contexts between apps seems a difficult task.

> self.videosink = gst.element_factory_make('glimagesink', 'videosink')
> self.videosink.set_property('client-draw-callback', self.draw_callback)

I think the client-draw-callback will offer you a way to manipulate
the video texture inside the glimagesink context, not the other way
around (drawing video inside your own app).

I assume you are only trying to display gst-originating (decoded
video) video inside your Gl app. If so, you can prototype things using
the fakesink element, by connecting it's handoff signals to a texture
upload in your application. See [1] and [2] for more info

Florent

[1] http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-data-spoof.html
[2] http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-fakesink.html#GstFakeSink-handoff




More information about the gstreamer-devel mailing list