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 2014-12-19 08:03:40.000000000 +0100 +++ comm-beta/mozilla/config/external/moz.build 2014-12-24 01:57:28.946111915 +0100 @@ -19,13 +19,13 @@ 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 CONFIG['MOZ_OPUS']: +if CONFIG['MOZ_OPUS'] and not CONFIG['MOZ_NATIVE_OGG']: external_dirs += ['media/libopus'] if CONFIG['MOZ_WEBM']: @@ -40,11 +40,12 @@ 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'] + external_dirs += [ 'media/kiss_fft', 'media/libcubeb', - 'media/libogg', - '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 2014-12-19 08:03:39.000000000 +0100 +++ comm-beta/mozilla/config/Makefile.in 2014-12-24 01:53:52.698468920 +0100 @@ -74,6 +74,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 2014-12-19 08:03:40.000000000 +0100 +++ comm-beta/mozilla/config/system-headers 2014-12-24 01:53:52.699468900 +0100 @@ -1332,6 +1332,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 2014-12-24 01:53:44.897626115 +0100 +++ comm-beta/mozilla/configure.in 2014-12-24 01:53:52.704468799 +0100 @@ -5169,6 +5169,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], @@ -5539,6 +5567,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 @@ -5549,8 +5587,28 @@ fi if test -n "$MOZ_OPUS"; then AC_DEFINE(MOZ_OPUS) + + 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 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 2014-12-19 08:04:14.000000000 +0100 +++ comm-beta/mozilla/layout/media/symbols.def.in 2014-12-24 01:53:52.705468779 +0100 @@ -66,6 +66,7 @@ vpx_mem_set_functions #endif #endif #ifdef MOZ_VORBIS +#ifndef MOZ_NATIVE_OGG ogg_page_bos ogg_page_granulepos ogg_page_serialno @@ -110,6 +111,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 @@ -140,6 +142,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 @@ -173,6 +176,7 @@ opus_encoder_ctl opus_encode opus_encode_float #endif +#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 2014-12-19 08:03:28.000000000 +0100 +++ comm-beta/mozilla/toolkit/library/moz.build 2014-12-24 01:53:52.705468779 +0100 @@ -236,6 +236,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 2014-12-19 08:03:31.000000000 +0100 +++ comm-beta/mozilla/xpcom/build/XPCOMInit.cpp 2014-12-24 01:53:52.706468759 +0100 @@ -652,11 +652,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.