How can I send each xvimagesink into a separate DrawingArea?

Sebastian Dröge sebastian at centricular.com
Sun Sep 13 08:16:15 PDT 2015


On So, 2015-09-13 at 07:40 -0700, Giacomo D wrote:

> So I create a "DrawingArea":
> 
>         window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
>         window.set_title("LYS - Broadcaster")
>         window.set_default_size(500, 400)
>         window.connect("destroy", Gtk.main_quit, "WM destroy")
> 
>         vbox = Gtk.VBox()
>         window.add(vbox)
>         self.movie_window1 = Gtk.DrawingArea()
>         vbox.add(self.movie_window1)
>                           
> Using the method below, I get a flickering stream with all three 
> videos in the same window. How can I send each xvimagesink into a 
> separate DrawingArea?

First of all you have to actually create multiple drawing areas... and
then

>     def on_sync_message1(self, bus, message):
>         if message.get_structure().get_name() == 'prepare-window
> -handle':
>             imagesink = message.src
>             imagesink.set_property("force-aspect-ratio", True)
>             Gdk.threads_enter()
>            
> imagesink.set_window_handle(self.movie_window1.get_property('window')
> .get_xid())
>             Gdk.threads_leave()

Depending on which video sink is posting the message, you would set the
XID of the corresponding drawing area on the sink. A different one for
each sink.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150913/34dcd356/attachment.sig>


More information about the gstreamer-devel mailing list