summaryrefslogtreecommitdiffstats
path: root/gst/udp
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-05-21 13:47:43 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-05-21 13:47:43 +0000
commit7e120f5dac90591e2eefb46ae8a1c88280aaa8ae (patch)
treed62ae205b053037573b443cf3a645bb289b2f3d6 /gst/udp
parent9d494db510d6667140a86315b64d325ae38a98c1 (diff)
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.
Diffstat (limited to 'gst/udp')
-rw-r--r--gst/udp/gstmultiudpsink.c35
-rw-r--r--gst/udp/gstmultiudpsink.h2
2 files changed, 24 insertions, 13 deletions
diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c
index 57bdd09b..237103bd 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 e2bd2aa9..e9543eda 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 {