[gst-devel] Notes about docs/random/negotiation

David Schleef ds at schleef.org
Mon Dec 29 16:29:02 CET 2003


On Tue, Dec 30, 2003 at 01:11:15AM +0100, Benjamin Otte wrote:
> :p
> Nice that you answer all the questions after I wrote the solutions ;)
> 
> On Mon, 29 Dec 2003, David Schleef wrote:
> 
> > Elements don't need a src_link() function to use try_set_caps().
> >
> Every pad that has non-fixed template caps needs a src_link or a get_caps
> function, because the sink may do renego.
> Every pad that has fixed template caps doesn't need to call try_set_caps.
> Therefore every element that uses try_set_caps but doesn't have a src_link
> function is broken.

Or a getcaps function.  Which is the better solution, imo.  If a
decoder reads the stream data and decides on exactly one output
format, that format should be reflected in the getcaps function,
because that's the only format the element is willing to accept
on its source pad.  If the getcaps function (or pad template)
pretends to support more formats, but then rejects all but one of
them in the src_link function, I think that's broken.  It requires
more code _and_ makes autoplugging more complicated.

It might be wise to consolidate such behavior in a GstPad subclass
in 0.9.



dave...





More information about the gstreamer-devel mailing list