diff options
author | Peter Korsgaard <jacmet@sunsite.dk> | 2012-01-25 23:53:04 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-03-14 14:10:27 +0000 |
commit | 787e896bdeb6c67d13a918ec55d3826fa010fb90 (patch) | |
tree | f0e47f95675fdf55f28e4052cf36abdacfc0c6dd | |
parent | d13e1b49f6b690f8476fdca12a115f571f180171 (diff) | |
download | gstreamer-plugins-base-787e896bdeb6c67d13a918ec55d3826fa010fb90.tar.gz |
vorbisdec: support modern Tremor versions
Tremor changed to use standard libogg rather than its own incompatible
copy back in Aug 2010 (r17375), causing gst-plugin-base build to fail.
Tremolo so far unfortunately hasn't been updated. Restructure
vorbisdeclib.h so the int/float logic is seperate from the ogg handling,
and only use the legacy _ogg_packet_wrapper code for Tremolo.
https://bugzilla.gnome.org/show_bug.cgi?id=668726
-rw-r--r-- | ext/vorbis/gstvorbisdeclib.h | 77 |
1 files changed, 41 insertions, 36 deletions
diff --git a/ext/vorbis/gstvorbisdeclib.h b/ext/vorbis/gstvorbisdeclib.h index ca00af9db..e1475918a 100644 --- a/ext/vorbis/gstvorbisdeclib.h +++ b/ext/vorbis/gstvorbisdeclib.h @@ -29,11 +29,6 @@ #ifndef TREMOR -#include <vorbis/codec.h> - -typedef float vorbis_sample_t; -typedef ogg_packet ogg_packet_wrapper; - #define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to float audio" #define GST_VORBIS_DEC_SRC_CAPS \ @@ -47,6 +42,42 @@ typedef ogg_packet ogg_packet_wrapper; #define GST_VORBIS_DEC_GLIB_TYPE_NAME GstVorbisDec +#else /* TREMOR */ + +#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio" + +#define GST_VORBIS_DEC_SRC_CAPS \ + GST_STATIC_CAPS ("audio/x-raw-int, " \ + "rate = (int) [ 1, MAX ], " \ + "channels = (int) [ 1, 6 ], " \ + "endianness = (int) BYTE_ORDER, " \ + "width = (int) { 16, 32 }, " \ + "depth = (int) 16, " \ + "signed = (boolean) true") + +#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH (16) + +/* we need a different type name here */ +#define GST_VORBIS_DEC_GLIB_TYPE_NAME GstIVorbisDec + +/* and still have it compile */ +typedef struct _GstVorbisDec GstIVorbisDec; +typedef struct _GstVorbisDecClass GstIVorbisDecClass; + +#endif /* TREMOR */ + +#ifndef USE_TREMOLO + +#ifdef TREMOR + #include <tremor/ivorbiscodec.h> + typedef ogg_int32_t vorbis_sample_t; +#else + #include <vorbis/codec.h> + typedef float vorbis_sample_t; +#endif + +typedef ogg_packet ogg_packet_wrapper; + static inline guint8 * gst_ogg_packet_data (ogg_packet * p) { @@ -72,17 +103,11 @@ gst_ogg_packet_from_wrapper (ogg_packet_wrapper * packet) return packet; } -#else - -#ifdef USE_TREMOLO - #include <Tremolo/ivorbiscodec.h> - #include <Tremolo/codec_internal.h> - typedef ogg_int16_t vorbis_sample_t; -#else - #include <tremor/ivorbiscodec.h> - typedef ogg_int32_t vorbis_sample_t; -#endif +#else /* USE_TREMOLO */ +#include <Tremolo/ivorbiscodec.h> +#include <Tremolo/codec_internal.h> +typedef ogg_int16_t vorbis_sample_t; typedef struct _ogg_packet_wrapper ogg_packet_wrapper; struct _ogg_packet_wrapper { @@ -91,26 +116,6 @@ struct _ogg_packet_wrapper { ogg_buffer buf; }; -#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio" - -#define GST_VORBIS_DEC_SRC_CAPS \ - GST_STATIC_CAPS ("audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, 6 ], " \ - "endianness = (int) BYTE_ORDER, " \ - "width = (int) { 16, 32 }, " \ - "depth = (int) 16, " \ - "signed = (boolean) true") - -#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH (16) - -/* we need a different type name here */ -#define GST_VORBIS_DEC_GLIB_TYPE_NAME GstIVorbisDec - -/* and still have it compile */ -typedef struct _GstVorbisDec GstIVorbisDec; -typedef struct _GstVorbisDecClass GstIVorbisDecClass; - /* compensate minor variation */ #define vorbis_synthesis(a, b) vorbis_synthesis (a, b, 1) @@ -154,7 +159,7 @@ gst_ogg_packet_from_wrapper (ogg_packet_wrapper * packet) return &(packet->packet); } -#endif +#endif /* USE_TREMOLO */ typedef void (*CopySampleFunc)(vorbis_sample_t *out, vorbis_sample_t **in, guint samples, gint channels, gint width); |