[gst-devel] more caps

Ronald Bultje rbultje at ronald.bitfreak.net
Thu Dec 25 02:21:01 CET 2003


Hi all,

I'm debugging avidemux with the current caps system and got somewhere:

On Wed, 2003-12-24 at 17:40, Ronald Bultje wrote:
> - I actually like Benjamin's idea of deprecating try_set_caps(). Not for
> 0.8.0, but still, we can make a start for 0.8 (simply allowing it, but
> not recommending it) and complete it in 0.10. It forces correct element
> writing which is a good thing.

Apparently, try_set_caps is already deprecated, even though it's not
annotated as such yet. When avidemux plays and reads a new stream
header, the following used to happen:

* create pad
* try_set_caps()
* set event functions etc.
* add pad to element

The link is only being created in step 4. This means that in step 2, we
do try_set_caps on an unlinked pad, which is a no-op (line 1241 of
gstpad.c). Consequently, it uses the template caps for linking, fixates
it to the lowest which leads to the bogus values being set on ffmpegdec
(or whichever decoder).

The obvious fix is to move try_set_caps to the bottom. This works, but
leads to two links. First, a full link is being done using the template
caps, and then directly we re-link with try_set_caps. this is expensive!
Yes, it takes up to a second. Not to mention that we've probably got a
bunch of memleaks here, too (see previous email). I'm willing to
implement this everywhere as a quickfix if people don't object. However,
it's not a nice fix.

The only 'right' fix seems to be to use a src_getcaps function already.
I really dislike this, but I'll try it out and give a note on my
progress this afternoon.

I didn't get anywhere yet with gst_pad_get_allowed_caps() or
GST_PAD_CAPS(), but I'll look at that too.

Ronald

-- 
Ronald Bultje <rbultje at ronald.bitfreak.net>
Linux Video/Multimedia developer





More information about the gstreamer-devel mailing list