g_main_loop_run() freeze the window

Sebastian Dröge sebastian at centricular.com
Wed Dec 16 00:20:56 PST 2015


On Di, 2015-12-15 at 13:47 -0800, doon wrote:
> I trying to create Gstreamer video player in C#. So I use Pinvoke for
> import Gstreamer C++ functions. All looking nice but if I add in C++
> "g_main_loop_run(loop);" my C# application going to freeze, I just
> can't click any button or move my window. I think there is some
> problem due to gmaincontext, but I don't know exactly what problem
> and how I can resolve it. 

g_main_loop_run() will block until g_main_loop_quit() is called. It's a
normal event loop.

If you want to use a GMainLoop, you probably want to run it in a
different thread to not block your C# application's event loop. You
don't have to use one though, you can also integrate the GstBus in
whatever event loop you have in your application already.


Also, did you see the C# bindings for GStreamer? That way you don't
have to P/invoke and write C code.

-- 
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/20151216/3a464ea5/attachment.sig>


More information about the gstreamer-devel mailing list