[gst-devel] gst_element_connect et al naming

Andy Wingo wingo at pobox.com
Tue Oct 8 18:20:02 CEST 2002

On Tue, 08 Oct 2002, David I. Lehn wrote:

> There is an issue with the naming of gst_element_connect and
> gst_element_disconnect and perhaps other functions.  They overload
> methods of a similar name in GObject.  Namely, g_object_connect and
> g_object_disconnect.  In C this hardly matters.  However, for the Python
> wrappers this is not a very object-oriented way to do things.  The
> GstElement methods have different functionality entirely from the same
> GObject methods.
> This requires code that would normally be written as:
>   element.connect("sig", handler)
> to be written in a rather awkward form:
>   GObject.connect(element, "sig", handler)

This is an instance where, IMNSHO, the object-oriented model fails. An
element connection involves *two* elements, neither of which is
privileged. this function would make a lot more sense as
gst_element_connect (foo, bar), which incidentally is how it works in c.
if you want OO, try element.connect_to() or something.

> Comments?  Is there more API with similar overloading?

considering g_object_connect is merely a convenience routine for things
defined in gsignal.h, i would tend to see the problem in the gtk signal
code and not in gstreamer. not that i think there's a problem ;-)



More information about the gstreamer-devel mailing list