[farsight2/master] Change the candidates api set->add in the core lib

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


---
 docs/libs/farsight2-libs-sections.txt |    7 ++---
 gst-libs/gst/farsight/fs-stream.c     |   43 +++++++++-----------------------
 gst-libs/gst/farsight/fs-stream.h     |   19 +++++---------
 3 files changed, 22 insertions(+), 47 deletions(-)

diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 5f43d9b..fb556d2 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -21,8 +21,8 @@ FsParticipantPrivate
 FsStream
 FsStreamClass
 FsStreamDirection
-fs_stream_add_remote_candidate
-fs_stream_remote_candidates_added
+FsStreamState
+fs_stream_set_remote_candidates
 fs_stream_select_candidate_pair
 fs_stream_set_remote_codecs
 fs_stream_emit_error
@@ -174,8 +174,7 @@ fs_transmitter_get_type
 <TITLE>FsStreamTransmitter</TITLE>
 FsStreamTransmitter
 FsStreamTransmitterClass
-fs_stream_transmitter_add_remote_candidate
-fs_stream_transmitter_remote_candidates_added
+fs_stream_transmitter_set_remote_candidates
 fs_stream_transmitter_select_candidate_pair
 fs_stream_transmitter_gather_local_candidates
 fs_stream_transmitter_emit_error
diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index 5fe5d5b..db60c13 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -366,55 +366,36 @@ fs_stream_set_property (GObject *object,
 }
 
 /**
- * fs_stream_add_remote_candidate:
+ * fs_stream_set_remote_candidate:
  * @stream: an #FsStream
- * @candidate: an #FsCandidate struct representing a remote candidate
+ * @candidates: an #GList of #FsCandidate representing the remote candidates
  * @error: location of a #GError, or %NULL if no error occured
  *
- * This function adds the given candidate into the remote candiate list of the
- * stream. It will be used for establishing a connection with the peer. A copy
- * will be made so the user must free the passed candidate using
- * fs_candidate_destroy() when done.
+ * This function sets the list of remote candidates. Any new candidates are
+ * added to the list. The candidates will be used to establish a connection
+ * with the peer. A copy will be made so the user must free the
+ * passed candidate using fs_candidate_destroy() when done.
  *
  * Return value: TRUE if the candidate was valid, FALSE otherwise
  */
 gboolean
-fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate,
-                                GError **error)
+fs_stream_set_remote_candidates (FsStream *stream,
+    GList *candidates,
+    GError **error)
 {
   FsStreamClass *klass = FS_STREAM_GET_CLASS (stream);
 
-  if (klass->add_remote_candidate) {
-    return klass->add_remote_candidate (stream, candidate, error);
+  if (klass->set_remote_candidates) {
+    return klass->set_remote_candidates (stream, candidates, error);
   } else {
     g_set_error (error, FS_ERROR, FS_ERROR_NOT_IMPLEMENTED,
-      "add_remote_candidate not defined in class");
+      "set_remote_candidate not defined in class");
   }
 
   return FALSE;
 }
 
 /**
- * fs_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
- */
-
-void
-fs_stream_remote_candidates_added (FsStream *stream)
-{
-  FsStreamClass *klass = FS_STREAM_GET_CLASS (stream);
-
-  if (klass->remote_candidates_added) {
-    klass->remote_candidates_added (stream);
-  } else {
-    GST_WARNING ("remote_candidates_added not defined in class");
-  }
-}
-
-/**
  * fs_stream_select_candidate_pair:
  * @stream: a #FsStream
  * @local_foundation: The foundation of the local candidates to be selected
diff --git a/gst-libs/gst/farsight/fs-stream.h b/gst-libs/gst/farsight/fs-stream.h
index 216108e..510ead6 100644
--- a/gst-libs/gst/farsight/fs-stream.h
+++ b/gst-libs/gst/farsight/fs-stream.h
@@ -74,8 +74,7 @@ typedef struct _FsStreamPrivate FsStreamPrivate;
 /**
  * FsStreamClass:
  * @parent_class: Our parent
- * @add_remote_candidate: Adds a remote candidate
- * @remote_candidates_added: Tell the stream to start the connectivity checks
+ * @set_remote_candidates: Set sthe remote candidates
  * @select_candidate_pair: Select the candidate pair
  * @set_remote_codecs: Sets the list of remote codecs
  *
@@ -88,11 +87,9 @@ struct _FsStreamClass
   GObjectClass parent_class;
 
   /*virtual functions */
-  gboolean (*add_remote_candidate) (FsStream *stream,
-                                    FsCandidate *candidate,
-                                    GError **error);
-
-  void (*remote_candidates_added) (FsStream *stream);
+  gboolean (*set_remote_candidates) (FsStream *stream,
+                                     GList *candidates,
+                                     GError **error);
 
   gboolean (*select_candidate_pair) (FsStream *stream,
       const gchar *local_foundation,
@@ -124,11 +121,9 @@ struct _FsStream
 
 GType fs_stream_get_type (void);
 
-gboolean fs_stream_add_remote_candidate (FsStream *stream,
-                                         FsCandidate *candidate,
-                                         GError **error);
-
-void fs_stream_remote_candidates_added (FsStream *stream);
+gboolean fs_stream_set_remote_candidates (FsStream *stream,
+                                          GList *candidates,
+                                          GError **error);
 
 gboolean fs_stream_select_candidate_pair (FsStream *stream,
     const gchar *local_foundation,
-- 
1.5.6.5




More information about the farsight-commits mailing list