summaryrefslogtreecommitdiff
path: root/package/multimedia/gst-plugins-base/gst-plugins-base-0.10.35-tremor.patch
blob: fa8785bed41821e6c0a8cc09e5386dee8ff38107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
From 0088753651350de3060ece22c1be4153b6009515 Mon Sep 17 00:00:00 2001
From: Peter Korsgaard <jacmet@sunsite.dk>
Date: Wed, 25 Jan 2012 23:53:04 +0100
Subject: [PATCH] base: vorbisdeclib: support modern Tremor versions

Reported upstream as https://bugzilla.gnome.org/show_bug.cgi?id=668726

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 legacy _ogg_packet_wrapper code is only used for
Tremolo.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 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 ca00af9..e147591 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);
-- 
1.7.8.3