GstAudioDecoder feature proposal for 1.0

Tim-Philipp Müller t.i.m at zen.co.uk
Fri Jul 6 13:57:18 PDT 2012


On Fri, 2012-07-06 at 22:23 +0200, dv wrote:

Hi "C.R.",

> The problem is that I cannot find out what downstream needs. In this 
> case, I could not determine that a 32bit integer format is the best 
> choice. GstAudioDecoder's setformat call informs me about incoming (that 
> is, upstream) caps, but nothing informs me about downstream. It seems to 
> be a limitation of GstAudioDecoder.
> 
> If so, I suggest to extend GstAudioDecoder in 0.11/1.0 to also inform 
> about downstream caps.

When set_format gets called with the input caps, or you get your first
handle_frame call, you could do a gst_pad_get_allowed_caps() on the
decoder's source pad to find out what downstream supports (compatible
with your output caps as per the pad template). The rule is generally
that the preferred format(s) should be listed first if the GstCaps have
multiple structures or contain lists with multiple allowed values.

It's up to you to decide what you want to output then. You could have a
look at e.g. a52dec to see how it tries to figure out whether to downmix
multichannel audio to stereo itself or not.

Cheers
 -Tim



More information about the gstreamer-devel mailing list