[farsight2/master] Use the functions to add stream transmitters

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


---
 transmitters/nice/fs-nice-stream-transmitter.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 3ee37e9..e6574ac 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -95,6 +95,8 @@ struct _FsNiceStreamTransmitterPrivate
   GList *candidates_to_set;
 
   guint stream_id;
+
+  NiceGstStream *gststream;
 };
 
 #define FS_NICE_STREAM_TRANSMITTER_GET_PRIVATE(o)  \
@@ -273,12 +275,15 @@ fs_nice_stream_transmitter_dispose (GObject *object)
   FsNiceStreamTransmitter *self = FS_NICE_STREAM_TRANSMITTER (object);
 
   FS_NICE_STREAM_TRANSMITTER_LOCK (self);
+  if (self->priv->gststream)
+    fs_nice_transmitter_free_gst_stream (self->priv->transmitter,
+        self->priv->gststream);
+  self->priv->gststream = NULL;
+
   if (self->priv->stream_id)
-  {
     nice_agent_remove_stream (self->priv->transmitter->agent,
         self->priv->stream_id);
-    self->priv->stream_id = 0;
-  }
+  self->priv->stream_id = 0;
   FS_NICE_STREAM_TRANSMITTER_UNLOCK (self);
 
   parent_class->dispose (object);
@@ -785,6 +790,13 @@ fs_nice_stream_transmitter_gather_local_candidates (
       self->priv->transmitter->agent,
       self->priv->transmitter->components);
 
+  self->priv->gststream = fs_nice_transmitter_add_gst_stream (
+      self->priv->transmitter,
+      self->priv->stream_id,
+      error);
+  if (self->priv->gststream == NULL)
+    return FALSE;
+
   return TRUE;
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list