From: Sebastian Dröge Date: Thu, 23 Oct 2008 07:11:23 +0000 (+0000) Subject: Move float endianness conversion macros to core. Second part of bug ##555196. X-Git-Tag: 1.19.3~511^2~10228 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d7ebf29d969b6895cc0455125c115b92aed9556;p=platform%2Fupstream%2Fgstreamer.git Move float endianness conversion macros to core. Second part of bug ##555196. Original commit message from CVS: * docs/libs/gst-plugins-base-libs-sections.txt: * gst-libs/gst/floatcast/floatcast.h: Move float endianness conversion macros to core. Second part of bug ##555196. --- diff --git a/ChangeLog b/ChangeLog index 0da2e38..6d319b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-10-23 Sebastian Dröge + + * docs/libs/gst-plugins-base-libs-sections.txt: + * gst-libs/gst/floatcast/floatcast.h: + Move float endianness conversion macros to core. Second part of + bug ##555196. + 2008-10-22 Stefan Kost * sys/ximage/ximagesink.h: diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 4a08e9f..834dc1e 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -298,14 +298,6 @@ gst_fft_f64_free
gstfloatcast gst/floatcast/floatcast.h -GDOUBLE_FROM_BE -GDOUBLE_FROM_LE -GDOUBLE_TO_BE -GDOUBLE_TO_LE -GFLOAT_FROM_BE -GFLOAT_FROM_LE -GFLOAT_TO_BE -GFLOAT_TO_LE gst_cast_double gst_cast_float
diff --git a/gst-libs/gst/floatcast/floatcast.h b/gst-libs/gst/floatcast/floatcast.h index a05a6fc..1db21b7 100644 --- a/gst-libs/gst/floatcast/floatcast.h +++ b/gst-libs/gst/floatcast/floatcast.h @@ -97,128 +97,6 @@ G_BEGIN_DECLS #endif -/* FIXME 0.11: don't use GLib namespace (GDOUBLE_SWAP_LE_BE, GFLOAT_TO_LE, - * GFLOAT_TO_BE, GDOUBLE_TO_LE, GDOUBLE_TO_BE) */ - -/** - * GFLOAT_SWAP_LE_BE: - * @in: input value - * - * Swap byte order of a 32-bit floating point value (float). - */ -inline static gfloat -GFLOAT_SWAP_LE_BE(gfloat in) -{ - union - { - guint32 i; - gfloat f; - } u; - - u.f = in; - u.i = GUINT32_SWAP_LE_BE (u.i); - return u.f; -} - -/** - * GDOUBLE_SWAP_LE_BE: - * @in: input value - * - * Swap byte order of a 64-bit floating point value (double). - */ -inline static gdouble -GDOUBLE_SWAP_LE_BE(gdouble in) -{ - union - { - guint64 i; - gdouble d; - } u; - - u.d = in; - u.i = GUINT64_SWAP_LE_BE (u.i); - return u.d; -} - -/** - * GDOUBLE_TO_LE: - * @val: value - * - * Convert 64-bit floating point value (double) from native byte order into - * little endian byte order. - */ -/** - * GDOUBLE_TO_BE: - * @val: value - * - * Convert 64-bit floating point value (double) from native byte order into - * big endian byte order. - */ -/** - * GDOUBLE_FROM_LE: - * @val: value - * - * Convert 64-bit floating point value (double) from little endian byte order - * into native byte order. - */ -/** - * GDOUBLE_FROM_BE: - * @val: value - * - * Convert 64-bit floating point value (double) from big endian byte order - * into native byte order. - */ - -/** - * GFLOAT_TO_LE: - * @val: value - * - * Convert 32-bit floating point value (float) from native byte order into - * little endian byte order. - */ -/** - * GFLOAT_TO_BE: - * @val: value - * - * Convert 32-bit floating point value (float) from native byte order into - * big endian byte order. - */ -/** - * GFLOAT_FROM_LE: - * @val: value - * - * Convert 32-bit floating point value (float) from little endian byte order - * into native byte order. - */ -/** - * GFLOAT_FROM_BE: - * @val: value - * - * Convert 32-bit floating point value (float) from big endian byte order - * into native byte order. - */ - -#if G_BYTE_ORDER == G_LITTLE_ENDIAN -#define GFLOAT_TO_LE(val) ((gfloat) (val)) -#define GFLOAT_TO_BE(val) (GFLOAT_SWAP_LE_BE (val)) -#define GDOUBLE_TO_LE(val) ((gdouble) (val)) -#define GDOUBLE_TO_BE(val) (GDOUBLE_SWAP_LE_BE (val)) - -#elif G_BYTE_ORDER == G_BIG_ENDIAN -#define GFLOAT_TO_LE(val) (GFLOAT_SWAP_LE_BE (val)) -#define GFLOAT_TO_BE(val) ((gfloat) (val)) -#define GDOUBLE_TO_LE(val) (GDOUBLE_SWAP_LE_BE (val)) -#define GDOUBLE_TO_BE(val) ((gdouble) (val)) - -#else /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */ -#error unknown ENDIAN type -#endif /* !G_LITTLE_ENDIAN && !G_BIG_ENDIAN */ - -#define GFLOAT_FROM_LE(val) (GFLOAT_TO_LE (val)) -#define GFLOAT_FROM_BE(val) (GFLOAT_TO_BE (val)) -#define GDOUBLE_FROM_LE(val) (GDOUBLE_TO_LE (val)) -#define GDOUBLE_FROM_BE(val) (GDOUBLE_TO_BE (val)) - G_END_DECLS #endif /* __FLOATCAST_H__ */