[farsight2/master] Make fs_stream_add_remote_candidate return a GErrror

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


---
 gst-libs/gst/farsight/fs-stream.c   |   12 +++++++++---
 gst-libs/gst/farsight/fs-stream.h   |    9 ++++++---
 gst/fsrtpconference/fs-rtp-stream.c |   11 +++++++----
 3 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index dd74ca5..774cc9d 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -467,22 +467,28 @@ fs_stream_set_property (GObject *object,
  * fs_stream_add_remote_candidate:
  * @stream: an #FsStream
  * @candidate: an #FsCandidate struct representing a remote candidate
+ * @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.
+ *
+ * Return value: TRUE if the candidate was valid, FALSE otherwise
  */
-void
-fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate)
+gboolean
+fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate,
+                                GError **error)
 {
   FsStreamClass *klass = FS_STREAM_GET_CLASS (stream);
 
   if (klass->add_remote_candidate) {
-    klass->add_remote_candidate (stream, candidate);
+    return klass->add_remote_candidate (stream, candidate, error);
   } else {
     g_warning ("add_remote_candidate not defined in class");
   }
+
+  return FALSE;
 }
 
 /**
diff --git a/gst-libs/gst/farsight/fs-stream.h b/gst-libs/gst/farsight/fs-stream.h
index 9178381..3350d7e 100644
--- a/gst-libs/gst/farsight/fs-stream.h
+++ b/gst-libs/gst/farsight/fs-stream.h
@@ -96,8 +96,9 @@ struct _FsStreamClass
   GObjectClass parent_class;
 
   /*virtual functions */
-  void (*add_remote_candidate) (FsStream *stream,
-                                FsCandidate *candidate);
+  gboolean (*add_remote_candidate) (FsStream *stream,
+                                    FsCandidate *candidate,
+                                    GError **error);
 
   gboolean (*preload_recv_codec) (FsStream *stream, FsCodec *codec,
                                   GError **error);
@@ -125,7 +126,9 @@ struct _FsStream
 
 GType fs_stream_get_type (void);
 
-void fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate);
+gboolean fs_stream_add_remote_candidate (FsStream *stream,
+                                         FsCandidate *candidate,
+                                         GError **error);
 
 gboolean fs_stream_preload_recv_codec (FsStream *stream, FsCodec *codec,
                                        GError **error);
diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 7edcdbc..2109f8a 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -86,8 +86,9 @@ static void fs_rtp_stream_set_property (GObject *object,
                                     guint prop_id,
                                     const GValue *value,
                                     GParamSpec *pspec);
-static void fs_rtp_stream_add_remote_candidate (FsStream *stream,
-                                                FsCandidate *candidate);
+static gboolean fs_rtp_stream_add_remote_candidate (FsStream *stream,
+                                                    FsCandidate *candidate,
+                                                    GError **error);
 static gboolean fs_rtp_stream_preload_recv_codec (FsStream *stream,
                                                   FsCodec *codec,
                                                   GError **error);
@@ -269,14 +270,16 @@ fs_rtp_stream_set_property (GObject *object,
  * fs_rtp_stream_add_remote_candidate:
  * @stream: an #FsStream
  * @candidate: an #FsCandidate struct representing a remote candidate
+ * @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.
  */
-static void
-fs_rtp_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate)
+static gboolean
+fs_rtp_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate,
+                                    GError **error)
 {
 }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list