[gst-devel] Audio format identifiers and portability

Thomas Nyberg thomas at codefactory.se
Tue Mar 13 23:00:59 CET 2001


On Tue, Mar 13, 2001 at 01:45:54PM -0800, Erik Walthinsen wrote:
> 
> So the question is, do we want to have an enum with standard types,
> potentially making yet another mess like soundcards.h, or do we want to
> use the properties system to describe things, such as:
> 
> depth: 8-32
> width: 8-32
> endian: 0,1
> signed: 0,1
> float: 0,1
>

The nice thing about enums are that they are easy to store internally and
to move around. The drawback with the above is that you get long lists
which are hard and takes a lot of time to go through. One possibility
would be to have 
enum {
     DEPTH_8 = 1 << 0,
     DEPTH_16 = 1 << 1,
     ...
}
and just format = DEPTH_8 | LITTLE_ENDIAN | SIGNED;
which makes use of a small datatype(int) to store the values, you
do not need lists or anything like that.

The drawback is that support for new and strange types are hard to
add - you would have to change a header-file and add it. Also,
only 32-different flags can be used with any ease.

There is always the compromise, functions to convert between
the two possibilities but that is just too much work. However,
it would be nice to have
gst_make_audio_format_nice_thingy_prop(DEPTH_8 | UNSIGNED) and it
filled the correct prop-lists in.

/Thomas

-- 
Thomas Nyberg                    thomas.nyberg at codefactory.se
CodeFactory AB                   http://www.codefactory.se/
Office: +46 (0)90 71 86 10       Cell: +46 (0)70 335 61 64





More information about the gstreamer-devel mailing list