diff -up comm-beta/mozilla/config/external/moz.build.system-ogg comm-beta/mozilla/config/external/moz.build --- comm-beta/mozilla/config/external/moz.build.system-ogg 2015-09-04 11:31:03.000000000 +0200 +++ comm-beta/mozilla/config/external/moz.build 2015-09-23 23:30:11.722860168 +0200 @@ -19,12 +19,15 @@ if CONFIG['MOZ_UPDATER']: # There's no "native brotli" yet, but probably in the future... external_dirs += ['modules/brotli'] -if CONFIG['MOZ_VORBIS']: +if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_OGG']: external_dirs += ['media/libvorbis'] if CONFIG['MOZ_TREMOR']: external_dirs += ['media/libtremor'] +if not CONFIG['MOZ_NATIVE_OGG']: + external_dirs += ['media/libopus'] + if CONFIG['MOZ_WEBM']: external_dirs += ['media/libnestegg'] @@ -37,6 +40,9 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ if not CONFIG['MOZ_NATIVE_PNG']: external_dirs += ['media/libpng'] +if not CONFIG['MOZ_NATIVE_OGG']: + external_dirs += ['media/libogg', 'media/libtheora'] + if CONFIG['CPU_ARCH'] == 'arm': external_dirs += ['media/openmax_dl'] @@ -49,9 +55,6 @@ if CONFIG['MOZ_WEBSPEECH_POCKETSPHINX']: external_dirs += [ 'media/kiss_fft', 'media/libcubeb', - 'media/libogg', - 'media/libopus', - 'media/libtheora', 'media/libspeex_resampler', 'media/libstagefright', 'media/libsoundtouch', diff -up comm-beta/mozilla/config/Makefile.in.system-ogg comm-beta/mozilla/config/Makefile.in --- comm-beta/mozilla/config/Makefile.in.system-ogg 2015-09-04 11:31:03.000000000 +0200 +++ comm-beta/mozilla/config/Makefile.in 2015-09-23 23:13:57.812809885 +0200 @@ -76,6 +76,7 @@ export:: $(export-preqs) -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \ -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ + -DMOZ_NATIVE_OGG=$(MOZ_NATIVE_OGG) \ -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers $(INSTALL) system_wrappers $(DIST) diff -up comm-beta/mozilla/config/system-headers.system-ogg comm-beta/mozilla/config/system-headers --- comm-beta/mozilla/config/system-headers.system-ogg 2015-09-04 11:31:03.000000000 +0200 +++ comm-beta/mozilla/config/system-headers 2015-09-23 23:13:57.897809074 +0200 @@ -1323,6 +1323,17 @@ ogg/os_types.h nestegg/nestegg.h cubeb/cubeb.h #endif +#if MOZ_NATIVE_OGG==1 +vorbis/codec.h +vorbis/vorbisenc.h +theora/theoradec.h +ogg/ogg.h +ogg/os_types.h +opus/opus_defines.h +opus/opus.h +opus/opus_multistream.h +opus/opus_types.h +#endif gst/gst.h gst/app/gstappsink.h gst/app/gstappsrc.h diff -up comm-beta/mozilla/configure.in.system-ogg comm-beta/mozilla/configure.in --- comm-beta/mozilla/configure.in.system-ogg 2015-09-23 23:13:56.444822948 +0200 +++ comm-beta/mozilla/configure.in 2015-09-23 23:13:57.929808768 +0200 @@ -5229,6 +5229,34 @@ fi AC_SUBST(MOZ_RAW) +dnl system ogg Support +dnl ======================================================== +MOZ_ARG_WITH_BOOL(system-ogg, +[ --with-system-ogg Use system ogg, vorbis, theora, and opus libraries (located with pkgconfig)], + MOZ_NATIVE_OGG=1) + +MOZ_OGG_CFLAGS= +MOZ_OGG_LIBS= +MOZ_VORBIS_CFLAGS= +MOZ_VORBIS_LIBS= +MOZ_THEORA_CFLAGS= +MOZ_THEORA_LIBS= +MOZ_OPUS_CFLAGS= +MOZ_OPUS_LIBS= + +if test -n "$MOZ_NATIVE_OGG"; then + dnl ============================ + dnl === ogg (version) check === + dnl ============================ + dnl Check to see if we have system ogg and theora packages. + PKG_CHECK_MODULES(OGG, ogg) + PKG_CHECK_MODULES(THEORA, theoradec) + MOZ_OGG_CFLAGS="$OGG_CFLAGS" + MOZ_OGG_LIBS="$OGG_LIBS" + MOZ_THEORA_CFLAGS="$THEORA_CFLAGS" + MOZ_THEORA_LIBS="$THEORA_LIBS" +fi + dnl Checks for __attribute__(aligned()) directive need by libogg AC_CACHE_CHECK([__attribute__ ((aligned ())) support], [ac_cv_c_attribute_aligned], @@ -5618,6 +5646,17 @@ fi if test -n "$MOZ_VORBIS"; then AC_DEFINE(MOZ_VORBIS) + + if test -n "$MOZ_NATIVE_OGG"; then + dnl ============================ + dnl === vorbis (version) check === + dnl ============================ + dnl Check to see if we have a system vorbis package. + PKG_CHECK_MODULES(VORBIS, vorbis) + PKG_CHECK_MODULES(VORBISENC, vorbisenc) + MOZ_VORBIS_CFLAGS="$VORBIS_CFLAGS $VORBISENC_CFLAGS" + MOZ_VORBIS_LIBS="$VORBIS_LIBS $VORBISENC_LIBS" + fi fi if test -n "$MOZ_TREMOR"; then @@ -5626,6 +5665,27 @@ if test -n "$MOZ_TREMOR"; then MOZ_WEBM_ENCODER= fi + +if test -n "$MOZ_NATIVE_OGG"; then + dnl ============================ + dnl === opus (version) check === + dnl ============================ + dnl Check to see if we have a system opus package. + PKG_CHECK_MODULES(OPUS, opus) + MOZ_OPUS_CFLAGS="$OPUS_CFLAGS" + MOZ_OPUS_LIBS="$OPUS_LIBS" +fi + +AC_SUBST(MOZ_NATIVE_OGG) +AC_SUBST_LIST(MOZ_OGG_CFLAGS) +AC_SUBST_LIST(MOZ_OGG_LIBS) +AC_SUBST_LIST(MOZ_VORBIS_CFLAGS) +AC_SUBST_LIST(MOZ_VORBIS_LIBS) +AC_SUBST_LIST(MOZ_THEORA_CFLAGS) +AC_SUBST_LIST(MOZ_THEORA_LIBS) +AC_SUBST_LIST(MOZ_OPUS_CFLAGS) +AC_SUBST_LIST(MOZ_OPUS_LIBS) + if test -n "$MOZ_WEBM_ENCODER"; then AC_DEFINE(MOZ_WEBM_ENCODER) fi diff -up comm-beta/mozilla/layout/media/symbols.def.in.system-ogg comm-beta/mozilla/layout/media/symbols.def.in --- comm-beta/mozilla/layout/media/symbols.def.in.system-ogg 2015-09-04 11:31:18.000000000 +0200 +++ comm-beta/mozilla/layout/media/symbols.def.in 2015-09-23 23:13:58.161806553 +0200 @@ -65,6 +65,7 @@ vpx_codec_encode #endif #endif #ifdef MOZ_VORBIS +#ifndef MOZ_NATIVE_OGG ogg_page_bos ogg_page_granulepos ogg_page_serialno @@ -109,6 +110,7 @@ vorbis_synthesis_pcmout vorbis_synthesis_read vorbis_synthesis_restart #endif +#endif moz_speex_resampler_init moz_speex_resampler_destroy moz_speex_resampler_process_float @@ -139,6 +141,7 @@ cubeb_stream_set_panning cubeb_stream_get_current_device cubeb_stream_device_destroy cubeb_stream_register_device_changed_callback +#ifndef MOZ_NATIVE_OGG th_comment_clear th_comment_init th_decode_alloc @@ -170,6 +173,7 @@ opus_encoder_destroy opus_encoder_ctl opus_encode opus_encode_float +#endif #ifndef MOZ_NATIVE_PNG MOZ_APNG_get_first_frame_is_hidden MOZ_APNG_get_next_frame_blend_op diff -up comm-beta/mozilla/toolkit/library/moz.build.system-ogg comm-beta/mozilla/toolkit/library/moz.build --- comm-beta/mozilla/toolkit/library/moz.build.system-ogg 2015-09-04 11:30:29.000000000 +0200 +++ comm-beta/mozilla/toolkit/library/moz.build 2015-09-23 23:13:58.423804051 +0200 @@ -226,6 +226,12 @@ if CONFIG['MOZ_NATIVE_LIBEVENT']: if CONFIG['MOZ_NATIVE_LIBVPX']: OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS'] +if CONFIG['MOZ_NATIVE_OGG']: + OS_LIBS += CONFIG['MOZ_OGG_LIBS'] + OS_LIBS += CONFIG['MOZ_VORBIS_LIBS'] + OS_LIBS += CONFIG['MOZ_THEORA_LIBS'] + OS_LIBS += CONFIG['MOZ_OPUS_LIBS'] + if not CONFIG['MOZ_TREE_PIXMAN']: OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] diff -up comm-beta/mozilla/xpcom/build/XPCOMInit.cpp.system-ogg comm-beta/mozilla/xpcom/build/XPCOMInit.cpp --- comm-beta/mozilla/xpcom/build/XPCOMInit.cpp.system-ogg 2015-09-04 11:30:33.000000000 +0200 +++ comm-beta/mozilla/xpcom/build/XPCOMInit.cpp 2015-09-23 23:13:58.578802571 +0200 @@ -665,11 +665,13 @@ NS_InitXPCOM2(nsIServiceManager** aResul // this oddness. mozilla::SetICUMemoryFunctions(); +#if 0 // Do the same for libogg. ogg_set_mem_functions(OggReporter::CountingMalloc, OggReporter::CountingCalloc, OggReporter::CountingRealloc, OggReporter::CountingFree); +#endif #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) // And for VPX.