[gst-devel] Extending a pad template
in7y118 at public.uni-hamburg.de
in7y118 at public.uni-hamburg.de
Thu Feb 12 06:46:02 CET 2004
Quoting David Schleef <ds at schleef.org>:
> On Tue, Feb 10, 2004 at 03:27:40PM +0100, in7y118 at public.uni-hamburg.de
> wrote:
> > We certainly lack that remove_template function (you can go ahead and just
> add
> > it in CVS),
>
> We don't have a gst_element_class_remove_template() function because
> it's not appropriate. The entire purpose of pad templates is that
> they're a class property -- if they're removable, that defeats the
> purpose.
>
That's not true I think.
You can build elements in 2 ways:
1) You build a specialized element and make subclasses more general. (example:
mpegdemux => dvddemux)
2) You build a general element and make subclasses more specialized. (example:
videofilter => effecTV - though this example isn't really good because
videofilter isn't registered)
Both require a _remove_template - in the first case to make the template more
general, in the second case to make it more special.
In the first case we get around this by adding a padtemplate, so there's 2
audio templates.
In the second case we get around this (for now) by just not installing
templates at all in the superclass (since it's not registered) or just using
the more general template. videofilter even has a register_my_templates like
function for that purpose.
Benjamin
More information about the gstreamer-devel
mailing list