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

David Schleef ds at schleef.org
Mon Dec 29 12:11:14 CET 2003


On Wed, Dec 24, 2003 at 01:40:08PM +0100, Benjamin Otte wrote:
> Note 1: This is probably mostly directed at David.
> Note 2: David, please get yourself your own subdirectory in docs/random.
> It's nice to know who to bug with questions about those random docs.
> 
> Anyway, I just read the negotiation stuff, and there were some things I
> wanted to have cleared:
> 
> - What's the exact order of fixate functions called? Does the
> (non)existance of such functions influence that behaviour? (I guess the
> default fixate function is never called if another one is available?)

App's fixate function, srcpad's fixate function, sinkpad's fixate
function, core's fixate function.  If any exist and return non-NULL,
the loop is restarted.  So effectively, the app can completely shut
out all the other fixate functions.  It's a sucky system, but it's
better than nothing (I hope).

> - Is there a simple way we can get around renego issues which will come
> up with elements that aren't fixed to allow this? (elements without a src
> link function that use gst_pad_try_set_caps)

Elements don't need a src_link() function to use try_set_caps().

> - Why doesn't gst_pad_try_set_caps call its own link function? That would
> be the only way of doing caps nego without calling both link functions...

It's assumed that if you (the element) are setting caps on a pad, you
already think they're acceptable.

> - Can we deprecate gst_pad_try_set_caps? Every element using this _must_
> have a src_link function knowing about this or renego will definitely
> break. And then, you can simply use gst_pad_renegotiate.

One could deprecate gst_pad_try_set_caps().  Without it, however, the
elements would have to have a lot more code, including a src_link()
function, a src_getcaps() function, and a renegotiation that is
currently just a simple "set the caps to _this_" becomes a full
renegotiation, calling getcaps functions, intersecting, calling link
functions, etc.  Also, it breaks ximagesink, which calls try_set_caps()
on its sink pad, and if that fails, it still does something reasonable.
We don't have a good system for preferred caps (fixate is only barely
better than nothing), so until then, we definitely need try_set_caps()
for the ximagesink case.

> - Can we have gst_pad_ensure_negotiated or something? I guess that would
> be nice to have.

Potentially.  Right now, use (GST_PAD_CAPS(pad) != NULL).

> - I want a testsuite for all elements trying renego, please :) (I know mad
> will break...)

Go ahead. :)

> - What's the function call to get the currently negotiated caps of a pad?

GST_PAD_CAPS(pad) or gst_pad_get_negotiated_caps(pad).

> - Is pad->caps deprecated? If so, can we add a comment in the header?

Yes.  The field should be removed.  (Better, rename it, and then
remove it when we do a final ABI rundown.  I've been keeping structures
ABI stable for a few weeks now.)

> - Can someone rework/deprecate the macros - like GST_CAPS_FIXED or
> GST_PAD_CAPS? Or don't we want that?

GST_CAPS_FIXED() is gone.  GST_PAD_CAPS() should probably go away, too.
I'm not a big fan of 90% of these macros.



dave...





More information about the gstreamer-devel mailing list