b=1033140 make speex_resampler declarations consistent with OUTSIDE_SPEEX implementation r=padenot

Instead of defining OUTSIDE_SPEEX and RANDOM_PREFIX everywhere
speex_resampler.h is included, it is easier to patch the header.

Symbol names in gkmedias symbols.def are updated now that RANDOM_PREFIX is
taking effect, and unused symbols are no longer exported.

--HG--
extra : transplant_source : sx%C9%ED%EB%E7%D8P%09%18%87%D4Oj%85%D5%25%C8%A5%01
This commit is contained in:
Karl Tomlinson 2014-07-02 20:22:45 +12:00
parent fd77d782b0
commit b2353db8a8
7 changed files with 46 additions and 170 deletions

View File

@ -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

View File

@ -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)

View File

@ -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'] = ''

View File

@ -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

View File

@ -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

View File

@ -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 <sys/types.h>
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 <sys/types.h>
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 <inttypes.h>
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 <speex/speex_config_types.h>
#endif
#endif
#endif /* _SPEEX_TYPES_H */

View File

@ -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