[gst-devel] gstmarshal confusion [PATCH]

vishnu at pobox.com vishnu at pobox.com
Sat Sep 8 12:28:02 CEST 2001


Current CVS mixed up the signal type marshallers and argument types.
Apparently, glib2 is more strict about this that 1.2.  i'm not sure
about the impact of this patch on gstreamer + glib 1.2, but it is
necessary for glib2.

The main point of this patch is to fix a few places similar to this:

  gst_bin_signals[OBJECT_ADDED] =
    g_signal_new ("object_added", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST,
                    G_STRUCT_OFFSET (GstBinClass, object_added), NULL, NULL,
                    gst_marshal_VOID__POINTER, G_TYPE_NONE, 1,
                    GST_TYPE_ELEMENT);

This code is wrong because GST_TYPE_ELEMENT is an object, not a pointer.
The patch also renames g_cclosure_marshal_* to gst_marshal_* in the
affected files (this is entirely cosmetic).

Please comment.

Index: gstbin.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstbin.c,v
retrieving revision 1.86
diff -u -p -r1.86 gstbin.c
--- gstbin.c	2001/08/13 18:45:54	1.86
+++ gstbin.c	2001/09/08 18:03:19
@@ -110,7 +110,7 @@ gst_bin_class_init (GstBinClass *klass)
   gst_bin_signals[OBJECT_ADDED] =
     g_signal_new ("object_added", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_FIRST,
                     G_STRUCT_OFFSET (GstBinClass, object_added), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                     GST_TYPE_ELEMENT);
 
   klass->change_state_type =		gst_bin_change_state_type;
Index: gstelement.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstelement.c,v
retrieving revision 1.71
diff -u -p -r1.71 gstelement.c
--- gstelement.c	2001/08/21 20:16:45	1.71
+++ gstelement.c	2001/09/08 18:03:21
@@ -103,37 +103,37 @@ gst_element_class_init (GstElementClass 
   gst_element_signals[STATE_CHANGE] =
     g_signal_new ("state_change", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass, state_change), NULL, NULL,
-                    g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1,
+		  gst_marshal_VOID__INT, G_TYPE_NONE, 1,
                     G_TYPE_INT);
   gst_element_signals[NEW_PAD] =
     g_signal_new ("new_pad", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass, new_pad), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                     GST_TYPE_PAD);
   gst_element_signals[PAD_REMOVED] =
     g_signal_new ("pad_removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass, pad_removed), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                     GST_TYPE_PAD);
   gst_element_signals[NEW_GHOST_PAD] =
     g_signal_new ("new_ghost_pad", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass, new_ghost_pad), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                     GST_TYPE_PAD);
   gst_element_signals[GHOST_PAD_REMOVED] =
     g_signal_new ("ghost_pad_removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass, ghost_pad_removed), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                     GST_TYPE_PAD);
   gst_element_signals[ERROR] =
     g_signal_new ("error", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass, error), NULL, NULL,
-                    g_cclosure_marshal_VOID__STRING, G_TYPE_NONE,1,
+                    gst_marshal_VOID__STRING, G_TYPE_NONE,1,
                     G_TYPE_STRING);
   gst_element_signals[EOS] =
     g_signal_new ("eos", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstElementClass,eos), NULL, NULL,
-                    g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+                    gst_marshal_VOID__VOID, G_TYPE_NONE, 0);
 
 
 
Index: gstmarshal.list
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstmarshal.list,v
retrieving revision 1.1
diff -u -p -r1.1 gstmarshal.list
--- gstmarshal.list	2001/06/25 19:59:33	1.1
+++ gstmarshal.list	2001/09/08 18:03:21
@@ -1,2 +1,8 @@
+VOID:VOID
+VOID:BOOLEAN
+VOID:INT
+VOID:STRING
+VOID:POINTER
+VOID:OBJECT
 VOID:OBJECT,POINTER
 VOID:INT,INT
Index: gstpad.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gstpad.c,v
retrieving revision 1.101
diff -u -p -r1.101 gstpad.c
--- gstpad.c	2001/08/22 21:45:25	1.101
+++ gstpad.c	2001/09/08 18:03:23
@@ -28,6 +28,7 @@
 #include "gsttype.h"
 #include "gstbin.h"
 #include "gstscheduler.h"
+#include "gstmarshal.h"
 
 
 /***** Start with the base GstPad class *****/
@@ -149,27 +150,27 @@ gst_real_pad_class_init (GstRealPadClass
   gst_real_pad_signals[REAL_SET_ACTIVE] =
     g_signal_new ("set_active", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstRealPadClass, set_active), NULL, NULL,
-                    g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1,
                     G_TYPE_BOOLEAN);
   gst_real_pad_signals[REAL_CAPS_CHANGED] =
     g_signal_new ("caps_changed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstRealPadClass, caps_changed), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__POINTER, G_TYPE_NONE, 1,
                     G_TYPE_POINTER);
   gst_real_pad_signals[REAL_CAPS_NEGO_FAILED] =
     g_signal_new ("caps_nego_failed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstRealPadClass, caps_nego_failed), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__POINTER, G_TYPE_NONE, 1,
                     G_TYPE_POINTER);
   gst_real_pad_signals[REAL_CONNECTED] =
     g_signal_new ("connected", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstRealPadClass, connected), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__POINTER, G_TYPE_NONE, 1,
                     G_TYPE_POINTER);
   gst_real_pad_signals[REAL_DISCONNECTED] =
     g_signal_new ("disconnected", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstRealPadClass, disconnected), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__POINTER, G_TYPE_NONE, 1,
                     G_TYPE_POINTER);
 
 //  gtk_object_add_arg_type ("GstRealPad::active", G_TYPE_BOOLEAN,
@@ -1631,7 +1632,7 @@ gst_padtemplate_class_init (GstPadTempla
   gst_padtemplate_signals[TEMPL_PAD_CREATED] =
     g_signal_new ("pad_created", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GstPadTemplateClass, pad_created), NULL, NULL,
-                    g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
+                    gst_marshal_VOID__OBJECT, G_TYPE_NONE, 1,
                     GST_TYPE_PAD);





More information about the gstreamer-devel mailing list