[gst-devel] audio/raw float caps format

Leif Johnson leif at ambient.2y.net
Sat Jun 28 16:55:04 CEST 2003

Hi Ronald -

On Fri, 27 Jun 2003, Ronald Bultje wrote:

> Hey Benjamin,
> On Tue, 2003-06-24 at 12:42, Benjamin Otte wrote:
> > And apart from that I hate using glib type names to describe formats.
> > Same goes for float audio, I'd prefer a width parameter to a
> > "gfloat"/"gdouble" distinction. And btw, if there are endianness issues
> > with floats, we need to do endianness there, too.
> Interesting point, but as you know, floats aren't as simple as ints. But
> I do agree that our current way of describing them is suboptimal, too. If
> someone has better ideas (maybe width *is* a good idea, don't know, I'm
> not an audio expert), please let me know. :). Now is the time for such
> changes.

While I'm no audio expert either, it sounds like a good call to replace the
float `layout' property with a `width' property, for two reasons : (a) int
audio has a `width' property as well, making this more of a common property
for audio, and (b) we could get rid of this dependency on gtypes, for what
it's worth. I also think having a float width of 32 or 64 also makes the
data understood more clearly as IEEE standard floats---that is what we're
using, right ? : )

Also, since floats and ints both have endianness issues, that seems to be a
common property. Finally, do we only want to support one- or two-channel
audio ? While that could be fairly limiting, it's likely that multichannel
GStreamer audio apps will want to do all their processing in multiple
one-channel pipelines anyway. (I've never heard of 16-channel interlaced
audio before ...)

The relevant part of the mimetypes file would then read thusly :

Preface - properties for all audio formats:
  'rate' = 8000 - 192000 (INT) <- sampling rate
  'width' = 8/16/24/32/64 (INT) <- memory bits per sample
  'channels' = 1 - 2 (INT) <- number of audio channels
  'endianness' = 1234/4321 (INT)

1 - Raw Audio (integer format)
  mimetype: audio/x-raw-int
  properties: 'depth' = X (INT) <- used bits per sample
              'signedness' = TRUE/FALSE (BOOLEAN)

2 - Raw Audio (floating point format)
  mimetype: audio/x-raw-float
  properties: 'intercept' = X (FLOAT)
              'slope' = X (FLOAT)

A last note : I noticed in the mimetypes file that 'width' and 'depth' are
in bits, while in the audioconvert plugin 'width' is counted in bytes, and
'depth' in bits. Is something wrong with here, is this just a handy
internal shortcut for the plugin, or am I missing something deeper ?


Leif Morgan Johnson : http://ambient.2y.net/leif/

More information about the gstreamer-devel mailing list