getting handle of Gstreamer DirectShow sink default window

Robin gstreamerdeveloper at gmail.com
Thu Apr 19 05:46:54 PDT 2012


Hi,

I struggled with this initially :).  You need an XOverlayAdapter.  It has an 
XwindowId that you set to the Windows window handle.

This is C# code, but it should work in a similar way in C or C++:

            // Create window draw sink (directdraw).

           MyDirectDrawSink = ElementFactory.Make("directdrawsink", 
"gStreamerBinDirectShow_directdrawsink");
           if (MyDirectDrawSink == null)
           {
               // TODO - throw.
           }

           // Overlay window adapter.

           MyDirectDrawSinkAdapter = new 
XOverlayAdapter(MyDirectDrawSink.Handle);
           MyDirectDrawSinkAdapter.XwindowId = (ulong)MyWindowHandle;

So create the adapter passing in the Handle of the element, then set the 
XwindowId property to the handle of the window you want to display the movie 
in.

That's all there is to it.  There are a few tidy-up things you need to 
remember, such as preventing the Windows window from painting its background 
(gives flicker on resize) and booting a paused window to tell it to draw on 
resize.  The latter can be done with this:

    MyDirectDrawSinkAdapter.Expose();

i.e. calling the Expose() method on the draw sink adapter.

I hope this helps.


Robin


-----Original Message----- 
From: padam
Sent: Wednesday, April 18, 2012 12:04 PM
To: gstreamer-devel at lists.freedesktop.org
Subject: Re: getting handle of Gstreamer DirectShow sink default window

i can not handle with that. Meybe i don't make myself clear. I want to play
video/audio in other window that default window of gstreamer, so i have to
send handle, thanks that gstreamer will know where he has to create a
window, for example when i give him handle "0" i want to display movie on
desktop. I want to use gst_x_overlay_set_window_handle but if i thinking
right i need to create sink xoverlay, but i can't do it writing app on
Windows OS.  I think it's simple, but i have no idea how to do that.

--
View this message in context: 
http://gstreamer-devel.966125.n4.nabble.com/getting-handle-of-Gstreamer-DirectShow-sink-default-window-tp4554132p4567376.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel 



More information about the gstreamer-devel mailing list