diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | docs/gst/tmpl/gstxml.sgml | 10 | ||||
-rw-r--r-- | gst/gstelement.c | 4 | ||||
-rw-r--r-- | gst/gsterror.c | 12 | ||||
-rw-r--r-- | gst/gsterror.h | 28 | ||||
-rw-r--r-- | gst/gstmarshal.list | 2 |
6 files changed, 51 insertions, 20 deletions
@@ -1,3 +1,18 @@ +2004-03-09 Johan Dahlin <johan@gnome.org> + + Reviewed by: Thomas Vander Stichele + + * gst/gstelement.c (gst_element_class_init): register second + parameter as GST_TYPE_G_ERROR instead of G_TYPE_POINTER, so + language bindings can (de)marshall correctly. + + * gst/gsterror.h: Add GST_TYPE_G_ERROR and cleanup a little bit + + * gst/gsterror.c (gst_g_error_get_type): New function + + * gst/gstmarshal.list: Remove VOID:OBJECT,POINTER,STRING, replace + with VOID:OBJECT,OBJECT,STRING + 2004-03-10 Jan Schmidt <thaytan@mad.scientist.com> * gst/registries/gstxmlregistry.c: (gst_xml_registry_load): diff --git a/docs/gst/tmpl/gstxml.sgml b/docs/gst/tmpl/gstxml.sgml index 32d00bc1f9..08450b21b9 100644 --- a/docs/gst/tmpl/gstxml.sgml +++ b/docs/gst/tmpl/gstxml.sgml @@ -110,6 +110,10 @@ All GstElements can be serialized to an XML presentation and subsequently loaded </para> +@: +@: +@: + @gstxml: the object which received the signal. @arg1: @arg2: @@ -119,7 +123,7 @@ All GstElements can be serialized to an XML presentation and subsequently loaded </para> -@: -@: -@: +@gstxml: the object which received the signal. +@arg1: +@arg2: diff --git a/gst/gstelement.c b/gst/gstelement.c index 6f92539171..d6c6788a09 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -132,8 +132,8 @@ gst_element_class_init (GstElementClass *klass) gst_element_signals[ERROR] = g_signal_new ("error", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstElementClass, error), NULL, NULL, - gst_marshal_VOID__OBJECT_POINTER_STRING, G_TYPE_NONE, 3, - GST_TYPE_ELEMENT, G_TYPE_POINTER, + gst_marshal_VOID__OBJECT_OBJECT_STRING, G_TYPE_NONE, 3, + GST_TYPE_ELEMENT, GST_TYPE_G_ERROR, G_TYPE_STRING); gst_element_signals[EOS] = g_signal_new ("eos", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, diff --git a/gst/gsterror.c b/gst/gsterror.c index c2e555d511..1324af1fb1 100644 --- a/gst/gsterror.c +++ b/gst/gsterror.c @@ -33,6 +33,18 @@ GQuark gst_ ## string ## _error_quark (void) { \ quark = g_quark_from_static_string ("gst-" # string "-error-quark"); \ return quark; } +GType +gst_g_error_get_type (void) +{ + static GType type = 0; + + if (!type) + type = g_boxed_type_register_static ("GstGError", + (GBoxedCopyFunc) g_error_copy, + (GBoxedFreeFunc) g_error_free); + return type; +} + /* initialize the dynamic table of translated core errors */ static gchar ** _gst_core_errors_init () { diff --git a/gst/gsterror.h b/gst/gsterror.h index 2ac5aa69fd..c1c96e8bac 100644 --- a/gst/gsterror.h +++ b/gst/gsterror.h @@ -53,9 +53,6 @@ typedef enum { } GstCoreError; -#define GST_CORE_ERROR gst_core_error_quark () -GQuark gst_core_error_quark (void); - /* Library errors are for errors from the library being used by elements initializing, closing, ... */ typedef enum { @@ -69,10 +66,6 @@ typedef enum { } GstLibraryError; -#define GST_LIBRARY_ERROR gst_library_error_quark () -GQuark gst_library_error_quark (void); - - /* Resource errors are for anything external used by an element: memory, files, network connections, process space, ... They're typically used by source and sink elements */ @@ -94,9 +87,6 @@ typedef enum { } GstResourceError; -#define GST_RESOURCE_ERROR gst_resource_error_quark () -GQuark gst_resource_error_quark (void); - /* Stream errors are for anything related to the stream being processed: format errors, media type errors, ... They're typically used by decoders, demuxers, converters, ... */ @@ -116,12 +106,22 @@ typedef enum { } GstStreamError; -#define GST_STREAM_ERROR gst_stream_error_quark () -GQuark gst_stream_error_quark (void); +/* This should go away once we convinced glib people to register GError */ +#define GST_TYPE_G_ERROR (gst_g_error_get_type ()) + +#define GST_LIBRARY_ERROR gst_library_error_quark () +#define GST_RESOURCE_ERROR gst_resource_error_quark () +#define GST_CORE_ERROR gst_core_error_quark () +#define GST_STREAM_ERROR gst_stream_error_quark () +#define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno)) -#define GST_ERROR_SYSTEM ("system error: %s", g_strerror (errno)) -gchar * gst_error_get_message (GQuark domain, gint code); +GType gst_g_error_get_type (void); +gchar * gst_error_get_message (GQuark domain, gint code); +GQuark gst_stream_error_quark (void); +GQuark gst_core_error_quark (void); +GQuark gst_resource_error_quark (void); +GQuark gst_library_error_quark (void); G_END_DECLS diff --git a/gst/gstmarshal.list b/gst/gstmarshal.list index 631aa38591..7ec2067f80 100644 --- a/gst/gstmarshal.list +++ b/gst/gstmarshal.list @@ -9,7 +9,7 @@ VOID:OBJECT VOID:OBJECT,PARAM VOID:OBJECT,POINTER VOID:OBJECT,BOXED -VOID:OBJECT,POINTER,STRING +VOID:OBJECT,OBJECT,STRING VOID:OBJECT,STRING VOID:INT,INT VOID:INT64 |