GNOME Bugzilla – Bug 423304
file descriptor closed in udpsrc and dynudpsink
Last modified: 2007-03-29 10:00:06 UTC
Hi, when passing a sock fd to udpsrc and/or dynudpsink these elements close the fd on state change. This is a problem if the same fd is used in two elements such as udpsrc an dynudpsink (for ex. for RTP endpoints). The application should have possibility to control the close() of the passed fd . The following patch adds this ability with a new property : 'closefd', defaulting to TRUE to keep the elements in the old behaviour. If set to FALSE the passed fd (and only this one) will not be closed. Regards.
Created attachment 85378 [details] patch for 'closefd' property on udpsrc/dynudpsink elements
Patch by: Laurent Glayal <spglegle at yahoo dot fr> * gst/udp/gstdynudpsink.c: (gst_dynudpsink_class_init), (gst_dynudpsink_init), (gst_dynudpsink_set_property), (gst_dynudpsink_get_property), (gst_dynudpsink_init_send), (gst_dynudpsink_close): * gst/udp/gstdynudpsink.h: * gst/udp/gstudpsrc.c: (gst_udpsrc_class_init), (gst_udpsrc_init), (gst_udpsrc_create), (gst_udpsrc_set_property), (gst_udpsrc_get_property), (gst_udpsrc_start), (gst_udpsrc_stop): * gst/udp/gstudpsrc.h: Rework the socket allocation a bit based on the sockfd argument so that it becomes usable. Add a closefd property to instruct the udp elements to close the custom file descriptors when going to READY. Fixes #423304. API:GstUDPSrc::closefd property API:GstDynUDPSink::closefd property