[farsight2/master] Add stun timeout for the rawudp transmitter

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:19:26 PST 2008


---
 transmitters/rawudp/fs-rawudp-stream-transmitter.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index 17cef4d..57b2e08 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -53,7 +53,8 @@ enum
   PROP_SENDING,
   PROP_PREFERED_LOCAL_CANDIDATES,
   PROP_STUN_IP,
-  PROP_STUN_PORT
+  PROP_STUN_PORT,
+  PROP_STUN_TIMEOUT
 };
 
 struct _FsRawUdpStreamTransmitterPrivate
@@ -76,6 +77,8 @@ struct _FsRawUdpStreamTransmitterPrivate
   gchar *stun_ip;
   guint stun_port;
 
+  guint stun_timeout;
+
   GList *prefered_local_candidates;
 };
 
@@ -165,6 +168,14 @@ fs_rawudp_stream_transmitter_class_init (FsRawUdpStreamTransmitterClass *klass)
       1, 65535, 3478,
       G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
 
+  g_object_class_install_property (gobject_class,
+    PROP_STUN_TIMEOUT,
+    g_param_spec_uint ("stun-timeout",
+      "The timeout for the STUN reply",
+      "How long to wait for for the STUN reply (in seconds) before giving up",
+      0, G_MAXUINT, 30,
+      G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
+
   gobject_class->dispose = fs_rawudp_stream_transmitter_dispose;
   gobject_class->finalize = fs_rawudp_stream_transmitter_finalize;
 
@@ -264,6 +275,9 @@ fs_rawudp_stream_transmitter_get_property (GObject *object,
     case PROP_STUN_PORT:
       g_value_set_uint (value, self->priv->stun_port);
       break;
+    case PROP_STUN_TIMEOUT:
+      g_value_set_uint (value, self->priv->stun_timeout);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -324,6 +338,9 @@ fs_rawudp_stream_transmitter_set_property (GObject *object,
     case PROP_STUN_PORT:
       self->priv->stun_port = g_value_get_uint (value);
       break;
+    case PROP_STUN_TIMEOUT:
+      self->priv->stun_port = g_value_get_uint (value);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
-- 
1.5.6.5




More information about the farsight-commits mailing list