[farsight2/master] Implement fs_nice_stream_transmitter_new_candidate

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


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

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index e365501..6e7f028 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -559,6 +559,30 @@ fs_nice_stream_transmitter_new_candidate (FsNiceStreamTransmitter *self,
     guint component_id,
     const gchar *foundation)
 {
+  FsCandidate *fscandidate = NULL;
+  GSList *candidates, *item;
+
+  candidates = nice_agent_get_local_candidates (
+      self->priv->transmitter->agent,
+      self->priv->stream_id, component_id);
+
+  for (item = candidates; item; item = g_slist_next (item))
+  {
+    NiceCandidate *candidate = item->data;
+
+    if (!strcmp (item->data, foundation))
+    {
+      fscandidate = nice_candidate_to_fs_candidate (candidate);
+      break;
+    }
+  }
+  g_slist_free (candidates);
+
+  if (fscandidate)
+  {
+    g_signal_emit_by_name (self, "new-local-candidate", fscandidate);
+    fs_candidate_destroy (fscandidate);
+  }
 }
 
 
-- 
1.5.6.5




More information about the farsight-commits mailing list