[gst-devel] float caps, category, audioconvert changes

David Schleef ds at schleef.org
Sun Jul 20 13:10:27 CEST 2003

On Sun, Jul 20, 2003 at 05:51:55PM +0200, Benjamin Otte wrote:
> On 20 Jul 2003, Ronald Bultje wrote:
> > > GUINT32_TO_LE() and GUINT64_TO_LE().
> >
> > Do UINT functions work for FLOAT types, too? As far as I understand, it
> > will just cast it to a guint64 and return it as such, too.

Use it to swap the bytes in memory, not the values themselves.  Not
every sequence of bits is a valid [normalized] floating point number.

> It does the byteswapping when needed. But it's an ugly hack to include
> somewhere, so we should probably do 2 things:
> 1) Add GST_FLOAT/DOUBLE_TO_LE/BE somewhere and document why we use that
> ugly hack there.
> 2) File a bug against glib to make them include those macros in future
> versions. (done, it's #117901)

A GST_FLOAT/DOUBLE_TO_LE/BE macro will only work if it takes an
int32/int64 as the argument.  The byte-swapped float must not be
accessed as a float value, since it may be modified.


More information about the gstreamer-devel mailing list