Emulating behavior of gst-launch -e in gst program

Krzysztof Konopko krzysztof.konopko at youview.com
Sat Feb 2 08:58:35 PST 2013


On 01/02/13 08:47, Ian Davidson wrote:
> Thanks for the info Tim,
> 
> Where can I read about what is 'safe' to do in a signal handler?
> 
> Ian
> 
> On 31/01/2013 22:45, Tim-Philipp Müller wrote:
>> 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.
>>
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 

I think that gst-launch doesn't take the best approach to signal
handling.  Use signalfd instead [1]. An example might be useful [2].

You get a file descriptor which you can watch it with g_io_add_watch()
[3]. See the example [4]

[1] http://linux.die.net/man/2/signalfd
[2] http://kriscience.blogspot.co.uk/2013/02/handling-posix-signals.html
[3] http://developer.gnome.org/glib/stable/glib-IO-Channels.html
[4]
http://kriscience.blogspot.co.uk/2012/12/reading-standard-input-from-gmainloop.html


More information about the gstreamer-devel mailing list