[gst-devel] scale-renegotiation

David Schleef ds at schleef.org
Fri Nov 7 13:36:17 CET 2003


On Fri, Nov 07, 2003 at 10:20:24PM +0100, Ronald Bultje wrote:
> A better way to do this would be to redo capsnego directly with a
> chained caps from the ximagesink plugin: it sends back a chained caps
> where the first one is the caps with the new size (wanted), and the
> second is the current one. Problem here is - currently - that this will
> only work if the videoscale plugin is directly connected to ximagesink.
> If there's plugins in between, e.g. a fps-changer, it won't work. If
> someone knows of a way to fix this: I prefer this method. ;).
> -
> 
> In other words: won't work. Please make it work and I'll happily use
> this.

It does work, as long as those elements negotiate caps correctly.
Examples of working elements are anything that subclasses videofilter
and videotestsrc.  The getcaps() function for all the pads will
call get_allowed_caps() on the opposite pad, adjust the properties
that it needs to, and return those caps.  The link() function on
each pad will call try_set_caps() on the opposite pad (with adjusted
caps), and properly update the internal state when the caps changes.

Caps negotiation is one of the things in GStreamer that works really
well when it's implemented correctly.

And, btw, you can't call try_set_caps() with chained (i.e., non-fixed)
caps.



dave...





More information about the gstreamer-devel mailing list