GstAudioSrc: Automatic format negotiation

Sebastian Dröge sebastian at centricular.com
Tue Aug 16 07:33:26 UTC 2016


On Sun, 2016-08-14 at 20:33 +0200, marcin at saepia.net wrote:
> Hello,
> 
> I would like to work on improving directsoundsrc and other windows
> drivers as now they are not too reliable.
> 
> For example, I have a semi-professional soundcard that can hang GSt
> when it is accessed via directsoundsrc.
> 
> I suspect most of the issues are due to format incompatibilities.
> 
> The thing I do not fully understand in the GStreamer architecture is
> that in GstAudioSrc, prepare virtual method receives a ring buffer
> spec that already contains information about desired sample format.
> It looks like a contradiction to "please the highest quality you
> support".
> 
> Does this mean that it is an application task to set caps, and check
> if starting playback hasn't failed, and retry with different caps?
> 
> If not, and such negotiation is done internally, what is the origin
> on caps passed to the prepare  virtual method and how can I achieve
> behaviour that automatically picks up the best possible quality?
> 
> Or maybe that is just not achievable with GstAudioSrc?

prepare() is getting the format, that's true. At that point you'll have
to follow that and configure the device accordingly.

Negotiation is happening before that already, by your source reporting
all supported caps (GstBaseSrc::get_caps()) and having them ordered by
preference. GstAudioSrc/GstBaseSrc will then in combination with the
downstream elements make sure that a suitable format is selected (you
can also override part of that, see e.g. GstBaseSrc::fixate() and
::negotiate()).

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160816/7ebc95d7/attachment.sig>


More information about the gstreamer-devel mailing list