From: <wt...@ke...> - 2008-01-17 11:13:27
|
CVS Root: /cvs/gstreamer Module: gst-plugins-good Changes by: wtay Date: Thu Jan 17 2008 11:13:30 UTC Log message: Patch by: Olivier Crete <tester at tester dot ca> * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init), (gst_multiudpsink_init), (gst_multiudpsink_set_property), (gst_multiudpsink_get_property), (gst_multiudpsink_init_send), (gst_multiudpsink_add_internal), (gst_multiudpsink_remove): * gst/udp/gstmultiudpsink.h: Add property to automatically join a multicast group or not. This can be useful when sharing a socket between multiple elements. Fixes #509531. Modified files: . : ChangeLog gst/udp : gstmultiudpsink.c gstmultiudpsink.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3259&r2=1.3260 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.c.diff?r1=1.24&r2=1.25 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.h.diff?r1=1.9&r2=1.10 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v retrieving revision 1.3259 retrieving revision 1.3260 diff -u -d -r1.3259 -r1.3260 --- ChangeLog 16 Jan 2008 21:53:40 -0000 1.3259 +++ ChangeLog 17 Jan 2008 11:13:15 -0000 1.3260 @@ -1,3 +1,16 @@ +2008-01-17 Wim Taymans <wim...@co...> + + Patch by: Olivier Crete <tester at tester dot ca> + * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init), + (gst_multiudpsink_init), (gst_multiudpsink_set_property), + (gst_multiudpsink_get_property), (gst_multiudpsink_init_send), + (gst_multiudpsink_add_internal), (gst_multiudpsink_remove): + * gst/udp/gstmultiudpsink.h: + Add property to automatically join a multicast group or not. This can be + useful when sharing a socket between multiple elements. + Fixes #509531. 2008-01-16 Stefan Kost <en...@us...> * gst/videomixer/Makefile.am: Index: gstmultiudpsink.c RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- gstmultiudpsink.c 2 Nov 2007 21:16:08 -0000 1.24 +++ gstmultiudpsink.c 17 Jan 2008 11:13:16 -0000 1.25 @@ -80,6 +80,7 @@ #define DEFAULT_CLOSEFD TRUE #define DEFAULT_SOCK -1 #define DEFAULT_CLIENTS NULL +#define DEFAULT_AUTO_MULTICAST TRUE enum { @@ -89,7 +90,8 @@ PROP_SOCKFD, PROP_CLOSEFD, PROP_SOCK, - PROP_CLIENTS + PROP_CLIENTS, + PROP_AUTO_MULTICAST /* FILL ME */ }; @@ -285,6 +287,11 @@ g_param_spec_string ("clients", "Clients", "A comma separated list of host:port pairs with destinations", DEFAULT_CLIENTS, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_AUTO_MULTICAST, + g_param_spec_boolean ("auto-multicast", + "Automatically join/leave multicast groups", + "Automatically join/leave the multicast groups, FALSE means user" + " has to do it himself", DEFAULT_AUTO_MULTICAST, G_PARAM_READWRITE)); gstelement_class->change_state = gst_multiudpsink_change_state; @@ -308,6 +315,7 @@ sink->sockfd = DEFAULT_SOCKFD; sink->closefd = DEFAULT_CLOSEFD; sink->externalfd = (sink->sockfd != -1); + sink->auto_multicast = DEFAULT_AUTO_MULTICAST; } static void @@ -462,6 +470,9 @@ case PROP_CLIENTS: gst_multiudpsink_set_clients_string (udpsink, g_value_get_string (value)); break; + case PROP_AUTO_MULTICAST: + udpsink->auto_multicast = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -496,6 +507,9 @@ g_value_take_string (value, gst_multiudpsink_get_clients_string (udpsink)); + g_value_set_boolean (value, udpsink->auto_multicast); @@ -565,7 +579,7 @@ for (clients = sink->clients; clients; clients = g_list_next (clients)) { client = (GstUDPClient *) clients->data; - if (client->multi_addr.imr_multiaddr.s_addr) + if (client->multi_addr.imr_multiaddr.s_addr && sink->auto_multicast) join_multicast (client); } return TRUE; @@ -631,7 +645,8 @@ client->theiraddr.sin_addr = *((struct in_addr *) &addr); } /* if init_send has already been called, set sockopts for multicast */ - if (*client->sock > 0 && client->multi_addr.imr_multiaddr.s_addr) + if (*client->sock > 0 && client->multi_addr.imr_multiaddr.s_addr && + sink->auto_multicast) /* we dont need to lookup for localhost */ @@ -712,7 +727,7 @@ g_get_current_time (&now); client->disconnect_time = GST_TIMEVAL_TO_TIME (now); - if (client->multi_addr.imr_multiaddr.s_addr) + if (client->multi_addr.imr_multiaddr.s_addr && sink->auto_multicast) leave_multicast (client); /* Unlock to emit signal before we delete the actual client */ Index: gstmultiudpsink.h RCS file: /cvs/gstreamer/gst-plugins-good/gst/udp/gstmultiudpsink.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- gstmultiudpsink.h 2 Nov 2007 21:16:08 -0000 1.9 +++ gstmultiudpsink.h 17 Jan 2008 11:13:16 -0000 1.10 @@ -70,6 +70,8 @@ gboolean closefd; gboolean externalfd; + gboolean auto_multicast; struct _GstMultiUDPSinkClass { |