[gst-devel] g_main_loop

Kalyanavarathan, Vasanth VKalyanavarathan at ndsuk.com
Thu Jun 15 16:32:02 CEST 2006

Let me clarify my understanding

1. Java Application -> Talks to C / C++ Gstreamer Application -> Creates
and Talks to Gstreamer Plugins

Assuming the above is the way your application is working.
Following is what I have to add

1. Your C/ C++ application which has created the pipeline
Would need to start the pipeline in g_main_loop_run
And this thread will not return until g_main_loop_quit

2. You will receive callbacks on which you can call
G_main_loop_quit to exit the thread in which the pipeline
Is run.

3. You will receive call backs only if your plugins 
Post a message to the message bus.

Gst_element_post_message(your plugin element, your custom msg);

4. The callbacks are called in the context of the pipeline thread which
is the thread in which you called g_main_loop_run

5. With respect to random dumps during g_main_loop_run.

I would test your pipeline using gst-launch and see if the
Problem occurs. In which case it is plugin problem (some G_OBJECT_UNREF)

If otherwise it is your GST Application problem where you have added
your elements to a bin and still trying to be the owner of the elements
and trying to free or use the elements that have been destroyed by the

Hope this helps


-----Original Message-----

Message: 1
Date: Tue, 13 Jun 2006 01:59:50 -0700
From: Robert Scott <robert.b.scott at sbcglobal.net>
Subject: [gst-devel] g_main_loop
To: gstreamer-devel at lists.sourceforge.net
Message-ID: <26A4AD84-ADF9-40AA-AE20-02E34DE5F67B at sbcglobal.net>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed


I am writing a multithreaded gstreamer application and I am having
random SEGFAULTS whenever I start g_main_loop.  I am a little unclear on
how gstreamer works because I can actually play music without starting
g_main_loop(Music plays, but I do not receive callbacks to the bus

My question is, do I have to wrap all calls into gstreamer with
gdk_threads_enter and gdk_thread_exit.  This is for a java program with
a high level JNI interface to gstreamer, but I read somewhere that this
was necessary for multithreaded applications.  Is there some more
information available somewhere?  The docs don't seem to handle the
multithreaded part.



This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster at nds.com and destroy the original message

More information about the gstreamer-devel mailing list