From 7e120f5dac90591e2eefb46ae8a1c88280aaa8ae Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 21 May 2008 13:47:43 +0000 Subject: [PATCH] gst/udp/gstmultiudpsink.*: Add a fixme for the auto-multicast property. Original commit message from CVS: * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init), (gst_multiudpsink_setup_qos_dscp), (gst_multiudpsink_add_internal): * gst/udp/gstmultiudpsink.h: Add a fixme for the auto-multicast property. Fix some confusing debug messages. Disable setting a qos value by default. --- ChangeLog | 11 ++++++++++- common | 2 +- gst/udp/gstmultiudpsink.c | 35 +++++++++++++++++++++++------------ gst/udp/gstmultiudpsink.h | 2 +- 4 files changed, 35 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index cab2570..07c8b3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-05-21 Wim Taymans + * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init), + (gst_multiudpsink_setup_qos_dscp), (gst_multiudpsink_add_internal): + * gst/udp/gstmultiudpsink.h: + Add a fixme for the auto-multicast property. + Fix some confusing debug messages. + Disable setting a qos value by default. + +2008-05-21 Wim Taymans + Patch by: Gustaf Räntilä * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_render): @@ -14,7 +23,7 @@ (gst_multiudpsink_set_property), (gst_multiudpsink_get_property), (gst_multiudpsink_init_send), (gst_multiudpsink_add_internal): * gst/udp/gstmultiudpsink.h: - Add qos-dscp property to manage the Quality of service. + Add qos-dscp property to manage the Quality of service. Fixes #469917. 2008-05-21 Wim Taymans diff --git a/common b/common index e365978..d074950 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e365978c480a8fffa4bdb61568fb2cd989d1b197 +Subproject commit d0749502b0e891038593866f619a75305367b409 diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c index 57bdd09..237103b 100644 --- a/gst/udp/gstmultiudpsink.c +++ b/gst/udp/gstmultiudpsink.c @@ -80,10 +80,13 @@ enum #define DEFAULT_CLOSEFD TRUE #define DEFAULT_SOCK -1 #define DEFAULT_CLIENTS NULL +/* FIXME, this should be disabled by default, we don't need to join a multicast + * group for sending, if this socket is also used for receiving, it should + * be configured in the element that does the receive. */ #define DEFAULT_AUTO_MULTICAST TRUE #define DEFAULT_TTL 64 #define DEFAULT_LOOP TRUE -#define DEFAULT_QOS_DSCP 0 +#define DEFAULT_QOS_DSCP -1 enum { @@ -307,9 +310,9 @@ gst_multiudpsink_class_init (GstMultiUDPSinkClass * klass) "Used for setting the multicast loop parameter. TRUE = enable," " FALSE = disable", DEFAULT_LOOP, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_QOS_DSCP, - g_param_spec_uint ("qos-dscp", "QoS diff srv code point", - "Quality of Service, differentiated services code point", 0, 63, - DEFAULT_QOS_DSCP, G_PARAM_READWRITE)); + g_param_spec_int ("qos-dscp", "QoS diff srv code point", + "Quality of Service, differentiated services code point (-1 default)", + -1, 63, DEFAULT_QOS_DSCP, G_PARAM_READWRITE)); gstelement_class->change_state = gst_multiudpsink_change_state; @@ -481,6 +484,10 @@ gst_multiudpsink_setup_qos_dscp (GstMultiUDPSink * sink) { gint tos; + /* don't touch on -1 */ + if (sink->qos_dscp < 0) + return; + if (sink->sock < 0) return; @@ -667,14 +674,18 @@ gst_multiudpsink_add_internal (GstMultiUDPSink * sink, const gchar * host, g_get_current_time (&now); client->connect_time = GST_TIMEVAL_TO_TIME (now); - /* check if its a multicast address */ - if (*client->sock > 0 && gst_udp_is_multicast (&client->theiraddr) && - sink->auto_multicast) { - GST_DEBUG_OBJECT (sink, "multicast address detected"); - gst_udp_join_group (*(client->sock), sink->loop, sink->ttl, - &client->theiraddr); - } else { - GST_DEBUG_OBJECT (sink, "normal address detected"); + if (*client->sock > 0) { + /* check if its a multicast address */ + if (gst_udp_is_multicast (&client->theiraddr)) { + GST_DEBUG_OBJECT (sink, "multicast address detected"); + if (sink->auto_multicast) { + GST_DEBUG_OBJECT (sink, "joining multicast group"); + gst_udp_join_group (*(client->sock), sink->loop, sink->ttl, + &client->theiraddr); + } + } else { + GST_DEBUG_OBJECT (sink, "normal address detected"); + } } if (lock) diff --git a/gst/udp/gstmultiudpsink.h b/gst/udp/gstmultiudpsink.h index e2bd2aa..e9543ed 100644 --- a/gst/udp/gstmultiudpsink.h +++ b/gst/udp/gstmultiudpsink.h @@ -73,7 +73,7 @@ struct _GstMultiUDPSink { gboolean auto_multicast; gint ttl; gboolean loop; - guint qos_dscp; + gint qos_dscp; }; struct _GstMultiUDPSinkClass { -- 2.7.4