[farsight2/master] Add fs_stream_transmitter_remote_candidates_added and fs_stream_transmitter_select_candidate_pair

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


---
 docs/libs/farsight-libs-sections.txt          |    2 +
 gst-libs/gst/farsight/fs-stream-transmitter.c |   53 +++++++++++++++++++++++++
 gst-libs/gst/farsight/fs-stream-transmitter.h |   13 ++++++
 3 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/docs/libs/farsight-libs-sections.txt b/docs/libs/farsight-libs-sections.txt
index 6ba2c0c..f16bfb8 100644
--- a/docs/libs/farsight-libs-sections.txt
+++ b/docs/libs/farsight-libs-sections.txt
@@ -170,6 +170,8 @@ fs_transmitter_get_type
 FsStreamTransmitter
 FsStreamTransmitterClass
 fs_stream_transmitter_add_remote_candidate
+fs_stream_transmitter_remote_candidates_added
+fs_stream_transmitter_select_candidate_pair
 <SUBSECTION Standard>
 FS_IS_STREAM_TRANSMITTER
 FS_IS_STREAM_TRANSMITTER_CLASS
diff --git a/gst-libs/gst/farsight/fs-stream-transmitter.c b/gst-libs/gst/farsight/fs-stream-transmitter.c
index e71899f..493060e 100644
--- a/gst-libs/gst/farsight/fs-stream-transmitter.c
+++ b/gst-libs/gst/farsight/fs-stream-transmitter.c
@@ -302,3 +302,56 @@ fs_stream_transmitter_add_remote_candidate (
   return FALSE;
 }
 
+
+/**
+ * fs_stream_transmitter_remote_candidates_added:
+ * @streamtransmitter: a #FsStreamTransmitter
+ *
+ * Call this function when the remotes candidates have been set and the
+ * checks can start. More candidates can be added afterwards
+ */
+
+void
+fs_stream_transmitter_remote_candidates_added (
+    FsStreamTransmitter *streamtransmitter)
+{
+  FsStreamTransmitterClass *klass =
+    FS_STREAM_TRANSMITTER_GET_CLASS (streamtransmitter);
+
+  if (klass->remote_candidates_added) {
+    klass->remote_candidates_added (streamtransmitter);
+  } else {
+    g_warning ("remote_candidates_added not defined in class");
+  }
+}
+
+/**
+ * fs_stream_transmitter_select_candidate_pair:
+ * @streamtransmitter: a #FsStreamTransmitter
+ * @lfoundation: The foundation of the local candidate to be selected
+ * @rfoundation: The foundation of the remote candidate to be selected
+ * @error: location of a #GErrorh, 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
+ */
+
+gboolean
+fs_stream_transmitter_select_candidate_pair (
+    FsStreamTransmitter *streamtransmitter, gchar *lfoundation,
+    gchar *rfoundation, GError **error)
+{
+  FsStreamTransmitterClass *klass =
+    FS_STREAM_TRANSMITTER_GET_CLASS (streamtransmitter);
+
+  if (klass->select_candidate_pair) {
+    return klass->select_candidate_pair (streamtransmitter, lfoundation, rfoundation,
+    error);
+  } else {
+    g_warning ("select_candidate_pair not defined in class");
+  }
+
+  return FALSE;
+}
diff --git a/gst-libs/gst/farsight/fs-stream-transmitter.h b/gst-libs/gst/farsight/fs-stream-transmitter.h
index 4b22bdf..2dc8684 100644
--- a/gst-libs/gst/farsight/fs-stream-transmitter.h
+++ b/gst-libs/gst/farsight/fs-stream-transmitter.h
@@ -70,6 +70,12 @@ struct _FsStreamTransmitterClass
   gboolean (*add_remote_candidate) (FsStreamTransmitter *streamtransmitter,
                                     FsCandidate *candidate, GError **error);
 
+  void (*remote_candidates_added) (FsStreamTransmitter *streamtransmitter);
+
+  gboolean (*select_candidate_pair) (FsStreamTransmitter *streamtransmitter,
+                                     gchar *lfoundation, gchar *rfoundation,
+                                     GError **error);
+
   /*< private >*/
   gpointer _padding[8];
 };
@@ -94,6 +100,13 @@ gboolean fs_stream_transmitter_add_remote_candidate (
     FsStreamTransmitter *streamtransmitter,
     FsCandidate *candidate, GError **error);
 
+void fs_stream_transmitter_remote_candidates_added (
+    FsStreamTransmitter *streamtransmitter);
+
+gboolean fs_stream_transmitter_select_candidate_pair (
+    FsStreamTransmitter *streamtransmitter, gchar *lfoundation,
+    gchar *rfoundation, GError **error);
+
 
 G_END_DECLS
 
-- 
1.5.6.5




More information about the farsight-commits mailing list