Does anybody know how can i get a handle of default window, which is creating by gstreamer? I am writting on Windows, so any X11 class are not feasible.
thanks |
Or maybe somebody know where pipeline is building window, so i can make new property like WindowHandle?
|
In reply to this post by padam
On 04/13/2012 10:20 AM, padam wrote:
> Does anybody know how can i get a handle of default window, which is creating > by gstreamer? I am writting on Windows, so any X11 class are not feasible. you open your own, take a look at the GstXOverlay interface, despite its name, it works on non X11 as well. Stefan > thanks > > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/getting-handle-of-Gstreamer-DirectShow-sink-default-window-tp4554132p4554132.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Thanks! I will check it for sure!
|
This post was updated on .
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 xvimagesink, 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.
EDIT: Now i try with directdrawsink. I hope that this will help EDIT2: I change Player.sink = gst_element_factory_make ("autovideosink", "sink"); to Player.sink = gst_element_factory_make ("directdrawsink", "sink"); and later i made new instance of GstXOverlay lika that: GstXOverlay* ov; ... ov = (GstXOverlay*)Player.sink; and only when i want to get window id that way: gst_x_overlay_got_window_handle(ov, Player.HANDLE); i get few errors: GLib-Object-WARNING **: cannot register existing type 'GstXOverlay' GLib-Object-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE<interface_type>' failed CRITICAL **: file ...xoverlay.c: line 441: assertion 'GST'Is'X'OVERLAY <overlay>' failed xoverlay.c xoverlay.h |
Hi,
> 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. > Please read your reply again. It is hard to make any sense out of it. gst-plugins-base/tests/examples/overlay has examples for gtk and qt. Those should help to get you started. Ideally we could also get some for windows/macos if someone cares to con tribute them. Stefan _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Ok, lets start from the beginning. There is parameter in mplayer such as -wid which allows mplayer to launch and playing wideo/audio in other window. So i don\t need any gtk+ or Qt, because i only would like to open my movie in window of other app. I will get handler of that window by other app and start my gstreamer app like app.exe -wid 5, where "5" is id of other window. That's all.
|
In reply to this post by padam
> ...There is parameter in mplayer such as -wid
> which allows mplayer to launch and playing wideo/audio in other window. OSSBuild has an app that does this, actually. Examine gst-player: http://code.google.com/p/ossbuild/source/browse/trunk/Main/GStreamer/Source/gstreamer/tools/gst-player.c Start on line 2249 so you can see that the window handle is being passed in on the command line. Then go to line 2464 where gst_bus_set_sync_handler() is called with a reference to the xoverlay_bus_sync_handler() function. Then go to line 1264 where it's being used. Look at line 1256 in the same method to see where it's looking for a specific "prepare-xwindow-id" message from the bus and if it sees that, it calls gst_x_overlay_set_window_handle(). You'll need to setup something similar to do what you want. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
This post was updated on .
Great, thanks! And does it will working on Windows OS?
|
> Great, thanks! And is this will working on Windows OS?
Yes. But it hasn't been tested against newer gstreamer releases, so it may require a bit of updating to get it to work right. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
It wasn't easy but finally i could compile this example project, but i change "autovideosink" to "directdrawsink" cause that first wasn't sending "prepare-xwindow-id", but still i get dew errors:
GLib-GObject-WARNING **: cannot register existing type 'GstXOverlay' GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE <interface_type>' failed CRITICAL **: file ..\..\..\Source\gstreamer\gst\gstbin.c: line 3717: assertion 'G_TYPE_IS_INTERFACE' <iface>' failed GLib-GObject-WARNING **: cannot register existing type 'GstXOverlay' GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE <interface_type>' failed GLib-GObject-WARNING **: invalid cast from 'GstDirectDrawSink' to '<invalid>' CRITICAL **: file ..\..\..\Source\gstreamer\gst\gstinterface.c: line 157: assertion 'gst_element_implements'interface <GST_ELEMENT <from>, iface_type>' failed I had to download xoverlay.c from some site, cause without it, it wasn't able to compile. I hame so many complications with gstreamer on Windows... |
In reply to this post by padam
On 04/18/2012 10:59 PM, padam wrote:
> Ok, lets start from the beginning. There is parameter in mplayer such as -wid > which allows mplayer to launch and playing wideo/audio in other window. So i > don\t need any gtk+ or Qt, because i only would like to open my movie in > window of other app. I will get handler of that window by other app and > start my gstreamer app like app.exe -wid 5, where "5" is id of other window. > That's all. What are you trying to tell me? You are aware that gstreamer is a library and mplayer is an application. gstreamer does what an application that uses gstreamer tells it to do. You can for sure write an application using gstreamer that provides a similar behavior. Stefan _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
right... i am aware of that, but as you can see i can't open movie in other window. I did not say that gstreamer should automatically do that, what mplayer is doing. I wrote my errors and i do not know what i have to do to solve that problem. If i understand I made good creating directdrawsink but why xoverlay.h funtion didn't working?
|
In reply to this post by padam
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: [hidden email] 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 [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
unfortunately that solution can't work on C/C++ (or i am so wrong) cause i have to use gst_x_overlay_set_window_handle function. Meybe it's wrong that i downloaded xoverlay.c, but before that i couldn't compile my solution. I'm watching this topic What Lib File(s) Do I Need to Include to Use GstXOverlay?.
|
> What Lib File(s) Do I Need to Include to Use GstXOverlay? As far as I can see from looking at the C# class hierarchy, its base classes are GLib implementations, so I'm guessing you need to include GLib. We have GInterfaceAdapter, XOverlay, IWrapper as bases here. Of course there's always the chance this is a C# thing, but I doubt it. I'm pretty sure directing output towards a window is kind-of essential for gStreamer to be in any way useful on the Windows platform, whichever language or environment you're using. Seb might know if he's lurking anywhere :). Robin _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
This post was updated on .
I added glib-2.0.lib at the beginning. I added too gstinterfaces-0.10.lib, but errors about xoverlay.h functions have not disappeared.
To make all more difficult i decided to use gst_directdraw_sink_create_default_window() function from gstdirectdrawsink.c, bu then i get error like: Error 23 error LNK2019: unresolved external symbol _gst_element_class_add_static_pad_template referenced in function _gst_directdraw_sink_base_init Error 24 error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function _gst_directdraw_sink_setup_ddraw Error 25 error LNK2001: unresolved external symbol _IID_IDirectDraw7 Error 26 error LNK2019: unresolved external symbol _gst_x_overlay_got_window_handle referenced in function _gst_directdraw_sink_window_thread If i were Chandler, i would say: Could i have more problems? |
It appeared that gst_x_overlay_set_xwindow_id() function is working, although reference manual of GstXOverlay says that it is outdated and i should use gst_x_overlay_set_window_handle, which by the way is not working... being exact it says: "gst_x_overlay_set_xwindow_id is deprecated and should not be used in newly-written code. Use gst_x_overlay_set_window_handle() instead.". So i do not know if reference manual is only for gstreamer linuks edition, or what... now everything is working.
Thanks you all for your help |
Great to hear it's all working now adam.
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |