[gst-devel] Change to "have_type" signal...

Ronald Bultje rbultje at ronald.bitfreak.net
Sun May 25 23:17:02 CEST 2003


Hey Brett,

On Mon, 2003-05-26 at 02:11, Brett Kosinski wrote:
> The "have_type" signal in gsttypefind.c has its first argument defined as
> G_TYPE_POINTER.  For the wrappers I'm creating, this isn't specific enough
> (since the callback code can't know how to marshall the parameter).  I
> believe the type should be set to GST_TYPE_CAPS (since that's what's
> passed).  Are there any arguments against this change?  I can provide a
> patch (I didn't since the change is VERY simple).

gsttypefind.h has a bug here too, btw:

  void                  (*have_type)    (GstElement *element);

That should have a GstCaps *caps as second argument, of course.

Concerning your change, most source files actually use G_TYPE_OBJECT
since GstCaps is a derivative of it. GST_TYPE_CAPS isn't a base type in
glib...

I've applied the following patch (to CVS/HEAD):

--
Index: gsttypefind.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttypefind.c,v
retrieving revision 1.30
diff -u -r1.30 gsttypefind.c
--- gsttypefind.c       13 Apr 2003 00:55:08 -0000      1.30
+++ gsttypefind.c       26 May 2003 06:04:52 -0000
@@ -116,7 +116,7 @@
       g_signal_new ("have_type", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
                      G_STRUCT_OFFSET (GstTypeFindClass, have_type), NULL, NULL,
                      g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1,
-                     G_TYPE_POINTER);
+                     G_TYPE_OBJECT);
  
   gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_type_find_set_property);
   gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_type_find_get_property);
Index: gsttypefind.h
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/gst/gsttypefind.h,v
retrieving revision 1.11
diff -u -r1.11 gsttypefind.h
--- gsttypefind.h       17 Jan 2003 20:41:04 -0000      1.11
+++ gsttypefind.h       26 May 2003 06:04:52 -0000
@@ -57,7 +57,8 @@
   GstElementClass      parent_class;
  
   /* signals */
-  void                         (*have_type)    (GstElement *element);
+  void                         (*have_type)    (GstElement *element,
+                                        GstCaps    *caps);
 };
  
 GType gst_type_find_get_type (void);
--

That should be enough.

Thanks for reporting,

Ronald

oh, one more thing, we normally use bugzilla
(http://bugzilla.gnome.org/) for bug reporting like this, you might want
to have a look at that too.

-- 
Ronald Bultje <rbultje at ronald.bitfreak.net>





More information about the gstreamer-devel mailing list