[farsight2/master] Implement remote_candidates_added and select_candidate_pair in FsRtpStream

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


---
 gst/fsrtpconference/fs-rtp-stream.c |   51 +++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 5df0f8a..0267d9a 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -92,6 +92,13 @@ static void fs_rtp_stream_constructed (GObject *object);
 static gboolean fs_rtp_stream_add_remote_candidate (FsStream *stream,
                                                     FsCandidate *candidate,
                                                     GError **error);
+static void fs_rtp_stream_remote_candidates_added (FsStream *stream);
+static gboolean fs_rtp_stream_select_candidate_pair (FsStream *stream,
+                                                     gchar *lfoundation,
+                                                     gchar *rfoundatihon,
+                                                     GError **error);
+
+
 static gboolean fs_rtp_stream_preload_recv_codec (FsStream *stream,
                                                   FsCodec *codec,
                                                   GError **error);
@@ -166,6 +173,8 @@ fs_rtp_stream_class_init (FsRtpStreamClass *klass)
   stream_class->add_remote_candidate = fs_rtp_stream_add_remote_candidate;
   stream_class->preload_recv_codec = fs_rtp_stream_preload_recv_codec;
   stream_class->set_remote_codecs = fs_rtp_stream_set_remote_codecs;
+  stream_class->remote_candidates_added = fs_rtp_stream_remote_candidates_added;
+  stream_class->select_candidate_pair = fs_rtp_stream_select_candidate_pair;
 
 #if 0
   g_object_class_override_property (gobject_class,
@@ -362,6 +371,48 @@ fs_rtp_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate,
       self->priv->stream_transmitter, candidate, error);
 }
 
+
+/**
+ * fs_rtp_stream_remote_candidates_added:
+ * @stream: a #FsStream
+ *
+ * Call this function when the remotes candidates have been set and the
+ * checks can start. More candidates can be added afterwards
+ */
+
+static void
+fs_rtp_stream_remote_candidates_added (FsStream *stream)
+{
+  FsRtpStream *self = FS_RTP_STREAM (stream);
+
+  fs_stream_transmitter_remote_candidates_added (
+      self->priv->stream_transmitter);
+}
+
+/**
+ * fs_rtp_stream_select_candidate_pair:
+ * @stream: a #FsStream
+ * @lfoundation: The foundation of the local candidate to be selected
+ * @rfoundation: The foundation of the remote candidate to be selected
+ * @error: location of a #GError, or NULL if no error occured
+ *
+ * This function selects one pair of candidates to be selected to start
+ * sending media on.
+ *
+ * Returns: TRUE if the candidate pair could be selected, FALSE otherwise
+ */
+
+static gboolean
+fs_rtp_stream_select_candidate_pair (FsStream *stream, gchar *lfoundation,
+                                     gchar *rfoundation, GError **error)
+{
+  FsRtpStream *self = FS_RTP_STREAM (stream);
+
+  return fs_stream_transmitter_select_candidate_pair (
+      self->priv->stream_transmitter, lfoundation, rfoundation, error);
+}
+
+
 /**
  * fs_rtp_stream_preload_recv_codec:
  * @stream: an #FsStream
-- 
1.5.6.5




More information about the farsight-commits mailing list