Emulating behavior of gst-launch -e in gst program

Ian Davidson id012c3076 at blueyonder.co.uk
Wed Jan 30 09:15:56 PST 2013


If your program is based on the Hello World example, take care. That 
program has 'pipeline' defined locally in the main body.  When a Ctrl-C 
is captured, you do not have access to the same pipeline. Move the 
pipeline to be a Global variable and you should be OK.

Ian

On 30/01/2013 17:04, Wes Miller wrote:
> I read several posts on this topic here and elsewhere, but none answered my
> question.
>
> Given any program that implements a gst pipeline either using
> gst_parse_launch() or a fully coded pipeline. how do I capture an external
> /ctrl-c/ and turn it into a graceful shutdown?
>
> I currently have a gst_parse_launch() pipeline that works well enough to map
> my mic to my speakers.  The gst_pipeline variable, /my_pipeline,/ is global
> and at pipeline creation time does contain a nonzero value.
>
> I also have a signal catcher in place with actions to handle SIGINT and
> SIGKILL.  Print statements prove that the sighandler does get called when I
> /ctrl-c/ or  send the program a /kill -9/.  However, in the signal handler
> /my_pipeline/ equals 0, so  I can't use
>
>        gst_element_send_event( my_pipeline, gst_event_new_eos() );
>
> I copied the eos handler out of gst_launch as best I could.  It managed to
> require the multiple /ctrl-c/'s, but /my_pipeline/ is still 0 by the time
> the sighandler is launched.
>
> Thanks for any help.
>
>
>
>
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Emulating-behavior-of-gst-launch-e-in-gst-program-tp4658243.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>



More information about the gstreamer-devel mailing list