[gst-devel] How to associate GStreamer elements with a specific GMainContext?

Wim Taymans wim.taymans at gmail.com
Wed Aug 20 12:48:16 CEST 2008


On Wed, 2008-08-20 at 12:30 +0200, Philipp Leibfried wrote:
> Hi everyone,
> 
> I have a question concerning GStreamer and multi-threading.
> 
> I'm devleoping an application in which I need to run several GStreamer pipelines in parallell, i.e. each in its own thread. Moreover, pipelines need to be paused or stopped at a caller's request. The latter is why I plan on using g_main_context_iteration() instead of g_main_loop_run() to "run" the pipelines.
> The question is: how do I make sure that g_nmain_context_iteration() only runs one specific pipeline and not all of the pipelines which happen to be active at the time of the call? Is there a way to associate specific GStreamer elements with a specific GMainContext?
> 
GStreamer pipeline are not run from a GMainLoop at all, elements spawn
their own GThreads when needed. You can use a mainloop to interact with
a pipeline's GstBus, with gst_bus_create_watch() you an create a GSource
for each pipeline bus and attach it to any mainloop you want. Usually
you just want one mainloop, though.

Wim 

> TIA
> -Philipp Leibfried
> 
> 
> 





More information about the gstreamer-devel mailing list