fa8785bed41821e6c0a8cc09e5386dee8ff38107
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / gstreamer / gst-plugins-base / 0001-tremor.patch
1 From 0088753651350de3060ece22c1be4153b6009515 Mon Sep 17 00:00:00 2001
2 From: Peter Korsgaard <jacmet@sunsite.dk>
3 Date: Wed, 25 Jan 2012 23:53:04 +0100
4 Subject: [PATCH] base: vorbisdeclib: support modern Tremor versions
5
6 Reported upstream as https://bugzilla.gnome.org/show_bug.cgi?id=668726
7
8 Tremor changed to use standard libogg rather than its own incompatible
9 copy back in Aug 2010 (r17375), causing gst-plugin-base build to fail.
10
11 Tremolo so far unfortunately hasn't been updated. Restructure
12 vorbisdeclib.h so the legacy _ogg_packet_wrapper code is only used for
13 Tremolo.
14
15 Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
16 ---
17  ext/vorbis/gstvorbisdeclib.h |   77 ++++++++++++++++++++++-------------------
18  1 files changed, 41 insertions(+), 36 deletions(-)
19
20 diff --git a/ext/vorbis/gstvorbisdeclib.h b/ext/vorbis/gstvorbisdeclib.h
21 index ca00af9..e147591 100644
22 --- a/ext/vorbis/gstvorbisdeclib.h
23 +++ b/ext/vorbis/gstvorbisdeclib.h
24 @@ -29,11 +29,6 @@
25  
26  #ifndef TREMOR
27  
28 -#include <vorbis/codec.h>
29 -
30 -typedef float                          vorbis_sample_t;
31 -typedef ogg_packet                     ogg_packet_wrapper;
32 -
33  #define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to float audio"
34  
35  #define GST_VORBIS_DEC_SRC_CAPS \
36 @@ -47,6 +42,42 @@ typedef ogg_packet                     ogg_packet_wrapper;
37  
38  #define GST_VORBIS_DEC_GLIB_TYPE_NAME      GstVorbisDec
39  
40 +#else /* TREMOR */
41 +
42 +#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio"
43 +
44 +#define GST_VORBIS_DEC_SRC_CAPS \
45 +    GST_STATIC_CAPS ("audio/x-raw-int, "   \
46 +        "rate = (int) [ 1, MAX ], "        \
47 +        "channels = (int) [ 1, 6 ], "      \
48 +        "endianness = (int) BYTE_ORDER, "  \
49 +        "width = (int) { 16, 32 }, "       \
50 +        "depth = (int) 16, "               \
51 +        "signed = (boolean) true")
52 +
53 +#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH           (16)
54 +
55 +/* we need a different type name here */
56 +#define GST_VORBIS_DEC_GLIB_TYPE_NAME      GstIVorbisDec
57 +
58 +/* and still have it compile */
59 +typedef struct _GstVorbisDec               GstIVorbisDec;
60 +typedef struct _GstVorbisDecClass          GstIVorbisDecClass;
61 +
62 +#endif /* TREMOR */
63 +
64 +#ifndef USE_TREMOLO
65 +
66 +#ifdef TREMOR
67 + #include <tremor/ivorbiscodec.h>
68 + typedef ogg_int32_t                    vorbis_sample_t;
69 +#else
70 + #include <vorbis/codec.h>
71 + typedef float                          vorbis_sample_t;
72 +#endif
73 +
74 +typedef ogg_packet                     ogg_packet_wrapper;
75 +
76  static inline guint8 *
77  gst_ogg_packet_data (ogg_packet * p)
78  {
79 @@ -72,17 +103,11 @@ gst_ogg_packet_from_wrapper (ogg_packet_wrapper * packet)
80    return packet;
81  }
82  
83 -#else
84 -
85 -#ifdef USE_TREMOLO
86 -  #include <Tremolo/ivorbiscodec.h>
87 -  #include <Tremolo/codec_internal.h>
88 -  typedef ogg_int16_t                    vorbis_sample_t;
89 -#else
90 -  #include <tremor/ivorbiscodec.h>
91 -  typedef ogg_int32_t                    vorbis_sample_t;
92 -#endif
93 +#else /* USE_TREMOLO */
94  
95 +#include <Tremolo/ivorbiscodec.h>
96 +#include <Tremolo/codec_internal.h>
97 +typedef ogg_int16_t                    vorbis_sample_t;
98  typedef struct _ogg_packet_wrapper     ogg_packet_wrapper;
99  
100  struct _ogg_packet_wrapper {
101 @@ -91,26 +116,6 @@ struct _ogg_packet_wrapper {
102    ogg_buffer          buf;
103  };
104  
105 -#define GST_VORBIS_DEC_DESCRIPTION "decode raw vorbis streams to integer audio"
106 -
107 -#define GST_VORBIS_DEC_SRC_CAPS \
108 -    GST_STATIC_CAPS ("audio/x-raw-int, "   \
109 -        "rate = (int) [ 1, MAX ], "        \
110 -        "channels = (int) [ 1, 6 ], "      \
111 -        "endianness = (int) BYTE_ORDER, "  \
112 -        "width = (int) { 16, 32 }, "       \
113 -        "depth = (int) 16, "               \
114 -        "signed = (boolean) true")
115 -
116 -#define GST_VORBIS_DEC_DEFAULT_SAMPLE_WIDTH           (16)
117 -
118 -/* we need a different type name here */
119 -#define GST_VORBIS_DEC_GLIB_TYPE_NAME      GstIVorbisDec
120 -
121 -/* and still have it compile */
122 -typedef struct _GstVorbisDec               GstIVorbisDec;
123 -typedef struct _GstVorbisDecClass          GstIVorbisDecClass;
124 -
125  /* compensate minor variation */
126  #define vorbis_synthesis(a, b)             vorbis_synthesis (a, b, 1)
127  
128 @@ -154,7 +159,7 @@ gst_ogg_packet_from_wrapper (ogg_packet_wrapper * packet)
129    return &(packet->packet);
130  }
131  
132 -#endif
133 +#endif /* USE_TREMOLO */
134  
135  typedef void (*CopySampleFunc)(vorbis_sample_t *out, vorbis_sample_t **in,
136                             guint samples, gint channels, gint width);
137 -- 
138 1.7.8.3
139