Close a pipeline with g_main_loop_quit() fonction

James Cameron quozl at
Wed Sep 12 20:40:03 UTC 2018

Your code was missing.  I'll presume C.

You can put g_main_quit anywhere.

But g_main_quit alone won't exit a function or immediately close a
GStreamer pipeline.

To exit a function, use language elements such as "return;".

To close a GStreamer pipeline, g_main_quit will cause the main loop to
exit, and what happens next depends on the code after your main loop.

A return from main() will cause the GStreamer threads to exit.

A more common method is to send an end of stream event, wait for the
event to propagate, detect pipeline state change using a message
signal handler, then destroy the pipeline and call g_main_quit.

On Tue, Sep 11, 2018 at 10:47:42PM -0500, Rom6 wrote:
> Hi all, first of all excuse me for my quiet bad english it's not my natural
> language.
> So my problème is that i dev a software where i stream with gstreamer my
> desktop, and i want to close the pipeline with the function
> g_main_quit(main_loop), but i dunno where to pace it.
> To be clear i want to exit of the function and close the pipeline.
> Here  a portion of code :
> So how can exit the function with g_main_quit() function ?
> Thanks a lot , bye
> --
> Sent from:
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at

James Cameron

More information about the gstreamer-devel mailing list