Offscreen rendering and SDL

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Offscreen rendering and SDL

Eamon Caddigan
Hi all,

I am new to gstreamer, and I'm trying to incorporate it into an SDL
application (actually, it's a pygame application, but I'm writing a
module in C, so I can use the standard API for this). Using code
snippets I found online, I've managed to create a window using X11 and
can send the video there, but this approach makes it impossible to
draw graphics over the video.

It seems like I need to render to some sort of offscreen construct,
and then grab the data from there and blit it to the screen, but I'm
totally lost as to how to do this. I've been gleaning through the
gstreamer documentation for a couple weeks now, but I haven't gotten
any closer to figuring this out. I think the two big questions are:

1) Which videosink would I use?
2) How do I fetch the decoded video data?

Thanks,
Eamon Caddigan
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Offscreen rendering and SDL

Andrey Nechypurenko-2
Hi,

> application (actually, it's a pygame application, but I'm writing a
> module in C, so I can use the standard API for this). Using code
> snippets I found online, I've managed to create a window using X11 and
> can send the video there, but this approach makes it impossible to
> draw graphics over the video.

One possible way would be to create the OpenGL texture with decoded
frame. Than you can do whatever you want to compose the video with
your own graphics. For example, you can map the texture on the plane
in background and make your own drawing in front of this plane (in
foreground).

There are at least two ways to get decoded video frame as a texture.
The first one one is to use elements from gst-plugins-gl [1]. You can
take a look at corresponding examples [2] (there is also SDL example
over there). The second one is to use fakesink element with it's
hand-off mechanism to get raw decoded frame.

Yet another options might be cairo or gdkpixbuf plugins but I have no
experience with them.

[1] http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-gl-plugins/html/
[2] http://cgit.freedesktop.org/gstreamer/gst-plugins-gl/tree/tests/examples
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel