[gst-devel] linking pads (was: wingo gstreamer: gstreamer/ gstreamer/gst/)

Benjamin Otte in7y118 at public.uni-hamburg.de
Wed Mar 10 07:48:10 CET 2004


Quoting Andy Wingo <wingo at pobox.com>:

> * gst_pad_can_link_filtered
> 
> I think we need to assert that the pads have parents; otherwise there is
> surely a programming error somewhere. By assert, I mean use
> g_return_val_if_fail.
> 
> Their directions are not specified, and they can have incompatible caps.
> Perhaps we should assert that they not be connected already? This is
> really a question for the autoplug guys, so do speak up...
> 
I'd like to have gst_pad_can_link_filtered as a function that I can throw any 
two pads at and see if they can connect without having to think about them any 
more.
Or to give a formal definition:
gst_pad_can_link_filtered (gst_element_get_pad (element1, name1), 
gst_element_get_pad (element2, name2)); should never print anything to stderr, 
if both gst_element_get_pad don't return NULL.
Note that this means you can g_return_if_fail if the pad doesn't have a parent 
and that the g_warning for decoupled elements should be made a debugging 
message.

> * gst_pad_link_filtered
> 
> I think that we should assert that gst_pad_can_link_filtered. Anything
> else would be a programming error. Note that this function can still
> fail if calling the linkfuncs doesn't work out.
> 
This sounds like a very good idea. Just g_assert (gst_pad_can_link_filtered 
()); and you don't have duplicated code anymore.


Benjamin




More information about the gstreamer-devel mailing list