Emulating behavior of gst-launch -e in gst program

Ian Davidson id012c3076 at blueyonder.co.uk
Thu Jan 31 00:40:51 PST 2013


This code worked for me

    static void
    sigint_restore (void)
    {
       struct sigaction action;

       memset (&action, 0, sizeof (action));
       action.sa_handler = SIG_DFL;

       sigaction (SIGINT, &action, NULL);
    }


    static void
    sigint_handler_sighandler (int signum)
    {
       g_print ("Caught interrupt -- ");

       gst_element_send_event (pipeline, gst_event_new_eos ());
       sigint_restore ();
    }


    static void
    sigint_setup (void)
    {
       struct sigaction action;

       memset (&action, 0, sizeof (action));
       action.sa_handler = sigint_handler_sighandler;

       sigaction (SIGINT, &action, NULL);
    }

(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.

Ian

On 30/01/2013 22:10, Wes Miller wrote:
> I tried using sigaction instead fo signal.  No help.
>
> It's almost like the SIGKILL kills the gobjects before it get to my program.
> Which of course makes no sense since gst-launch works perfectly well.
>
> I note gst-launch has its own eventg loop (at least it looks like one).
> Would that make a diffrence?
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130131/93e24f8f/attachment.html>


More information about the gstreamer-devel mailing list