[farsight2/master] Change add->set remote candidates in the transmitter base class

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


---
 gst-libs/gst/farsight/fs-stream-transmitter.c |   38 +++++-------------------
 gst-libs/gst/farsight/fs-stream-transmitter.h |   17 ++++-------
 2 files changed, 14 insertions(+), 41 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-stream-transmitter.c b/gst-libs/gst/farsight/fs-stream-transmitter.c
index 4294e5c..bfd0293 100644
--- a/gst-libs/gst/farsight/fs-stream-transmitter.c
+++ b/gst-libs/gst/farsight/fs-stream-transmitter.c
@@ -271,27 +271,28 @@ fs_stream_transmitter_set_property (GObject *object,
 
 
 /**
- * fs_stream_transmitter_add_remote_candidate
+ * fs_stream_transmitter_set_remote_candidates
  * @streamtransmitter: a #FsStreamTranmitter
- * @candidate: a remote #FsCandidate to add
+ * @candidates: a #GList of the remote candidates
  * @error: location of a #GError, or NULL if no error occured
  *
- * This function is used to add remote candidates to the transmitter
+ * This function is used to set the remote candidates to the transmitter
  *
  * Returns: TRUE of the candidate could be added, FALSE if it couldnt
  *   (and the #GError will be set)
  */
 
 gboolean
-fs_stream_transmitter_add_remote_candidate (
-    FsStreamTransmitter *streamtransmitter, FsCandidate *candidate,
+fs_stream_transmitter_set_remote_candidates (
+    FsStreamTransmitter *streamtransmitter,
+    GList *candidates,
     GError **error)
 {
   FsStreamTransmitterClass *klass =
     FS_STREAM_TRANSMITTER_GET_CLASS (streamtransmitter);
 
-  if (klass->add_remote_candidate) {
-    return klass->add_remote_candidate (streamtransmitter, candidate, error);
+  if (klass->set_remote_candidates) {
+    return klass->set_remote_candidates (streamtransmitter, candidates, error);
   } else {
     g_set_error (error, FS_ERROR, FS_ERROR_NOT_IMPLEMENTED,
       "add_remote_candidate not defined in stream transmitter class");
@@ -300,29 +301,6 @@ 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 {
-    GST_WARNING ("remote_candidates_added not defined in transmitter class");
-  }
-}
-
 /**
  * fs_stream_transmitter_select_candidate_pair:
  * @streamtransmitter: a #FsStreamTransmitter
diff --git a/gst-libs/gst/farsight/fs-stream-transmitter.h b/gst-libs/gst/farsight/fs-stream-transmitter.h
index 0004c41..100f3a9 100644
--- a/gst-libs/gst/farsight/fs-stream-transmitter.h
+++ b/gst-libs/gst/farsight/fs-stream-transmitter.h
@@ -57,8 +57,7 @@ typedef struct _FsStreamTransmitterPrivate FsStreamTransmitterPrivate;
 /**
  * FsStreamTransmitterClass:
  * @parent_class: Our parent
- * @add_remote_candidate: Sets the remote candidate
- * @remote_candidates_added: Tell the stream to start the connectivity checks
+ * @set_remote_candidate: Sets the remote candidates
  * @select_candidate_pair: Select the candidate pair
  * @gather_local_candidates: Starts the gathering of local candidates
  *
@@ -70,10 +69,8 @@ struct _FsStreamTransmitterClass
   GObjectClass parent_class;
 
   /*virtual functions */
-  gboolean (*add_remote_candidate) (FsStreamTransmitter *streamtransmitter,
-                                    FsCandidate *candidate, GError **error);
-
-  void (*remote_candidates_added) (FsStreamTransmitter *streamtransmitter);
+  gboolean (*set_remote_candidates) (FsStreamTransmitter *streamtransmitter,
+                                     GList *candidates, GError **error);
 
   gboolean (*select_candidate_pair) (FsStreamTransmitter *streamtransmitter,
       const gchar *local_foundation,
@@ -102,12 +99,10 @@ struct _FsStreamTransmitter
 
 GType fs_stream_transmitter_get_type (void);
 
-gboolean fs_stream_transmitter_add_remote_candidate (
+gboolean fs_stream_transmitter_set_remote_candidates (
     FsStreamTransmitter *streamtransmitter,
-    FsCandidate *candidate, GError **error);
-
-void fs_stream_transmitter_remote_candidates_added (
-    FsStreamTransmitter *streamtransmitter);
+    GList *candidates,
+    GError **error);
 
 gboolean fs_stream_transmitter_select_candidate_pair (
     FsStreamTransmitter *streamtransmitter,
-- 
1.5.6.5




More information about the farsight-commits mailing list