diff --git a/layout/media/symbols.def.in b/layout/media/symbols.def.in index dd11d638b57..bbf2e5004d6 100644 --- a/layout/media/symbols.def.in +++ b/layout/media/symbols.def.in @@ -110,29 +110,19 @@ vorbis_synthesis_pcmout vorbis_synthesis_read vorbis_synthesis_restart #endif -speex_resampler_init -speex_resampler_init_frac -speex_resampler_destroy -speex_resampler_process_float -speex_resampler_process_int -speex_resampler_process_interleaved_float -speex_resampler_process_interleaved_int -speex_resampler_set_rate -speex_resampler_get_rate -speex_resampler_set_rate_frac -speex_resampler_get_ratio -speex_resampler_set_quality -speex_resampler_get_quality -speex_resampler_set_input_stride -speex_resampler_get_input_stride -speex_resampler_set_output_stride -speex_resampler_get_output_stride -speex_resampler_get_input_latency -speex_resampler_get_output_latency -speex_resampler_skip_zeros -speex_resampler_set_skip_frac_num -speex_resampler_reset_mem -speex_resampler_strerror +moz_speex_resampler_init +moz_speex_resampler_destroy +moz_speex_resampler_process_float +moz_speex_resampler_process_interleaved_float +moz_speex_resampler_process_interleaved_int +moz_speex_resampler_set_rate +moz_speex_resampler_get_rate +moz_speex_resampler_get_ratio +moz_speex_resampler_get_input_latency +moz_speex_resampler_get_output_latency +moz_speex_resampler_skip_zeros +moz_speex_resampler_set_skip_frac_num +moz_speex_resampler_reset_mem cubeb_destroy cubeb_init cubeb_get_backend_id diff --git a/media/libspeex_resampler/outside-speex.patch b/media/libspeex_resampler/outside-speex.patch new file mode 100644 index 00000000000..baa47c66625 --- /dev/null +++ b/media/libspeex_resampler/outside-speex.patch @@ -0,0 +1,30 @@ +diff --git a/media/libspeex_resampler/src/speex_resampler.h b/media/libspeex_resampler/src/speex_resampler.h +--- a/media/libspeex_resampler/src/speex_resampler.h ++++ b/media/libspeex_resampler/src/speex_resampler.h +@@ -34,24 +34,25 @@ + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + */ + + + #ifndef SPEEX_RESAMPLER_H + #define SPEEX_RESAMPLER_H + +-#ifdef OUTSIDE_SPEEX ++#if 1 /* OUTSIDE_SPEEX */ + + /********* WARNING: MENTAL SANITY ENDS HERE *************/ + + /* If the resampler is defined outside of Speex, we change the symbol names so that + there won't be any clash if linking with Speex later on. */ + + /* #define RANDOM_PREFIX your software name here */ ++#define RANDOM_PREFIX moz_speex + #ifndef RANDOM_PREFIX + #error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes" + #endif + + #define CAT_PREFIX2(a,b) a ## b + #define CAT_PREFIX(a,b) CAT_PREFIX2(a, b) + + #define speex_resampler_init CAT_PREFIX(RANDOM_PREFIX,_resampler_init) diff --git a/media/libspeex_resampler/src/moz.build b/media/libspeex_resampler/src/moz.build index 6e02a92d396..d16bcc191bd 100644 --- a/media/libspeex_resampler/src/moz.build +++ b/media/libspeex_resampler/src/moz.build @@ -7,9 +7,7 @@ LIBRARY_NAME = 'speex' EXPORTS.speex += [ - 'speex_config_types.h', 'speex_resampler.h', - 'speex_types.h', ] SOURCES += [ @@ -26,9 +24,6 @@ FINAL_LIBRARY = 'gkmedias' # We don't compile the full speex codec, only the resampler. DEFINES['OUTSIDE_SPEEX'] = True -# Speex wants a random prefix when building in another program, to avoid name -# clashes -DEFINES['RANDOM_PREFIX'] = 'speex' # We don't use -fvisibility=hidden DEFINES['SPX_RESAMPLE_EXPORT'] = '' diff --git a/media/libspeex_resampler/src/speex_config_types.h b/media/libspeex_resampler/src/speex_config_types.h deleted file mode 100644 index ee00f68fd0b..00000000000 --- a/media/libspeex_resampler/src/speex_config_types.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __SPEEX_TYPES_H__ -#define __SPEEX_TYPES_H__ - -/* these are filled in by configure */ -typedef int16_t spx_int16_t; -typedef uint16_t spx_uint16_t; -typedef int32_t spx_int32_t; -typedef uint32_t spx_uint32_t; - -#endif - diff --git a/media/libspeex_resampler/src/speex_resampler.h b/media/libspeex_resampler/src/speex_resampler.h index d23739188a7..84c3de7d066 100644 --- a/media/libspeex_resampler/src/speex_resampler.h +++ b/media/libspeex_resampler/src/speex_resampler.h @@ -39,7 +39,7 @@ #ifndef SPEEX_RESAMPLER_H #define SPEEX_RESAMPLER_H -#ifdef OUTSIDE_SPEEX +#if 1 /* OUTSIDE_SPEEX */ /********* WARNING: MENTAL SANITY ENDS HERE *************/ @@ -47,6 +47,7 @@ there won't be any clash if linking with Speex later on. */ /* #define RANDOM_PREFIX your software name here */ +#define RANDOM_PREFIX moz_speex #ifndef RANDOM_PREFIX #error "Please define RANDOM_PREFIX (above) to something specific to your project to prevent symbol name clashes" #endif diff --git a/media/libspeex_resampler/src/speex_types.h b/media/libspeex_resampler/src/speex_types.h deleted file mode 100644 index 59bb5b435f6..00000000000 --- a/media/libspeex_resampler/src/speex_types.h +++ /dev/null @@ -1,130 +0,0 @@ -/* speex_types.h taken from libogg */ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: #ifdef jail to whip a few platforms into the UNIX ideal. - last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $ - - ********************************************************************/ -/** - @file speex_types.h - @brief Speex types -*/ -#ifndef _SPEEX_TYPES_H -#define _SPEEX_TYPES_H - -#if defined(_WIN32) - -# if defined(__CYGWIN__) -# include <_G_config.h> - typedef _G_int32_t spx_int32_t; - typedef _G_uint32_t spx_uint32_t; - typedef _G_int16_t spx_int16_t; - typedef _G_uint16_t spx_uint16_t; -# elif defined(__MINGW32__) - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; -# elif defined(__MWERKS__) - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; -# else - /* MSVC/Borland */ - typedef __int32 spx_int32_t; - typedef unsigned __int32 spx_uint32_t; - typedef __int16 spx_int16_t; - typedef unsigned __int16 spx_uint16_t; -# endif - -#elif defined(__MACOS__) - -# include - typedef SInt16 spx_int16_t; - typedef UInt16 spx_uint16_t; - typedef SInt32 spx_int32_t; - typedef UInt32 spx_uint32_t; - -#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */ - -# include - typedef int16_t spx_int16_t; - typedef u_int16_t spx_uint16_t; - typedef int32_t spx_int32_t; - typedef u_int32_t spx_uint32_t; - -#elif defined(__BEOS__) - - /* Be */ -# include - typedef int16_t spx_int16_t; - typedef u_int16_t spx_uint16_t; - typedef int32_t spx_int32_t; - typedef u_int32_t spx_uint32_t; - -#elif defined (__EMX__) - - /* OS/2 GCC */ - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#elif defined (DJGPP) - - /* DJGPP */ - typedef short spx_int16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#elif defined(R5900) - - /* PS2 EE */ - typedef int spx_int32_t; - typedef unsigned spx_uint32_t; - typedef short spx_int16_t; - -#elif defined(__SYMBIAN32__) - - /* Symbian GCC */ - typedef signed short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef signed int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X) - - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef long spx_int32_t; - typedef unsigned long spx_uint32_t; - -#elif defined(CONFIG_TI_C6X) - - typedef short spx_int16_t; - typedef unsigned short spx_uint16_t; - typedef int spx_int32_t; - typedef unsigned int spx_uint32_t; - -#else - -# ifdef _BUILD_SPEEX -# include "include/speex/speex_config_types.h" -#else -# include -#endif - -#endif - -#endif /* _SPEEX_TYPES_H */ diff --git a/media/libspeex_resampler/update.sh b/media/libspeex_resampler/update.sh index 8d250a11299..7e6c7091fe9 100644 --- a/media/libspeex_resampler/update.sh +++ b/media/libspeex_resampler/update.sh @@ -18,6 +18,7 @@ cp $1/AUTHORS . cp $1/COPYING . # apply outstanding local patches +patch -p1 < outside-speex.patch patch -p1 < sse-detect-runtime.patch patch -p3 < reset.patch patch -p3 < set-skip-frac.patch