Unix signal handling in GStreamer app

daniel at poradnik-webmastera.com daniel at poradnik-webmastera.com
Tue May 22 10:39:23 UTC 2018


Hi,
I have registered SIGINT handler using g_unix_signal_add(), to 
gracefully close app when user presses Ctrl-C. In my pipeline I use 
autovideosink, which uses X server to display graphics. When it connects 
to local X server (DISPLAY=:0), everything works as expected. However 
when I want to connect to X server running on another machine 
(DISPLAY=192.168.100.10:0.0), my SIGINT handler stops working. I suspect 
that X video sink registers its own handler and removes my one.

gst-launch somehow handles this properly. I have checked its code for 
some hints, but did not find anything obvious. Additionally it 
implements its own event loop, instead of g_main_loop_run() which I use 
in my app.

How to properly handle SIGINT in my app?

Regards,
Daniel


More information about the gstreamer-devel mailing list