[farsight2/master] Add long-term-credentials boolean

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


---
 transmitters/nice/fs-nice-stream-transmitter.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 2363ec8..562ae76 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -904,6 +904,15 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
             i);
         return FALSE;
       }
+      if (gst_structure_has_field (s, "long-term-credentials") &&
+          !gst_structure_has_field_typed (s, "long-term-credentials",
+              G_TYPE_BOOLEAN))
+      {
+        g_set_error (error, FS_ERROR, FS_ERROR_INVALID_ARGUMENTS,
+            "Element %d of the relay-info a long-term-creditials"
+            " that is not a boolean", i);
+        return FALSE;
+      }
     }
   }
 
@@ -1007,15 +1016,18 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
       GValue *val = g_value_array_get_nth (self->priv->relay_info, i);
       const GstStructure *s = gst_value_get_structure (val);
       const gchar *username, *password, *ip;
+      gboolean long_term_creds = FALSE;
       guint port;
 
       ip = gst_structure_get_string (s, "ip");
       gst_structure_get_uint (s, "port",  &port);
       username = gst_structure_get_string (s, "username");
       password = gst_structure_get_string (s, "password");
+      gst_structure_get_boolean (s, "long-term-credentials", &long_term_creds);
 
       nice_agent_set_relay_info(self->priv->agent->agent,
-          self->priv->stream_id, i + 1, ip, port, username, password);
+          self->priv->stream_id, i + 1, ip, port, username, password,
+          long_term_creds);
     }
   }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list