1 From 787e896bdeb6c67d13a918ec55d3826fa010fb90 Mon Sep 17 00:00:00 2001
2 From: Peter Korsgaard <jacmet@sunsite.dk>
3 Date: Wed, 25 Jan 2012 22:53:04 +0000
4 Subject: vorbisdec: support modern Tremor versions
6 Tremor changed to use standard libogg rather than its own incompatible
7 copy back in Aug 2010 (r17375), causing gst-plugin-base build to fail.
9 Tremolo so far unfortunately hasn't been updated. Restructure
10 vorbisdeclib.h so the int/float logic is seperate from the ogg handling,
11 and only use the legacy _ogg_packet_wrapper code for Tremolo.
13 https://bugzilla.gnome.org/show_bug.cgi?id=668726
15 (limited to 'ext/vorbis/gstvorbisdeclib.h')
17 --- a/ext/vorbis/gstvorbisdeclib.h
18 +++ b/ext/vorbis/gstvorbisdeclib.h
23 -#include <vorbis/codec.h>
25 -typedef float vorbis_sample_t;
26 -typedef ogg_packet ogg_packet_wrapper;
28 #define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to float audio"
30 #define GST_VORBIS_DEC_SRC_CAPS \
31 @@ -47,6 +42,42 @@ typedef ogg_packet o
33 #define GST_VORBIS_DEC_GLIB_TYPE_NAME GstVorbisDec
37 +#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio"
39 +#define GST_VORBIS_DEC_SRC_CAPS \
40 + GST_STATIC_CAPS ("audio/x-raw-int, " \
41 + "rate = (int) [ 1, MAX ], " \
42 + "channels = (int) [ 1, 6 ], " \
43 + "endianness = (int) BYTE_ORDER, " \
44 + "width = (int) { 16, 32 }, " \
45 + "depth = (int) 16, " \
46 + "signed = (boolean) true")
48 +#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH (16)
50 +/* we need a different type name here */
51 +#define GST_VORBIS_DEC_GLIB_TYPE_NAME GstIVorbisDec
53 +/* and still have it compile */
54 +typedef struct _GstVorbisDec GstIVorbisDec;
55 +typedef struct _GstVorbisDecClass GstIVorbisDecClass;
62 + #include <tremor/ivorbiscodec.h>
63 + typedef ogg_int32_t vorbis_sample_t;
65 + #include <vorbis/codec.h>
66 + typedef float vorbis_sample_t;
69 +typedef ogg_packet ogg_packet_wrapper;
71 static inline guint8 *
72 gst_ogg_packet_data (ogg_packet * p)
74 @@ -72,17 +103,11 @@ gst_ogg_packet_from_wrapper (ogg_packet_
81 - #include <Tremolo/ivorbiscodec.h>
82 - #include <Tremolo/codec_internal.h>
83 - typedef ogg_int16_t vorbis_sample_t;
85 - #include <tremor/ivorbiscodec.h>
86 - typedef ogg_int32_t vorbis_sample_t;
88 +#else /* USE_TREMOLO */
90 +#include <Tremolo/ivorbiscodec.h>
91 +#include <Tremolo/codec_internal.h>
92 +typedef ogg_int16_t vorbis_sample_t;
93 typedef struct _ogg_packet_wrapper ogg_packet_wrapper;
95 struct _ogg_packet_wrapper {
96 @@ -91,26 +116,6 @@ struct _ogg_packet_wrapper {
100 -#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio"
102 -#define GST_VORBIS_DEC_SRC_CAPS \
103 - GST_STATIC_CAPS ("audio/x-raw-int, " \
104 - "rate = (int) [ 1, MAX ], " \
105 - "channels = (int) [ 1, 6 ], " \
106 - "endianness = (int) BYTE_ORDER, " \
107 - "width = (int) { 16, 32 }, " \
108 - "depth = (int) 16, " \
109 - "signed = (boolean) true")
111 -#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH (16)
113 -/* we need a different type name here */
114 -#define GST_VORBIS_DEC_GLIB_TYPE_NAME GstIVorbisDec
116 -/* and still have it compile */
117 -typedef struct _GstVorbisDec GstIVorbisDec;
118 -typedef struct _GstVorbisDecClass GstIVorbisDecClass;
120 /* compensate minor variation */
121 #define vorbis_synthesis(a, b) vorbis_synthesis (a, b, 1)
123 @@ -154,7 +159,7 @@ gst_ogg_packet_from_wrapper (ogg_packet_
124 return &(packet->packet);
128 +#endif /* USE_TREMOLO */
130 typedef void (*CopySampleFunc)(vorbis_sample_t *out, vorbis_sample_t **in,
131 guint samples, gint channels, gint width);