Index: head/mail/thunderbird/Makefile =================================================================== --- head/mail/thunderbird/Makefile (revision 436666) +++ head/mail/thunderbird/Makefile (revision 436667) @@ -1,91 +1,88 @@ # Created by: Joe Marcus Clarke # $FreeBSD$ PORTNAME= thunderbird -DISTVERSION= 45.8.0 -PORTREVISION= 1 +DISTVERSION= 52.0 CATEGORIES= mail news net-im ipv6 MASTER_SITES= MOZILLA/${PORTNAME}/releases/${DISTVERSION}/source \ - MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build1/source + MOZILLA/${PORTNAME}/candidates/${DISTVERSION}-candidates/build3/source DISTFILES= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX} EXTRACT_ONLY= ${PORTNAME}-${DISTVERSION}.source${EXTRACT_SUFX} MAINTAINER= gecko@FreeBSD.org COMMENT= Mozilla Thunderbird is standalone mail and news that stands above -BUILD_DEPENDS= nspr>=4.12:devel/nspr \ - nss>=3.21.3:security/nss \ +BUILD_DEPENDS= nspr>=4.13.1:devel/nspr \ + nss>=3.28.3:security/nss \ libevent>=2.0.21_2:devel/libevent \ - soundtouch>=1.9.0:audio/soundtouch \ - harfbuzz>=1.1.0:print/harfbuzz \ - graphite2>=1.3.7:graphics/graphite2 \ - png>=1.6.19:graphics/png \ + harfbuzz>=1.4.1:print/harfbuzz \ + graphite2>=1.3.8:graphics/graphite2 \ + png>=1.6.25:graphics/png \ libvorbis>=1.3.5,3:audio/libvorbis \ libvpx>=1.5.0:multimedia/libvpx \ - sqlite3>=3.9.1:databases/sqlite3 \ + sqlite3>=3.17.0:databases/sqlite3 \ ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3 \ v4l_compat>0:multimedia/v4l_compat \ autoconf-2.13:devel/autoconf213 \ yasm:devel/yasm \ zip:archivers/zip +# soundtouch>=1.9.0:audio/soundtouch \ LIB_DEPENDS= libv4l2.so:multimedia/libv4l SSP_UNSAFE= yes USE_GECKO= gecko -USE_MOZILLA= # empty +USE_MOZILLA= -soundtouch USE_GL= gl USES= tar:xz -MOZ_OPTIONS= --program-transform-name='s/thunderbird/${MOZILLA}/' \ - --enable-single-profile --disable-profilesharing \ - --enable-application=mail --enable-official-branding +MOZ_OPTIONS= --enable-application=mail --enable-official-branding MOZ_MK_OPTIONS= MOZ_THUNDERBIRD=1 MAIL_PKG_SHARED=1 MOZ_EXPORT= MOZ_THUNDERBIRD=1 MAIL_PKG_SHARED=1 MOZ_PKGCONFIG_FILES= PORTNAME_ICON= ${MOZILLA}.png PORTNAME_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default48.png SYSTEM_PREFS= ${FAKEDIR}/lib/${PORTNAME}/defaults/pref/${PORTNAME}.js MOZ_PIS_SCRIPTS=moz_pis_S50cleanhome OPTIONS_DEFINE= LIGHTNING RUST OPTIONS_SINGLE= TOOLKIT OPTIONS_SINGLE_TOOLKIT= GTK2 GTK3 -OPTIONS_DEFAULT=BUNDLED_CAIRO CANBERRA GTK2 LIGHTNING +OPTIONS_DEFAULT=BUNDLED_CAIRO CANBERRA GTK3 LIGHTNING .include "${.CURDIR}/../../www/firefox/Makefile.options" .include WRKSRC:= ${WRKDIR}/${PORTNAME}-${DISTVERSION} MOZSRC:= ${WRKSRC}/mozilla .if ${PORT_OPTIONS:MLIGHTNING} MOZ_OPTIONS+= --enable-calendar .else MOZ_OPTIONS+= --disable-calendar .endif post-extract: @${SED} -e 's|@PORTNAME_ICON@|${PORTNAME_ICON}|;s|@MOZILLA@|${MOZILLA}|' \ <${FILESDIR}/thunderbird.desktop.in >${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/mail/app/nsMailApp.cpp pre-configure: (cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${MOZSRC} && ${LOCALBASE}/bin/autoconf-2.13) (cd ${MOZSRC}/js/src/ && ${LOCALBASE}/bin/autoconf-2.13) port-pre-install: ${MKDIR} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/defaults post-install: ${INSTALL_DATA} ${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop ${STAGEDIR}${PREFIX}/share/applications ${LN} -sf ${PORTNAME_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME_ICON} .include Index: head/mail/thunderbird/distinfo =================================================================== --- head/mail/thunderbird/distinfo (revision 436666) +++ head/mail/thunderbird/distinfo (revision 436667) @@ -1,3 +1,3 @@ -TIMESTAMP = 1488747365 -SHA256 (thunderbird-45.8.0.source.tar.xz) = 743cbf4856ad460a791f6b17bff175053fccec2af1edd8e8295ac6fda2634c28 -SIZE (thunderbird-45.8.0.source.tar.xz) = 201199348 +TIMESTAMP = 1490115800 +SHA256 (thunderbird-52.0.source.tar.xz) = 9e18561eede364e3a182828c502595433052d48632f3e4f174e7310f15a56eb9 +SIZE (thunderbird-52.0.source.tar.xz) = 228381452 Index: head/mail/thunderbird/files/patch-bug1130155 =================================================================== --- head/mail/thunderbird/files/patch-bug1130155 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1130155 (nonexistent) @@ -1,179 +0,0 @@ -commit eab3e3a -Author: Mikhail Teterin -Date: Tue Dec 16 19:34:02 2014 -0800 - - Bug 1130155 - Avoid assert failures when consuming only part of buffer. ---- - media/libcubeb/src/cubeb_alsa.c | 112 ++++++++++++++++++++++++++++++---------- - 1 file changed, 85 insertions(+), 27 deletions(-) - -diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c -index 9bbc129..e72944a 100644 ---- mozilla/media/libcubeb/src/cubeb_alsa.c -+++ mozilla/media/libcubeb/src/cubeb_alsa.c -@@ -14,6 +14,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - #include "cubeb/cubeb.h" -@@ -45,6 +47,7 @@ MAKE_TYPEDEF(snd_pcm_avail_update); - MAKE_TYPEDEF(snd_pcm_close); - MAKE_TYPEDEF(snd_pcm_delay); - MAKE_TYPEDEF(snd_pcm_drain); -+MAKE_TYPEDEF(snd_pcm_forward); - MAKE_TYPEDEF(snd_pcm_frames_to_bytes); - MAKE_TYPEDEF(snd_pcm_get_params); - /* snd_pcm_hw_params_alloca is actually a macro */ -@@ -305,32 +308,35 @@ alsa_refill_stream(cubeb_stream * stm) - long got; - void * p; - int draining; -+ unsigned pipefailures, againfailures; - - draining = 0; - - pthread_mutex_lock(&stm->mutex); - -- r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents); -- if (r < 0 || revents != POLLOUT) { -- /* This should be a stream error; it makes no sense for poll(2) to wake -- for this stream and then have the stream report that it's not ready. -- Unfortunately, this does happen, so just bail out and try again. */ -- pthread_mutex_unlock(&stm->mutex); -- return RUNNING; -- } -+ for (pipefailures = 0;;) { -+ r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents); -+ if (r < 0 || revents != POLLOUT || -+ (avail = WRAP(snd_pcm_avail_update)(stm->pcm)) == 0) { -+ /* This should be a stream error; it makes no sense for poll(2) to wake -+ for this stream and then have the stream report that it's not ready. -+ Unfortunately, this does happen, so just bail out and try again. */ -+ pthread_mutex_unlock(&stm->mutex); -+ return RUNNING; -+ } - -- avail = WRAP(snd_pcm_avail_update)(stm->pcm); -- if (avail == -EPIPE) { -+ if (avail > 0) -+ break; -+ if (pipefailures++ > 11) { -+ fprintf(stderr, "%s: repeated failures from snd_pcm_avail_update, " -+ "giving up\n", __func__); -+ pthread_mutex_unlock(&stm->mutex); -+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ return ERROR; -+ } - WRAP(snd_pcm_recover)(stm->pcm, avail, 1); -- avail = WRAP(snd_pcm_avail_update)(stm->pcm); -- } -- -- /* Failed to recover from an xrun, this stream must be broken. */ -- if (avail < 0) { -- pthread_mutex_unlock(&stm->mutex); -- stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -- return ERROR; - } -+ pipefailures = againfailures = 0; - - /* This should never happen. */ - if ((unsigned int) avail > stm->buffer_size) { -@@ -359,10 +365,11 @@ alsa_refill_stream(cubeb_stream * stm) - if (got < 0) { - pthread_mutex_unlock(&stm->mutex); - stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ free(p); - return ERROR; - } - if (got > 0) { -- snd_pcm_sframes_t wrote; -+ snd_pcm_sframes_t wrote, towrite = got; - - if (stm->params.format == CUBEB_SAMPLE_FLOAT32NE) { - float * b = (float *) p; -@@ -375,14 +382,62 @@ alsa_refill_stream(cubeb_stream * stm) - b[i] *= stm->volume; - } - } -- wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got); -- if (wrote == -EPIPE) { -- WRAP(snd_pcm_recover)(stm->pcm, wrote, 1); -- wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got); -+ for (;;) { -+ wrote = WRAP(snd_pcm_writei)(stm->pcm, p, -+ towrite > avail ? avail : towrite); -+ switch(wrote) { -+ case -EPIPE: -+ if (pipefailures++ > 3) { -+ fprintf(stderr, "%s: Too many underflows, giving up\n", __func__); -+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ pthread_mutex_unlock(&stm->mutex); -+ free(p); -+ return ERROR; -+ } -+ WRAP(snd_pcm_recover)(stm->pcm, wrote, 1); -+ continue; -+ case -EAGAIN: -+ if (againfailures++ > 3) { -+ fprintf(stderr, "%s: Too many -EAGAIN errors from snd_pcm_writei, " -+ "giving up\n", __func__); -+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ pthread_mutex_unlock(&stm->mutex); -+ free(p); -+ return ERROR; -+ } -+ continue; -+ case -EBADFD: -+ fprintf(stderr, "%s: snc_pcm_writei returned -%s, giving up\n", -+ __func__, "EBADFD"); -+ free(p); -+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ pthread_mutex_unlock(&stm->mutex); -+ return ERROR; -+ } -+ if (wrote < 0) { -+ fprintf(stderr, "%s: snc_pcm_writei returned unexpected error %lld, " -+ "giving up\n", __func__, (long long)wrote); -+ free(p); -+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ pthread_mutex_unlock(&stm->mutex); -+ return ERROR; -+ } -+ pipefailures = againfailures = 0; -+ stm->write_position += wrote; -+ gettimeofday(&stm->last_activity, NULL); -+ if (wrote > towrite) { -+ fprintf(stderr, "%s: snc_pcm_writei wrote %lld frames, which was more " -+ "than we requested (%lld). This should not happen, giving up\n", -+ __func__, (long long)wrote, (long long)towrite); -+ free(p); -+ stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -+ pthread_mutex_unlock(&stm->mutex); -+ return ERROR; -+ } -+ if (towrite == wrote) -+ break; -+ towrite -= wrote; - } -- assert(wrote >= 0 && wrote == got); -- stm->write_position += wrote; -- gettimeofday(&stm->last_activity, NULL); - } - if (got != avail) { - long buffer_fill = stm->buffer_size - (avail - got); -@@ -1177,7 +1232,10 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position) - return CUBEB_OK; - } - -- assert(delay >= 0); -+ if (delay < 0) { -+ WRAP(snd_pcm_forward)(stm->pcm, -delay); -+ delay = 0; -+ } - - *position = 0; - if (stm->write_position >= (snd_pcm_uframes_t) delay) { Property changes on: head/mail/thunderbird/files/patch-bug1130155 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1320621 =================================================================== --- head/mail/thunderbird/files/patch-bug1320621 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1320621 (nonexistent) @@ -1,39 +0,0 @@ -Make sure --enable-system-hunspell picks up system headers - ---- mozilla/extensions/spellcheck/hunspell/glue/moz.build -+++ mozilla/extensions/spellcheck/hunspell/glue/moz.build -@@ -11,12 +11,14 @@ UNIFIED_SOURCES += [ - 'RemoteSpellCheckEngineParent.cpp', - ] - --CXXFLAGS += CONFIG['MOZ_HUNSPELL_CFLAGS'] -- - FINAL_LIBRARY = 'xul' - -+if CONFIG['MOZ_NATIVE_HUNSPELL']: -+ CXXFLAGS += CONFIG['MOZ_HUNSPELL_CFLAGS'] -+else: -+ LOCAL_INCLUDES += ['../src'] -+ - LOCAL_INCLUDES += [ -- '../src', - '/dom/base', - '/extensions/spellcheck/src', - ] ---- mozilla/extensions/spellcheck/src/moz.build -+++ mozilla/extensions/spellcheck/src/moz.build -@@ -17,9 +17,13 @@ UNIFIED_SOURCES += [ - - FINAL_LIBRARY = 'xul' - -+if CONFIG['MOZ_NATIVE_HUNSPELL']: -+ CXXFLAGS += CONFIG['MOZ_HUNSPELL_CFLAGS'] -+else: -+ LOCAL_INCLUDES += ['../hunspell/src'] -+ - LOCAL_INCLUDES += [ - '../hunspell/glue', -- '../hunspell/src', - '/dom/base', - ] - EXPORTS.mozilla += [ Property changes on: head/mail/thunderbird/files/patch-bug1320621 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1153151 =================================================================== --- head/mail/thunderbird/files/patch-bug1153151 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1153151 (nonexistent) @@ -1,13 +0,0 @@ -Bug 1153151 - make libcubeb sndio use non-blocking i/o - ---- mozilla/media/libcubeb/src/cubeb_sndio.c.orig 2017-01-12 17:53:15 UTC -+++ mozilla/media/libcubeb/src/cubeb_sndio.c -@@ -187,7 +187,7 @@ sndio_stream_init(cubeb *context, - if (s == NULL) - return CUBEB_ERROR; - s->context = context; -- s->hdl = sio_open(NULL, SIO_PLAY, 0); -+ s->hdl = sio_open(NULL, SIO_PLAY, 1); - if (s->hdl == NULL) { - free(s); - DPR("sndio_stream_init(), sio_open() failed\n"); Property changes on: head/mail/thunderbird/files/patch-bug1153151 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1232150 =================================================================== --- head/mail/thunderbird/files/patch-bug1232150 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1232150 (nonexistent) @@ -1,280 +0,0 @@ -commit 9a18802e82c7 -Author: Martin Husemann -Date: Fri Jan 22 00:09:00 2016 +0100 - - Bug 1232150 - "Atomic operations for PPC/PPC64". r=lhansen ---- - js/src/jit/AtomicOperations.h | 2 + - js/src/jit/none/AtomicOperations-sparc.h | 251 +++++++++++++++++++++++++++++++ - 2 files changed, 253 insertions(+) - -diff --git js/src/jit/AtomicOperations.h js/src/jit/AtomicOperations.h -index 16196342a282..42aee72eb879 100644 ---- mozilla/js/src/jit/AtomicOperations.h -+++ mozilla/js/src/jit/AtomicOperations.h -@@ -328,6 +328,8 @@ AtomicOperations::isLockfree(int32_t size) - # include "jit/mips-shared/AtomicOperations-mips-shared.h" - #elif defined(__ppc__) || defined(__PPC__) - # include "jit/none/AtomicOperations-ppc.h" -+#elif defined(__sparc__) -+# include "jit/none/AtomicOperations-sparc.h" - #elif defined(JS_CODEGEN_NONE) - // You can disable the JIT with --disable-ion but you must still - // provide the atomic operations that will be used by the JS engine. -diff --git js/src/jit/none/AtomicOperations-sparc.h js/src/jit/none/AtomicOperations-sparc.h -new file mode 100644 -index 000000000000..706ada86241b ---- /dev/null -+++ mozilla/js/src/jit/none/AtomicOperations-sparc.h -@@ -0,0 +1,251 @@ -+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- -+ * vim: set ts=8 sts=4 et sw=4 tw=99: -+ * 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/. */ -+ -+/* For documentation, see jit/AtomicOperations.h */ -+ -+#ifndef jit_sparc_AtomicOperations_sparc_h -+#define jit_sparc_AtomicOperations_sparc_h -+ -+#include "mozilla/Assertions.h" -+#include "mozilla/Types.h" -+ -+#if defined(__clang__) || defined(__GNUC__) -+ -+// The default implementation tactic for gcc/clang is to use the newer -+// __atomic intrinsics added for use in C++11 . Where that -+// isn't available, we use GCC's older __sync functions instead. -+// -+// ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS is kept as a backward -+// compatible option for older compilers: enable this to use GCC's old -+// __sync functions instead of the newer __atomic functions. This -+// will be required for GCC 4.6.x and earlier, and probably for Clang -+// 3.1, should we need to use those versions. -+ -+//#define ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ -+inline bool -+js::jit::AtomicOperations::isLockfree8() -+{ -+# ifndef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int8_t), 0)); -+ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int16_t), 0)); -+ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int32_t), 0)); -+# if defined(__LP64__) -+ MOZ_ASSERT(__atomic_always_lock_free(sizeof(int64_t), 0)); -+# endif -+ return true; -+# else -+ return false; -+# endif -+} -+ -+inline void -+js::jit::AtomicOperations::fenceSeqCst() -+{ -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ __sync_synchronize(); -+# else -+ __atomic_thread_fence(__ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::loadSeqCst(T* addr) -+{ -+ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8()); -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ __sync_synchronize(); -+ T v = *addr; -+ __sync_synchronize(); -+# else -+ T v; -+ __atomic_load(addr, &v, __ATOMIC_SEQ_CST); -+# endif -+ return v; -+} -+ -+template -+inline void -+js::jit::AtomicOperations::storeSeqCst(T* addr, T val) -+{ -+ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8()); -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ __sync_synchronize(); -+ *addr = val; -+ __sync_synchronize(); -+# else -+ __atomic_store(addr, &val, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::compareExchangeSeqCst(T* addr, T oldval, T newval) -+{ -+ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8()); -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ return __sync_val_compare_and_swap(addr, oldval, newval); -+# else -+ __atomic_compare_exchange(addr, &oldval, &newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); -+ return oldval; -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::fetchAddSeqCst(T* addr, T val) -+{ -+#if !defined( __LP64__) -+ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet"); -+#endif -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ return __sync_fetch_and_add(addr, val); -+# else -+ return __atomic_fetch_add(addr, val, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::fetchSubSeqCst(T* addr, T val) -+{ -+#if !defined( __LP64__) -+ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet"); -+#endif -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ return __sync_fetch_and_sub(addr, val); -+# else -+ return __atomic_fetch_sub(addr, val, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::fetchAndSeqCst(T* addr, T val) -+{ -+#if !defined( __LP64__) -+ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet"); -+#endif -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ return __sync_fetch_and_and(addr, val); -+# else -+ return __atomic_fetch_and(addr, val, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::fetchOrSeqCst(T* addr, T val) -+{ -+#if !defined( __LP64__) -+ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet"); -+#endif -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ return __sync_fetch_and_or(addr, val); -+# else -+ return __atomic_fetch_or(addr, val, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::fetchXorSeqCst(T* addr, T val) -+{ -+#if !defined( __LP64__) -+ static_assert(sizeof(T) <= 4, "not available for 8-byte values yet"); -+#endif -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ return __sync_fetch_and_xor(addr, val); -+# else -+ return __atomic_fetch_xor(addr, val, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+template -+inline T -+js::jit::AtomicOperations::loadSafeWhenRacy(T* addr) -+{ -+ return *addr; // FIXME (1208663): not yet safe -+} -+ -+template -+inline void -+js::jit::AtomicOperations::storeSafeWhenRacy(T* addr, T val) -+{ -+ *addr = val; // FIXME (1208663): not yet safe -+} -+ -+inline void -+js::jit::AtomicOperations::memcpySafeWhenRacy(void* dest, const void* src, size_t nbytes) -+{ -+ ::memcpy(dest, src, nbytes); // FIXME (1208663): not yet safe -+} -+ -+inline void -+js::jit::AtomicOperations::memmoveSafeWhenRacy(void* dest, const void* src, size_t nbytes) -+{ -+ ::memmove(dest, src, nbytes); // FIXME (1208663): not yet safe -+} -+ -+template -+inline T -+js::jit::AtomicOperations::exchangeSeqCst(T* addr, T val) -+{ -+ MOZ_ASSERT(sizeof(T) < 8 || isLockfree8()); -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ T v; -+ __sync_synchronize(); -+ do { -+ v = *addr; -+ } while (__sync_val_compare_and_swap(addr, v, val) != v); -+ return v; -+# else -+ T v; -+ __atomic_exchange(addr, &val, &v, __ATOMIC_SEQ_CST); -+ return v; -+# endif -+} -+ -+template -+inline void -+js::jit::RegionLock::acquire(void* addr) -+{ -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ while (!__sync_bool_compare_and_swap(&spinlock, 0, 1)) -+ ; -+# else -+ uint32_t zero = 0; -+ uint32_t one = 1; -+ while (!__atomic_compare_exchange(&spinlock, &zero, &one, false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE)) { -+ zero = 0; -+ continue; -+ } -+# endif -+} -+ -+template -+inline void -+js::jit::RegionLock::release(void* addr) -+{ -+ MOZ_ASSERT(AtomicOperations::loadSeqCst(&spinlock) == 1, "releasing unlocked region lock"); -+# ifdef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ __sync_sub_and_fetch(&spinlock, 1); -+# else -+ uint32_t zero = 0; -+ __atomic_store(&spinlock, &zero, __ATOMIC_SEQ_CST); -+# endif -+} -+ -+# undef ATOMICS_IMPLEMENTED_WITH_SYNC_INTRINSICS -+ -+#elif defined(ENABLE_SHARED_ARRAY_BUFFER) -+ -+# error "Either disable JS shared memory, use GCC or Clang, or add code here" -+ -+#endif -+ -+#endif // jit_sparc_AtomicOperations_sparc_h Property changes on: head/mail/thunderbird/files/patch-bug1232150 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1252246 =================================================================== --- head/mail/thunderbird/files/patch-bug1252246 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1252246 (nonexistent) @@ -1,44 +0,0 @@ -# Prefer PTHREAD_PROCESS_SHARED on FreeBSD 11.0 or later - -diff --git a/ipc/glue/CrossProcessMutex.h b/ipc/glue/CrossProcessMutex.h ---- mozilla/ipc/glue/CrossProcessMutex.h -+++ mozilla/ipc/glue/CrossProcessMutex.h -@@ -9,7 +9,7 @@ - #include "base/process.h" - #include "mozilla/Mutex.h" - --#if defined(OS_LINUX) || defined(XP_DARWIN) -+#if !defined(OS_WIN) && !defined(OS_NETBSD) && !defined(OS_OPENBSD) - #include - #include "SharedMemoryBasic.h" - #include "mozilla/Atomics.h" -@@ -34,7 +34,7 @@ struct ParamTraits; - namespace mozilla { - #if defined(OS_WIN) - typedef HANDLE CrossProcessMutexHandle; --#elif defined(OS_LINUX) || defined(OS_MACOSX) -+#elif !defined(OS_NETBSD) && !defined(OS_OPENBSD) - typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessMutexHandle; - #else - // Stub for other platforms. We can't use uintptr_t here since different -@@ -100,7 +100,7 @@ private: - - #if defined(OS_WIN) - HANDLE mMutex; --#elif defined(OS_LINUX) || defined(OS_MACOSX) -+#elif !defined(OS_NETBSD) && !defined(OS_OPENBSD) - RefPtr mSharedBuffer; - pthread_mutex_t* mMutex; - mozilla::Atomic* mCount; -diff --git a/ipc/glue/moz.build b/ipc/glue/moz.build ---- mozilla/ipc/glue/moz.build -+++ mozilla/ipc/glue/moz.build -@@ -61,7 +61,7 @@ if CONFIG['OS_ARCH'] == 'WINNT': - SOURCES += [ - 'CrossProcessMutex_windows.cpp', - ] --elif CONFIG['OS_ARCH'] in ('Linux', 'Darwin'): -+elif not CONFIG['OS_ARCH'] in ('NetBSD', 'OpenBSD'): - UNIFIED_SOURCES += [ - 'CrossProcessMutex_posix.cpp', - ] Property changes on: head/mail/thunderbird/files/patch-bug1252246 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1320991 =================================================================== --- head/mail/thunderbird/files/patch-bug1320991 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1320991 (nonexistent) @@ -1,43 +0,0 @@ -commit 454e2dbe1b4f -Author: Mike Shal -Date: Tue Dec 20 16:37:18 2016 -0500 - - Bug 1320991 - Support --with-system-{nss,nspr} in modules/libmar; r?glandium - - The problem with the modules/libmar/tests/moz.build file when building - --with-system-nspr and --with-system-nss is that the nss libraries don't - exist in the tree, so they fail when trying to copy into the test - directory. - - However, it turns out that the libraries copied into the test directory - aren't even used when building with an in-tree copy, because the - xpcshell launcher sets LD_LIBRARY_PATH to point to dist/bin. Since we - use the dist/bin copies anyway for an in-tree build, we can stop copying - them into the test directory and simultaneously fix the --with-system - build. - - The DEFINES can also go away since this directory doesn't actually build - anything. - - MozReview-Commit-ID: Bk2f28wc9ZJ ---- - modules/libmar/tests/moz.build | 17 ----------------- - 1 file changed, 17 deletions(-) - -diff --git modules/libmar/tests/moz.build modules/libmar/tests/moz.build -index ee72571b0c6b..9642553e8aa2 100644 ---- mozilla/modules/libmar/tests/Makefile.in -+++ mozilla/modules/libmar/tests/Makefile.in -@@ -10,12 +10,5 @@ ifneq ($(OS_TARGET),Android) - ifndef MOZ_PROFILE_GENERATE - libs:: - $(INSTALL) ../tool/signmar$(BIN_SUFFIX) $(TESTROOT)/unit -- $(INSTALL) $(DEPTH)/dist/bin/$(DLL_PREFIX)nss3$(DLL_SUFFIX) $(TESTROOT)/unit --ifndef MOZ_FOLD_LIBS -- $(INSTALL) $(DEPTH)/dist/bin/$(DLL_PREFIX)nssutil3$(DLL_SUFFIX) $(TESTROOT)/unit -- $(INSTALL) $(DEPTH)/dist/bin/$(DLL_PREFIX)plc4$(DLL_SUFFIX) $(TESTROOT)/unit -- $(INSTALL) $(DEPTH)/dist/bin/$(DLL_PREFIX)nspr4$(DLL_SUFFIX) $(TESTROOT)/unit -- $(INSTALL) $(DEPTH)/dist/bin/$(DLL_PREFIX)plds4$(DLL_SUFFIX) $(TESTROOT)/unit --endif - endif - endif # Not Android Property changes on: head/mail/thunderbird/files/patch-bug1320991 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1153179 =================================================================== --- head/mail/thunderbird/files/patch-bug1153179 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1153179 (nonexistent) @@ -1,40 +0,0 @@ -Bug 1153179 - fix latency reporting in libcubeb sndio - ---- mozilla/media/libcubeb/src/cubeb_sndio.c.orig 2017-01-12 17:53:15 UTC -+++ mozilla/media/libcubeb/src/cubeb_sndio.c -@@ -67,7 +67,7 @@ sndio_onmove(void *arg, int delta) - { - cubeb_stream *s = (cubeb_stream *)arg; - -- s->rdpos += delta; -+ s->rdpos += delta * s->bpf; - } - - static void * -@@ -135,7 +135,7 @@ sndio_mainloop(void *arg) - state = CUBEB_STATE_ERROR; - break; - } -- s->wrpos = 0; -+ s->wrpos += n; - start += n; - } - } -@@ -326,7 +336,7 @@ sndio_stream_get_position(cubeb_stream * - { - pthread_mutex_lock(&s->mtx); - DPR("sndio_stream_get_position() %lld\n", s->rdpos); -- *p = s->rdpos; -+ *p = s->rdpos / s->bpf; - pthread_mutex_unlock(&s->mtx); - return CUBEB_OK; - } -@@ -346,7 +356,7 @@ sndio_stream_get_latency(cubeb_stream * - { - // http://www.openbsd.org/cgi-bin/man.cgi?query=sio_open - // in the "Measuring the latency and buffers usage" paragraph. -- *latency = stm->wrpos - stm->rdpos; -+ *latency = (stm->wrpos - stm->rdpos) / stm->bpf; - return CUBEB_OK; - } - Property changes on: head/mail/thunderbird/files/patch-bug1153179 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1233275 =================================================================== --- head/mail/thunderbird/files/patch-bug1233275 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1233275 (nonexistent) @@ -1,36 +0,0 @@ -# Copy environment for IPC using NSPR to avoid race - -diff --git a/ipc/chromium/src/base/process_util_bsd.cc b/ipc/chromium/src/base/process_util_bsd.cc ---- mozilla/ipc/chromium/src/base/process_util_bsd.cc -+++ mozilla/ipc/chromium/src/base/process_util_bsd.cc -@@ -12,10 +12,9 @@ - - #include - -+#include "nspr.h" - #include "base/eintr_wrapper.h" - --extern "C" char **environ __attribute__((__visibility__("default"))); -- - namespace base { - - void FreeEnvVarsArray(char* array[], int length) -@@ -66,6 +65,7 @@ bool LaunchApp(const std::vector= 6 is now itself a wrapper around cstdlib, which -circles back to our STL wrapper. - -But of the things our STL wrappers do, including mozalloc.h is not one -that is necessary for cstdlib. So skip including mozalloc.h in our -cstdlib wrapper. - -Additionally, some C++ sources (in media/mtransport) are including -headers in an extern "C" block, which end up including stdlib.h, which -ends up including cstdlib because really, this is all C++, and our -wrapper pre-includes for mozalloc.h, which fails because templates -don't work inside extern "C". So, don't pre-include when we're not -including mozalloc.h. - - -diff --git config/gcc-stl-wrapper.template.h config/gcc-stl-wrapper.template.h ---- mozilla/config/gcc-stl-wrapper.template.h -+++ mozilla/config/gcc-stl-wrapper.template.h -@@ -12,33 +12,40 @@ - // compiling ObjC. - #if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS) - # error "STL code can only be used with -fno-exceptions" - #endif - - // Silence "warning: #include_next is a GCC extension" - #pragma GCC system_header - -+// Don't include mozalloc for cstdlib. See bug 1245076. -+#ifndef moz_dont_include_mozalloc_for_cstdlib -+# define moz_dont_include_mozalloc_for_cstdlib -+#endif -+#ifndef moz_dont_include_mozalloc_for_${HEADER} - // mozalloc.h wants ; break the cycle by always explicitly - // including here. NB: this is a tad sneaky. Sez the gcc docs: - // - // `#include_next' does not distinguish between and "file" - // inclusion, nor does it check that the file you specify has the - // same name as the current file. It simply looks for the file - // named, starting with the directory in the search path after the - // one where the current file was found. --#include_next -+# include_next - - // See if we're in code that can use mozalloc. NB: this duplicates - // code in nscore.h because nscore.h pulls in prtypes.h, and chromium - // can't build with that being included before base/basictypes.h. --#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) --# include "mozilla/mozalloc.h" --#else --# error "STL code can only be used with infallible ::operator new()" -+# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) -+# include "mozilla/mozalloc.h" -+# else -+# error "STL code can only be used with infallible ::operator new()" -+# endif -+ - #endif - - #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG) - // Enable checked iterators and other goodies - // - // FIXME/bug 551254: gcc's debug STL implementation requires -frtti. - // Figure out how to resolve this with -fno-rtti. Maybe build with - // -frtti in DEBUG builds? Property changes on: head/mail/thunderbird/files/patch-bug1245076 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1268816 =================================================================== --- head/mail/thunderbird/files/patch-bug1268816 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1268816 (nonexistent) @@ -1,50 +0,0 @@ - -# HG changeset patch -# User Lee Salzman -# Date 1461978185 14400 -# Node ID b622cbd9ba13d01abcb1d04684dcb39c22a08590 -# Parent f3a5c8b5e17073a1e68f079da93f8dbe10e454a9 -Bug 1268816 - allow Skia to use C++11 features on platforms that have them. r=froydnj - -diff --git config/stl-headers config/stl-headers ---- mozilla/config/stl-headers -+++ mozilla/config/stl-headers -@@ -29,16 +29,17 @@ iterator - limits - list - map - memory - ostream - set - stack - string -+type_traits - utility - vector - cassert - climits - cmath - cstdarg - cstdio - cstdlib -diff --git config/system-headers config/system-headers ---- mozilla/config/system-headers -+++ mozilla/config/system-headers -@@ -1109,16 +1109,17 @@ ThreadManagerTests.h - Threads.h - time.h - Timer.h - tlhelp32.h - ToolUtils.h - tr1/functional - trace.h - Traps.h -+type_traits - typeinfo - types.h - Types.h - UAppleEventsMgr.h - UAttachments.h - ucontext.h - uconv.h - UCursor.h Property changes on: head/mail/thunderbird/files/patch-bug1268816 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1336791 =================================================================== --- head/mail/thunderbird/files/patch-bug1336791 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1336791 (nonexistent) @@ -1,21 +0,0 @@ -# Allow readelf to print types without parentheses - ---- mozilla/toolkit/library/dependentlibs.py -+++ mozilla/toolkit/library/dependentlibs.py -@@ -57,11 +57,15 @@ def dependentlibs_readelf(lib): - for line in proc.stdout: - # Each line has the following format: - # tag (TYPE) value -+ # or with BSD readelf: -+ # tag TYPE value - # Looking for NEEDED type entries - tmp = line.split(' ', 3) -- if len(tmp) > 3 and tmp[2] == '(NEEDED)': -+ if len(tmp) > 3 and 'NEEDED' in tmp[2]: - # NEEDED lines look like: - # 0x00000001 (NEEDED) Shared library: [libname] -+ # or with BSD readelf: -+ # 0x00000001 NEEDED Shared library: [libname] - match = re.search('\[(.*)\]', tmp[3]) - if match: - deps.append(match.group(1)) Property changes on: head/mail/thunderbird/files/patch-bug1336791 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1329520 =================================================================== --- head/mail/thunderbird/files/patch-bug1329520 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1329520 (nonexistent) @@ -1,146 +0,0 @@ -commit 8b0557b033b9 -Author: Dimitry Andric -Date: Fri Jan 27 13:55:00 2017 +0100 - - Bug 1329520 - Fix "memory/mozalloc/throw_gcc.h:35:1: note: declaration missing '[[noreturn]]' (libc++ 4.0)" r=nfroyd ---- - memory/mozalloc/throw_gcc.h | 47 ++++++++++++++++++++++++++++++--------------- - 1 file changed, 31 insertions(+), 16 deletions(-) - -diff --git memory/mozalloc/throw_gcc.h memory/mozalloc/throw_gcc.h -index 18027e04a4a3..4264df63d493 100644 ---- mozilla/memory/mozalloc/throw_gcc.h -+++ mozilla/memory/mozalloc/throw_gcc.h -@@ -19,97 +19,110 @@ - - #include "mozilla/mozalloc_abort.h" - -+// libc++ 4.0.0 and higher use C++11 [[noreturn]] attributes for the functions -+// below, and since clang does not allow mixing __attribute__((noreturn)) and -+// [[noreturn]], we have to explicitly use the latter here. See bug 1329520. -+#if defined(__clang__) -+# if __has_feature(cxx_attributes) && \ -+ defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 4000 -+# define MOZ_THROW_NORETURN [[noreturn]] -+# endif -+#endif -+#ifndef MOZ_THROW_NORETURN -+# define MOZ_THROW_NORETURN MOZ_NORETURN -+#endif -+ - namespace std { - - // NB: user code is not supposed to touch the std:: namespace. We're - // doing this after careful review because we want to define our own - // exception throwing semantics. Don't try this at home! - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_bad_exception(void) - { - mozalloc_abort("fatal: STL threw bad_exception"); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_bad_alloc(void) - { - mozalloc_abort("fatal: STL threw bad_alloc"); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_bad_cast(void) - { - mozalloc_abort("fatal: STL threw bad_cast"); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_bad_typeid(void) - { - mozalloc_abort("fatal: STL threw bad_typeid"); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_logic_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_domain_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_invalid_argument(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_length_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_out_of_range(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_runtime_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_range_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_overflow_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_underflow_error(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_ios_failure(const char* msg) - { - mozalloc_abort(msg); - } - --MOZ_NORETURN MOZ_ALWAYS_INLINE void -+MOZ_THROW_NORETURN MOZ_ALWAYS_INLINE void - __throw_system_error(int err) - { - char error[128]; -@@ -120,4 +133,6 @@ __throw_system_error(int err) - - } // namespace std - -+#undef MOZ_THROW_NORETURN -+ - #endif // mozilla_throw_gcc_h Property changes on: head/mail/thunderbird/files/patch-bug1329520 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1278861 =================================================================== --- head/mail/thunderbird/files/patch-bug1278861 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1278861 (nonexistent) @@ -1,38 +0,0 @@ - -# HG changeset patch -# User Nathan Froyd -# Date 1466820205 14400 -# Node ID bd25b06261c840a62d035192cf4b1dbc18f54e3f -# Parent fbe25a30fcbbe172bdd37c70c5b06cdbb07886af -Bug 1278861 - adjust ifdefs in Conversions.h:ToInt32 to catch clang-on-arm-generally; r=luke - -The bug noted in ToInt32 doesn't just exist when compiling for -arm-darwin; it exists for ARM targets generally. The ifdef should -reflect that. - -diff --git mozilla/js/public/Conversions.h mozilla/js/public/Conversions.h ---- mozilla/js/public/Conversions.h -+++ mozilla/js/public/Conversions.h -@@ -395,19 +395,19 @@ ToIntWidth(double d) - } - - } // namespace detail - - /* ES5 9.5 ToInt32 (specialized for doubles). */ - inline int32_t - ToInt32(double d) - { -- // clang crashes compiling this when targeting arm-darwin: -+ // clang crashes compiling this when targeting arm: - // https://llvm.org/bugs/show_bug.cgi?id=22974 --#if defined (__arm__) && defined (__GNUC__) && !defined(__APPLE__) -+#if defined (__arm__) && defined (__GNUC__) && !defined(__clang__) - int32_t i; - uint32_t tmp0; - uint32_t tmp1; - uint32_t tmp2; - asm ( - // We use a pure integer solution here. In the 'softfp' ABI, the argument - // will start in r0 and r1, and VFP can't do all of the necessary ECMA - // conversions by itself so some integer code will be required anyway. A - Property changes on: head/mail/thunderbird/files/patch-bug1278861 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1269171 =================================================================== --- head/mail/thunderbird/files/patch-bug1269171 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1269171 (nonexistent) @@ -1,258 +0,0 @@ - -# HG changeset patch -# User Mike Hommey -# Date 1463557039 -32400 -# Node ID 68da139d0866977c0ada86319fa94388f2255446 -# Parent a640e6fa8ab9977fb6c5bcf63dc4daca6699477b -Bug 1269171 - Change how mozalloc.h is hooked in STL wrappers. r=froydnj - -Since the introduction of the STL wrappers, they have included -mozalloc.h, and multiple times, we've hit header reentrancy problems, -and worked around them as best as we could. - -Taking a step back, all mozalloc.h does is: -- declare moz_* allocator functions. -- define inline implementations of various operator new/delete variants. - -The first only requires the functions to be declared before they are used, -so mozalloc.h only needs to be included before anything that would use -those functions. - -The second doesn't actually require a specific order, as long as the -declaration for those functions comes before their use, and they are -either declared in or implicitly by the C++ compiler. - -So all in all, it doesn't matter that mozalloc.h is included before the -wrapped STL headers. What matters is that it's included when STL headers -are included. So arrange things such that mozalloc.h is included after -the first wrapped STL header is fully preprocessed (and all its includes -have been included). - - -diff --git config/gcc-stl-wrapper.template.h config/gcc-stl-wrapper.template.h ---- mozilla/config/gcc-stl-wrapper.template.h -+++ mozilla/config/gcc-stl-wrapper.template.h -@@ -12,56 +12,54 @@ - // compiling ObjC. - #if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS) - # error "STL code can only be used with -fno-exceptions" - #endif - - // Silence "warning: #include_next is a GCC extension" - #pragma GCC system_header - --// Don't include mozalloc for cstdlib. See bug 1245076. --#ifndef moz_dont_include_mozalloc_for_cstdlib --# define moz_dont_include_mozalloc_for_cstdlib --#endif --#ifndef moz_dont_include_mozalloc_for_${HEADER} --// mozalloc.h wants ; break the cycle by always explicitly --// including here. NB: this is a tad sneaky. Sez the gcc docs: --// --// `#include_next' does not distinguish between and "file" --// inclusion, nor does it check that the file you specify has the --// same name as the current file. It simply looks for the file --// named, starting with the directory in the search path after the --// one where the current file was found. --# include_next -- --// See if we're in code that can use mozalloc. NB: this duplicates --// code in nscore.h because nscore.h pulls in prtypes.h, and chromium --// can't build with that being included before base/basictypes.h. --# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) --# include "mozilla/mozalloc.h" --# else --# error "STL code can only be used with infallible ::operator new()" --# endif -- --#endif -- - #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG) - // Enable checked iterators and other goodies - // - // FIXME/bug 551254: gcc's debug STL implementation requires -frtti. - // Figure out how to resolve this with -fno-rtti. Maybe build with - // -frtti in DEBUG builds? - // - // # define _GLIBCXX_DEBUG 1 - #endif - -+// Don't include mozalloc for cstdlib. See bug 1245076. -+#ifndef moz_dont_include_mozalloc_for_cstdlib -+# define moz_dont_include_mozalloc_for_cstdlib -+#endif -+ -+// Include mozalloc after the STL header and all other headers it includes -+// have been preprocessed. -+#if !defined(MOZ_INCLUDE_MOZALLOC_H) && \ -+ !defined(moz_dont_include_mozalloc_for_${HEADER}) -+# define MOZ_INCLUDE_MOZALLOC_H -+# define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER} -+#endif -+ - #pragma GCC visibility push(default) - #include_next <${HEADER}> - #pragma GCC visibility pop - -+#ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER} -+// See if we're in code that can use mozalloc. NB: this duplicates -+// code in nscore.h because nscore.h pulls in prtypes.h, and chromium -+// can't build with that being included before base/basictypes.h. -+# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) -+# include "mozilla/mozalloc.h" -+# else -+# error "STL code can only be used with infallible ::operator new()" -+# endif -+#endif -+ - // gcc calls a __throw_*() function from bits/functexcept.h when it - // wants to "throw an exception". functexcept exists nominally to - // support -fno-exceptions, but since we'll always use the system - // libstdc++, and it's compiled with exceptions, then in practice - // these __throw_*() functions will always throw exceptions (shades of - // -fshort-wchar). We don't want that and so define our own inlined - // __throw_*(). - #ifndef mozilla_throw_gcc_h -diff --git config/make-stl-wrappers.py config/make-stl-wrappers.py ---- mozilla/config/make-stl-wrappers.py -+++ mozilla/config/make-stl-wrappers.py -@@ -25,28 +25,26 @@ def header_path(header, compiler): - def is_comment(line): - return re.match(r'\s*#.*', line) - - def main(outdir, compiler, template_file, header_list_file): - if not os.path.isdir(outdir): - os.mkdir(outdir) - - template = open(template_file, 'r').read() -- path_to_new = header_path('new', compiler) - - for header in open(header_list_file, 'r'): - header = header.rstrip() - if 0 == len(header) or is_comment(header): - continue - - path = header_path(header, compiler) - with FileAvoidWrite(os.path.join(outdir, header)) as f: - f.write(string.Template(template).substitute(HEADER=header, -- HEADER_PATH=path, -- NEW_HEADER_PATH=path_to_new)) -+ HEADER_PATH=path)) - - - if __name__ == '__main__': - if 5 != len(sys.argv): - print("""Usage: - python {0} OUT_DIR ('msvc'|'gcc') TEMPLATE_FILE HEADER_LIST_FILE - """.format(sys.argv[0]), file=sys.stderr) - sys.exit(1) -diff --git config/msvc-stl-wrapper.template.h config/msvc-stl-wrapper.template.h ---- mozilla/config/msvc-stl-wrapper.template.h -+++ mozilla/config/msvc-stl-wrapper.template.h -@@ -3,45 +3,33 @@ - */ - /* 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/. */ - - #ifndef mozilla_${HEADER}_h - #define mozilla_${HEADER}_h - --#ifndef MOZ_HAVE_INCLUDED_ALLOC --#define MOZ_HAVE_INCLUDED_ALLOC -- - #if _HAS_EXCEPTIONS - # error "STL code can only be used with -fno-exceptions" - #endif - -+// Include mozalloc after the STL header and all other headers it includes -+// have been preprocessed. -+#if !defined(MOZ_INCLUDE_MOZALLOC_H) -+# define MOZ_INCLUDE_MOZALLOC_H -+# define MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER} -+#endif -+ - // Code built with !_HAS_EXCEPTIONS calls std::_Throw(), but the win2k - // CRT doesn't export std::_Throw(). So we define it. - #ifndef mozilla_Throw_h - # include "mozilla/throw_msvc.h" - #endif - --// Code might include before other wrapped headers, but --// includes and so we want to wrap it. But mozalloc.h --// wants also, so we break the cycle by always explicitly --// including here. --#include <${NEW_HEADER_PATH}> -- --// See if we're in code that can use mozalloc. NB: this duplicates --// code in nscore.h because nscore.h pulls in prtypes.h, and chromium --// can't build with that being included before base/basictypes.h. --#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) --# include "mozilla/mozalloc.h" --#else --# error "STL code can only be used with infallible ::operator new()" --#endif --#endif /* MOZ_HAVE_INCLUDED_ALLOC */ -- - #ifdef _DEBUG - // From - // http://msdn.microsoft.com/en-us/library/aa985982%28VS.80%29.aspx - // and - // http://msdn.microsoft.com/en-us/library/aa985965%28VS.80%29.aspx - // there appear to be two types of STL container checking. The - // former is enabled by -D_DEBUG (which is implied by -MDd or -MTd), and - // looks to be full generation/mutation checked iterators as done by -@@ -70,9 +58,20 @@ - // but that's OK because we're not throwing them. - #pragma warning( push ) - #pragma warning( disable : 4275 4530 ) - - #include <${HEADER_PATH}> - - #pragma warning( pop ) - -+#ifdef MOZ_INCLUDE_MOZALLOC_H_FROM_${HEADER} -+// See if we're in code that can use mozalloc. NB: this duplicates -+// code in nscore.h because nscore.h pulls in prtypes.h, and chromium -+// can't build with that being included before base/basictypes.h. -+# if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC) -+# include "mozilla/mozalloc.h" -+# else -+# error "STL code can only be used with infallible ::operator new()" -+# endif -+#endif -+ - #endif // if mozilla_${HEADER}_h -diff --git memory/mozalloc/mozalloc.h memory/mozalloc/mozalloc.h ---- mozilla/memory/mozalloc/mozalloc.h -+++ mozilla/memory/mozalloc/mozalloc.h -@@ -7,20 +7,27 @@ - - #ifndef mozilla_mozalloc_h - #define mozilla_mozalloc_h - - /* - * https://bugzilla.mozilla.org/show_bug.cgi?id=427099 - */ - --#include --#include - #if defined(__cplusplus) - # include -+// Since libstdc++ 6, including the C headers (e.g. stdlib.h) instead of the -+// corresponding C++ header (e.g. cstdlib) can cause confusion in C++ code -+// using things defined there. Specifically, with stdlib.h, the use of abs() -+// in gfx/graphite2/src/inc/UtfCodec.h somehow ends up picking the wrong abs() -+# include -+# include -+#else -+# include -+# include - #endif - - #if defined(__cplusplus) - #include "mozilla/fallible.h" - #include "mozilla/TemplateLib.h" - #endif - #include "mozilla/Attributes.h" - #include "mozilla/Types.h" Property changes on: head/mail/thunderbird/files/patch-bug1269171 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug757366 =================================================================== --- head/mail/thunderbird/files/patch-bug757366 (revision 436666) +++ head/mail/thunderbird/files/patch-bug757366 (nonexistent) @@ -1,58 +0,0 @@ -commit 2a3be4b384b9 -Author: Jonathan Kew -Date: Mon Sep 26 18:05:14 2016 +0100 - - Bug 757366 - Don't cast pointers to 'name'-table data to uint16_t*, as they may not be 16-bit-aligned. r=jrmuizel ---- - gfx/thebes/gfxFontUtils.cpp | 26 ++++++++++++++------------ - 1 file changed, 14 insertions(+), 12 deletions(-) - -diff --git gfx/thebes/gfxFontUtils.cpp gfx/thebes/gfxFontUtils.cpp -index 526e17d..cb505e8 100644 ---- mozilla/gfx/thebes/gfxFontUtils.cpp -+++ mozilla/gfx/thebes/gfxFontUtils.cpp -@@ -918,16 +918,18 @@ IsValidSFNTVersion(uint32_t version) - version == TRUETYPE_TAG('t','r','u','e'); - } - --// copy and swap UTF-16 values, assume no surrogate pairs, can be in place -+// Copy and swap UTF-16 values, assume no surrogate pairs, can be in place. -+// aInBuf and aOutBuf are NOT necessarily 16-bit-aligned, so we should avoid -+// accessing them directly as uint16_t* values. -+// aLen is count of UTF-16 values, so the byte buffers are twice that. - static void --CopySwapUTF16(const uint16_t *aInBuf, uint16_t *aOutBuf, uint32_t aLen) -+CopySwapUTF16(const char* aInBuf, char* aOutBuf, uint32_t aLen) - { -- const uint16_t *end = aInBuf + aLen; -+ const char* end = aInBuf + aLen * 2; - while (aInBuf < end) { -- uint16_t value = *aInBuf; -- *aOutBuf = (value >> 8) | (value & 0xff) << 8; -- aOutBuf++; -- aInBuf++; -+ uint8_t b0 = *aInBuf++; -+ *aOutBuf++ = *aInBuf++; -+ *aOutBuf++ = b0; - } - } - -@@ -1446,13 +1448,13 @@ gfxFontUtils::DecodeFontName(const char *aNameData, int32_t aByteLen, - if (csName[0] == 0) { - // empty charset name: data is utf16be, no need to instantiate a converter - uint32_t strLen = aByteLen / 2; --#ifdef IS_LITTLE_ENDIAN - aName.SetLength(strLen); -- CopySwapUTF16(reinterpret_cast(aNameData), -- reinterpret_cast(aName.BeginWriting()), strLen); -+#ifdef IS_LITTLE_ENDIAN -+ CopySwapUTF16(aNameData, reinterpret_cast(aName.BeginWriting()), -+ strLen); - #else -- aName.Assign(reinterpret_cast(aNameData), strLen); --#endif -+ memcpy(aName.BeginWriting(), aNameData, strLen * 2); -+#endif - return true; - } - Property changes on: head/mail/thunderbird/files/patch-bug757366 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-modules-libpref-init-all.js =================================================================== --- head/mail/thunderbird/files/patch-modules-libpref-init-all.js (revision 436666) +++ head/mail/thunderbird/files/patch-modules-libpref-init-all.js (nonexistent) @@ -1,15 +0,0 @@ ---- mozilla/modules/libpref/init/all.js.orig 2015-08-06 22:39:34 UTC -+++ mozilla/modules/libpref/init/all.js -@@ -4052,7 +4052,12 @@ pref("layers.max-active", -1); - pref("layers.tiles.adjust", true); - - // Set the default values, and then override per-platform as needed -+#ifdef MOZ_TREE_CAIRO - pref("layers.offmainthreadcomposition.enabled", true); -+#else -+// Disable for system cairo on suspicion of causing random crashes -+pref("layers.offmainthreadcomposition.enabled", false); -+#endif - // Compositor target frame rate. NOTE: If vsync is enabled the compositor - // frame rate will still be capped. - // -1 -> default (match layout.frame_rate or 60 FPS) Property changes on: head/mail/thunderbird/files/patch-modules-libpref-init-all.js ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c =================================================================== --- head/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c (revision 436666) +++ head/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c (nonexistent) @@ -1,16 +0,0 @@ ---- mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c~ -+++ mozilla/media/mtransport/third_party/nICEr/src/util/mbslen.c -@@ -54,6 +54,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - # endif - #endif - -+#ifdef __DragonFly__ -+#include -+# if __DragonFly_version > 300502 -+# define HAVE_XLOCALE -+# endif -+#endif -+ - #ifdef HAVE_XLOCALE - #include - #endif /* HAVE_XLOCALE */ Property changes on: head/mail/thunderbird/files/patch-media-mtransport-third_party-nICEr-src-util-mbslen.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1021761 =================================================================== --- head/mail/thunderbird/files/patch-bug1021761 (revision 436666) +++ head/mail/thunderbird/files/patch-bug1021761 (revision 436667) @@ -1,1157 +1,1157 @@ -diff --git configure.in configure.in +diff --git build/moz.configure/old.configure build/moz.configure/old.configure +index b95dd2b..4cbefd5 100644 +--- mozilla/build/moz.configure/old.configure ++++ mozilla/build/moz.configure/old.configure +@@ -305,6 +305,7 @@ def old_configure_options(*options): + '--with-nspr-prefix', + '--with-nss-exec-prefix', + '--with-nss-prefix', ++ '--with-oss', + '--with-pthreads', + '--with-qemu-exe', + '--with-servo', +diff --git old-configure.in configure.in index 48e60c0..ec08417 100644 ---- mozilla/configure.in -+++ mozilla/configure.in +--- mozilla/old-configure.in ++++ mozilla/old-configure.in @@ -5591,6 +5591,67 @@ fi AC_SUBST(MOZ_WEBM_ENCODER) dnl ================================== +dnl = Check OSS availability +dnl ================================== + +dnl If using Linux, Solaris or BSDs, ensure that OSS is available +case "$OS_TARGET" in +Linux|SunOS|DragonFly|FreeBSD|NetBSD|GNU/kFreeBSD) + MOZ_OSS=1 + ;; +esac + +MOZ_ARG_WITH_STRING(oss, +[ --with-oss[=PFX] Enable OpenSoundSystem support [installed at prefix PFX]], + OSSPREFIX=$withval) + +if test -n "$OSSPREFIX"; then + if test "$OSSPREFIX" != "no"; then + MOZ_OSS=1 + else + MOZ_OSS= + fi +fi + +_SAVE_CFLAGS=$CFLAGS +_SAVE_LIBS=$LIBS +if test -n "$MOZ_OSS"; then + dnl Prefer 4Front implementation + AC_MSG_CHECKING([MOZ_OSS_CFLAGS]) + if test "$OSSPREFIX" != "yes"; then + oss_conf=${OSSPREFIX%/usr}/etc/oss.conf + if test -f "$oss_conf"; then + . "$oss_conf" + else + OSSLIBDIR=$OSSPREFIX/lib/oss + fi + if test -d "$OSSLIBDIR"; then + MOZ_OSS_CFLAGS="$MOZ_OSS_CFLAGS -I$OSSLIBDIR/include" + fi + fi + AC_MSG_RESULT([$MOZ_OSS_CFLAGS]) + + CFLAGS="$CFLAGS $MOZ_OSS_CFLAGS" + MOZ_CHECK_HEADERS(sys/soundcard.h soundcard.h) + + if test "$ac_cv_header_sys_soundcard_h" != "yes" -a \ + "$ac_cv_header_soundcard_h" != "yes"; then + AC_MSG_ERROR([Need OSS for Ogg, Wave or WebM decoding on $OS_TARGET. Disable with --without-oss.]) + fi + + dnl Assume NetBSD implementation over SunAudio + AC_CHECK_LIB(ossaudio, _oss_ioctl, + [AC_DEFINE_UNQUOTED(CUBEB_OSS_DEFAULT_OUTPUT, "/dev/sound") + MOZ_OSS_LIBS="$MOZ_OSS_LIBS -lossaudio"]) +fi +CFLAGS=$_SAVE_CFLAGS +LIBS=$_SAVE_LIBS + +AC_SUBST(MOZ_OSS) +AC_SUBST_LIST(MOZ_OSS_CFLAGS) +AC_SUBST_LIST(MOZ_OSS_LIBS) + +dnl ================================== dnl = Check alsa availability on Linux dnl ================================== diff --git media/libcubeb/AUTHORS media/libcubeb/AUTHORS index b441e8a..950d9e5 100644 --- mozilla/media/libcubeb/AUTHORS +++ mozilla/media/libcubeb/AUTHORS @@ -4,3 +4,4 @@ Michael Wu Paul Adenot David Richards Sebastien Alaiwan +Evgeniy Vodolazskiy diff --git media/libcubeb/src/cubeb.c media/libcubeb/src/cubeb.c index 9c3adcc..45d765b 100644 --- mozilla/media/libcubeb/src/cubeb.c +++ mozilla/media/libcubeb/src/cubeb.c @@ -54,6 +54,9 @@ int opensl_init(cubeb ** context, char const * context_name); #if defined(USE_AUDIOTRACK) int audiotrack_init(cubeb ** context, char const * context_name); #endif +#if defined(USE_OSS) +int oss_init(cubeb ** context, char const * context_name); +#endif int validate_stream_params(cubeb_stream_params stream_params) @@ -120,6 +123,9 @@ cubeb_init(cubeb ** context, char const * context_name) #if defined(USE_AUDIOTRACK) audiotrack_init, #endif +#if defined(USE_OSS) + oss_init, +#endif }; int i; diff --git media/libcubeb/src/cubeb_alsa.c media/libcubeb/src/cubeb_alsa.c index a962553..1f780f4 100644 --- mozilla/media/libcubeb/src/cubeb_alsa.c +++ mozilla/media/libcubeb/src/cubeb_alsa.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -24,6 +25,50 @@ #define ALSA_PA_PLUGIN "ALSA <-> PulseAudio PCM I/O Plugin" +#ifdef DISABLE_LIBASOUND_DLOPEN +#define WRAP(x) x +#else +#define WRAP(x) cubeb_##x +#define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x +MAKE_TYPEDEF(snd_config); +MAKE_TYPEDEF(snd_config_add); +MAKE_TYPEDEF(snd_config_copy); +MAKE_TYPEDEF(snd_config_delete); +MAKE_TYPEDEF(snd_config_get_id); +MAKE_TYPEDEF(snd_config_get_string); +MAKE_TYPEDEF(snd_config_imake_integer); +MAKE_TYPEDEF(snd_config_search); +MAKE_TYPEDEF(snd_config_search_definition); +MAKE_TYPEDEF(snd_lib_error_set_handler); +MAKE_TYPEDEF(snd_pcm_avail_update); +MAKE_TYPEDEF(snd_pcm_close); +MAKE_TYPEDEF(snd_pcm_delay); +MAKE_TYPEDEF(snd_pcm_drain); +MAKE_TYPEDEF(snd_pcm_frames_to_bytes); +MAKE_TYPEDEF(snd_pcm_get_params); +/* snd_pcm_hw_params_alloca is actually a macro */ +/* MAKE_TYPEDEF(snd_pcm_hw_params_alloca); */ +MAKE_TYPEDEF(snd_pcm_hw_params_sizeof); +#define snd_pcm_hw_params_sizeof cubeb_snd_pcm_hw_params_sizeof +MAKE_TYPEDEF(snd_pcm_hw_params_any); +MAKE_TYPEDEF(snd_pcm_hw_params_get_channels_max); +MAKE_TYPEDEF(snd_pcm_hw_params_get_rate); +MAKE_TYPEDEF(snd_pcm_hw_params_set_rate_near); +MAKE_TYPEDEF(snd_pcm_nonblock); +MAKE_TYPEDEF(snd_pcm_open); +MAKE_TYPEDEF(snd_pcm_open_lconf); +MAKE_TYPEDEF(snd_pcm_pause); +MAKE_TYPEDEF(snd_pcm_poll_descriptors); +MAKE_TYPEDEF(snd_pcm_poll_descriptors_count); +MAKE_TYPEDEF(snd_pcm_poll_descriptors_revents); +MAKE_TYPEDEF(snd_pcm_recover); +MAKE_TYPEDEF(snd_pcm_set_params); +MAKE_TYPEDEF(snd_pcm_state); +MAKE_TYPEDEF(snd_pcm_writei); + +#undef MAKE_TYPEDEF +#endif + /* ALSA is not thread-safe. snd_pcm_t instances are individually protected by the owning cubeb_stream's mutex. snd_pcm_t creation and destruction is not thread-safe until ALSA 1.0.24 (see alsa-lib.git commit 91c9c8f1), @@ -64,6 +109,8 @@ struct cubeb { workaround is not required. */ snd_config_t * local_config; int is_pa; + + void * libasound; }; enum stream_state { -@@ -262,7 +309,7 @@ alsa_refill_stream(cubeb_stream * stm) +@@ -260,10 +307,10 @@ alsa_refill_stream(cubeb_stream * stm) pthread_mutex_lock(&stm->mutex); -- r = snd_pcm_poll_descriptors_revents(stm->pcm, stm->fds, stm->nfds, &revents); -+ r = WRAP(snd_pcm_poll_descriptors_revents)(stm->pcm, stm->fds, stm->nfds, &revents); - if (r < 0 || revents != POLLOUT) { - /* This should be a stream error; it makes no sense for poll(2) to wake - for this stream and then have the stream report that it's not ready. -@@ -271,10 +318,10 @@ alsa_refill_stream(cubeb_stream * stm) - return RUNNING; - } - - avail = snd_pcm_avail_update(stm->pcm); + avail = WRAP(snd_pcm_avail_update)(stm->pcm); - if (avail == -EPIPE) { + if (avail < 0) { - snd_pcm_recover(stm->pcm, avail, 1); - avail = snd_pcm_avail_update(stm->pcm); + WRAP(snd_pcm_recover)(stm->pcm, avail, 1); + avail = WRAP(snd_pcm_avail_update)(stm->pcm); } /* Failed to recover from an xrun, this stream must be broken. */ -@@ -293,8 +340,8 @@ alsa_refill_stream(cubeb_stream * stm) - available to write. If avail is still zero here, the stream must be in - a funky state, so recover and try again. */ - if (avail == 0) { -- snd_pcm_recover(stm->pcm, -EPIPE, 1); -- avail = snd_pcm_avail_update(stm->pcm); -+ WRAP(snd_pcm_recover)(stm->pcm, -EPIPE, 1); -+ avail = WRAP(snd_pcm_avail_update)(stm->pcm); - if (avail <= 0) { - pthread_mutex_unlock(&stm->mutex); - stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_ERROR); -@@ -302,7 +349,7 @@ alsa_refill_stream(cubeb_stream * stm) - } +@@ -286,7 +333,7 @@ alsa_refill_stream(cubeb_stream * stm) + return RUNNING; } - p = calloc(1, snd_pcm_frames_to_bytes(stm->pcm, avail)); + p = calloc(1, WRAP(snd_pcm_frames_to_bytes)(stm->pcm, avail)); assert(p); pthread_mutex_unlock(&stm->mutex); -@@ -327,10 +374,10 @@ alsa_refill_stream(cubeb_stream * stm) +@@ -312,10 +359,10 @@ alsa_refill_stream(cubeb_stream * stm) b[i] *= stm->volume; } } - wrote = snd_pcm_writei(stm->pcm, p, got); + wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got); - if (wrote == -EPIPE) { + if (wrote < 0) { - snd_pcm_recover(stm->pcm, wrote, 1); - wrote = snd_pcm_writei(stm->pcm, p, got); + WRAP(snd_pcm_recover)(stm->pcm, wrote, 1); + wrote = WRAP(snd_pcm_writei)(stm->pcm, p, got); } assert(wrote >= 0 && wrote == got); stm->write_position += wrote; @@ -342,7 +389,7 @@ alsa_refill_stream(cubeb_stream * stm) /* Fill the remaining buffer with silence to guarantee one full period has been written. */ - snd_pcm_writei(stm->pcm, (char *) p + got, avail - got); + WRAP(snd_pcm_writei)(stm->pcm, (char *) p + got, avail - got); set_timeout(&stm->drain_timeout, buffer_time * 1000); @@ -453,26 +500,26 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm) slave_def = NULL; - r = snd_config_search(root_pcm, "slave", &slave_pcm); + r = WRAP(snd_config_search)(root_pcm, "slave", &slave_pcm); if (r < 0) { return NULL; } - r = snd_config_get_string(slave_pcm, &string); + r = WRAP(snd_config_get_string)(slave_pcm, &string); if (r >= 0) { - r = snd_config_search_definition(lconf, "pcm_slave", string, &slave_def); + r = WRAP(snd_config_search_definition)(lconf, "pcm_slave", string, &slave_def); if (r < 0) { return NULL; } } do { - r = snd_config_search(slave_def ? slave_def : slave_pcm, "pcm", &pcm); + r = WRAP(snd_config_search)(slave_def ? slave_def : slave_pcm, "pcm", &pcm); if (r < 0) { break; } - r = snd_config_get_string(slave_def ? slave_def : slave_pcm, &string); + r = WRAP(snd_config_get_string)(slave_def ? slave_def : slave_pcm, &string); if (r < 0) { break; } @@ -481,7 +528,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm) if (r < 0 || r > (int) sizeof(node_name)) { break; } - r = snd_config_search(lconf, node_name, &pcm); + r = WRAP(snd_config_search)(lconf, node_name, &pcm); if (r < 0) { break; } @@ -490,7 +537,7 @@ get_slave_pcm_node(snd_config_t * lconf, snd_config_t * root_pcm) } while (0); if (slave_def) { - snd_config_delete(slave_def); + WRAP(snd_config_delete)(slave_def); } return NULL; @@ -513,22 +560,22 @@ init_local_config_with_workaround(char const * pcm_name) lconf = NULL; - if (snd_config == NULL) { + if (*WRAP(snd_config) == NULL) { return NULL; } - r = snd_config_copy(&lconf, snd_config); + r = WRAP(snd_config_copy)(&lconf, *WRAP(snd_config)); if (r < 0) { return NULL; } do { - r = snd_config_search_definition(lconf, "pcm", pcm_name, &pcm_node); + r = WRAP(snd_config_search_definition)(lconf, "pcm", pcm_name, &pcm_node); if (r < 0) { break; } - r = snd_config_get_id(pcm_node, &string); + r = WRAP(snd_config_get_id)(pcm_node, &string); if (r < 0) { break; } @@ -537,7 +584,7 @@ init_local_config_with_workaround(char const * pcm_name) if (r < 0 || r > (int) sizeof(node_name)) { break; } - r = snd_config_search(lconf, node_name, &pcm_node); + r = WRAP(snd_config_search)(lconf, node_name, &pcm_node); if (r < 0) { break; } @@ -548,12 +595,12 @@ init_local_config_with_workaround(char const * pcm_name) } /* Fetch the PCM node's type, and bail out if it's not the PulseAudio plugin. */ - r = snd_config_search(pcm_node, "type", &node); + r = WRAP(snd_config_search)(pcm_node, "type", &node); if (r < 0) { break; } - r = snd_config_get_string(node, &string); + r = WRAP(snd_config_get_string)(node, &string); if (r < 0) { break; } @@ -564,18 +611,18 @@ init_local_config_with_workaround(char const * pcm_name) /* Don't clobber an explicit existing handle_underrun value, set it only if it doesn't already exist. */ - r = snd_config_search(pcm_node, "handle_underrun", &node); + r = WRAP(snd_config_search)(pcm_node, "handle_underrun", &node); if (r != -ENOENT) { break; } /* Disable pcm_pulse's asynchronous underrun handling. */ - r = snd_config_imake_integer(&node, "handle_underrun", 0); + r = WRAP(snd_config_imake_integer)(&node, "handle_underrun", 0); if (r < 0) { break; } - r = snd_config_add(pcm_node, node); + r = WRAP(snd_config_add)(pcm_node, node); if (r < 0) { break; } @@ -583,7 +630,7 @@ init_local_config_with_workaround(char const * pcm_name) return lconf; } while (0); - snd_config_delete(lconf); + WRAP(snd_config_delete)(lconf); return NULL; } @@ -595,9 +642,9 @@ alsa_locked_pcm_open(snd_pcm_t ** pcm, snd_pcm_stream_t stream, snd_config_t * l pthread_mutex_lock(&cubeb_alsa_mutex); if (local_config) { - r = snd_pcm_open_lconf(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK, local_config); + r = WRAP(snd_pcm_open_lconf)(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK, local_config); } else { - r = snd_pcm_open(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK); + r = WRAP(snd_pcm_open)(pcm, CUBEB_ALSA_PCM_NAME, stream, SND_PCM_NONBLOCK); } pthread_mutex_unlock(&cubeb_alsa_mutex); @@ -610,7 +657,7 @@ alsa_locked_pcm_close(snd_pcm_t * pcm) int r; pthread_mutex_lock(&cubeb_alsa_mutex); - r = snd_pcm_close(pcm); + r = WRAP(snd_pcm_close)(pcm); pthread_mutex_unlock(&cubeb_alsa_mutex); return r; @@ -667,12 +714,65 @@ alsa_init(cubeb ** context, char const * context_name) pthread_attr_t attr; snd_pcm_t * dummy; + void * libasound = NULL; + +#ifndef DISABLE_LIBASOUND_DLOPEN + libasound = dlopen("libasound.so", RTLD_LAZY); + if (!libasound) { + return CUBEB_ERROR; + } + +#define LOAD(x) do { \ + cubeb_##x = dlsym(libasound, #x); \ + if (!cubeb_##x) { \ + dlclose(libasound); \ + return CUBEB_ERROR; \ + } \ + } while(0) + + LOAD(snd_config); + LOAD(snd_config_add); + LOAD(snd_config_copy); + LOAD(snd_config_delete); + LOAD(snd_config_get_id); + LOAD(snd_config_get_string); + LOAD(snd_config_imake_integer); + LOAD(snd_config_search); + LOAD(snd_config_search_definition); + LOAD(snd_lib_error_set_handler); + LOAD(snd_pcm_avail_update); + LOAD(snd_pcm_close); + LOAD(snd_pcm_delay); + LOAD(snd_pcm_drain); + LOAD(snd_pcm_frames_to_bytes); + LOAD(snd_pcm_get_params); + /* snd_pcm_hw_params_alloca is actually a macro */ + /* LOAD(snd_pcm_hw_params_alloca); */ + LOAD(snd_pcm_hw_params_sizeof); + LOAD(snd_pcm_hw_params_any); + LOAD(snd_pcm_hw_params_get_channels_max); + LOAD(snd_pcm_hw_params_get_rate); + LOAD(snd_pcm_hw_params_set_rate_near); + LOAD(snd_pcm_nonblock); + LOAD(snd_pcm_open); + LOAD(snd_pcm_open_lconf); + LOAD(snd_pcm_pause); + LOAD(snd_pcm_poll_descriptors); + LOAD(snd_pcm_poll_descriptors_count); + LOAD(snd_pcm_poll_descriptors_revents); + LOAD(snd_pcm_recover); + LOAD(snd_pcm_set_params); + LOAD(snd_pcm_state); + LOAD(snd_pcm_writei); + +#undef LOAD +#endif assert(context); *context = NULL; pthread_mutex_lock(&cubeb_alsa_mutex); if (!cubeb_alsa_error_handler_set) { - snd_lib_error_set_handler(silent_error_handler); + WRAP(snd_lib_error_set_handler)(silent_error_handler); cubeb_alsa_error_handler_set = 1; } pthread_mutex_unlock(&cubeb_alsa_mutex); @@ -680,6 +780,8 @@ alsa_init(cubeb ** context, char const * context_name) ctx = calloc(1, sizeof(*ctx)); assert(ctx); + ctx->libasound = libasound; + ctx->ops = &alsa_ops; r = pthread_mutex_init(&ctx->mutex, NULL); @@ -729,7 +831,7 @@ alsa_init(cubeb ** context, char const * context_name) config fails with EINVAL, the PA PCM is too old for this workaround. */ if (r == -EINVAL) { pthread_mutex_lock(&cubeb_alsa_mutex); - snd_config_delete(ctx->local_config); + WRAP(snd_config_delete)(ctx->local_config); pthread_mutex_unlock(&cubeb_alsa_mutex); ctx->local_config = NULL; } else if (r >= 0) { @@ -768,9 +870,13 @@ alsa_destroy(cubeb * ctx) pthread_mutex_destroy(&ctx->mutex); free(ctx->fds); + if (ctx->libasound) { + dlclose(ctx->libasound); + } + if (ctx->local_config) { pthread_mutex_lock(&cubeb_alsa_mutex); - snd_config_delete(ctx->local_config); + WRAP(snd_config_delete)(ctx->local_config); pthread_mutex_unlock(&cubeb_alsa_mutex); } @@ -838,7 +944,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name, return CUBEB_ERROR; } - r = snd_pcm_nonblock(stm->pcm, 1); + r = WRAP(snd_pcm_nonblock)(stm->pcm, 1); assert(r == 0); - /* Ugly hack: the PA ALSA plugin allows buffer configurations that can't -@@ -848,23 +954,23 @@ alsa_stream_init(cubeb * ctx, cubeb_stream ** stream, char const * stream_name, - latency = latency < 500 ? 500 : latency; + latency_us = latency_frames * 1e6 / stm->params.rate; +@@ -855,7 +961,7 @@ alsa_stream_init(cubeb * ctx, cubeb_stre + latency_us = latency_us < min_latency ? min_latency: latency_us; } - r = snd_pcm_set_params(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED, -- stm->params.channels, stm->params.rate, 1, -- latency * 1000); + r = WRAP(snd_pcm_set_params)(stm->pcm, format, SND_PCM_ACCESS_RW_INTERLEAVED, -+ stm->params.channels, stm->params.rate, 1, -+ latency * 1000); + stm->params.channels, stm->params.rate, 1, + latency_us); if (r < 0) { - alsa_stream_destroy(stm); +@@ -867,15 +973,15 @@ alsa_stream_init(cubeb * ctx, cubeb_stre return CUBEB_ERROR_INVALID_FORMAT; } -- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &stm->period_size); -+ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &stm->period_size); +- r = snd_pcm_get_params(stm->pcm, &stm->buffer_size, &period_size); ++ r = WRAP(snd_pcm_get_params)(stm->pcm, &stm->buffer_size, &period_size); assert(r == 0); - stm->nfds = snd_pcm_poll_descriptors_count(stm->pcm); + stm->nfds = WRAP(snd_pcm_poll_descriptors_count)(stm->pcm); assert(stm->nfds > 0); stm->saved_fds = calloc(stm->nfds, sizeof(struct pollfd)); assert(stm->saved_fds); - r = snd_pcm_poll_descriptors(stm->pcm, stm->saved_fds, stm->nfds); + r = WRAP(snd_pcm_poll_descriptors)(stm->pcm, stm->saved_fds, stm->nfds); assert((nfds_t) r == stm->nfds); r = pthread_cond_init(&stm->cond, NULL); @@ -895,7 +1001,7 @@ alsa_stream_destroy(cubeb_stream * stm) pthread_mutex_lock(&stm->mutex); if (stm->pcm) { if (stm->state == DRAINING) { - snd_pcm_drain(stm->pcm); + WRAP(snd_pcm_drain)(stm->pcm); } alsa_locked_pcm_close(stm->pcm); stm->pcm = NULL; @@ -938,12 +1044,12 @@ alsa_get_max_channel_count(cubeb * ctx, uint32_t * max_channels) return CUBEB_ERROR; } - r = snd_pcm_hw_params_any(stm->pcm, hw_params); + r = WRAP(snd_pcm_hw_params_any)(stm->pcm, hw_params); if (r < 0) { return CUBEB_ERROR; } - r = snd_pcm_hw_params_get_channels_max(hw_params, max_channels); + r = WRAP(snd_pcm_hw_params_get_channels_max)(hw_params, max_channels); if (r < 0) { return CUBEB_ERROR; } -@@ -963,34 +1069,34 @@ alsa_get_preferred_sample_rate(cubeb * ctx, uint32_t * rate) { +@@ -969,34 +1075,34 @@ alsa_get_preferred_sample_rate(cubeb * c /* get a pcm, disabling resampling, so we get a rate the * hardware/dmix/pulse/etc. supports. */ -- r = snd_pcm_open(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0); -+ r = WRAP(snd_pcm_open)(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK | SND_PCM_NO_AUTO_RESAMPLE, 0); +- r = snd_pcm_open(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK, SND_PCM_NO_AUTO_RESAMPLE); ++ r = WRAP(snd_pcm_open)(&pcm, CUBEB_ALSA_PCM_NAME, SND_PCM_STREAM_PLAYBACK, SND_PCM_NO_AUTO_RESAMPLE); if (r < 0) { return CUBEB_ERROR; } - r = snd_pcm_hw_params_any(pcm, hw_params); + r = WRAP(snd_pcm_hw_params_any)(pcm, hw_params); if (r < 0) { - snd_pcm_close(pcm); + WRAP(snd_pcm_close)(pcm); return CUBEB_ERROR; } - r = snd_pcm_hw_params_get_rate(hw_params, rate, &dir); + r = WRAP(snd_pcm_hw_params_get_rate)(hw_params, rate, &dir); if (r >= 0) { /* There is a default rate: use it. */ - snd_pcm_close(pcm); + WRAP(snd_pcm_close)(pcm); return CUBEB_OK; } /* Use a common rate, alsa may adjust it based on hw/etc. capabilities. */ *rate = 44100; - r = snd_pcm_hw_params_set_rate_near(pcm, hw_params, rate, NULL); + r = WRAP(snd_pcm_hw_params_set_rate_near)(pcm, hw_params, rate, NULL); if (r < 0) { - snd_pcm_close(pcm); + WRAP(snd_pcm_close)(pcm); return CUBEB_ERROR; } - snd_pcm_close(pcm); + WRAP(snd_pcm_close)(pcm); return CUBEB_OK; } @@ -1013,7 +1119,7 @@ alsa_stream_start(cubeb_stream * stm) ctx = stm->context; pthread_mutex_lock(&stm->mutex); - snd_pcm_pause(stm->pcm, 0); + WRAP(snd_pcm_pause)(stm->pcm, 0); gettimeofday(&stm->last_activity, NULL); pthread_mutex_unlock(&stm->mutex); @@ -1047,7 +1153,7 @@ alsa_stream_stop(cubeb_stream * stm) pthread_mutex_unlock(&ctx->mutex); pthread_mutex_lock(&stm->mutex); - snd_pcm_pause(stm->pcm, 1); + WRAP(snd_pcm_pause)(stm->pcm, 1); pthread_mutex_unlock(&stm->mutex); return CUBEB_OK; @@ -1063,8 +1169,8 @@ alsa_stream_get_position(cubeb_stream * stm, uint64_t * position) pthread_mutex_lock(&stm->mutex); delay = -1; - if (snd_pcm_state(stm->pcm) != SND_PCM_STATE_RUNNING || - snd_pcm_delay(stm->pcm, &delay) != 0) { + if (WRAP(snd_pcm_state)(stm->pcm) != SND_PCM_STATE_RUNNING || + WRAP(snd_pcm_delay)(stm->pcm, &delay) != 0) { *position = stm->last_position; pthread_mutex_unlock(&stm->mutex); return CUBEB_OK; @@ -1089,7 +1195,7 @@ alsa_stream_get_latency(cubeb_stream * stm, uint32_t * latency) snd_pcm_sframes_t delay; /* This function returns the delay in frames until a frame written using snd_pcm_writei is sent to the DAC. The DAC delay should be < 1ms anyways. */ - if (snd_pcm_delay(stm->pcm, &delay)) { + if (WRAP(snd_pcm_delay)(stm->pcm, &delay)) { return CUBEB_ERROR; } diff --git media/libcubeb/src/cubeb_oss.c media/libcubeb/src/cubeb_oss.c new file mode 100644 index 0000000..5e38e27 --- /dev/null +++ mozilla/media/libcubeb/src/cubeb_oss.c -@@ -0,0 +1,432 @@ +@@ -0,0 +1,442 @@ +/* + * Copyright © 2014 Mozilla Foundation + * + * This program is made available under an ISC-style license. See the + * accompanying file LICENSE for details. + */ +#if defined(HAVE_SYS_SOUNDCARD_H) +#include +#else +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include ++#include + +#include "cubeb/cubeb.h" +#include "cubeb-internal.h" + +#ifndef CUBEB_OSS_DEFAULT_OUTPUT +#define CUBEB_OSS_DEFAULT_OUTPUT "/dev/dsp" +#endif + +#define OSS_BUFFER_SIZE 1024 + +struct cubeb { + struct cubeb_ops const * ops; +}; + +struct cubeb_stream { + cubeb * context; + + cubeb_data_callback data_callback; + cubeb_state_callback state_callback; + void * user_ptr; + float volume; + float panning; + + pthread_mutex_t state_mutex; + pthread_cond_t state_cond; + + int running; + int stopped; + int floating; + + /* These two vars are needed to support old versions of OSS */ + unsigned int position_bytes; + unsigned int last_position_bytes; + + uint64_t written_frags; /* The number of fragments written to /dev/dsp */ + uint64_t missed_frags; /* fragments output with stopped stream */ + + cubeb_stream_params params; + int fd; + pthread_t th; +}; + +static struct cubeb_ops const oss_ops; + +int oss_init(cubeb ** context, char const * context_name) +{ + cubeb* ctx = (cubeb*)malloc(sizeof(cubeb)); + ctx->ops = &oss_ops; + *context = ctx; + return CUBEB_OK; +} + +static void oss_destroy(cubeb *ctx) +{ + free(ctx); +} + +static char const * oss_get_backend_id(cubeb * context) +{ + static char oss_name[] = "oss"; + return oss_name; +} + +static int oss_get_max_channel_count(cubeb * ctx, uint32_t * max_channels) +{ + *max_channels = 2; /* Let's support only stereo for now */ + return CUBEB_OK; +} + +static int oss_get_min_latency(cubeb * context, cubeb_stream_params params, + uint32_t * latency_ms) +{ + /* 40ms is a big enough number to work ok */ + *latency_ms = 40; + return CUBEB_OK; +} + +static int oss_get_preferred_sample_rate(cubeb *context, uint32_t * rate) +{ + /* 48000 seems a prefered choice for most audio devices + * and a good choice for OSS */ + *rate = 48000; + return CUBEB_OK; +} + +static void run_state_callback(cubeb_stream *stream, cubeb_state state) +{ + if (stream->state_callback) { + stream->state_callback(stream, stream->user_ptr, state); + } +} + +static long run_data_callback(cubeb_stream *stream, void *buffer, long nframes) +{ + long got = 0; + pthread_mutex_lock(&stream->state_mutex); + if (stream->data_callback && stream->running && !stream->stopped) { + pthread_mutex_unlock(&stream->state_mutex); -+ got = stream->data_callback(stream, stream->user_ptr, buffer, nframes); ++ got = stream->data_callback(stream, stream->user_ptr, NULL, buffer, nframes); + } else { + pthread_mutex_unlock(&stream->state_mutex); + } + return got; +} + +static void apply_volume_int(int16_t* buffer, unsigned int n, + float volume, float panning) +{ + float left = volume; + float right = volume; + unsigned int i; + int pan[2]; + if (panning<0) { + right *= (1+panning); + } else { + left *= (1-panning); + } + pan[0] = 128.0*left; + pan[1] = 128.0*right; + for(i=0; irunning) { + pthread_mutex_lock(&stream->state_mutex); + if (stream->stopped) { + pthread_mutex_unlock(&stream->state_mutex); + run_state_callback(stream, CUBEB_STATE_STOPPED); + pthread_mutex_lock(&stream->state_mutex); + while (stream->stopped) { + pthread_cond_wait(&stream->state_cond, &stream->state_mutex); + } + pthread_mutex_unlock(&stream->state_mutex); + run_state_callback(stream, CUBEB_STATE_STARTED); + continue; + } + pthread_mutex_unlock(&stream->state_mutex); + if (stream->floating) { + got = run_data_callback(stream, f_buffer, + OSS_BUFFER_SIZE/stream->params.channels); + apply_volume_float(f_buffer, got*stream->params.channels, + stream->volume, stream->panning); + for (i=0; i<((unsigned long)got)*stream->params.channels; i++) { + /* Clipping is prefered to overflow */ + if(f_buffer[i]>=1.0){ + f_buffer[i]=1.0; + } + if(f_buffer[i]<=-1.0){ + f_buffer[i]=-1.0; + } + /* One might think that multipling by 32767.0 is logical but results in clipping */ + buffer[i] = f_buffer[i]*32767.0; + } + } else { + got = run_data_callback(stream, buffer, + OSS_BUFFER_SIZE/stream->params.channels); + apply_volume_int(buffer, got*stream->params.channels, + stream->volume, stream->panning); + } + if (got<0) { + run_state_callback(stream, CUBEB_STATE_ERROR); + break; + } + if (!got) { + run_state_callback(stream, CUBEB_STATE_DRAINED); + } + if (got) { + size_t i = 0; + size_t s = got*stream->params.channels*sizeof(int16_t); + while (i < s) { + ssize_t n = write(stream->fd, ((char*)buffer) + i, s - i); + if (n<=0) { + run_state_callback(stream, CUBEB_STATE_ERROR); + break; + } + i+=n; + } + stream->written_frags+=got; + } + } + return NULL; +} + +static void oss_try_set_latency(cubeb_stream* stream, unsigned int latency) +{ + unsigned int latency_bytes, n_frag; + int frag; + /* fragment size of 1024 is a good choice with good chances to be accepted */ + unsigned int frag_size=1024; + unsigned int frag_log=10; /* 2^frag_log = frag_size */ + latency_bytes = + latency*stream->params.rate*stream->params.channels*sizeof(uint16_t)/1000; + n_frag = latency_bytes>>frag_log; + frag = (n_frag<<16) | frag_log; + /* Even if this fails we wish to continue, not checking for errors */ + ioctl(stream->fd, SNDCTL_DSP_SETFRAGMENT, &frag); +} + +static int oss_stream_init(cubeb * context, cubeb_stream ** stm, + char const * stream_name, -+ cubeb_stream_params stream_params, ++ cubeb_devid input_device, ++ cubeb_stream_params * input_stream_params, ++ cubeb_devid output_device, ++ cubeb_stream_params * output_stream_params, + unsigned int latency, + cubeb_data_callback data_callback, + cubeb_state_callback state_callback, void * user_ptr) +{ + cubeb_stream* stream = (cubeb_stream*)malloc(sizeof(cubeb_stream)); + stream->context = context; + stream->data_callback = data_callback; + stream->state_callback = state_callback; + stream->user_ptr = user_ptr; + ++ assert(!input_stream_params && "not supported."); ++ if (input_device || output_device) { ++ /* Device selection not yet implemented. */ ++ return CUBEB_ERROR_DEVICE_UNAVAILABLE; ++ } ++ + if ((stream->fd = open(CUBEB_OSS_DEFAULT_OUTPUT, O_WRONLY)) == -1) { + free(stream); + return CUBEB_ERROR; + } +#define SET(what, to) do { unsigned int i = to; \ + int j = ioctl(stream->fd, what, &i); \ + if (j == -1 || i != to) { \ + close(stream->fd); \ + free(stream); \ + return CUBEB_ERROR_INVALID_FORMAT; } } while (0) + -+ stream->params = stream_params; ++ stream->params = *output_stream_params; + stream->volume = 1.0; + stream->panning = 0.0; + + oss_try_set_latency(stream, latency); + + stream->floating = 0; + SET(SNDCTL_DSP_CHANNELS, stream->params.channels); + SET(SNDCTL_DSP_SPEED, stream->params.rate); + switch (stream->params.format) { + case CUBEB_SAMPLE_S16LE: + SET(SNDCTL_DSP_SETFMT, AFMT_S16_LE); + break; + case CUBEB_SAMPLE_S16BE: + SET(SNDCTL_DSP_SETFMT, AFMT_S16_BE); + break; + case CUBEB_SAMPLE_FLOAT32LE: + SET(SNDCTL_DSP_SETFMT, AFMT_S16_NE); + stream->floating = 1; + break; + default: + close(stream->fd); + free(stream); + return CUBEB_ERROR; + } + + + pthread_mutex_init(&stream->state_mutex, NULL); + pthread_cond_init(&stream->state_cond, NULL); + + stream->running = 1; + stream->stopped = 1; + stream->position_bytes = 0; + stream->last_position_bytes = 0; + stream->written_frags = 0; + stream->missed_frags = 0; + + pthread_create(&stream->th, NULL, writer, (void*)stream); + + *stm = stream; + + return CUBEB_OK; +} + +static void oss_stream_destroy(cubeb_stream * stream) +{ + pthread_mutex_lock(&stream->state_mutex); + + stream->running = 0; + stream->stopped = 0; + pthread_cond_signal(&stream->state_cond); + + pthread_mutex_unlock(&stream->state_mutex); + + pthread_join(stream->th, NULL); + + pthread_mutex_destroy(&stream->state_mutex); + pthread_cond_destroy(&stream->state_cond); + close(stream->fd); + free(stream); +} + +static int oss_stream_get_latency(cubeb_stream * stream, uint32_t * latency) +{ + if (ioctl(stream->fd, SNDCTL_DSP_GETODELAY, latency)==-1) { + return CUBEB_ERROR; + } + /* Convert latency from bytes to frames */ + *latency /= stream->params.channels*sizeof(int16_t); + return CUBEB_OK; +} + + +static int oss_stream_current_optr(cubeb_stream * stream, uint64_t * position) +{ + count_info ci; + /* Unfortunately, this ioctl is only available in OSS 4.x */ +#ifdef SNDCTL_DSP_CURRENT_OPTR + oss_count_t count; + if (ioctl(stream->fd, SNDCTL_DSP_CURRENT_OPTR, &count) != -1) { + *position = count.samples;// + count.fifo_samples; + return CUBEB_OK; + } +#endif + /* Fall back to this ioctl in case the previous one fails */ + if (ioctl(stream->fd, SNDCTL_DSP_GETOPTR, &ci) == -1) { + return CUBEB_ERROR; + } + /* ci.bytes is only 32 bit and will start to wrap after arithmetic overflow */ + stream->position_bytes += ci.bytes - stream->last_position_bytes; + stream->last_position_bytes = ci.bytes; + *position = stream->position_bytes/stream->params.channels/sizeof(int16_t); + return CUBEB_OK; +} + +static int oss_stream_get_position(cubeb_stream * stream, uint64_t * position) +{ + if ( oss_stream_current_optr(stream, position) == CUBEB_OK ){ + *position -= stream->missed_frags; + return CUBEB_OK; + } + /* If no correct method to get position works we resort to this */ + *position = stream->written_frags; + return CUBEB_OK; +} + + +static int oss_stream_start(cubeb_stream * stream) +{ + pthread_mutex_lock(&stream->state_mutex); + if (stream->stopped) { + uint64_t ptr; + oss_stream_current_optr(stream, &ptr); + stream->missed_frags = ptr - stream->written_frags; + stream->stopped = 0; + pthread_cond_signal(&stream->state_cond); + } + pthread_mutex_unlock(&stream->state_mutex); + return CUBEB_OK; +} + +static int oss_stream_stop(cubeb_stream * stream) +{ + pthread_mutex_lock(&stream->state_mutex); + stream->stopped = 1; + pthread_mutex_unlock(&stream->state_mutex); + return CUBEB_OK; +} + +int oss_stream_set_panning(cubeb_stream * stream, float panning) +{ + if (stream->params.channels == 2) { + stream->panning=panning; + } + return CUBEB_OK; +} + +int oss_stream_set_volume(cubeb_stream * stream, float volume) +{ + stream->volume=volume; + return CUBEB_OK; +} + +static struct cubeb_ops const oss_ops = { + .init = oss_init, + .get_backend_id = oss_get_backend_id, + .get_max_channel_count = oss_get_max_channel_count, + .get_min_latency = oss_get_min_latency, + .get_preferred_sample_rate = oss_get_preferred_sample_rate, + .destroy = oss_destroy, + .stream_init = oss_stream_init, + .stream_destroy = oss_stream_destroy, + .stream_start = oss_stream_start, + .stream_stop = oss_stream_stop, + .stream_get_position = oss_stream_get_position, + .stream_get_latency = oss_stream_get_latency, + .stream_set_volume = oss_stream_set_volume, + .stream_set_panning = oss_stream_set_panning, + .stream_get_current_device = NULL, + .stream_device_destroy = NULL, + .stream_register_device_changed_callback = NULL +}; diff --git media/libcubeb/src/moz.build media/libcubeb/src/moz.build index 8b7a0dd..31212ce 100644 --- mozilla/media/libcubeb/src/moz.build +++ mozilla/media/libcubeb/src/moz.build @@ -17,6 +17,12 @@ if CONFIG['MOZ_ALSA']: ] DEFINES['USE_ALSA'] = True +if CONFIG['MOZ_OSS']: + SOURCES += [ + 'cubeb_oss.c', + ] + DEFINES['USE_OSS'] = True + if CONFIG['MOZ_PULSEAUDIO']: SOURCES += [ 'cubeb_pulse.c', @@ -75,5 +81,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': FAIL_ON_WARNINGS = True +CFLAGS += CONFIG['MOZ_OSS_CFLAGS'] CFLAGS += CONFIG['MOZ_ALSA_CFLAGS'] CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS'] diff --git media/libcubeb/tests/moz.build media/libcubeb/tests/moz.build index 1b17c7b..48b56c2 100644 --- mozilla/media/libcubeb/tests/moz.build +++ mozilla/media/libcubeb/tests/moz.build @@ -73,7 +73,6 @@ elif CONFIG['OS_TARGET'] == 'OpenBSD': 'sndio', ] else: - OS_LIBS += CONFIG['MOZ_ALSA_LIBS'] OS_LIBS += CONFIG['MOZ_PULSEAUDIO_LIBS'] if CONFIG['GNU_CXX']: diff --git media/libcubeb/update.sh media/libcubeb/update.sh index a96badd..2f9585e 100755 --- mozilla/media/libcubeb/update.sh +++ mozilla/media/libcubeb/update.sh -@@ -10,6 +10,7 @@ cp $1/src/cubeb_audiounit.c src - cp $1/src/cubeb_pulse.c src - cp $1/src/cubeb_sndio.c src +@@ -16,6 +16,7 @@ cp $1/src/cubeb_audiounit.cpp src + cp $1/src/cubeb_osx_run_loop.h src + cp $1/src/cubeb_jack.cpp src cp $1/src/cubeb_opensl.c src +cp $1/src/cubeb_oss.c src - cp $1/src/cubeb_audiotrack.c src - cp $1/src/cubeb_wasapi.cpp src - cp $1/src/cubeb_resampler.h src + cp $1/src/cubeb_panner.cpp src + cp $1/src/cubeb_panner.h src + cp $1/src/cubeb_pulse.c src diff --git media/webrtc/signaling/test/common.build media/webrtc/signaling/test/common.build index 991f03f..3d99eb5 100644 --- mozilla/media/webrtc/signaling/test/common.build +++ mozilla/media/webrtc/signaling/test/common.build @@ -102,8 +102,8 @@ USE_LIBS += ['mozglue'] OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] OS_LIBS += CONFIG['REALTIME_LIBS'] -if CONFIG['MOZ_ALSA']: - OS_LIBS += CONFIG['MOZ_ALSA_LIBS'] +if CONFIG['MOZ_OSS']: + OS_LIBS += CONFIG['MOZ_OSS_LIBS'] - if CONFIG['MOZ_NATIVE_JPEG']: + if CONFIG['MOZ_SYSTEM_JPEG']: OS_LIBS += CONFIG['MOZ_JPEG_LIBS'] diff --git toolkit/library/moz.build toolkit/library/moz.build index e191f13..4fb268a 100644 --- mozilla/toolkit/library/moz.build +++ mozilla/toolkit/library/moz.build -@@ -234,8 +234,8 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: +@@ -234,8 +234,8 @@ if CONFIG['MOZ_SYSTEM_LIBVPX']: if not CONFIG['MOZ_TREE_PIXMAN']: OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] -if CONFIG['MOZ_ALSA']: - OS_LIBS += CONFIG['MOZ_ALSA_LIBS'] +if CONFIG['MOZ_OSS']: + OS_LIBS += CONFIG['MOZ_OSS_LIBS'] if CONFIG['HAVE_CLOCK_MONOTONIC']: OS_LIBS += CONFIG['REALTIME_LIBS'] Index: head/mail/thunderbird/files/patch-bug1288587 =================================================================== --- head/mail/thunderbird/files/patch-bug1288587 (nonexistent) +++ head/mail/thunderbird/files/patch-bug1288587 (revision 436667) @@ -0,0 +1,67 @@ +diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure +index 855214a..1e91d51 100644 +--- mozilla/build/moz.configure/init.configure ++++ mozilla/build/moz.configure/init.configure +@@ -165,16 +165,17 @@ option(env='PYTHON', nargs=1, help='Python interpreter') + # ============================================================== + @depends('PYTHON', check_build_environment, mozconfig, '--help') + @imports('os') + @imports('sys') + @imports('subprocess') + @imports(_from='mozbuild.configure.util', _import='LineIO') + @imports(_from='mozbuild.virtualenv', _import='VirtualenvManager') + @imports(_from='mozbuild.virtualenv', _import='verify_python_version') ++@imports(_from='__builtin__', _import='KeyError') + @imports('distutils.sysconfig') + def virtualenv_python(env_python, build_env, mozconfig, help): + if help: + return + + python = env_python[0] if env_python else None + + # Ideally we'd rely on the mozconfig injection from mozconfig_options, +@@ -184,16 +185,22 @@ def virtualenv_python(env_python, build_env, mozconfig, help): + if 'PYTHON' in mozconfig['env']['added']: + python = mozconfig['env']['added']['PYTHON'] + elif 'PYTHON' in mozconfig['env']['modified']: + python = mozconfig['env']['modified']['PYTHON'][1] + elif 'PYTHON' in mozconfig['vars']['added']: + python = mozconfig['vars']['added']['PYTHON'] + elif 'PYTHON' in mozconfig['vars']['modified']: + python = mozconfig['vars']['modified']['PYTHON'][1] ++ for i in ('env', 'vars'): ++ for j in ('added', 'modified'): ++ try: ++ del mozconfig[i][j]['PYTHON'] ++ except KeyError: ++ pass + + with LineIO(lambda l: log.error(l)) as out: + verify_python_version(out) + topsrcdir, topobjdir = build_env.topsrcdir, build_env.topobjdir + if topobjdir.endswith('/js/src'): + topobjdir = topobjdir[:-7] + + with LineIO(lambda l: log.info(l)) as out: +@@ -219,17 +226,20 @@ def virtualenv_python(env_python, build_env, mozconfig, help): + log.info('Creating Python environment') + manager.build(python) + + python = normsep(manager.python_path) + + if python != normsep(sys.executable): + log.info('Reexecuting in the virtualenv') + if env_python: +- del os.environ['PYTHON'] ++ try: ++ del os.environ['PYTHON'] ++ except KeyError: ++ pass + # One would prefer to use os.execl, but that's completely borked on + # Windows. + sys.exit(subprocess.call([python] + sys.argv)) + + # We are now in the virtualenv + if not distutils.sysconfig.get_python_lib(): + die('Could not determine python site packages directory') + Property changes on: head/mail/thunderbird/files/patch-bug1288587 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug1322660 =================================================================== --- head/mail/thunderbird/files/patch-bug1322660 (nonexistent) +++ head/mail/thunderbird/files/patch-bug1322660 (revision 436667) @@ -0,0 +1,80 @@ +--- mozilla/modules/woff2/src/store_bytes.h ++++ mozilla/modules/woff2/src/store_bytes.h +@@ -29,41 +29,44 @@ inline size_t StoreU32(uint8_t* dst, size_t offset, uint32_t x) { + dst[offset + 1] = x >> 16; + dst[offset + 2] = x >> 8; + dst[offset + 3] = x; + return offset + 4; + } + + inline size_t Store16(uint8_t* dst, size_t offset, int x) { + #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) +- *reinterpret_cast(dst + offset) = +- ((x & 0xFF) << 8) | ((x & 0xFF00) >> 8); ++ uint16_t v = ((x & 0xFF) << 8) | ((x & 0xFF00) >> 8); ++ memcpy(dst + offset, &v, 2); + #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) +- *reinterpret_cast(dst + offset) = static_cast(x); ++ uint16_t v = static_cast(x); ++ memcpy(dst + offset, &v, 2); + #else + dst[offset] = x >> 8; + dst[offset + 1] = x; + #endif + return offset + 2; + } + + inline void StoreU32(uint32_t val, size_t* offset, uint8_t* dst) { + dst[(*offset)++] = val >> 24; + dst[(*offset)++] = val >> 16; + dst[(*offset)++] = val >> 8; + dst[(*offset)++] = val; + } + + inline void Store16(int val, size_t* offset, uint8_t* dst) { + #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) +- *reinterpret_cast(dst + *offset) = ++ uint16_t v = ((val & 0xFF) << 8) | ((val & 0xFF00) >> 8); ++ memcpy(dst + *offset, &v, 2); + ((val & 0xFF) << 8) | ((val & 0xFF00) >> 8); + *offset += 2; + #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) +- *reinterpret_cast(dst + *offset) = static_cast(val); ++ uint16_t v = static_cast(val); ++ memcpy(dst + *offset, &v, 2); + *offset += 2; + #else + dst[(*offset)++] = val >> 8; + dst[(*offset)++] = val; + #endif + } + + inline void StoreBytes(const uint8_t* data, size_t len, +--- mozilla/modules/woff2/src/woff2_common.cc ++++ mozilla/modules/woff2/src/woff2_common.cc +@@ -20,22 +20,23 @@ + + namespace woff2 { + + + uint32_t ComputeULongSum(const uint8_t* buf, size_t size) { + uint32_t checksum = 0; + size_t aligned_size = size & ~3; + for (size_t i = 0; i < aligned_size; i += 4) { ++ uint32_t v; ++ memcpy(&v, buf + i, 4); + #if (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)) +- uint32_t v = *reinterpret_cast(buf + i); + checksum += (((v & 0xFF) << 24) | ((v & 0xFF00) << 8) | + ((v & 0xFF0000) >> 8) | ((v & 0xFF000000) >> 24)); + #elif (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) +- checksum += *reinterpret_cast(buf + i); ++ checksum += v; + #else + checksum += (buf[i] << 24) | (buf[i + 1] << 16) | + (buf[i + 2] << 8) | buf[i + 3]; + #endif + } + + // treat size not aligned on 4 as if it were padded to 4 with 0's + if (size != aligned_size) { Property changes on: head/mail/thunderbird/files/patch-bug1322660 ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-bug826985 =================================================================== --- head/mail/thunderbird/files/patch-bug826985 (revision 436666) +++ head/mail/thunderbird/files/patch-bug826985 (revision 436667) @@ -1,179 +1,183 @@ commit 8024d93 Author: Henrik Gulbrandsen Date: Fri Jan 4 13:49:22 2013 +0100 Bug 826985 - Support more video formats for WebRTC via libv4l2 on Linux. --- config/system-headers | 1 + - configure.in | 7 +++++++ + old-configure.in | 7 +++++++ media/webrtc/signaling/test/Makefile.in | 1 + .../modules/video_capture/linux/device_info_linux.cc | 17 +++++++++++++++++ .../modules/video_capture/linux/video_capture_linux.cc | 16 +++++++++++++++- .../webrtc/modules/video_capture/video_capture.gypi | 11 +++++++++++ toolkit/library/Makefile.in | 1 + 6 files changed, 52 insertions(+), 1 deletion(-) diff --git config/system-headers config/system-headers index 55e4cd1..76567b3 100644 --- mozilla/config/system-headers +++ mozilla/config/system-headers -@@ -627,6 +627,7 @@ libgnome/libgnome.h +@@ -624,6 +624,7 @@ libgnome/libgnome.h libgnomeui/gnome-icon-lookup.h libgnomeui/gnome-icon-theme.h libgnomeui/gnome-ui-init.h +libv4l2.h - lib$routines.h - limits limits.h -diff --git configure.in configure.in + link.h + #ifdef ANDROID +diff --git old-configure.in configure.in index 55e4cd1..76567b3 100644 ---- mozilla/configure.in -+++ mozilla/configure.in +--- mozilla/old-configure.in ++++ mozilla/old-configure.in @@ -5309,6 +5309,9 @@ if test -n "$MOZ_WEBRTC"; then MOZ_VP8_ENCODER=1 MOZ_VP8_ERROR_CONCEALMENT=1 + dnl with libv4l2 we can support more cameras + PKG_CHECK_MODULES(MOZ_LIBV4L2, libv4l2) + dnl enable once Signaling lands MOZ_WEBRTC_SIGNALING=1 AC_DEFINE(MOZ_WEBRTC_SIGNALING) diff --git build/gyp.mozbuild build/gyp.mozbuild index b483cd1..f1dd1f0 100644 --- mozilla/build/gyp.mozbuild +++ mozilla/build/gyp.mozbuild @@ -11,6 +11,7 @@ gyp_vars = { 'have_ethtool_cmd_speed_hi': 1 if CONFIG['MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI'] else 0, 'include_alsa_audio': 1 if CONFIG['MOZ_ALSA'] else 0, 'include_pulse_audio': 1 if CONFIG['MOZ_PULSEAUDIO'] else 0, + 'use_libv4l2': 1 if CONFIG['MOZ_LIBV4L2_LIBS'] else 0, # basic stuff for everything 'include_internal_video_render': 0, 'clang_use_chrome_plugins': 0, diff --git media/webrtc/signaling/test/common.build media/webrtc/signaling/test/common.build index b483cd1..f1dd1f0 100644 --- mozilla/media/webrtc/signaling/test/common.build +++ mozilla/media/webrtc/signaling/test/common.build @@ -99,6 +99,7 @@ if CONFIG['JS_SHARED_LIBRARY']: USE_LIBS += ['mozglue'] +OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS'] OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] OS_LIBS += CONFIG['REALTIME_LIBS'] diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc index 239a292..bab496c 100644 --- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc +++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/device_info_linux.cc -@@ -25,10 +25,21 @@ +@@ -25,6 +25,9 @@ #else #include #endif +#ifdef HAVE_LIBV4L2 +#include +#endif #include "webrtc/system_wrappers/interface/ref_count.h" #include "webrtc/system_wrappers/interface/trace.h" +@@ -34,6 +37,15 @@ + #define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) ) + #endif +#ifdef HAVE_LIBV4L2 +#define open v4l2_open +#define close v4l2_close +#define dup v4l2_dup +#define ioctl v4l2_ioctl +#define mmap v4l2_mmap +#define munmap v4l2_munmap +#endif - ++ namespace webrtc { -@@ -130,6 +142,11 @@ WebRtc_Word32 DeviceInfoLinux::GetDeviceName( + namespace videocapturemodule +@@ -274,6 +286,11 @@ int32_t DeviceInfoLinux::GetDeviceName( memset(deviceNameUTF8, 0, deviceNameLength); memcpy(cameraName, cap.card, sizeof(cap.card)); + if (cameraName[0] == '\0') + { + sprintf(cameraName, "Camera at /dev/video%d", deviceNumber); + } + if (deviceNameLength >= strlen(cameraName)) { memcpy(deviceNameUTF8, cameraName, strlen(cameraName)); diff --git media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc index 12df1b3..e9863ba 100644 --- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc +++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/linux/video_capture_linux.cc @@ -25,6 +25,9 @@ #else #include #endif +#ifdef HAVE_LIBV4L2 +#include +#endif #include @@ -26,6 +31,15 @@ #include "critical_section_wrapper.h" #include "video_capture_linux.h" +#ifdef HAVE_LIBV4L2 +#define open v4l2_open +#define close v4l2_close +#define dup v4l2_dup +#define ioctl v4l2_ioctl +#define mmap v4l2_mmap +#define munmap v4l2_munmap +#endif + namespace webrtc { namespace videocapturemodule diff --git media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi index d46b5aa..e452223 100644 --- mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi +++ mozilla/media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi @@ -7,6 +7,9 @@ # be found in the AUTHORS file in the root of the source tree. { + 'variables': { + 'use_libv4l2%': 0, + }, 'targets': [ { 'target_name': 'video_capture_module', @@ -75,6 +78,19 @@ 'linux/video_capture_linux.cc', 'linux/video_capture_linux.h', ], + 'conditions': [ + ['use_libv4l2==1', { + 'defines': [ + 'HAVE_LIBV4L2', + ], + 'cflags_mozilla': [ + '$(MOZ_LIBV4L2_CFLAGS)', + ], + 'libraries': [ + '-lv4l2', + ], + }], + ], }], # linux ['OS=="mac"', { 'sources': [ diff --git toolkit/library/moz.build toolkit/library/moz.build index 9c16ffa..1db3794 100644 --- mozilla/toolkit/library/moz.build +++ mozilla/toolkit/library/moz.build @@ -163,6 +163,7 @@ if CONFIG['OS_ARCH'] == 'Linux' and CONF ] OS_LIBS += CONFIG['MOZ_CAIRO_OSLIBS'] +OS_LIBS += CONFIG['MOZ_LIBV4L2_LIBS'] OS_LIBS += CONFIG['MOZ_WEBRTC_X11_LIBS'] OS_LIBS += CONFIG['MOZ_APP_EXTRA_LIBS'] Index: head/mail/thunderbird/files/patch-bug847568 =================================================================== --- head/mail/thunderbird/files/patch-bug847568 (revision 436666) +++ head/mail/thunderbird/files/patch-bug847568 (revision 436667) @@ -1,257 +1,271 @@ # Allow building against system-wide graphite2/harfbuzz. diff --git config/Makefile.in config/Makefile.in -index 14bfc0d..5383399 100644 +index e2e11dc0e27e..a6206bb0ff30 100644 --- mozilla/config/Makefile.in +++ mozilla/config/Makefile.in -@@ -49,6 +49,8 @@ export:: $(export-preqs) - -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ - -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ - -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ -+ -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \ -+ -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \ - $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers - $(INSTALL) system_wrappers $(DIST) - +@@ -41,6 +41,8 @@ export:: $(export-preqs) + $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \ + -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \ + -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \ ++ -DMOZ_SYSTEM_GRAPHITE2=$(MOZ_SYSTEM_GRAPHITE2) \ ++ -DMOZ_SYSTEM_HARFBUZZ=$(MOZ_SYSTEM_HARFBUZZ) \ + -DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \ + -DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \ + -DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \ diff --git config/system-headers config/system-headers -index 18e8703..bdc5f82 100644 +index a0c53c651a3e..5ee7f71f9634 100644 --- mozilla/config/system-headers +++ mozilla/config/system-headers -@@ -1344,3 +1344,11 @@ unicode/utypes.h +@@ -1269,6 +1269,15 @@ libsn/sn-launcher.h + libsn/sn-monitor.h + libsn/sn-util.h #endif - libutil.h - unwind.h -+#if MOZ_NATIVE_GRAPHITE2==1 ++#if MOZ_SYSTEM_GRAPHITE2==1 +graphite2/Font.h +graphite2/Segment.h +#endif -+#if MOZ_NATIVE_HARFBUZZ==1 ++#if MOZ_SYSTEM_HARFBUZZ==1 ++harfbuzz/hb-glib.h +harfbuzz/hb-ot.h +harfbuzz/hb.h +#endif -diff --git configure.in configure.in -index ac38f40..87536b7 100644 ---- mozilla/configure.in -+++ mozilla/configure.in -@@ -7989,6 +7989,49 @@ if test "$USE_FC_FREETYPE"; then - fi - - dnl ======================================================== -+dnl Check for harfbuzz -+dnl ======================================================== -+ -+MOZ_ARG_WITH_BOOL(system-harfbuzz, -+[ --with-system-harfbuzz Use system harfbuzz (located with pkgconfig)], -+MOZ_NATIVE_HARFBUZZ=1, -+MOZ_NATIVE_HARFBUZZ=) -+ -+if test -n "$MOZ_NATIVE_HARFBUZZ"; then -+ PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 1.1.0) -+fi -+ -+AC_SUBST(MOZ_NATIVE_HARFBUZZ) -+ -+dnl ======================================================== -+dnl Check for graphite2 -+dnl ======================================================== -+ -+MOZ_ARG_WITH_BOOL(system-graphite2, -+[ --with-system-graphite2 Use system graphite2 (located with pkgconfig)], -+MOZ_NATIVE_GRAPHITE2=1, -+MOZ_NATIVE_GRAPHITE2=) -+ -+if test -n "$MOZ_NATIVE_GRAPHITE2"; then -+ PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2) -+ -+ dnl graphite2.pc has bogus version, check manually -+ AC_TRY_COMPILE([ #include -+ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ -+ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ -+ * 100 + GR2_VERSION_BUGFIX >= \ -+ (major) * 10000 + (minor) * 100 + (bugfix) ) -+ ], [ -+ #if !GR2_VERSION_REQUIRE(1,3,7) -+ #error "Insufficient graphite2 version." -+ #endif -+ ], [], -+ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) -+fi -+ -+AC_SUBST(MOZ_NATIVE_GRAPHITE2) -+ -+dnl ======================================================== - dnl Check for pixman and cairo - dnl ======================================================== - + #if MOZ_SYSTEM_HUNSPELL==1 + hunspell.hxx + #endif diff --git dom/base/moz.build dom/base/moz.build -index a660ba4..6b2f602 100644 +index 8e19020315ae..2fcdbb6f7b42 100644 --- mozilla/dom/base/moz.build +++ mozilla/dom/base/moz.build -@@ -397,6 +397,9 @@ if CONFIG['INTEL_ARCHITECTURE']: - SOURCES += ['nsTextFragmentSSE2.cpp'] - SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS'] +@@ -464,6 +464,9 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']: + if CONFIG['MOZ_X11']: + CXXFLAGS += CONFIG['TK_CFLAGS'] -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: -+ SOURCES['nsContentUtils.cpp'].flags += CONFIG['MOZ_HARFBUZZ_CFLAGS'] ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + - EXTRA_COMPONENTS += [ - 'ConsoleAPI.manifest', - 'ConsoleAPIStorage.js', + GENERATED_FILES += [ + 'PropertyUseCounterMap.inc', + 'UseCounterList.h', diff --git gfx/graphite2/moz-gr-update.sh gfx/graphite2/moz-gr-update.sh -index f3d76ea..a9e7fb6 100644 +index faaab1b17971..04eff5f09882 100644 --- mozilla/gfx/graphite2/moz-gr-update.sh +++ mozilla/gfx/graphite2/moz-gr-update.sh @@ -1,6 +1,7 @@ #!/bin/bash # Script used to update the Graphite2 library in the mozilla source tree +# and bump version for --with-system-graphite2 # This script lives in gfx/graphite2, along with the library source, # but must be run from the top level of the mozilla-central tree. -@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> +@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s///;s/Windows.h/windows.h/;" {} \; +# chase version for --with-system-graphite2 +perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \ -+ if /GR2_VERSION_REQUIRE/" configure.in ++ if /GR2_VERSION_REQUIRE/" old-configure.in + # summarize what's been touched echo Updated to $RELEASE. echo Here is what changed in the gfx/graphite2 directory: echo -hg stat gfx/graphite2 -+hg stat configure.in gfx/graphite2 ++hg stat old-configure.in gfx/graphite2 echo echo If gfx/graphite2/src/files.mk has changed, please make corresponding diff --git gfx/harfbuzz/README-mozilla gfx/harfbuzz/README-mozilla -index ca57d16..1ce21fe 100644 +index 22c76a7df020..a01490bd49ee 100644 --- mozilla/gfx/harfbuzz/README-mozilla +++ mozilla/gfx/harfbuzz/README-mozilla -@@ -18,3 +18,8 @@ the mozilla tree. - In addition, the src/Makefile.in file here is NOT from upstream, nor is it - generated from src/Makefile.am (the original harfbuzz version); it is a mozilla- - specific makefile that is maintained by hand. +@@ -19,3 +19,8 @@ the mozilla tree. + + If the collection of source files changes, manual updates to moz.build may be + needed, as we don't use the upstream makefiles. + +The in-tree copy may be omitted during build by --with-system-harfbuzz. -+Make sure to keep pkg-config version check within configure.in in sync ++Make sure to keep pkg-config version check within toolkit/moz.configure in sync +with checkout version or increment latest tag by one if it's not based +on upstream release. diff --git gfx/moz.build gfx/moz.build -index 519aa46..6929751 100644 +index 771f652e837a..3b358d84e384 100644 --- mozilla/gfx/moz.build +++ mozilla/gfx/moz.build -@@ -7,6 +7,12 @@ +@@ -10,6 +10,12 @@ with Files('**'): if CONFIG['MOZ_TREE_CAIRO']: DIRS += ['cairo'] -+if not CONFIG['MOZ_NATIVE_GRAPHITE2']: ++if not CONFIG['MOZ_SYSTEM_GRAPHITE2']: + DIRS += ['graphite2/src' ] + -+if not CONFIG['MOZ_NATIVE_HARFBUZZ']: ++if not CONFIG['MOZ_SYSTEM_HARFBUZZ']: + DIRS += ['harfbuzz/src'] + DIRS += [ '2d', 'ycbcr', -@@ -15,8 +21,6 @@ DIRS += [ +@@ -18,8 +24,6 @@ DIRS += [ 'qcms', 'gl', 'layers', - 'graphite2/src', - 'harfbuzz/src', 'ots/src', 'thebes', 'ipc', diff --git gfx/skia/generate_mozbuild.py gfx/skia/generate_mozbuild.py -index 28fa6b5..240dced 100755 +index e06ae3457a47..93faa61594a3 100755 --- mozilla/gfx/skia/generate_mozbuild.py +++ mozilla/gfx/skia/generate_mozbuild.py -@@ -134,6 +134,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_ +@@ -143,6 +143,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: '-Wno-unused-private-field', ] -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/skia/moz.build gfx/skia/moz.build -index 1d0c2f9..adb8941 100644 +index 2118677ca3a8..e4978b413784 100644 --- mozilla/gfx/skia/moz.build +++ mozilla/gfx/skia/moz.build -@@ -752,6 +752,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_ +@@ -753,6 +753,9 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']: '-Wno-unused-private-field', ] -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + - if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'): + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android'): CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS'] CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS'] diff --git gfx/thebes/moz.build gfx/thebes/moz.build -index d5852fa..aeeab25 100644 +index dee9b7bfa2cb..bd801f3a468e 100644 --- mozilla/gfx/thebes/moz.build +++ mozilla/gfx/thebes/moz.build -@@ -306,7 +306,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk +@@ -273,7 +273,13 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'): LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES'] -DEFINES['GRAPHITE2_STATIC'] = True -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: -+ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] -+ -+if CONFIG['MOZ_NATIVE_GRAPHITE2']: ++if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS'] +else: + DEFINES['GRAPHITE2_STATIC'] = True ++ ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: ++ CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] if CONFIG['CLANG_CXX']: # Suppress warnings from Skia header files. -index d736943..41a931f 100644 +diff --git intl/unicharutil/util/moz.build intl/unicharutil/util/moz.build +index cb1233c56d7e..06fb1f9f174b 100644 --- mozilla/intl/unicharutil/util/moz.build +++ mozilla/intl/unicharutil/util/moz.build -@@ -44,4 +44,7 @@ if CONFIG['ENABLE_INTL_API']: - LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES'] +@@ -40,4 +40,7 @@ if CONFIG['_MSC_VER']: + if CONFIG['ENABLE_INTL_API']: USE_LIBS += ['icu'] -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + DIST_INSTALL = True diff --git netwerk/dns/moz.build netwerk/dns/moz.build -index 0b0717a..2e665c9 100644 +index 79c26e3e7001..c4d93bc5f7dc 100644 --- mozilla/netwerk/dns/moz.build +++ mozilla/netwerk/dns/moz.build -@@ -66,6 +66,9 @@ LOCAL_INCLUDES += [ +@@ -69,6 +69,9 @@ LOCAL_INCLUDES += [ '/netwerk/base', ] -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS'] + - if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] > '19': - LOCAL_INCLUDES += ['%' + '%s/bionic/libc/dns/include' % CONFIG['ANDROID_SOURCE']] + if CONFIG['ENABLE_INTL_API']: + DEFINES['IDNA2008'] = True + USE_LIBS += ['icu'] +diff --git old-configure.in old-configure.in +index 95a58b634593..b614eef85c89 100644 +--- mozilla/old-configure.in ++++ mozilla/old-configure.in +@@ -4888,6 +4888,27 @@ dnl ======================================================== + AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR) + dnl ======================================================== ++dnl Check for graphite2 ++dnl ======================================================== ++if test -n "$MOZ_SYSTEM_GRAPHITE2"; then ++ dnl graphite2.pc has bogus version, check manually ++ _SAVE_CFLAGS=$CFLAGS ++ CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS" ++ AC_TRY_COMPILE([ #include ++ #define GR2_VERSION_REQUIRE(major,minor,bugfix) \ ++ ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \ ++ * 100 + GR2_VERSION_BUGFIX >= \ ++ (major) * 10000 + (minor) * 100 + (bugfix) ) ++ ], [ ++ #if !GR2_VERSION_REQUIRE(1,3,8) ++ #error "Insufficient graphite2 version." ++ #endif ++ ], [], ++ [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])]) ++ CFLAGS=$_SAVE_CFLAGS ++fi ++ ++dnl ======================================================== + dnl Check for pixman and cairo + dnl ======================================================== + diff --git toolkit/library/moz.build toolkit/library/moz.build -index 67f0db9..d42137a 100644 +index 24f940e1ed7e..079a575adec3 100644 --- mozilla/toolkit/library/moz.build +++ mozilla/toolkit/library/moz.build -@@ -231,6 +231,12 @@ if CONFIG['MOZ_NATIVE_LIBVPX']: - if not CONFIG['MOZ_TREE_PIXMAN']: - OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS'] +@@ -228,6 +228,12 @@ if CONFIG['MOZ_SYSTEM_JPEG']: + if CONFIG['MOZ_SYSTEM_PNG']: + OS_LIBS += CONFIG['MOZ_PNG_LIBS'] -+if CONFIG['MOZ_NATIVE_GRAPHITE2']: ++if CONFIG['MOZ_SYSTEM_GRAPHITE2']: + OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS'] + -+if CONFIG['MOZ_NATIVE_HARFBUZZ']: ++if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS'] + - if CONFIG['MOZ_OSS']: - OS_LIBS += CONFIG['MOZ_OSS_LIBS'] + if CONFIG['MOZ_SYSTEM_HUNSPELL']: + OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] +diff --git toolkit/moz.configure toolkit/moz.configure +index 9297e4d6f501..d8e273887e4b 100644 +--- mozilla/toolkit/moz.configure ++++ mozilla/toolkit/moz.configure +@@ -343,6 +343,26 @@ add_old_configure_assignment('FT2_LIBS', + add_old_configure_assignment('FT2_CFLAGS', + delayed_getattr(ft2_info, 'cflags')) + ++# Graphite2 ++# ============================================================== ++option('--with-system-graphite2', ++ help="Use system graphite2 (located with pkgconfig)") ++ ++system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2', ++ when='--with-system-graphite2') ++ ++set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True)) ++ ++# HarfBuzz ++# ============================================================== ++option('--with-system-harfbuzz', ++ help="Use system harfbuzz (located with pkgconfig)") ++ ++system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.4.1', ++ when='--with-system-harfbuzz') ++ ++set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True)) ++ + # Apple platform decoder support + # ============================================================== + @depends(toolkit) Index: head/mail/thunderbird/files/patch-bug981348 =================================================================== --- head/mail/thunderbird/files/patch-bug981348 (revision 436666) +++ head/mail/thunderbird/files/patch-bug981348 (revision 436667) @@ -1,41 +1,61 @@ diff --git dom/system/OSFileConstants.cpp dom/system/OSFileConstants.cpp -index 4b21361..cb3be32 100644 +index 88bba9baa401..99f240952dfe 100644 --- mozilla/dom/system/OSFileConstants.cpp +++ mozilla/dom/system/OSFileConstants.cpp -@@ -662,7 +662,7 @@ +@@ -16,14 +16,17 @@ + #include "dirent.h" + #include "poll.h" + #include "sys/stat.h" +-#if defined(ANDROID) ++#if defined(XP_LINUX) + #include + #define statvfs statfs ++#define f_frsize f_bsize + #else + #include "sys/statvfs.h" ++#endif // defined(XP_LINUX) ++#if !defined(ANDROID) + #include "sys/wait.h" + #include +-#endif // defined(ANDROID) ++#endif // !defined(ANDROID) + #endif // defined(XP_UNIX) + #if defined(XP_LINUX) +@@ -699,7 +702,7 @@ static const dom::ConstantSpec gLibcProperties[] = + { "OSFILE_SIZEOF_STATVFS", JS::Int32Value(sizeof (struct statvfs)) }, - { "OSFILE_OFFSETOF_STATVFS_F_BSIZE", JS::Int32Value(offsetof (struct statvfs, f_bsize)) }, + { "OSFILE_OFFSETOF_STATVFS_F_FRSIZE", JS::Int32Value(offsetof (struct statvfs, f_frsize)) }, { "OSFILE_OFFSETOF_STATVFS_F_BAVAIL", JS::Int32Value(offsetof (struct statvfs, f_bavail)) }, #endif // defined(XP_UNIX) diff --git toolkit/components/osfile/modules/osfile_unix_back.jsm toolkit/components/osfile/modules/osfile_unix_back.jsm -index b59fca4..0cf220b 100644 +index a028dda7d5ec..f5c632e3d7e5 100644 --- mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm +++ mozilla/toolkit/components/osfile/modules/osfile_unix_back.jsm @@ -228,8 +228,8 @@ let statvfs = new SharedAll.HollowStructure("statvfs", Const.OSFILE_SIZEOF_STATVFS); - statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BSIZE, - "f_bsize", Type.unsigned_long.implementation); + statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_FRSIZE, + "f_frsize", Type.unsigned_long.implementation); statvfs.add_field_at(Const.OSFILE_OFFSETOF_STATVFS_F_BAVAIL, "f_bavail", Type.fsblkcnt_t.implementation); diff --git toolkit/components/osfile/modules/osfile_unix_front.jsm toolkit/components/osfile/modules/osfile_unix_front.jsm -index 99e5e9b..de642c5 100644 +index bd60d4d8419c..a8cd6b546b0e 100644 --- mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm +++ mozilla/toolkit/components/osfile/modules/osfile_unix_front.jsm -@@ -373,7 +373,7 @@ - throw_on_negative("statvfs", UnixFile.statvfs(sourcePath, fileSystemInfoPtr)); +@@ -399,7 +399,7 @@ + throw_on_negative("statvfs", (UnixFile.statvfs || UnixFile.statfs)(sourcePath, fileSystemInfoPtr)); let bytes = new Type.uint64_t.implementation( - fileSystemInfo.f_bsize * fileSystemInfo.f_bavail); + fileSystemInfo.f_frsize * fileSystemInfo.f_bavail); return bytes.value; }; Index: head/mail/thunderbird/files/patch-build-pgo-profileserver.py =================================================================== --- head/mail/thunderbird/files/patch-build-pgo-profileserver.py (nonexistent) +++ head/mail/thunderbird/files/patch-build-pgo-profileserver.py (revision 436667) @@ -0,0 +1,11 @@ +--- mozilla/build/pgo/profileserver.py.orig 2011-02-24 21:49:47.000000000 +0100 ++++ mozilla/build/pgo/profileserver.py 2011-02-24 21:50:30.000000000 +0100 +@@ -59,7 +59,7 @@ if __name__ == '__main__': + env["MOZ_JAR_LOG_FILE"] = os.path.abspath(jarlog) + print "jarlog: %s" % env["MOZ_JAR_LOG_FILE"] + +- cmdargs = ["http://localhost:%d/index.html" % PORT] ++ cmdargs = ["http://127.0.0.1:%d/index.html" % PORT] + runner = FirefoxRunner(profile=profile, + binary=build.get_binary_path(where="staged-package"), + cmdargs=cmdargs, Property changes on: head/mail/thunderbird/files/patch-build-pgo-profileserver.py ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-env-api-keys =================================================================== --- head/mail/thunderbird/files/patch-env-api-keys (nonexistent) +++ head/mail/thunderbird/files/patch-env-api-keys (revision 436667) @@ -0,0 +1,21 @@ +# Accept API keys from environment like before bug 1294585 + +--- mozilla/build/moz.configure/keyfiles.configure ++++ mozilla/build/moz.configure/keyfiles.configure +@@ -18,6 +18,7 @@ def keyfile(desc, help=None, callback=lambda x: x): + @checking('for the %s key' % desc, lambda x: x and x is not no_key) + @imports(_from='__builtin__', _import='open') + @imports(_from='__builtin__', _import='IOError') ++ @imports(_from='os', _import='environ') + def keyfile(value): + if value: + try: +@@ -28,7 +29,7 @@ def keyfile(desc, help=None, callback=lambda x: x): + raise FatalCheckError("'%s' is empty." % value[0]) + except IOError as e: + raise FatalCheckError("'%s': %s." % (value[0], e.strerror)) +- return no_key ++ return environ.get('MOZ_%s_KEY' % desc.upper().replace(' ', '_')) or no_key + + return keyfile + Property changes on: head/mail/thunderbird/files/patch-env-api-keys ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/thunderbird/files/patch-ijg-libjpeg =================================================================== --- head/mail/thunderbird/files/patch-ijg-libjpeg (revision 436666) +++ head/mail/thunderbird/files/patch-ijg-libjpeg (revision 436667) @@ -1,383 +1,383 @@ # Partially revert bug 791305 to allow building with system IJG jpeg library -diff --git configure.in configure.in +diff --git old-configure.in configure.in index f0aeb5d..1c01010 100644 ---- mozilla/configure.in -+++ mozilla/configure.in -@@ -4027,11 +4027,7 @@ if test "$MOZ_NATIVE_JPEG" = 1; then +--- mozilla/old-configure.in ++++ mozilla/old-configure.in +@@ -4027,11 +4027,7 @@ if test "$MOZ_SYSTEM_JPEG" = 1; then #include ], [ #if JPEG_LIB_VERSION < $MOZJPEG #error "Insufficient JPEG library version ($MOZJPEG required)." - #endif - #ifndef JCS_EXTENSIONS - #error "libjpeg-turbo JCS_EXTENSIONS required" - #endif - ], + #endif ], - MOZ_NATIVE_JPEG=1, + MOZ_SYSTEM_JPEG=1, AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg])) fi diff --git image/decoders/nsJPEGDecoder.cpp image/decoders/nsJPEGDecoder.cpp index 8fa8200..1d2a259 100644 --- mozilla/image/decoders/nsJPEGDecoder.cpp +++ mozilla/image/decoders/nsJPEGDecoder.cpp @@ -21,13 +21,28 @@ extern "C" { #include "iccjpeg.h" -} +#ifdef JCS_EXTENSIONS #if MOZ_BIG_ENDIAN #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_XRGB #else #define MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB JCS_EXT_BGRX #endif +#else +/* Colorspace conversion (copied from jpegint.h) */ +struct jpeg_color_deconverter { + JMETHOD(void, start_pass, (j_decompress_ptr cinfo)); + JMETHOD(void, color_convert, (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows)); +}; + +METHODDEF(void) +ycc_rgb_convert_argb (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows); +#endif +} static void cmyk_convert_rgb(JSAMPROW row, JDIMENSION width); @@ -367,6 +382,7 @@ nsJPEGDecoder::WriteInternal(const char* case JCS_GRAYSCALE: case JCS_RGB: case JCS_YCbCr: +#ifdef JCS_EXTENSIONS // if we're not color managing we can decode directly to // MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB if (mCMSMode != eCMSMode_All) { @@ -375,6 +391,9 @@ nsJPEGDecoder::WriteInternal(const char* } else { mInfo.out_color_space = JCS_RGB; } +#else + mInfo.out_color_space = JCS_RGB; +#endif break; case JCS_CMYK: case JCS_YCCK: @@ -448,6 +467,16 @@ nsJPEGDecoder::WriteInternal(const char* return; // I/O suspension } +#ifndef JCS_EXTENSIONS + /* Force to use our YCbCr to Packed RGB converter when possible */ + if (!mTransform && (mCMSMode != eCMSMode_All) && + mInfo.jpeg_color_space == JCS_YCbCr && mInfo.out_color_space == JCS_RGB) { + /* Special case for the most common case: transform from YCbCr direct into packed ARGB */ + mInfo.out_color_components = 4; /* Packed ARGB pixels are always 4 bytes...*/ + mInfo.cconvert->color_convert = ycc_rgb_convert_argb; + } +#endif + // If this is a progressive JPEG ... mState = mInfo.buffered_image ? JPEG_DECOMPRESS_PROGRESSIVE : JPEG_DECOMPRESS_SEQUENTIAL; @@ -605,7 +633,11 @@ nsJPEGDecoder::OutputScanlines(bool* sus uint32_t* imageRow = ((uint32_t*)mImageData) + (mInfo.output_scanline * mInfo.output_width); +#ifdef JCS_EXTENSIONS if (mInfo.out_color_space == MOZ_JCS_EXT_NATIVE_ENDIAN_XRGB) { +#else + if (mInfo.cconvert->color_convert == ycc_rgb_convert_argb) { +#endif // Special case: scanline will be directly converted into packed ARGB if (jpeg_read_scanlines(&mInfo, (JSAMPARRAY)&imageRow, 1) != 1) { *suspend = true; // suspend @@ -920,6 +952,282 @@ term_source (j_decompress_ptr jd) } // namespace mozilla +#ifndef JCS_EXTENSIONS +/**************** YCbCr -> Cairo's RGB24/ARGB32 conversion: most common case **************/ + +/* + * YCbCr is defined per CCIR 601-1, except that Cb and Cr are + * normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5. + * The conversion equations to be implemented are therefore + * R = Y + 1.40200 * Cr + * G = Y - 0.34414 * Cb - 0.71414 * Cr + * B = Y + 1.77200 * Cb + * where Cb and Cr represent the incoming values less CENTERJSAMPLE. + * (These numbers are derived from TIFF 6.0 section 21, dated 3-June-92.) + * + * To avoid floating-point arithmetic, we represent the fractional constants + * as integers scaled up by 2^16 (about 4 digits precision); we have to divide + * the products by 2^16, with appropriate rounding, to get the correct answer. + * Notice that Y, being an integral input, does not contribute any fraction + * so it need not participate in the rounding. + * + * For even more speed, we avoid doing any multiplications in the inner loop + * by precalculating the constants times Cb and Cr for all possible values. + * For 8-bit JSAMPLEs this is very reasonable (only 256 entries per table); + * for 12-bit samples it is still acceptable. It's not very reasonable for + * 16-bit samples, but if you want lossless storage you shouldn't be changing + * colorspace anyway. + * The Cr=>R and Cb=>B values can be rounded to integers in advance; the + * values for the G calculation are left scaled up, since we must add them + * together before rounding. + */ + +#define SCALEBITS 16 /* speediest right-shift on some machines */ + +/* Use static tables for color processing. */ +/* Four tables, each 256 entries of 4 bytes totals 4K which is not bad... */ + +const int Cr_r_tab[(MAXJSAMPLE+1) * sizeof(int)] ={ + -0xb3, -0xb2, -0xb1, -0xaf, -0xae, -0xac, + -0xab, -0xaa, -0xa8, -0xa7, -0xa5, -0xa4, + -0xa3, -0xa1, -0xa0, -0x9e, -0x9d, -0x9c, + -0x9a, -0x99, -0x97, -0x96, -0x95, -0x93, + -0x92, -0x90, -0x8f, -0x8e, -0x8c, -0x8b, + -0x89, -0x88, -0x87, -0x85, -0x84, -0x82, + -0x81, -0x80, -0x7e, -0x7d, -0x7b, -0x7a, + -0x79, -0x77, -0x76, -0x74, -0x73, -0x72, + -0x70, -0x6f, -0x6d, -0x6c, -0x6b, -0x69, + -0x68, -0x66, -0x65, -0x64, -0x62, -0x61, + -0x5f, -0x5e, -0x5d, -0x5b, -0x5a, -0x58, + -0x57, -0x56, -0x54, -0x53, -0x51, -0x50, + -0x4f, -0x4d, -0x4c, -0x4a, -0x49, -0x48, + -0x46, -0x45, -0x43, -0x42, -0x40, -0x3f, + -0x3e, -0x3c, -0x3b, -0x39, -0x38, -0x37, + -0x35, -0x34, -0x32, -0x31, -0x30, -0x2e, + -0x2d, -0x2b, -0x2a, -0x29, -0x27, -0x26, + -0x24, -0x23, -0x22, -0x20, -0x1f, -0x1d, + -0x1c, -0x1b, -0x19, -0x18, -0x16, -0x15, + -0x14, -0x12, -0x11, -0x0f, -0x0e, -0x0d, + -0x0b, -0x0a, -0x08, -0x07, -0x06, -0x04, + -0x03, -0x01, 0x00, 0x01, 0x03, 0x04, + 0x06, 0x07, 0x08, 0x0a, 0x0b, 0x0d, + 0x0e, 0x0f, 0x11, 0x12, 0x14, 0x15, + 0x16, 0x18, 0x19, 0x1b, 0x1c, 0x1d, + 0x1f, 0x20, 0x22, 0x23, 0x24, 0x26, + 0x27, 0x29, 0x2a, 0x2b, 0x2d, 0x2e, + 0x30, 0x31, 0x32, 0x34, 0x35, 0x37, + 0x38, 0x39, 0x3b, 0x3c, 0x3e, 0x3f, + 0x40, 0x42, 0x43, 0x45, 0x46, 0x48, + 0x49, 0x4a, 0x4c, 0x4d, 0x4f, 0x50, + 0x51, 0x53, 0x54, 0x56, 0x57, 0x58, + 0x5a, 0x5b, 0x5d, 0x5e, 0x5f, 0x61, + 0x62, 0x64, 0x65, 0x66, 0x68, 0x69, + 0x6b, 0x6c, 0x6d, 0x6f, 0x70, 0x72, + 0x73, 0x74, 0x76, 0x77, 0x79, 0x7a, + 0x7b, 0x7d, 0x7e, 0x80, 0x81, 0x82, + 0x84, 0x85, 0x87, 0x88, 0x89, 0x8b, + 0x8c, 0x8e, 0x8f, 0x90, 0x92, 0x93, + 0x95, 0x96, 0x97, 0x99, 0x9a, 0x9c, + 0x9d, 0x9e, 0xa0, 0xa1, 0xa3, 0xa4, + 0xa5, 0xa7, 0xa8, 0xaa, 0xab, 0xac, + 0xae, 0xaf, 0xb1, 0xb2, + }; + +const int Cb_b_tab[(MAXJSAMPLE+1) * sizeof(int)] ={ + -0xe3, -0xe1, -0xdf, -0xde, -0xdc, -0xda, + -0xd8, -0xd6, -0xd5, -0xd3, -0xd1, -0xcf, + -0xce, -0xcc, -0xca, -0xc8, -0xc6, -0xc5, + -0xc3, -0xc1, -0xbf, -0xbe, -0xbc, -0xba, + -0xb8, -0xb7, -0xb5, -0xb3, -0xb1, -0xaf, + -0xae, -0xac, -0xaa, -0xa8, -0xa7, -0xa5, + -0xa3, -0xa1, -0x9f, -0x9e, -0x9c, -0x9a, + -0x98, -0x97, -0x95, -0x93, -0x91, -0x90, + -0x8e, -0x8c, -0x8a, -0x88, -0x87, -0x85, + -0x83, -0x81, -0x80, -0x7e, -0x7c, -0x7a, + -0x78, -0x77, -0x75, -0x73, -0x71, -0x70, + -0x6e, -0x6c, -0x6a, -0x69, -0x67, -0x65, + -0x63, -0x61, -0x60, -0x5e, -0x5c, -0x5a, + -0x59, -0x57, -0x55, -0x53, -0x52, -0x50, + -0x4e, -0x4c, -0x4a, -0x49, -0x47, -0x45, + -0x43, -0x42, -0x40, -0x3e, -0x3c, -0x3a, + -0x39, -0x37, -0x35, -0x33, -0x32, -0x30, + -0x2e, -0x2c, -0x2b, -0x29, -0x27, -0x25, + -0x23, -0x22, -0x20, -0x1e, -0x1c, -0x1b, + -0x19, -0x17, -0x15, -0x13, -0x12, -0x10, + -0x0e, -0x0c, -0x0b, -0x09, -0x07, -0x05, + -0x04, -0x02, 0x00, 0x02, 0x04, 0x05, + 0x07, 0x09, 0x0b, 0x0c, 0x0e, 0x10, + 0x12, 0x13, 0x15, 0x17, 0x19, 0x1b, + 0x1c, 0x1e, 0x20, 0x22, 0x23, 0x25, + 0x27, 0x29, 0x2b, 0x2c, 0x2e, 0x30, + 0x32, 0x33, 0x35, 0x37, 0x39, 0x3a, + 0x3c, 0x3e, 0x40, 0x42, 0x43, 0x45, + 0x47, 0x49, 0x4a, 0x4c, 0x4e, 0x50, + 0x52, 0x53, 0x55, 0x57, 0x59, 0x5a, + 0x5c, 0x5e, 0x60, 0x61, 0x63, 0x65, + 0x67, 0x69, 0x6a, 0x6c, 0x6e, 0x70, + 0x71, 0x73, 0x75, 0x77, 0x78, 0x7a, + 0x7c, 0x7e, 0x80, 0x81, 0x83, 0x85, + 0x87, 0x88, 0x8a, 0x8c, 0x8e, 0x90, + 0x91, 0x93, 0x95, 0x97, 0x98, 0x9a, + 0x9c, 0x9e, 0x9f, 0xa1, 0xa3, 0xa5, + 0xa7, 0xa8, 0xaa, 0xac, 0xae, 0xaf, + 0xb1, 0xb3, 0xb5, 0xb7, 0xb8, 0xba, + 0xbc, 0xbe, 0xbf, 0xc1, 0xc3, 0xc5, + 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xcf, + 0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, + 0xdc, 0xde, 0xdf, 0xe1, + }; + +const int Cr_g_tab[(MAXJSAMPLE+1) * sizeof(int)] ={ + 0x5b6900, 0x5ab22e, 0x59fb5c, 0x59448a, 0x588db8, 0x57d6e6, + 0x572014, 0x566942, 0x55b270, 0x54fb9e, 0x5444cc, 0x538dfa, + 0x52d728, 0x522056, 0x516984, 0x50b2b2, 0x4ffbe0, 0x4f450e, + 0x4e8e3c, 0x4dd76a, 0x4d2098, 0x4c69c6, 0x4bb2f4, 0x4afc22, + 0x4a4550, 0x498e7e, 0x48d7ac, 0x4820da, 0x476a08, 0x46b336, + 0x45fc64, 0x454592, 0x448ec0, 0x43d7ee, 0x43211c, 0x426a4a, + 0x41b378, 0x40fca6, 0x4045d4, 0x3f8f02, 0x3ed830, 0x3e215e, + 0x3d6a8c, 0x3cb3ba, 0x3bfce8, 0x3b4616, 0x3a8f44, 0x39d872, + 0x3921a0, 0x386ace, 0x37b3fc, 0x36fd2a, 0x364658, 0x358f86, + 0x34d8b4, 0x3421e2, 0x336b10, 0x32b43e, 0x31fd6c, 0x31469a, + 0x308fc8, 0x2fd8f6, 0x2f2224, 0x2e6b52, 0x2db480, 0x2cfdae, + 0x2c46dc, 0x2b900a, 0x2ad938, 0x2a2266, 0x296b94, 0x28b4c2, + 0x27fdf0, 0x27471e, 0x26904c, 0x25d97a, 0x2522a8, 0x246bd6, + 0x23b504, 0x22fe32, 0x224760, 0x21908e, 0x20d9bc, 0x2022ea, + 0x1f6c18, 0x1eb546, 0x1dfe74, 0x1d47a2, 0x1c90d0, 0x1bd9fe, + 0x1b232c, 0x1a6c5a, 0x19b588, 0x18feb6, 0x1847e4, 0x179112, + 0x16da40, 0x16236e, 0x156c9c, 0x14b5ca, 0x13fef8, 0x134826, + 0x129154, 0x11da82, 0x1123b0, 0x106cde, 0x0fb60c, 0x0eff3a, + 0x0e4868, 0x0d9196, 0x0cdac4, 0x0c23f2, 0x0b6d20, 0x0ab64e, + 0x09ff7c, 0x0948aa, 0x0891d8, 0x07db06, 0x072434, 0x066d62, + 0x05b690, 0x04ffbe, 0x0448ec, 0x03921a, 0x02db48, 0x022476, + 0x016da4, 0x00b6d2, 0x000000, -0x00b6d2, -0x016da4, -0x022476, + -0x02db48, -0x03921a, -0x0448ec, -0x04ffbe, -0x05b690, -0x066d62, + -0x072434, -0x07db06, -0x0891d8, -0x0948aa, -0x09ff7c, -0x0ab64e, + -0x0b6d20, -0x0c23f2, -0x0cdac4, -0x0d9196, -0x0e4868, -0x0eff3a, + -0x0fb60c, -0x106cde, -0x1123b0, -0x11da82, -0x129154, -0x134826, + -0x13fef8, -0x14b5ca, -0x156c9c, -0x16236e, -0x16da40, -0x179112, + -0x1847e4, -0x18feb6, -0x19b588, -0x1a6c5a, -0x1b232c, -0x1bd9fe, + -0x1c90d0, -0x1d47a2, -0x1dfe74, -0x1eb546, -0x1f6c18, -0x2022ea, + -0x20d9bc, -0x21908e, -0x224760, -0x22fe32, -0x23b504, -0x246bd6, + -0x2522a8, -0x25d97a, -0x26904c, -0x27471e, -0x27fdf0, -0x28b4c2, + -0x296b94, -0x2a2266, -0x2ad938, -0x2b900a, -0x2c46dc, -0x2cfdae, + -0x2db480, -0x2e6b52, -0x2f2224, -0x2fd8f6, -0x308fc8, -0x31469a, + -0x31fd6c, -0x32b43e, -0x336b10, -0x3421e2, -0x34d8b4, -0x358f86, + -0x364658, -0x36fd2a, -0x37b3fc, -0x386ace, -0x3921a0, -0x39d872, + -0x3a8f44, -0x3b4616, -0x3bfce8, -0x3cb3ba, -0x3d6a8c, -0x3e215e, + -0x3ed830, -0x3f8f02, -0x4045d4, -0x40fca6, -0x41b378, -0x426a4a, + -0x43211c, -0x43d7ee, -0x448ec0, -0x454592, -0x45fc64, -0x46b336, + -0x476a08, -0x4820da, -0x48d7ac, -0x498e7e, -0x4a4550, -0x4afc22, + -0x4bb2f4, -0x4c69c6, -0x4d2098, -0x4dd76a, -0x4e8e3c, -0x4f450e, + -0x4ffbe0, -0x50b2b2, -0x516984, -0x522056, -0x52d728, -0x538dfa, + -0x5444cc, -0x54fb9e, -0x55b270, -0x566942, -0x572014, -0x57d6e6, + -0x588db8, -0x59448a, -0x59fb5c, -0x5ab22e, + }; + +const int Cb_g_tab[(MAXJSAMPLE+1) * sizeof(int)] ={ + 0x2c8d00, 0x2c34e6, 0x2bdccc, 0x2b84b2, 0x2b2c98, 0x2ad47e, + 0x2a7c64, 0x2a244a, 0x29cc30, 0x297416, 0x291bfc, 0x28c3e2, + 0x286bc8, 0x2813ae, 0x27bb94, 0x27637a, 0x270b60, 0x26b346, + 0x265b2c, 0x260312, 0x25aaf8, 0x2552de, 0x24fac4, 0x24a2aa, + 0x244a90, 0x23f276, 0x239a5c, 0x234242, 0x22ea28, 0x22920e, + 0x2239f4, 0x21e1da, 0x2189c0, 0x2131a6, 0x20d98c, 0x208172, + 0x202958, 0x1fd13e, 0x1f7924, 0x1f210a, 0x1ec8f0, 0x1e70d6, + 0x1e18bc, 0x1dc0a2, 0x1d6888, 0x1d106e, 0x1cb854, 0x1c603a, + 0x1c0820, 0x1bb006, 0x1b57ec, 0x1affd2, 0x1aa7b8, 0x1a4f9e, + 0x19f784, 0x199f6a, 0x194750, 0x18ef36, 0x18971c, 0x183f02, + 0x17e6e8, 0x178ece, 0x1736b4, 0x16de9a, 0x168680, 0x162e66, + 0x15d64c, 0x157e32, 0x152618, 0x14cdfe, 0x1475e4, 0x141dca, + 0x13c5b0, 0x136d96, 0x13157c, 0x12bd62, 0x126548, 0x120d2e, + 0x11b514, 0x115cfa, 0x1104e0, 0x10acc6, 0x1054ac, 0x0ffc92, + 0x0fa478, 0x0f4c5e, 0x0ef444, 0x0e9c2a, 0x0e4410, 0x0debf6, + 0x0d93dc, 0x0d3bc2, 0x0ce3a8, 0x0c8b8e, 0x0c3374, 0x0bdb5a, + 0x0b8340, 0x0b2b26, 0x0ad30c, 0x0a7af2, 0x0a22d8, 0x09cabe, + 0x0972a4, 0x091a8a, 0x08c270, 0x086a56, 0x08123c, 0x07ba22, + 0x076208, 0x0709ee, 0x06b1d4, 0x0659ba, 0x0601a0, 0x05a986, + 0x05516c, 0x04f952, 0x04a138, 0x04491e, 0x03f104, 0x0398ea, + 0x0340d0, 0x02e8b6, 0x02909c, 0x023882, 0x01e068, 0x01884e, + 0x013034, 0x00d81a, 0x008000, 0x0027e6, -0x003034, -0x00884e, + -0x00e068, -0x013882, -0x01909c, -0x01e8b6, -0x0240d0, -0x0298ea, + -0x02f104, -0x03491e, -0x03a138, -0x03f952, -0x04516c, -0x04a986, + -0x0501a0, -0x0559ba, -0x05b1d4, -0x0609ee, -0x066208, -0x06ba22, + -0x07123c, -0x076a56, -0x07c270, -0x081a8a, -0x0872a4, -0x08cabe, + -0x0922d8, -0x097af2, -0x09d30c, -0x0a2b26, -0x0a8340, -0x0adb5a, + -0x0b3374, -0x0b8b8e, -0x0be3a8, -0x0c3bc2, -0x0c93dc, -0x0cebf6, + -0x0d4410, -0x0d9c2a, -0x0df444, -0x0e4c5e, -0x0ea478, -0x0efc92, + -0x0f54ac, -0x0facc6, -0x1004e0, -0x105cfa, -0x10b514, -0x110d2e, + -0x116548, -0x11bd62, -0x12157c, -0x126d96, -0x12c5b0, -0x131dca, + -0x1375e4, -0x13cdfe, -0x142618, -0x147e32, -0x14d64c, -0x152e66, + -0x158680, -0x15de9a, -0x1636b4, -0x168ece, -0x16e6e8, -0x173f02, + -0x17971c, -0x17ef36, -0x184750, -0x189f6a, -0x18f784, -0x194f9e, + -0x19a7b8, -0x19ffd2, -0x1a57ec, -0x1ab006, -0x1b0820, -0x1b603a, + -0x1bb854, -0x1c106e, -0x1c6888, -0x1cc0a2, -0x1d18bc, -0x1d70d6, + -0x1dc8f0, -0x1e210a, -0x1e7924, -0x1ed13e, -0x1f2958, -0x1f8172, + -0x1fd98c, -0x2031a6, -0x2089c0, -0x20e1da, -0x2139f4, -0x21920e, + -0x21ea28, -0x224242, -0x229a5c, -0x22f276, -0x234a90, -0x23a2aa, + -0x23fac4, -0x2452de, -0x24aaf8, -0x250312, -0x255b2c, -0x25b346, + -0x260b60, -0x26637a, -0x26bb94, -0x2713ae, -0x276bc8, -0x27c3e2, + -0x281bfc, -0x287416, -0x28cc30, -0x29244a, -0x297c64, -0x29d47e, + -0x2a2c98, -0x2a84b2, -0x2adccc, -0x2b34e6, + }; + + +/* We assume that right shift corresponds to signed division by 2 with + * rounding towards minus infinity. This is correct for typical "arithmetic + * shift" instructions that shift in copies of the sign bit. But some + * C compilers implement >> with an unsigned shift. For these machines you + * must define RIGHT_SHIFT_IS_UNSIGNED. + * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. + * It is only applied with constant shift counts. SHIFT_TEMPS must be + * included in the variables of any routine using RIGHT_SHIFT. + */ + +#ifdef RIGHT_SHIFT_IS_UNSIGNED +#define SHIFT_TEMPS INT32 shift_temp; +#define RIGHT_SHIFT(x,shft) \ + ((shift_temp = (x)) < 0 ? \ + (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ + (shift_temp >> (shft))) +#else +#define SHIFT_TEMPS +#define RIGHT_SHIFT(x,shft) ((x) >> (shft)) +#endif + + +METHODDEF(void) +ycc_rgb_convert_argb (j_decompress_ptr cinfo, + JSAMPIMAGE input_buf, JDIMENSION input_row, + JSAMPARRAY output_buf, int num_rows) +{ + JDIMENSION num_cols = cinfo->output_width; + JSAMPLE * range_limit = cinfo->sample_range_limit; + + SHIFT_TEMPS + + /* This is used if we don't have SSE2 */ + + while (--num_rows >= 0) { + JSAMPROW inptr0 = input_buf[0][input_row]; + JSAMPROW inptr1 = input_buf[1][input_row]; + JSAMPROW inptr2 = input_buf[2][input_row]; + input_row++; + uint32_t *outptr = (uint32_t *) *output_buf++; + for (JDIMENSION col = 0; col < num_cols; col++) { + int y = GETJSAMPLE(inptr0[col]); + int cb = GETJSAMPLE(inptr1[col]); + int cr = GETJSAMPLE(inptr2[col]); + JSAMPLE * range_limit_y = range_limit + y; + /* Range-limiting is essential due to noise introduced by DCT losses. */ + outptr[col] = 0xFF000000 | + ( range_limit_y[Cr_r_tab[cr]] << 16 ) | + ( range_limit_y[((int) RIGHT_SHIFT(Cb_g_tab[cb] + Cr_g_tab[cr], SCALEBITS))] << 8 ) | + ( range_limit_y[Cb_b_tab[cb]] ); + } + } +} +#endif + + ///*************** Inverted CMYK -> RGB conversion ************************* /// Input is (Inverted) CMYK stored as 4 bytes per pixel. /// Output is RGB stored as 3 bytes per pixel. Index: head/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp =================================================================== --- head/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp (revision 436666) +++ head/mail/thunderbird/files/patch-mail-app-nsMailApp.cpp (revision 436667) @@ -1,12 +1,12 @@ ---- mail/app/nsMailApp.cpp~ +--- mail/app/nsMailApp.cpp.orig 2017-03-21 17:00:12 UTC +++ mail/app/nsMailApp.cpp -@@ -320,6 +320,9 @@ int main(int argc, char* argv[]) - TriggerQuirks(); - #endif +@@ -322,6 +322,9 @@ int main(int argc, char* argv[], char* e + { + mozilla::TimeStamp start = mozilla::TimeStamp::Now(); + setenv("MOZ_GMP_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko", 0); + - int gotCounters; - #if defined(XP_UNIX) - struct rusage initialRUsage; + #ifdef HAS_DLL_BLOCKLIST + DllBlocklist_Initialize(); + Index: head/mail/thunderbird/files/patch-sample-type =================================================================== --- head/mail/thunderbird/files/patch-sample-type (revision 436666) +++ head/mail/thunderbird/files/patch-sample-type (revision 436667) @@ -1,13 +1,13 @@ # Let ports handle default sample type ---- mozilla/configure.in~ -+++ mozilla/configure.in +--- mozilla/old-configure.in~ ++++ mozilla/old-configure.in @@ -5144,7 +5144,7 @@ dnl Use integers over floats for audio o dnl (regarless of the CPU architecture, because audio dnl backends for those platforms don't support floats. We also dnl use integers on ARM with other OS, because it's more efficient. -if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then +if test -n "$MOZ_INTEGER_SAMPLES"; then MOZ_SAMPLE_TYPE_S16=1 AC_DEFINE(MOZ_SAMPLE_TYPE_S16) AC_SUBST(MOZ_SAMPLE_TYPE_S16) Index: head/mail/thunderbird/files/patch-z-bug517422 =================================================================== --- head/mail/thunderbird/files/patch-z-bug517422 (revision 436666) +++ head/mail/thunderbird/files/patch-z-bug517422 (revision 436667) @@ -1,444 +1,502 @@ # Allow more config/external/ libs built against system-wide version. +diff --git build/moz.configure/old.configure build/moz.configure/old.configure +index d0fe7accffe6..c46bdd023225 100644 +--- mozilla/build/moz.configure/old.configure ++++ mozilla/build/moz.configure/old.configure +@@ -288,7 +288,12 @@ def old_configure_options(*options): + '--with-system-libvpx', + '--with-system-nspr', + '--with-system-nss', ++ '--with-system-ogg', + '--with-system-png', ++ '--with-system-soundtouch', ++ '--with-system-theora', ++ '--with-system-tremor', ++ '--with-system-vorbis', + '--with-system-zlib', + '--with-thumb', + '--with-thumb-interwork', diff --git config/Makefile.in config/Makefile.in -index 5383399..0410004 100644 +index a6206bb0ff30..f20987c61754 100644 --- mozilla/config/Makefile.in +++ mozilla/config/Makefile.in -@@ -77,6 +77,11 @@ 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_SOUNDTOUCH=$(MOZ_NATIVE_SOUNDTOUCH) \ - $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers +@@ -51,6 +51,11 @@ export:: $(export-preqs) + -DMOZ_SYSTEM_LIBEVENT=$(MOZ_SYSTEM_LIBEVENT) \ + -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \ + -DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \ ++ -DMOZ_SYSTEM_OGG=$(MOZ_SYSTEM_OGG) \ ++ -DMOZ_SYSTEM_THEORA=$(MOZ_SYSTEM_THEORA) \ ++ -DMOZ_SYSTEM_VORBIS=$(MOZ_SYSTEM_VORBIS) \ ++ -DMOZ_SYSTEM_TREMOR=$(MOZ_SYSTEM_TREMOR) \ ++ -DMOZ_SYSTEM_SOUNDTOUCH=$(MOZ_SYSTEM_SOUNDTOUCH) \ + $(srcdir)/system-headers $(srcdir)/stl-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 +index 029ff8504795..2c3a40caa1ba 100644 --- mozilla/config/external/moz.build +++ mozilla/config/external/moz.build -@@ -19,10 +19,16 @@ if CONFIG['MOZ_UPDATER']: - # There's no "native brotli" yet, but probably in the future... +@@ -21,12 +21,21 @@ if CONFIG['MOZ_UPDATER']: external_dirs += ['modules/brotli'] + external_dirs += ['modules/woff2'] -if CONFIG['MOZ_VORBIS']: -+if not CONFIG['MOZ_NATIVE_OGG']: ++if not CONFIG['MOZ_SYSTEM_OGG']: + external_dirs += ['media/libogg'] + -+if not CONFIG['MOZ_NATIVE_THEORA']: -+ external_dirs += ['media/libtheora'] -+ -+if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_NATIVE_VORBIS']: ++if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_SYSTEM_VORBIS']: external_dirs += ['media/libvorbis'] -if CONFIG['MOZ_TREMOR']: -+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_NATIVE_TREMOR']: ++if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_SYSTEM_TREMOR']: external_dirs += ['media/libtremor'] - if CONFIG['MOZ_WEBM']: -@@ -37,15 +46,15 @@ if CONFIG['MOZ_VPX'] and not CONFIG['MOZ - if not CONFIG['MOZ_NATIVE_PNG']: - external_dirs += ['media/libpng'] - -+if not CONFIG['MOZ_NATIVE_SOUNDTOUCH']: ++if not CONFIG['MOZ_SYSTEM_THEORA']: ++ external_dirs += ['media/libtheora'] ++ ++if not CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: + external_dirs += ['media/libsoundtouch'] + - external_dirs += [ + if CONFIG['MOZ_WEBM_ENCODER']: + external_dirs += ['media/libmkv'] + +@@ -52,12 +61,9 @@ external_dirs += [ 'media/kiss_fft', 'media/libcubeb', + 'media/libnestegg', - 'media/libogg', 'media/libopus', - 'media/libtheora', 'media/libspeex_resampler', 'media/libstagefright', - 'media/libsoundtouch', + 'media/psshparser' ] - DIRS += ['../../' + i for i in external_dirs] diff --git config/system-headers config/system-headers -index bef567c..9807c29 100644 +index 5ee7f71f9634..13178ac3b3ab 100644 --- mozilla/config/system-headers +++ mozilla/config/system-headers -@@ -1364,3 +1363,17 @@ graphite2/Segment.h - harfbuzz/hb-ot.h - harfbuzz/hb.h - #endif -+#if MOZ_NATIVE_OGG==1 +@@ -1348,3 +1348,17 @@ unicode/utypes.h + libutil.h + unwind.h + fenv.h ++#if MOZ_SYSTEM_OGG==1 +ogg/ogg.h +ogg/os_types.h +#endif -+#if MOZ_NATIVE_THEORA==1 ++#if MOZ_SYSTEM_THEORA==1 +theora/theoradec.h +#endif -+#if MOZ_NATIVE_VORBIS==1 ++#if MOZ_SYSTEM_VORBIS==1 +vorbis/codec.h +vorbis/vorbisenc.h +#endif -+#if MOZ_NATIVE_TREMOR==1 ++#if MOZ_SYSTEM_TREMOR==1 +tremor/ivorbiscodec.h +#endif -diff --git configure.in configure.in -index 87db361..7947626 100644 ---- mozilla/configure.in -+++ mozilla/configure.in -@@ -5223,6 +5223,111 @@ if test "${ac_cv_c_attribute_aligned}" ! - 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) -+ -+ _SAVE_LIBS=$LIBS -+ LIBS="$LIBS $MOZ_OGG_LIBS" -+ AC_CHECK_FUNC(ogg_set_mem_functions, [], -+ [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)]) -+ LIBS=$_SAVE_LIBS -+fi -+ -+AC_SUBST(MOZ_NATIVE_OGG) -+ -+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.5) -+fi -+ -+AC_SUBST(MOZ_NATIVE_VORBIS) -+ -+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) -+ -+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) -+ -+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.9.0) -+ -+ AC_LANG_SAVE -+ AC_LANG_CPLUSPLUS -+ _SAVE_CXXFLAGS=$CXXFLAGS -+ CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" -+ AC_CACHE_CHECK(for soundtouch sample type, -+ ac_cv_soundtouch_sample_type, -+ [AC_TRY_COMPILE([#include -+ #ifndef SOUNDTOUCH_INTEGER_SAMPLES -+ #error soundtouch expects float samples -+ #endif], -+ [], -+ [ac_cv_soundtouch_sample_type=short], -+ [ac_cv_soundtouch_sample_type=float])]) -+ CXXFLAGS=$_SAVE_CXXFLAGS -+ AC_LANG_RESTORE -+ -+ if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ -+ -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then -+ AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) -+ fi -+fi -+ -+if test -n "$MOZ_NATIVE_SOUNDTOUCH"; then -+ AC_DEFINE(MOZ_NATIVE_SOUNDTOUCH) -+fi -+AC_SUBST(MOZ_NATIVE_SOUNDTOUCH) -+ -+dnl ======================================================== - dnl = Disable VP8 decoder support - dnl ======================================================== - MOZ_ARG_DISABLE_BOOL(webm, diff --git dom/media/AudioStream.cpp dom/media/AudioStream.cpp -index 2127256..1ec09fe 100644 +index 93ecda4319af..ff674c64ea07 100644 --- mozilla/dom/media/AudioStream.cpp +++ mozilla/dom/media/AudioStream.cpp -@@ -129,7 +129,9 @@ AudioStream::AudioStream() +@@ -115,7 +115,9 @@ AudioStream::AudioStream(DataSource& aSource) + : mMonitor("AudioStream") + , mChannels(0) , mOutChannels(0) - , mWritten(0) - , mAudioClock(this) -+#ifndef MOZ_NATIVE_SOUNDTOUCH ++#ifndef MOZ_SYSTEM_SOUNDTOUCH , mTimeStretcher(nullptr) +#endif , mDumpFile(nullptr) - , mBytesPerFrame(0) , mState(INITIALIZED) -@@ -152,9 +154,11 @@ AudioStream::~AudioStream() + , mDataSource(aSource) +@@ -130,9 +132,11 @@ AudioStream::~AudioStream() if (mDumpFile) { fclose(mDumpFile); } -+#ifndef MOZ_NATIVE_SOUNDTOUCH ++#ifndef MOZ_SYSTEM_SOUNDTOUCH if (mTimeStretcher) { soundtouch::destroySoundTouchObj(mTimeStretcher); } +#endif } size_t -@@ -177,7 +181,11 @@ nsresult AudioStream::EnsureTimeStretcherInitializedUnlocked() +@@ -151,7 +155,11 @@ nsresult AudioStream::EnsureTimeStretcherInitializedUnlocked() { mMonitor.AssertCurrentThreadOwns(); if (!mTimeStretcher) { -+#ifdef MOZ_NATIVE_SOUNDTOUCH ++#ifdef MOZ_SYSTEM_SOUNDTOUCH + mTimeStretcher = new soundtouch::SoundTouch(); +#else mTimeStretcher = soundtouch::createSoundTouchObj(); +#endif - mTimeStretcher->setSampleRate(mInRate); + mTimeStretcher->setSampleRate(mAudioClock.GetInputRate()); mTimeStretcher->setChannels(mOutChannels); mTimeStretcher->setPitch(1.0); diff --git dom/media/AudioStream.h dom/media/AudioStream.h -index a552e3e..02b80b1 100644 +index 7dc1f60f95cc..67d402a4117f 100644 --- mozilla/dom/media/AudioStream.h +++ mozilla/dom/media/AudioStream.h -@@ -15,7 +15,11 @@ - #include "mozilla/RefPtr.h" +@@ -16,7 +16,11 @@ + #include "mozilla/TimeStamp.h" #include "mozilla/UniquePtr.h" #include "CubebUtils.h" -+#ifdef MOZ_NATIVE_SOUNDTOUCH ++#ifdef MOZ_SYSTEM_SOUNDTOUCH +#include "soundtouch/SoundTouch.h" +#else #include "soundtouch/SoundTouchFactory.h" +#endif namespace mozilla { -@@ -277,7 +277,11 @@ private: - // Number of frames written to the buffers. - int64_t mWritten; +@@ -287,7 +291,11 @@ private: + uint32_t mChannels; + uint32_t mOutChannels; AudioClock mAudioClock; -+#ifdef MOZ_NATIVE_SOUNDTOUCH ++#ifdef MOZ_SYSTEM_SOUNDTOUCH + nsAutoPtr mTimeStretcher; +#else soundtouch::SoundTouch* mTimeStretcher; +#endif - // Stream start time for stream open delay telemetry. - TimeStamp mStartTime; + // Output file for dumping audio + FILE* mDumpFile; diff --git dom/media/moz.build dom/media/moz.build -index 7526cff..e0a0ca0 100644 +index 86b051c58d33..fb6186dce78b 100644 --- mozilla/dom/media/moz.build +++ mozilla/dom/media/moz.build -@@ -212,3 +212,18 @@ if CONFIG['ANDROID_VERSION'] > '15': +@@ -308,6 +308,21 @@ if CONFIG['MOZ_WEBRTC']: - CFLAGS += CONFIG['GSTREAMER_CFLAGS'] - CXXFLAGS += CONFIG['GSTREAMER_CFLAGS'] -+ -+if CONFIG['MOZ_NATIVE_OGG']: + DEFINES['MOZILLA_INTERNAL_API'] = True + ++if CONFIG['MOZ_SYSTEM_OGG']: + CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS'] + -+if CONFIG['MOZ_NATIVE_THEORA']: ++if CONFIG['MOZ_SYSTEM_THEORA']: + CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS'] + -+if CONFIG['MOZ_NATIVE_VORBIS']: ++if CONFIG['MOZ_SYSTEM_VORBIS']: + CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS'] + -+if CONFIG['MOZ_NATIVE_TREMOR']: ++if CONFIG['MOZ_SYSTEM_TREMOR']: + CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS'] + -+if CONFIG['MOZ_NATIVE_SOUNDTOUCH']: ++if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: + CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS'] ++ + if CONFIG['OS_TARGET'] == 'WINNT': + DEFINES['WEBRTC_WIN'] = True + else: +diff --git dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp +index 078f6ea5ef60..c600db067539 100644 +--- mozilla/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp ++++ mozilla/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp +@@ -11,9 +11,13 @@ + #include "prmem.h" + #include "prlink.h" + ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++#include "nsXPCOMPrivate.h" // for XUL_DLL ++#else + // We use a known symbol located in lgpllibs to determine its location. + // soundtouch happens to be always included in lgpllibs + #include "soundtouch/SoundTouch.h" ++#endif + + namespace mozilla { + +@@ -50,6 +54,12 @@ FFVPXRuntimeLinker::Init() + + sLinkStatus = LinkStatus_FAILED; + ++#ifdef MOZ_SYSTEM_SOUNDTOUCH ++ // We retrieve the path of the XUL library as this is where mozavcodec and ++ // mozavutil libs are located. ++ char* path = ++ PR_GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init); ++#else + // We retrieve the path of the lgpllibs library as this is where mozavcodec + // and mozavutil libs are located. + char* lgpllibsname = PR_GetLibraryName(nullptr, "lgpllibs"); +@@ -60,6 +70,7 @@ FFVPXRuntimeLinker::Init() + PR_GetLibraryFilePathname(lgpllibsname, + (PRFuncPtr)&soundtouch::SoundTouch::getVersionId); + PR_FreeLibraryName(lgpllibsname); ++#endif + if (!path) { + return false; + } diff --git media/libogg/README_MOZILLA media/libogg/README_MOZILLA -index 0833e4d..7ece97b 100644 +index 6213fdc7770c..ada799916a17 100644 --- mozilla/media/libogg/README_MOZILLA +++ mozilla/media/libogg/README_MOZILLA -@@ -6,3 +6,6 @@ The svn revision number used was r17287. +@@ -6,3 +6,6 @@ package downloaded from xiph.org and copied using the update.sh script. The int-types.patch address a bug that config_types.h generated from Linux platform can't be used on OpenSolaris directly see Mozilla bug 449754 + +The in-tree copy may be omitted during build by --with-system-ogg. -+Keep version in configure.in in sync on updates. ++Keep version in old-configure.in in sync on updates. diff --git media/libsoundtouch/README_MOZILLA media/libsoundtouch/README_MOZILLA -index bfd4b1a..15b158d 100644 +index dc0dbe8f6886..ea73b55e3e39 100644 --- mozilla/media/libsoundtouch/README_MOZILLA +++ mozilla/media/libsoundtouch/README_MOZILLA @@ -6,3 +6,5 @@ The whole library is not used, only the relevant files are imported in the tree, using the script `update.sh`. Some changes have been made to the files, using the patch `moz-libsoundtouch.patch`. We also use a custom soundtouch_config.h. +The in-tree copy may be omitted during build by --with-system-soundtouch. -+Keep version in configure.in in sync on updates. ++Keep version in old-configure.in in sync on updates. diff --git media/libsoundtouch/src/soundtouch_perms.h media/libsoundtouch/src/soundtouch_perms.h -index 0af2fe6..d80c145 100644 +index 0af2fe618311..10973564e7a4 100644 --- mozilla/media/libsoundtouch/src/soundtouch_perms.h +++ mozilla/media/libsoundtouch/src/soundtouch_perms.h @@ -12,7 +12,9 @@ #pragma GCC visibility push(default) #include "SoundTouch.h" -+#ifndef MOZ_NATIVE_SOUNDTOUCH ++#ifndef MOZ_SYSTEM_SOUNDTOUCH #include "SoundTouchFactory.h" +#endif #pragma GCC visibility pop #endif // MOZILLA_SOUNDTOUCH_PERMS_H diff --git media/libtheora/README_MOZILLA media/libtheora/README_MOZILLA -index d48dbfa..f08a2ed 100644 +index d48dbfa6f63d..6f30f250220e 100644 --- mozilla/media/libtheora/README_MOZILLA +++ mozilla/media/libtheora/README_MOZILLA @@ -3,3 +3,6 @@ using the update.sh script. The changes made were those applied by update.sh, the addition/update of Makefile.in files for the Mozilla build system. The subversion revision used was r17578. + +The in-tree copy may be omitted during build by --with-system-theora. -+Keep version in configure.in in sync on updates. ++Keep version in old-configure.in in sync on updates. diff --git media/libtheora/moz.build media/libtheora/moz.build -index 14265b1..3069e99 100644 +index c7f85eebff95..aae7b814adb5 100644 --- mozilla/media/libtheora/moz.build +++ mozilla/media/libtheora/moz.build -@@ -21,6 +21,9 @@ if CONFIG['GKMEDIAS_SHARED_LIBRARY']: +@@ -21,6 +21,9 @@ FINAL_LIBRARY = 'gkmedias' # The encoder is currently not included. DEFINES['THEORA_DISABLE_ENCODE'] = True -+if CONFIG['MOZ_NATIVE_OGG']: ++if CONFIG['MOZ_SYSTEM_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] + # Suppress warnings in third-party code. - if CONFIG['GNU_CC']: + if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']: CFLAGS += ['-Wno-type-limits'] diff --git media/libtremor/README_MOZILLA media/libtremor/README_MOZILLA -index ee67b53..3f34a09 100644 +index ee67b53a05c5..81c971773d55 100644 --- mozilla/media/libtremor/README_MOZILLA +++ mozilla/media/libtremor/README_MOZILLA @@ -5,3 +5,6 @@ Makefile.in files for the Mozilla build system. The upstream release used was http://svn.xiph.org/trunk/Tremor/ The subversion revision used was r17547. + +The in-tree copy may be omitted during build by --with-system-tremor. -+Keep version in configure.in in sync on updates. ++Keep version in old-configure.in in sync on updates. diff --git media/libtremor/moz.build media/libtremor/moz.build -index 31831ba..a03d576 100644 +index 83afc8e37c64..71ef159da3d7 100644 --- mozilla/media/libtremor/moz.build +++ mozilla/media/libtremor/moz.build -@@ -6,3 +6,5 @@ +@@ -9,3 +9,5 @@ with Files('*'): DIRS += ['include/tremor', 'lib'] -+if CONFIG['MOZ_NATIVE_OGG']: ++if CONFIG['MOZ_SYSTEM_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] diff --git media/libvorbis/README_MOZILLA media/libvorbis/README_MOZILLA -index 7c7454c..55baedd 100644 +index 1211ac074b33..eb31084aed25 100644 --- mozilla/media/libvorbis/README_MOZILLA +++ mozilla/media/libvorbis/README_MOZILLA -@@ -8,3 +8,6 @@ https://svn.xiph.org/tags/vorbis/libvorbis-1.3.4@19059 +@@ -8,3 +8,6 @@ https://svn.xiph.org/tags/vorbis/libvorbis-1.3.5@19464 Some files are renamed during the copy to prevent clashes with object file names with other Mozilla libraries. + +The in-tree copy may be omitted during build by --with-system-vorbis. -+Keep version in configure.in in sync on updates. ++Keep version in old-configure.in in sync on updates. diff --git media/libvorbis/moz.build media/libvorbis/moz.build -index 919b99e..cc776f7 100644 +index adf393782cc9..923b76231107 100644 --- mozilla/media/libvorbis/moz.build +++ mozilla/media/libvorbis/moz.build -@@ -55,3 +55,6 @@ FINAL_LIBRARY = 'gkmedias' +@@ -56,3 +56,6 @@ FINAL_LIBRARY = 'gkmedias' # Suppress warnings in third-party code. if CONFIG['GNU_CC']: CFLAGS += ['-Wno-uninitialized'] + -+if CONFIG['MOZ_NATIVE_OGG']: ++if CONFIG['MOZ_SYSTEM_OGG']: + CFLAGS += CONFIG['MOZ_OGG_CFLAGS'] +diff --git old-configure.in old-configure.in +index b614eef85c89..85f9099dba4d 100644 +--- mozilla/old-configure.in ++++ mozilla/old-configure.in +@@ -2941,6 +2941,111 @@ if test -n "$MOZ_OMX_PLUGIN"; then + fi + fi + ++dnl ======================================================== ++dnl Check for libogg ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-ogg, ++[ --with-system-ogg Use system libogg (located with pkgconfig)], ++MOZ_SYSTEM_OGG=1, ++MOZ_SYSTEM_OGG=) ++ ++if test -n "$MOZ_SYSTEM_OGG"; then ++ PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.3.0) ++ ++ _SAVE_LIBS=$LIBS ++ LIBS="$LIBS $MOZ_OGG_LIBS" ++ AC_CHECK_FUNC(ogg_set_mem_functions, [], ++ [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)]) ++ LIBS=$_SAVE_LIBS ++fi ++ ++AC_SUBST(MOZ_SYSTEM_OGG) ++ ++dnl ======================================================== ++dnl Check for libvorbis ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-vorbis, ++[ --with-system-vorbis Use system libvorbis (located with pkgconfig)], ++MOZ_SYSTEM_VORBIS=1, ++MOZ_SYSTEM_VORBIS=) ++ ++if test -n "$MOZ_SYSTEM_VORBIS"; then ++ PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.5) ++fi ++ ++AC_SUBST(MOZ_SYSTEM_VORBIS) ++ ++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_SYSTEM_TREMOR=1, ++MOZ_SYSTEM_TREMOR=) ++ ++if test -n "$MOZ_SYSTEM_TREMOR"; then ++ PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1) ++fi ++ ++AC_SUBST(MOZ_SYSTEM_TREMOR) ++ ++dnl ======================================================== ++dnl Check for libtheora ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-theora, ++[ --with-system-theora Use system libtheora (located with pkgconfig)], ++MOZ_SYSTEM_THEORA=1, ++MOZ_SYSTEM_THEORA=) ++ ++if test -n "$MOZ_SYSTEM_THEORA"; then ++ PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2) ++fi ++ ++AC_SUBST(MOZ_SYSTEM_THEORA) ++ ++dnl ======================================================== ++dnl Check for libSoundTouch ++dnl ======================================================== ++ ++MOZ_ARG_WITH_BOOL(system-soundtouch, ++[ --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)], ++MOZ_SYSTEM_SOUNDTOUCH=1, ++MOZ_SYSTEM_SOUNDTOUCH=) ++ ++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then ++ PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0) ++ ++ AC_LANG_SAVE ++ AC_LANG_CPLUSPLUS ++ _SAVE_CXXFLAGS=$CXXFLAGS ++ CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS" ++ AC_CACHE_CHECK(for soundtouch sample type, ++ ac_cv_soundtouch_sample_type, ++ [AC_TRY_COMPILE([#include ++ #ifndef SOUNDTOUCH_INTEGER_SAMPLES ++ #error soundtouch expects float samples ++ #endif], ++ [], ++ [ac_cv_soundtouch_sample_type=short], ++ [ac_cv_soundtouch_sample_type=float])]) ++ CXXFLAGS=$_SAVE_CXXFLAGS ++ AC_LANG_RESTORE ++ ++ if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \ ++ -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then ++ AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.]) ++ fi ++fi ++ ++if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then ++ AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH) ++fi ++AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH) ++ + dnl system libvpx Support + dnl ======================================================== + MOZ_ARG_WITH_BOOL(system-libvpx, diff --git toolkit/library/moz.build toolkit/library/moz.build -index d42137a..695e75a8 100644 +index 079a575adec3..514d901195de 100644 --- mozilla/toolkit/library/moz.build +++ mozilla/toolkit/library/moz.build -@@ -178,6 +178,21 @@ if CONFIG['MOZ_NATIVE_PNG']: - if CONFIG['MOZ_NATIVE_HUNSPELL']: +@@ -237,6 +237,21 @@ if CONFIG['MOZ_SYSTEM_HARFBUZZ']: + if CONFIG['MOZ_SYSTEM_HUNSPELL']: OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS'] -+if CONFIG['MOZ_NATIVE_OGG']: ++if CONFIG['MOZ_SYSTEM_OGG']: + OS_LIBS += CONFIG['MOZ_OGG_LIBS'] + -+if CONFIG['MOZ_NATIVE_THEORA']: ++if CONFIG['MOZ_SYSTEM_THEORA']: + OS_LIBS += CONFIG['MOZ_THEORA_LIBS'] + -+if CONFIG['MOZ_NATIVE_VORBIS']: ++if CONFIG['MOZ_SYSTEM_VORBIS']: + OS_LIBS += CONFIG['MOZ_VORBIS_LIBS'] + -+if CONFIG['MOZ_NATIVE_TREMOR']: ++if CONFIG['MOZ_SYSTEM_TREMOR']: + OS_LIBS += CONFIG['MOZ_TREMOR_LIBS'] + -+if CONFIG['MOZ_NATIVE_SOUNDTOUCH']: ++if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']: + OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS'] + - if CONFIG['MOZ_NATIVE_LIBEVENT']: + if CONFIG['MOZ_SYSTEM_LIBEVENT']: OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS'] diff --git xpcom/build/XPCOMInit.cpp xpcom/build/XPCOMInit.cpp -index 2cf281e..6d7af0e 100644 +index c083ab4bc4f3..62b917043a2c 100644 --- mozilla/xpcom/build/XPCOMInit.cpp +++ mozilla/xpcom/build/XPCOMInit.cpp -@@ -138,7 +138,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports*, REFNSIID, void**); - #include "mozilla/VisualEventTracer.h" - #endif +@@ -154,7 +154,9 @@ extern nsresult nsStringInputStreamConstructor(nsISupports*, REFNSIID, void**); + #include "mozilla/ipc/GeckoChildProcessHost.h" + +#ifndef MOZ_OGG_NO_MEM_REPORTING #include "ogg/ogg.h" +#endif #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING) - #include "vpx_mem/vpx_mem.h" - #endif -@@ -651,11 +653,13 @@ NS_InitXPCOM2(nsIServiceManager** aResult, + #if defined(HAVE_STDINT_H) + // mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in +@@ -664,11 +666,13 @@ NS_InitXPCOM2(nsIServiceManager** aResult, // this oddness. mozilla::SetICUMemoryFunctions(); +#ifndef MOZ_OGG_NO_MEM_REPORTING // 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.