<html><head></head><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:13px"><div id="yui_3_16_0_ym19_1_1492001687736_49644"><span id="yui_3_16_0_ym19_1_1492001687736_49643">You exception is due to improper initialization of something.</span></div><div id="yui_3_16_0_ym19_1_1492001687736_49423"><span id="yui_3_16_0_ym19_1_1492001687736_49422">You don't show us enough code to help.</span></div><div id="yui_3_16_0_ym19_1_1492001687736_49417"><span><br></span></div><div id="yui_3_16_0_ym19_1_1492001687736_49418" dir="ltr"><span id="yui_3_16_0_ym19_1_1492001687736_49556">But note that g_main_loop_run() is a blocking method (afaik). It will not return until the loop is stopped. So execution flow of your code will stop on the first call to </span><span id="yui_3_16_0_ym19_1_1492001687736_49557">g_main_loop_run().</span></div><div dir="ltr" id="yui_3_16_0_ym19_1_1492001687736_49699"><span id="yui_3_16_0_ym19_1_1492001687736_49557"> I think what you are trying to do will work fine with just one loop...<br></span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: lucida console, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Le Mercredi 12 avril 2017 17h03, Mikl <michael.yarochkin@timetronics.be> a écrit :<br></font></div>  <br><br> <div class="y_msg_container"><div dir="ltr">Hello,<br></div><div dir="ltr"><br></div><div dir="ltr">Can i have multiple GMainLoop independent objects inside of one<br></div><div dir="ltr">library(dll)?<br></div><div dir="ltr">My wish is to process multiple steams in one container.<br></div><div dir="ltr">Or it is "one for all" and can be different only inside of other<br></div><div dir="ltr">library(dll)?<br></div><div dir="ltr"><br></div><div dir="ltr">My wish :<br></div><div dir="ltr"><br></div><div dir="ltr">If i have "recorder" and "reader" classes in different threads, but defined<br></div><div dir="ltr">in the same library(dll):<br></div><div dir="ltr">GMainLoop* readerLoop = g_main_loop_new(NULL, FALSE);<br></div><div dir="ltr">GMainLoop* wriretLoop = g_main_loop_new(NULL, FALSE);<br></div><div dir="ltr"><br></div><div dir="ltr">Both have pipelines:<br></div><div dir="ltr">GstElement* readerPipeline;<br></div><div dir="ltr">GstElement* writerPipeline;<br></div><div dir="ltr"><br></div><div dir="ltr">Later, when i am watching events:<br></div><div dir="ltr">GstBus* readerBus = gst_pipeline_get_bus(GST_PIPELINE(readerPipeline));<br></div><div dir="ltr">gst_bus_add_watch(readerBus , BusCallback, this);<br></div><div dir="ltr">g_main_loop_run(readerLoop);<br></div><div dir="ltr"><br></div><div dir="ltr">GstBus* writerBus = gst_pipeline_get_bus(GST_PIPELINE(writerPipeline));<br></div><div dir="ltr">gst_bus_add_watch(writerBus , BusCallback, this);<br></div><div dir="ltr">g_main_loop_run(wriretLoop);<br></div><div dir="ltr"><br></div><div dir="ltr">Now, i have exception inside of BusCallback:<br></div><div dir="ltr">Exception thrown at 0x6146F214 (libgstreamer-1.0-0.dll) in MyApp.exe:<br></div><div dir="ltr">0xC0000005: Access violation reading location 0xCDCDCDCD.<br></div><div dir="ltr"><br></div><div dir="ltr">Will it work? Is any way to do it?<br></div><div dir="ltr"><br></div><div dir="ltr">Thank you in advance.<br></div><div dir="ltr">Mikl<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Multiple-loops-in-one-library-tp4682638.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Multiple-loops-in-one-library-tp4682638.html</a><br></div><div dir="ltr">Sent from the GStreamer-devel mailing list archive at Nabble.com.<br></div><div dir="ltr">_______________________________________________<br></div><div dir="ltr">gstreamer-devel mailing list<br></div><div dir="ltr"><a ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br></div><div dir="ltr"><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br></div><br><br></div>  </div> </div>  </div></div></body></html>