summaryrefslogtreecommitdiff
path: root/www/firefox/files/patch-z-bug517422
blob: d44a30f7048e0a8e9dc3578cf92a9153188a6478 (plain) (blame)
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
# Allow more config/external/ libs built against system-wide version.

diff --git config/Makefile.in config/Makefile.in
index 5383399..0410004 100644
--- config/Makefile.in
+++ config/Makefile.in
@@ -79,6 +79,13 @@ export:: $(export-preqs)
 		-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
 		-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
 		-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
+		-DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \
+		-DMOZ_NATIVE_THEORA=$(MOZ_NATIVE_THEORA) \
+		-DMOZ_NATIVE_VORBIS=$(MOZ_NATIVE_VORBIS) \
+		-DMOZ_NATIVE_TREMOR=$(MOZ_NATIVE_TREMOR) \
+		-DMOZ_NATIVE_OPUS=$(MOZ_NATIVE_OPUS) \
+		-DMOZ_NATIVE_SPEEX=$(MOZ_NATIVE_SPEEX) \
+		-DMOZ_NATIVE_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \
 		$(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
 	$(INSTALL) system_wrappers $(DIST)
 
diff --git config/external/moz.build config/external/moz.build
index f67c5c7..eb909ce 100644
--- config/external/moz.build
+++ config/external/moz.build
@@ -15,13 +15,13 @@ if CONFIG['MOZ_UPDATER']:
     if not CONFIG['MOZ_NATIVE_BZ2']:
         external_dirs += ['modules/libbz2']
 
-if CONFIG['MOZ_VORBIS']:
+if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']:
     external_dirs += ['media/libvorbis']
 
-if CONFIG['MOZ_TREMOR']:
+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']:
     external_dirs += ['media/libtremor']
 
-if CONFIG['MOZ_OPUS']:
+if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OPUS']:
     external_dirs += ['media/libopus']
 
 if CONFIG['MOZ_WEBM']:
@@ -34,16 +34,23 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ
     external_dirs += ['media/libvpx']
 
 if CONFIG['MOZ_OGG']:
-    external_dirs += ['media/libogg', 'media/libtheora']
+    if not CONFIG['MOZ_NATIVE_OGG']:
+        external_dirs += ['media/libogg']
+    if not CONFIG['MOZ_NATIVE_THEORA']:
+        external_dirs += ['media/libtheora']
 
 if not CONFIG['MOZ_NATIVE_PNG']:
     external_dirs += ['media/libpng']
 
+if not CONFIG['MOZ_NATIVE_SPEEX']:
+    external_dirs += ['media/libspeex_resampler']
+
+if not CONFIG['MOZ_NATIVE_SOUNDTOUCH']:
+    external_dirs += ['media/libsoundtouch']
+
 external_dirs += [
     'media/kiss_fft',
     'media/libcubeb',
-    'media/libspeex_resampler',
-    'media/libsoundtouch',
 ]
 
 PARALLEL_DIRS += ['../../' + i for i in external_dirs]
diff --git config/system-headers config/system-headers
index bef567c..9807c29 100644
--- config/system-headers
+++ config/system-headers
@@ -1050,8 +1050,6 @@ X11/Xutil.h
 xpt_struct.h
 xpt_xdr.h
 zmouse.h
-speex/speex_resampler.h
-soundtouch/SoundTouch.h
 #if MOZ_NATIVE_PNG==1
 png.h
 #endif
@@ -1119,6 +1117,8 @@ ogg/ogg.h
 ogg/os_types.h
 nestegg/nestegg.h
 cubeb/cubeb.h
+speex/speex_resampler.h
+soundtouch/SoundTouch.h
 #endif
 gst/gst.h
 gst/app/gstappsink.h
@@ -1155,3 +1155,29 @@ graphite2/Segment.h
 harfbuzz/hb-ot.h
 harfbuzz/hb.h
 #endif
+#if MOZ_NATIVE_OGG==1
+ogg/ogg.h
+ogg/os_types.h
+#endif
+#if MOZ_NATIVE_THEORA==1
+theora/theoradec.h
+#endif
+#if MOZ_NATIVE_VORBIS==1
+vorbis/codec.h
+vorbis/vorbisenc.h
+#endif
+#if MOZ_NATIVE_TREMOR==1
+tremor/ivorbiscodec.h
+#endif
+#if MOZ_NATIVE_OPUS==1
+opus.h
+opus_multistream.h
+opus/opus.h
+opus/opus_multistream.h
+#endif
+#if MOZ_NATIVE_SPEEX==1
+speex/speex_resampler.h
+#endif
+#if MOZ_NATIVE_SOUNDTOUCH==1
+soundtouch/SoundTouch.h
+#endif
diff --git configure.in configure.in
index 87db361..7947626 100644
--- configure.in
+++ configure.in
@@ -5211,6 +5211,57 @@ if test "${ac_cv_c_attribute_aligned}" != "0"; then
 fi
 
 dnl ========================================================
+dnl Check for libogg
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-ogg,
+[  --with-system-ogg       Use system libogg (located with pkgconfig)],
+MOZ_NATIVE_OGG=1,
+MOZ_NATIVE_OGG=)
+
+if test -n "$MOZ_NATIVE_OGG"; then
+    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.2.1)
+fi
+
+AC_SUBST(MOZ_NATIVE_OGG)
+AC_SUBST(MOZ_OGG_CFLAGS)
+AC_SUBST(MOZ_OGG_LIBS)
+
+dnl ========================================================
+dnl Check for libvorbis
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-vorbis,
+[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
+MOZ_NATIVE_VORBIS=1,
+MOZ_NATIVE_VORBIS=)
+
+if test -n "$MOZ_NATIVE_VORBIS"; then
+    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.4)
+fi
+
+AC_SUBST(MOZ_NATIVE_VORBIS)
+AC_SUBST(MOZ_VORBIS_CFLAGS)
+AC_SUBST(MOZ_VORBIS_LIBS)
+
+dnl ========================================================
+dnl Check for integer-only libvorbis aka tremor
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-tremor,
+[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
+MOZ_NATIVE_TREMOR=1,
+MOZ_NATIVE_TREMOR=)
+
+if test -n "$MOZ_NATIVE_TREMOR"; then
+    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
+fi
+
+AC_SUBST(MOZ_NATIVE_TREMOR)
+AC_SUBST(MOZ_TREMOR_CFLAGS)
+AC_SUBST(MOZ_TREMOR_LIBS)
+
+dnl ========================================================
 dnl = Disable Opus audio codec support
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(opus,
@@ -5219,6 +5274,76 @@ MOZ_ARG_DISABLE_BOOL(opus,
     MOZ_OPUS=1)
 
 dnl ========================================================
+dnl Check for libopus
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-opus,
+[  --with-system-opus      Use system libopus (located with pkgconfig)],
+MOZ_NATIVE_OPUS=1,
+MOZ_NATIVE_OPUS=)
+
+if test -n "$MOZ_NATIVE_OPUS"; then
+    PKG_CHECK_MODULES(MOZ_OPUS, opus >= 1.1)
+else
+    MOZ_OPUS_CFLAGS='-I$(topsrcdir)/media/libopus/include'
+fi
+
+AC_SUBST(MOZ_NATIVE_OPUS)
+AC_SUBST(MOZ_OPUS_CFLAGS)
+AC_SUBST(MOZ_OPUS_LIBS)
+
+dnl ========================================================
+dnl Check for libtheora
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-theora,
+[  --with-system-theora    Use system libtheora (located with pkgconfig)],
+MOZ_NATIVE_THEORA=1,
+MOZ_NATIVE_THEORA=)
+
+if test -n "$MOZ_NATIVE_THEORA"; then
+    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
+fi
+
+AC_SUBST(MOZ_NATIVE_THEORA)
+AC_SUBST(MOZ_THEORA_CFLAGS)
+AC_SUBST(MOZ_THEORA_LIBS)
+
+dnl ========================================================
+dnl Check for libspeex resampler
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-speex,
+[  --with-system-speex     Use system libspeex (located with pkgconfig)],
+MOZ_NATIVE_SPEEX=1,
+MOZ_NATIVE_SPEEX=)
+
+if test -n "$MOZ_NATIVE_SPEEX"; then
+    PKG_CHECK_MODULES(MOZ_SPEEX, speexdsp >= 1.2)
+fi
+
+AC_SUBST(MOZ_NATIVE_SPEEX)
+AC_SUBST(MOZ_SPEEX_CFLAGS)
+AC_SUBST(MOZ_SPEEX_LIBS)
+
+dnl ========================================================
+dnl Check for libsoundtouch
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-soundtouch,
+[  --with-system-soundtouch Use system libsoundtouch (located with pkgconfig)],
+MOZ_NATIVE_SOUNDTOUCH=1,
+MOZ_NATIVE_SOUNDTOUCH=)
+
+if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then
+    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.7.0)
+fi
+
+AC_SUBST(MOZ_NATIVE_SOUNDTOUCH)
+AC_SUBST(MOZ_SOUNDTOUCH_CFLAGS)
+AC_SUBST(MOZ_SOUNDTOUCH_LIBS)
+
+dnl ========================================================
 dnl = Disable VP8 decoder support
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(webm,
diff --git content/media/AudioStream.cpp content/media/AudioStream.cpp
index 88c8aa6..6b03288 100644
--- content/media/AudioStream.cpp
+++ content/media/AudioStream.cpp
@@ -13,7 +13,6 @@
 #include "mozilla/Mutex.h"
 #include <algorithm>
 #include "mozilla/Preferences.h"
-#include "soundtouch/SoundTouch.h"
 #include "Latency.h"
 
 namespace mozilla {
diff --git content/media/AudioStream.h content/media/AudioStream.h
index 085676d..00c54fb 100644
--- content/media/AudioStream.h
+++ content/media/AudioStream.h
@@ -15,6 +15,7 @@
 #include "mozilla/StaticMutex.h"
 
 #include "cubeb/cubeb.h"
+#include "soundtouch/SoundTouch.h"
 
 template <>
 class nsAutoRefTraits<cubeb_stream> : public nsPointerRefTraits<cubeb_stream>
diff --git content/media/Makefile.in content/media/Makefile.in
index fd34449..c6c42c8 100644
--- content/media/Makefile.in
+++ content/media/Makefile.in
@@ -6,3 +6,31 @@ include $(topsrcdir)/config/rules.mk
 
 CFLAGS   += $(GSTREAMER_CFLAGS)
 CXXFLAGS += $(GSTREAMER_CFLAGS)
+
+ifdef MOZ_NATIVE_OGG
+CXXFLAGS += $(MOZ_OGG_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_THEORA
+CXXFLAGS += $(MOZ_THEORA_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_VORBIS
+CXXFLAGS += $(MOZ_VORBIS_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_TREMOR
+CXXFLAGS += $(MOZ_TREMOR_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_OPUS
+CXXFLAGS += $(MOZ_OPUS_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_SPEEX
+CXXFLAGS += $(MOZ_SPEEX_CFLAGS)
+endif
+
+ifdef MOZ_NATIVE_SOUNDTOUCH
+CXXFLAGS += $(MOZ_SOUNDTOUCH_CFLAGS)
+endif
diff --git media/libcubeb/src/Makefile.in media/libcubeb/src/Makefile.in
index 4c14494..1cb98e2 100644
--- media/libcubeb/src/Makefile.in
+++ media/libcubeb/src/Makefile.in
@@ -9,3 +9,7 @@ CFLAGS += \
         $(MOZ_ALSA_CFLAGS) \
         $(MOZ_PULSEAUDIO_CFLAGS) \
         $(NULL)
+
+ifdef MOZ_NATIVE_SPEEX
+CFLAGS += $(MOZ_SPEEX_CFLAGS)
+endif
diff --git media/libtheora/Makefile.in media/libtheora/Makefile.in
new file mode 100644
index 0000000..1f02dc0
--- /dev/null
+++ media/libtheora/Makefile.in
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_OGG
+CFLAGS += $(MOZ_OGG_CFLAGS)
+endif
diff --git media/libtremor/Makefile.in media/libtremor/Makefile.in
new file mode 100644
index 0000000..1f02dc0
--- /dev/null
+++ media/libtremor/Makefile.in
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_OGG
+CFLAGS += $(MOZ_OGG_CFLAGS)
+endif
diff --git media/libvorbis/Makefile.in media/libvorbis/Makefile.in
new file mode 100644
index 0000000..1f02dc0
--- /dev/null
+++ media/libvorbis/Makefile.in
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_OGG
+CFLAGS += $(MOZ_OGG_CFLAGS)
+endif
diff --git media/webrtc/signaling/test/Makefile.in media/webrtc/signaling/test/Makefile.in
index bbc971c..6ed7e41 100644
--- media/webrtc/signaling/test/Makefile.in
+++ media/webrtc/signaling/test/Makefile.in
@@ -48,6 +48,12 @@ LIBS += \
   $(NULL)
 endif
 
+ifdef MOZ_NATIVE_OPUS
+LIBS += \
+  $(MOZ_OPUS_LIBS) \
+  $(NULL)
+endif
+
 ifdef MOZ_NATIVE_LIBVPX
 LIBS += \
   $(MOZ_LIBVPX_LIBS) \
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
index 00e77e7..55f48ab 100644
--- media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
@@ -14,9 +14,9 @@
       'conditions': [
         ['build_with_mozilla==1', {
           # Mozilla provides its own build of the opus library.
-          'include_dirs': [
-            '/media/libopus/include',
-           ]
+          'cflags_mozilla': [
+            '$(MOZ_OPUS_CFLAGS)',
+          ],
         }, {
           'dependencies': [
             '<(DEPTH)/third_party/opus/opus.gyp:opus'
diff --git toolkit/library/Makefile.in toolkit/library/Makefile.in
index d42137a..695e75a8 100644
--- toolkit/library/Makefile.in
+++ toolkit/library/Makefile.in
@@ -77,6 +77,34 @@ ifdef MOZ_NATIVE_HUNSPELL
 EXTRA_DSO_LDOPTS += $(MOZ_HUNSPELL_LIBS)
 endif
 
+ifdef MOZ_NATIVE_OGG
+EXTRA_DSO_LDOPTS += $(MOZ_OGG_LIBS)
+endif
+
+ifdef MOZ_NATIVE_THEORA
+EXTRA_DSO_LDOPTS += $(MOZ_THEORA_LIBS)
+endif
+
+ifdef MOZ_NATIVE_VORBIS
+EXTRA_DSO_LDOPTS += $(MOZ_VORBIS_LIBS)
+endif
+
+ifdef MOZ_NATIVE_TREMOR
+EXTRA_DSO_LDOPTS += $(MOZ_TREMOR_LIBS)
+endif
+
+ifdef MOZ_NATIVE_OPUS
+EXTRA_DSO_LDOPTS += $(MOZ_OPUS_LIBS)
+endif
+
+ifdef MOZ_NATIVE_SPEEX
+EXTRA_DSO_LDOPTS += $(MOZ_SPEEX_LIBS)
+endif
+
+ifdef MOZ_NATIVE_SOUNDTOUCH
+EXTRA_DSO_LDOPTS += $(MOZ_SOUNDTOUCH_LIBS)
+endif
+
 ifdef MOZ_NATIVE_LIBEVENT
 EXTRA_DSO_LDOPTS += $(MOZ_LIBEVENT_LIBS)
 endif