Emulating behavior of gst-launch -e in gst program

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Jan 31 14:45:48 PST 2013


On Thu, 2013-01-31 at 08:40 +0000, Ian Davidson wrote:

> This code worked for me

>         static void
>         sigint_handler_sighandler (int signum)
>         {
>           g_print ("Caught interrupt -- ");
>         
>           gst_element_send_event (pipeline, gst_event_new_eos ());
>           sigint_restore ();
>         }
> ...
> (with sigint_setup being called when I was ready in the main code).
> However, if I had problems with the pipeline, sending eos was useless.
> The pipeline problem would mean that the pipeline would never signal
> that it had stopped.

There are limits as to what you are allowed to / supposed to do in a
signal handler. You basically can't do anything interesting, allocating
an event and sending it downstream along the pipeline topology certainly
qualifies as 'interesting' here. Note how gst-launch.c just sets a
variable that is regularly checked from the main loop, and how it
doesn't even use g_print but only fprint.

Cheers
 -Tim



More information about the gstreamer-devel mailing list