[farsight2/master] Report method non-implementedness as a GError in FsStream

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


---
 gst-libs/gst/farsight/fs-stream.c |   12 ++++++++----
 gst-libs/gst/farsight/fs-stream.h |    5 ++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index f821632..c9c2b3e 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -485,7 +485,8 @@ fs_stream_add_remote_candidate (FsStream *stream, FsCandidate *candidate,
   if (klass->add_remote_candidate) {
     return klass->add_remote_candidate (stream, candidate, error);
   } else {
-    g_warning ("add_remote_candidate not defined in class");
+    g_set_error (error, FS_STREAM_ERROR, FS_STREAM_ERROR_NOT_IMPLEMENTED,
+      "add_remote_candidate not defined in class");
   }
 
   return FALSE;
@@ -534,7 +535,8 @@ fs_stream_select_candidate_pair (FsStream *stream, gchar *lfoundation,
     return klass->select_candidate_pair (stream, lfoundation, rfoundation,
     error);
   } else {
-    g_warning ("select_candidate_pair not defined in class");
+    g_set_error (error, FS_STREAM_ERROR, FS_STREAM_ERROR_NOT_IMPLEMENTED,
+      "select_candidate_pair not defined in class");
   }
 
   return FALSE;
@@ -562,7 +564,8 @@ fs_stream_preload_recv_codec (FsStream *stream, FsCodec *codec, GError **error)
   if (klass->preload_recv_codec) {
     return klass->preload_recv_codec (stream, codec, error);
   } else {
-    g_warning ("preload_recv_codec not defined in class");
+    g_set_error (error, FS_STREAM_ERROR, FS_STREAM_ERROR_NOT_IMPLEMENTED,
+      "preload_recv_codec not defined in class");
   }
 
   return FALSE;
@@ -591,7 +594,8 @@ fs_stream_set_remote_codecs (FsStream *stream,
   if (klass->set_remote_codecs) {
     return klass->set_remote_codecs (stream, remote_codecs, error);
   } else {
-    g_warning ("set_remote_codecs not defined in class");
+    g_set_error (error, FS_STREAM_ERROR, FS_STREAM_ERROR_NOT_IMPLEMENTED,
+      "set_remote_codecs 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 d1c2b9e..05fa09e 100644
--- a/gst-libs/gst/farsight/fs-stream.h
+++ b/gst-libs/gst/farsight/fs-stream.h
@@ -78,6 +78,8 @@ typedef struct _FsStreamPrivate FsStreamPrivate;
  * @FS_STREAM_ERROR_CONSTRUCTION: Error constructing some of the sub-elements
  * @FS_STREAM_ERROR_INVALID_ARGUMENTS: Invalid arguments to the function
  * @FS_STREAM_ERROR_NETWORK: A network related error
+ * @FS_STREAM_ERROR_NOT_IMPLEMENTED: This functionality is not implemented
+ * by this plugins
  *
  * This is the enum of error numbers that will come either on the "error" signal
  * or from the Gst Bus.
@@ -86,7 +88,8 @@ typedef struct _FsStreamPrivate FsStreamPrivate;
 typedef enum {
   FS_STREAM_ERROR_CONSTRUCTION,
   FS_STREAM_ERROR_INVALID_ARGUMENTS,
-  FS_STREAM_ERROR_NETWORK
+  FS_STREAM_ERROR_NETWORK,
+  FS_STREAM_ERROR_NOT_IMPLEMENTED
 } FsStreamError;
 
 /**
-- 
1.5.6.5




More information about the farsight-commits mailing list