Multiple loops in one library

philippe renon philippe_renon at yahoo.fr
Wed Apr 12 16:53:44 UTC 2017


You exception is due to improper initialization of something.You don't show us enough code to help.
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 g_main_loop_run(). I think what you are trying to do will work fine with just one loop...
 

    Le Mercredi 12 avril 2017 17h03, Mikl <michael.yarochkin at timetronics.be> a écrit :
 

 Hello,

Can i have multiple GMainLoop independent objects inside of one
library(dll)?
My wish is to process multiple steams in one container.
Or it is "one for all" and can be different only inside of other
library(dll)?

My wish :

If i have "recorder" and "reader" classes in different threads, but defined
in the same library(dll):
GMainLoop* readerLoop = g_main_loop_new(NULL, FALSE);
GMainLoop* wriretLoop = g_main_loop_new(NULL, FALSE);

Both have pipelines:
GstElement* readerPipeline;
GstElement* writerPipeline;

Later, when i am watching events:
GstBus* readerBus = gst_pipeline_get_bus(GST_PIPELINE(readerPipeline));
gst_bus_add_watch(readerBus , BusCallback, this);
g_main_loop_run(readerLoop);

GstBus* writerBus = gst_pipeline_get_bus(GST_PIPELINE(writerPipeline));
gst_bus_add_watch(writerBus , BusCallback, this);
g_main_loop_run(wriretLoop);

Now, i have exception inside of BusCallback:
Exception thrown at 0x6146F214 (libgstreamer-1.0-0.dll) in MyApp.exe:
0xC0000005: Access violation reading location 0xCDCDCDCD.

Will it work? Is any way to do it?

Thank you in advance.
Mikl



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Multiple-loops-in-one-library-tp4682638.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170412/f602fb63/attachment.html>


More information about the gstreamer-devel mailing list