[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-session.c | 7 ++++---
gst-libs/gst/farsight/fs-session.h | 4 +++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c
index 66ac987..d08203e 100644
--- a/gst-libs/gst/farsight/fs-session.c
+++ b/gst-libs/gst/farsight/fs-session.c
@@ -449,8 +449,8 @@ fs_session_new_stream (FsSession *session, FsParticipant *participant,
g_object_weak_ref (G_OBJECT (new_stream), (GWeakNotify)_remove_stream_ptr,
session);
} else {
- g_warning ("new_stream not defined for %s",
- G_OBJECT_TYPE_NAME (session));
+ g_set_error (error, FS_SESSION_ERROR, FS_SESSION_ERROR_NOT_IMPLEMENTED,
+ "new_stream not defined for %s", G_OBJECT_TYPE_NAME (session));
}
return new_stream;
}
@@ -537,7 +537,8 @@ fs_session_set_send_codec (FsSession *session, FsCodec *send_codec,
if (klass->set_send_codec) {
return klass->set_send_codec (session, send_codec, error);
} else {
- g_warning ("set_send_codec not defined in class");
+ g_set_error (error, FS_SESSION_ERROR, FS_SESSION_ERROR_NOT_IMPLEMENTED,
+ "set_send_codec not defined in class");
}
return FALSE;
}
diff --git a/gst-libs/gst/farsight/fs-session.h b/gst-libs/gst/farsight/fs-session.h
index d58ee2c..dfa5337 100644
--- a/gst-libs/gst/farsight/fs-session.h
+++ b/gst-libs/gst/farsight/fs-session.h
@@ -102,13 +102,15 @@ typedef enum
/**
* FsSessionError:
* @FS_SESSION_ERROR_CONSTRUCTION: Error constructing some of the sub-elements
+ * @FS_SESSION_ERROR_NOT_IMPLEMENTED: This functionality is not implemented
*
* This is the enum of error numbers that will come either on the "error" signal
* or from the Gst Bus.
*/
typedef enum {
- FS_SESSION_ERROR_CONSTRUCTION
+ FS_SESSION_ERROR_CONSTRUCTION,
+ FS_SESSION_ERROR_NOT_IMPLEMENTED
} FsSessionError;
/**
--
1.5.6.5
More information about the farsight-commits
mailing list