[gst-devel] gst_element_connect et al naming

David I. Lehn dlehn at vt.edu
Tue Oct 8 18:03:01 CEST 2002


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)

Other language bindings are likely to require similar tricks which
probably involving casting.  (ie, Java, C++, etc)

Should we try and correct this?  I think it's a good idea if people
start using the alternate language bindings.  I'm sure people will be
surprised and bothered by these little sort of things.

Here's a suggested mapping:

s/gst_element_connect/gst_element_connect_to_element/
s/gst_element_connect_many/gst_element_connect_to_elements/
s/gst_element_connect_filtered/gst_element_connect_to_element_filtered/
s/gst_element_disconnect/gst_element_disconnect_from_element/
s/gst_element_disconnect_many/gst_element_disconnect_from_elements/

Comments?  Is there more API with similar overloading?

-dave




More information about the gstreamer-devel mailing list