[gst-devel] gst_element_connect

Andy Wingo wingo at pobox.com
Thu Apr 11 07:26:46 CEST 2002


On Wed, 10 Apr 2002, Ronald Bultje wrote:

> Andy (Wingo) changed the API.
> 
> See his email from this Sunday at 3:28:
> > and s/gst_element_connect/gst_element_connect_pads/
> > and s/gst_element_connect_elements/gst_element_connect/
> 
> Andy: I don't really see why... Could you be some more verbose on why
> you wanted this?

Sure.

First, this wasn't out of the blue; ever since Company wrote
gst_element_connect_elements () we were thinking of substituting that
for gst_element_connect (). Here's why. I'll call the new version
connect_elements, and the old version connect_pads:

* The connect_elements function is much simpler to type. Two arguments
instead of four, and you don't have to know the pad names.

* The common case (which is what we optimize for: make the common things
easy and the not-so-common things possible) is that I just want to
connect two elements, and there is one logical way in which they can be
connected. So we want the common case to be convenient to type.

* I envision that an even more common case in the future will be the new
gst_element_connect_many () api.


Consider the differences:

gst_element_connect (e1, "src", e2, "sink");
gst_element_connect (e2, "myfunkynamesrc", e3, "sink");
gst_element_connect (e3, "src", e2, "sink%d");

vs.

gst_element_connect_many (e1, e2, e3, NULL);


How does that look? If you want the old behavior, it's still there, as
gst_element_connect_pads. But I don't imagine that it will see a lot of
use in the future.

regards,

wingo.




More information about the gstreamer-devel mailing list