Question about a custom decoder and caps renegotiation

Tim-Philipp Müller t.i.m at zen.co.uk
Sun Jul 1 14:23:04 PDT 2012


On Sat, 2012-06-30 at 11:16 +0200, dv wrote:

Hi,

> I am writing a GStreamer plugin for a decoder. It already works fine, 
> but outputs 16 bit integer samples at the moment, even though it 
> supports many more formats.
> 
> My question is how to inform the decoder about the desired sample 
> format. My guess is that I should use upstream caps renegotation.

You don't need upstream renegotiation for this, that's to tell upstream
elements that something has changed downstream.

In your decoder, you can simply do a gst_pad_get_allowed_caps(srcpad).
If you get a non-NULL return value, just pick the first structure of the
GstCaps and use that (or fixate that if needed). The first structure(s)
in GstCaps are the preferred ones generally.

Cheers
 -Tim



More information about the gstreamer-devel mailing list