[gst-devel] g_main_loop

Robert Scott robert.b.scott at sbcglobal.net
Thu Jun 15 22:36:45 CEST 2006


I guess maybe I should explain my application a little bit more.  The  
gstreamer application and the java application are actually all in  
one process.  I use JNI to make calls into a native C library, that  
does all of the gstreamer initialization and playback.

Right now I am not using a custom pipeline, just using a basic  
playbin to play music.  In the main thread, I call a function to  
initialize the gstreamer library.  In that same thread, I spawn a new  
thread that runs  g_main_loop runs.  In another thread (Typically a  
swing thread), I call gst_element_set_state( play,  
GST_STATE_PLAYING ), if I start the g_main_loop thread, then this  
call will occasionally block, indefinitely.  Oddly, If i don't start  
the g_main_loop, it always starts playback, but I don't get any bus  
callbacks.  (I am assuming those signals are delivered from  

The reason for all this is simple, java basically doesn't have a  
music playback library for a variety of formats. (If you know of one,  
let me know), so I decided to leverage gstreamer to build one and  
share with the world.

A while back I wrote a test program which simulates the behavior I  
see, before it would crash, not sure what it will do now(newer  
versions of gstreamer seemed to fix that):

If interested, it is available here:

Thanks for the reply.

More information about the gstreamer-devel mailing list