[xiph-commits] r14797 - in trunk/speex: . libspeex win32

jm at svn.xiph.org jm at svn.xiph.org
Fri Apr 25 04:10:55 PDT 2008


Author: jm
Date: 2008-04-25 04:10:55 -0700 (Fri, 25 Apr 2008)
New Revision: 14797

Modified:
   trunk/speex/configure.ac
   trunk/speex/libspeex/bits.c
   trunk/speex/libspeex/buffer.c
   trunk/speex/libspeex/jitter.c
   trunk/speex/libspeex/mdf.c
   trunk/speex/libspeex/modes.c
   trunk/speex/libspeex/modes_wb.c
   trunk/speex/libspeex/preprocess.c
   trunk/speex/libspeex/resample.c
   trunk/speex/libspeex/speex.c
   trunk/speex/libspeex/speex_callbacks.c
   trunk/speex/libspeex/speex_header.c
   trunk/speex/libspeex/stereo.c
   trunk/speex/win32/config.h
Log:
Patch by Thorvald Natvig: uses gcc visibility options to only export the
required symbols in the DSO


Modified: trunk/speex/configure.ac
===================================================================
--- trunk/speex/configure.ac	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/configure.ac	2008-04-25 11:10:55 UTC (rev 14797)
@@ -72,7 +72,28 @@
 )
 AC_MSG_RESULT($has_alloca)
 
+SAVE_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden"
+AC_MSG_CHECKING(for ELF visibility)
+AC_COMPILE_IFELSE([
+AC_LANG_PROGRAM([[
+#pragma GCC visibility push(hidden)
+__attribute__((visibility("default")))
+int var=10;
+]])],
+[
+has_visibility=yes
+AC_DEFINE([EXPORT], [__attribute__((visibility("default")))], [Symbol visibility prefix])
+],
+[
+has_visibility=no
+AC_DEFINE([EXPORT], [], [Symbol visibility prefix])
+CFLAGS="$SAVE_CFLAGS"
+]
+)
+AC_MSG_RESULT($has_visibility)
 
+
 AC_CHECK_HEADERS(sys/soundcard.h sys/audioio.h)
 
 XIPH_PATH_OGG([src="src"], [src=""])

Modified: trunk/speex/libspeex/bits.c
===================================================================
--- trunk/speex/libspeex/bits.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/bits.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -45,7 +45,7 @@
 #define MAX_CHARS_PER_FRAME (2000/BYTES_PER_CHAR)
 #endif
 
-void speex_bits_init(SpeexBits *bits)
+EXPORT void speex_bits_init(SpeexBits *bits)
 {
    bits->chars = (char*)speex_alloc(MAX_CHARS_PER_FRAME);
    if (!bits->chars)
@@ -58,7 +58,7 @@
    speex_bits_reset(bits);
 }
 
-void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
+EXPORT void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
 {
    bits->chars = (char*)buff;
    bits->buf_size = buf_size;
@@ -68,7 +68,7 @@
    speex_bits_reset(bits);
 }
 
-void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size)
+EXPORT void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size)
 {
    bits->chars = (char*)buff;
    bits->buf_size = buf_size;
@@ -82,14 +82,14 @@
    
 }
 
-void speex_bits_destroy(SpeexBits *bits)
+EXPORT void speex_bits_destroy(SpeexBits *bits)
 {
    if (bits->owner)
       speex_free(bits->chars);
    /* Will do something once the allocation is dynamic */
 }
 
-void speex_bits_reset(SpeexBits *bits)
+EXPORT void speex_bits_reset(SpeexBits *bits)
 {
    /* We only need to clear the first byte now */
    bits->chars[0]=0;
@@ -99,14 +99,14 @@
    bits->overflow=0;
 }
 
-void speex_bits_rewind(SpeexBits *bits)
+EXPORT void speex_bits_rewind(SpeexBits *bits)
 {
    bits->charPtr=0;
    bits->bitPtr=0;
    bits->overflow=0;
 }
 
-void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
+EXPORT void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
 {
    int i;
    int nchars = len / BYTES_PER_CHAR;
@@ -153,7 +153,7 @@
    bits->charPtr=0;
 }
 
-void speex_bits_read_whole_bytes(SpeexBits *bits, char *chars, int nbytes)
+EXPORT void speex_bits_read_whole_bytes(SpeexBits *bits, char *chars, int nbytes)
 {
    int i,pos;
    int nchars = nbytes/BYTES_PER_CHAR;
@@ -185,7 +185,7 @@
    bits->nbBits+=nchars<<LOG2_BITS_PER_CHAR;
 }
 
-int speex_bits_write(SpeexBits *bits, char *chars, int max_nbytes)
+EXPORT int speex_bits_write(SpeexBits *bits, char *chars, int max_nbytes)
 {
    int i;
    int max_nchars = max_nbytes/BYTES_PER_CHAR;
@@ -208,7 +208,7 @@
    return max_nchars*BYTES_PER_CHAR;
 }
 
-int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes)
+EXPORT int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes)
 {
    int max_nchars = max_nbytes/BYTES_PER_CHAR;
    int i;
@@ -226,7 +226,7 @@
    return max_nchars*BYTES_PER_CHAR;
 }
 
-void speex_bits_pack(SpeexBits *bits, int data, int nbBits)
+EXPORT void speex_bits_pack(SpeexBits *bits, int data, int nbBits)
 {
    unsigned int d=data;
 
@@ -269,7 +269,7 @@
    }
 }
 
-int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
+EXPORT int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
 {
    unsigned int d=speex_bits_unpack_unsigned(bits,nbBits);
    /* If number is negative */
@@ -280,7 +280,7 @@
    return d;
 }
 
-unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
+EXPORT unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
 {
    unsigned int d=0;
    if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+nbBits>bits->nbBits)
@@ -302,7 +302,7 @@
    return d;
 }
 
-unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits)
+EXPORT unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits)
 {
    unsigned int d=0;
    int bitPtr, charPtr;
@@ -331,7 +331,7 @@
    return d;
 }
 
-int speex_bits_peek(SpeexBits *bits)
+EXPORT int speex_bits_peek(SpeexBits *bits)
 {
    if ((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+1>bits->nbBits)
       bits->overflow=1;
@@ -340,7 +340,7 @@
    return (bits->chars[bits->charPtr]>>(BITS_PER_CHAR-1 - bits->bitPtr))&1;
 }
 
-void speex_bits_advance(SpeexBits *bits, int n)
+EXPORT void speex_bits_advance(SpeexBits *bits, int n)
 {
     if (((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr+n>bits->nbBits) || bits->overflow){
       bits->overflow=1;
@@ -350,7 +350,7 @@
    bits->bitPtr = (bits->bitPtr+n) & (BITS_PER_CHAR-1);       /* modulo by BITS_PER_CHAR */
 }
 
-int speex_bits_remaining(SpeexBits *bits)
+EXPORT int speex_bits_remaining(SpeexBits *bits)
 {
    if (bits->overflow)
       return -1;
@@ -358,12 +358,12 @@
       return bits->nbBits-((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr);
 }
 
-int speex_bits_nbytes(SpeexBits *bits)
+EXPORT int speex_bits_nbytes(SpeexBits *bits)
 {
    return ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);
 }
 
-void speex_bits_insert_terminator(SpeexBits *bits)
+EXPORT void speex_bits_insert_terminator(SpeexBits *bits)
 {
    if (bits->bitPtr)
       speex_bits_pack(bits, 0, 1);

Modified: trunk/speex/libspeex/buffer.c
===================================================================
--- trunk/speex/libspeex/buffer.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/buffer.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -48,7 +48,7 @@
    int   available;
 };
 
-SpeexBuffer *speex_buffer_init(int size)
+EXPORT SpeexBuffer *speex_buffer_init(int size)
 {
    SpeexBuffer *st = speex_alloc(sizeof(SpeexBuffer));
    st->data = speex_alloc(size);
@@ -59,13 +59,13 @@
    return st;
 }
 
-void speex_buffer_destroy(SpeexBuffer *st)
+EXPORT void speex_buffer_destroy(SpeexBuffer *st)
 {
    speex_free(st->data);
    speex_free(st);
 }
 
-int speex_buffer_write(SpeexBuffer *st, void *_data, int len)
+EXPORT int speex_buffer_write(SpeexBuffer *st, void *_data, int len)
 {
    int end;
    int end1;
@@ -97,7 +97,7 @@
    return len;
 }
 
-int speex_buffer_writezeros(SpeexBuffer *st, int len)
+EXPORT int speex_buffer_writezeros(SpeexBuffer *st, int len)
 {
    /* This is almost the same as for speex_buffer_write() but using 
    SPEEX_MEMSET() instead of SPEEX_COPY(). Update accordingly. */
@@ -129,7 +129,7 @@
    return len;
 }
 
-int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
+EXPORT int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
 {
    int end, end1;
    char *data = _data;
@@ -156,12 +156,12 @@
    return len;
 }
 
-int speex_buffer_get_available(SpeexBuffer *st)
+EXPORT int speex_buffer_get_available(SpeexBuffer *st)
 {
    return st->available;
 }
 
-int speex_buffer_resize(SpeexBuffer *st, int len)
+EXPORT int speex_buffer_resize(SpeexBuffer *st, int len)
 {
    int old_len = st->size;
    if (len > old_len)

Modified: trunk/speex/libspeex/jitter.c
===================================================================
--- trunk/speex/libspeex/jitter.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/jitter.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -269,7 +269,7 @@
 
 
 /** Initialise jitter buffer */
-JitterBuffer *jitter_buffer_init(int step_size)
+EXPORT JitterBuffer *jitter_buffer_init(int step_size)
 {
    JitterBuffer *jitter = (JitterBuffer*)speex_alloc(sizeof(JitterBuffer));
    if (jitter)
@@ -294,7 +294,7 @@
 }
 
 /** Reset jitter buffer */
-void jitter_buffer_reset(JitterBuffer *jitter)
+EXPORT void jitter_buffer_reset(JitterBuffer *jitter)
 {
    int i;
    for (i=0;i<SPEEX_JITTER_MAX_BUFFER_SIZE;i++)
@@ -325,7 +325,7 @@
 }
 
 /** Destroy jitter buffer */
-void jitter_buffer_destroy(JitterBuffer *jitter)
+EXPORT void jitter_buffer_destroy(JitterBuffer *jitter)
 {
    jitter_buffer_reset(jitter);
    speex_free(jitter);
@@ -365,7 +365,7 @@
 
 
 /** Put one packet into the jitter buffer */
-void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet)
+EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet)
 {
    int i,j;
    int late;
@@ -462,7 +462,7 @@
 }
 
 /** Get one packet from the jitter buffer */
-int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset)
+EXPORT int jitter_buffer_get(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t desired_span, spx_int32_t *start_offset)
 {
    int i;
    unsigned int j;
@@ -677,7 +677,7 @@
 
 }
 
-int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet)
+EXPORT int jitter_buffer_get_another(JitterBuffer *jitter, JitterBufferPacket *packet)
 {
    int i, j;
    for (i=0;i<SPEEX_JITTER_MAX_BUFFER_SIZE;i++)
@@ -736,7 +736,7 @@
 }
 
 /* Let the jitter buffer know it's the right time to adjust the buffering delay to the network conditions */
-int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset)
+EXPORT int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int32_t *start_offset)
 {
    /* If the programmer calls jitter_buffer_update_delay() directly, 
       automatically disable auto-adjustment */
@@ -746,12 +746,12 @@
 }
 
 /** Get pointer timestamp of jitter buffer */
-int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter)
+EXPORT int jitter_buffer_get_pointer_timestamp(JitterBuffer *jitter)
 {
    return jitter->pointer_timestamp;
 }
 
-void jitter_buffer_tick(JitterBuffer *jitter)
+EXPORT void jitter_buffer_tick(JitterBuffer *jitter)
 {
    /* Automatically-adjust the buffering delay if requested */
    if (jitter->auto_adjust)
@@ -767,7 +767,7 @@
    jitter->buffered = 0;
 }
 
-void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem)
+EXPORT void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem)
 {
    /* Automatically-adjust the buffering delay if requested */
    if (jitter->auto_adjust)
@@ -780,7 +780,7 @@
 
 
 /* Used like the ioctl function to control the jitter buffer parameters */
-int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr)
+EXPORT int jitter_buffer_ctl(JitterBuffer *jitter, int request, void *ptr)
 {
    int count, i;
    switch(request)

Modified: trunk/speex/libspeex/mdf.c
===================================================================
--- trunk/speex/libspeex/mdf.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/mdf.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -378,7 +378,7 @@
 #endif
 
 /** Creates a new echo canceller state */
-SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length)
+EXPORT SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length)
 {
    int i,N,M;
    SpeexEchoState *st = (SpeexEchoState *)speex_alloc(sizeof(SpeexEchoState));
@@ -495,7 +495,7 @@
 }
 
 /** Resets echo canceller state */
-void speex_echo_state_reset(SpeexEchoState *st)
+EXPORT void speex_echo_state_reset(SpeexEchoState *st)
 {
    int i, M, N;
    st->cancel_count=0;
@@ -545,7 +545,7 @@
 }
 
 /** Destroys an echo canceller state */
-void speex_echo_state_destroy(SpeexEchoState *st)
+EXPORT void speex_echo_state_destroy(SpeexEchoState *st)
 {
    spx_fft_destroy(st->fft_table);
 
@@ -587,7 +587,7 @@
 #endif
 }
 
-void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t *out)
+EXPORT void speex_echo_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t *out)
 {
    int i;
    /*speex_warning_int("capture with fill level ", st->play_buf_pos/st->frame_size);*/
@@ -610,7 +610,7 @@
    }
 }
 
-void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play)
+EXPORT void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play)
 {
    /*speex_warning_int("playback with fill level ", st->play_buf_pos/st->frame_size);*/
    if (!st->play_buf_started)
@@ -637,13 +637,13 @@
 }
 
 /** Performs echo cancellation on a frame (deprecated, last arg now ignored) */
-void speex_echo_cancel(SpeexEchoState *st, const spx_int16_t *in, const spx_int16_t *far_end, spx_int16_t *out, spx_int32_t *Yout)
+EXPORT void speex_echo_cancel(SpeexEchoState *st, const spx_int16_t *in, const spx_int16_t *far_end, spx_int16_t *out, spx_int32_t *Yout)
 {
    speex_echo_cancellation(st, in, far_end, out);
 }
 
 /** Performs echo cancellation on a frame */
-void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, const spx_int16_t *far_end, spx_int16_t *out)
+EXPORT void speex_echo_cancellation(SpeexEchoState *st, const spx_int16_t *in, const spx_int16_t *far_end, spx_int16_t *out)
 {
    int i,j;
    int N,M;
@@ -1141,7 +1141,7 @@
    
 }
 
-int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr)
+EXPORT int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr)
 {
    switch(request)
    {

Modified: trunk/speex/libspeex/modes.c
===================================================================
--- trunk/speex/libspeex/modes.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/modes.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -337,7 +337,7 @@
 
 
 /* Default mode for narrowband */
-const SpeexMode speex_nb_mode = {
+EXPORT const SpeexMode speex_nb_mode = {
    &nb_mode,
    nb_mode_query,
    "narrowband",
@@ -355,7 +355,7 @@
 
 
 
-int speex_mode_query(const SpeexMode *mode, int request, void *ptr)
+EXPORT int speex_mode_query(const SpeexMode *mode, int request, void *ptr)
 {
    return mode->query(mode->mode, request, ptr);
 }

Modified: trunk/speex/libspeex/modes_wb.c
===================================================================
--- trunk/speex/libspeex/modes_wb.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/modes_wb.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -52,7 +52,7 @@
 #define NULL 0
 #endif
 
-const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
+EXPORT const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
 
 extern const signed char hexc_table[];
 extern const signed char hexc_10_32_table[];
@@ -200,7 +200,7 @@
 };
 
 
-const SpeexMode speex_wb_mode = {
+EXPORT const SpeexMode speex_wb_mode = {
    &sb_wb_mode,
    wb_mode_query,
    "wideband (sub-band CELP)",
@@ -270,7 +270,7 @@
 }
 
 
-const SpeexMode speex_uwb_mode = {
+EXPORT const SpeexMode speex_uwb_mode = {
    &sb_uwb_mode,
    wb_mode_query,
    "ultra-wideband (sub-band CELP)",
@@ -289,7 +289,7 @@
 /* We have defined speex_lib_get_mode() as a macro in speex.h */
 #undef speex_lib_get_mode
 
-const SpeexMode * speex_lib_get_mode (int mode)
+EXPORT const SpeexMode * speex_lib_get_mode (int mode)
 {
    if (mode < 0 || mode >= SPEEX_NB_MODES) return NULL;
 

Modified: trunk/speex/libspeex/preprocess.c
===================================================================
--- trunk/speex/libspeex/preprocess.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/preprocess.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -392,7 +392,7 @@
 }
 
 #endif
-SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate)
+EXPORT SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_rate)
 {
    int i;
    int N, N3, N4, M;
@@ -530,7 +530,7 @@
    return st;
 }
 
-void speex_preprocess_state_destroy(SpeexPreprocessState *st)
+EXPORT void speex_preprocess_state_destroy(SpeexPreprocessState *st)
 {
    speex_free(st->frame);
    speex_free(st->ft);
@@ -718,12 +718,12 @@
 
 void speex_echo_get_residual(SpeexEchoState *st, spx_word32_t *Yout, int len);
 
-int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo)
+EXPORT int speex_preprocess(SpeexPreprocessState *st, spx_int16_t *x, spx_int32_t *echo)
 {
    return speex_preprocess_run(st, x);
 }
 
-int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
+EXPORT int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
 {
    int i;
    int M;
@@ -1010,7 +1010,7 @@
    }
 }
 
-void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x)
+EXPORT void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x)
 {
    int i;
    int N = st->ps_size;
@@ -1045,7 +1045,7 @@
 }
 
 
-int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr)
+EXPORT int speex_preprocess_ctl(SpeexPreprocessState *state, int request, void *ptr)
 {
    int i;
    SpeexPreprocessState *st;

Modified: trunk/speex/libspeex/resample.c
===================================================================
--- trunk/speex/libspeex/resample.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/resample.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -721,12 +721,12 @@
 
 }
 
-SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
+EXPORT SpeexResamplerState *speex_resampler_init(spx_uint32_t nb_channels, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
 {
    return speex_resampler_init_frac(nb_channels, in_rate, out_rate, in_rate, out_rate, quality, err);
 }
 
-SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
+EXPORT SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate, int quality, int *err)
 {
    spx_uint32_t i;
    SpeexResamplerState *st;
@@ -779,7 +779,7 @@
    return st;
 }
 
-void speex_resampler_destroy(SpeexResamplerState *st)
+EXPORT void speex_resampler_destroy(SpeexResamplerState *st)
 {
    speex_free(st->mem);
    speex_free(st->sinc_table);
@@ -854,7 +854,7 @@
 #define FIXED_STACK_ALLOC 1024
 
 #ifdef FIXED_POINT
-int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
+EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
 {
    spx_uint32_t i;
    int istride_save, ostride_save;
@@ -920,16 +920,16 @@
 #endif
    return RESAMPLER_ERR_SUCCESS;
 }
-int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
+EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
 {
    return speex_resampler_process_native(st, channel_index, in, in_len, out, out_len);
 }
 #else
-int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
+EXPORT int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_index, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
 {
    return speex_resampler_process_native(st, channel_index, in, in_len, out, out_len);
 }
-int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
+EXPORT int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_index, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
 {
    spx_uint32_t i;
    int istride_save, ostride_save;
@@ -997,7 +997,7 @@
 }
 #endif
 
-int speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
+EXPORT int speex_resampler_process_interleaved_float(SpeexResamplerState *st, const float *in, spx_uint32_t *in_len, float *out, spx_uint32_t *out_len)
 {
    spx_uint32_t i;
    int istride_save, ostride_save;
@@ -1019,7 +1019,7 @@
 }
 
                
-int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
+EXPORT int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_int16_t *in, spx_uint32_t *in_len, spx_int16_t *out, spx_uint32_t *out_len)
 {
    spx_uint32_t i;
    int istride_save, ostride_save;
@@ -1040,18 +1040,18 @@
    return RESAMPLER_ERR_SUCCESS;
 }
 
-int speex_resampler_set_rate(SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate)
+EXPORT int speex_resampler_set_rate(SpeexResamplerState *st, spx_uint32_t in_rate, spx_uint32_t out_rate)
 {
    return speex_resampler_set_rate_frac(st, in_rate, out_rate, in_rate, out_rate);
 }
 
-void speex_resampler_get_rate(SpeexResamplerState *st, spx_uint32_t *in_rate, spx_uint32_t *out_rate)
+EXPORT void speex_resampler_get_rate(SpeexResamplerState *st, spx_uint32_t *in_rate, spx_uint32_t *out_rate)
 {
    *in_rate = st->in_rate;
    *out_rate = st->out_rate;
 }
 
-int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
+EXPORT int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_num, spx_uint32_t ratio_den, spx_uint32_t in_rate, spx_uint32_t out_rate)
 {
    spx_uint32_t fact;
    spx_uint32_t old_den;
@@ -1090,13 +1090,13 @@
    return RESAMPLER_ERR_SUCCESS;
 }
 
-void speex_resampler_get_ratio(SpeexResamplerState *st, spx_uint32_t *ratio_num, spx_uint32_t *ratio_den)
+EXPORT void speex_resampler_get_ratio(SpeexResamplerState *st, spx_uint32_t *ratio_num, spx_uint32_t *ratio_den)
 {
    *ratio_num = st->num_rate;
    *ratio_den = st->den_rate;
 }
 
-int speex_resampler_set_quality(SpeexResamplerState *st, int quality)
+EXPORT int speex_resampler_set_quality(SpeexResamplerState *st, int quality)
 {
    if (quality > 10 || quality < 0)
       return RESAMPLER_ERR_INVALID_ARG;
@@ -1108,42 +1108,42 @@
    return RESAMPLER_ERR_SUCCESS;
 }
 
-void speex_resampler_get_quality(SpeexResamplerState *st, int *quality)
+EXPORT void speex_resampler_get_quality(SpeexResamplerState *st, int *quality)
 {
    *quality = st->quality;
 }
 
-void speex_resampler_set_input_stride(SpeexResamplerState *st, spx_uint32_t stride)
+EXPORT void speex_resampler_set_input_stride(SpeexResamplerState *st, spx_uint32_t stride)
 {
    st->in_stride = stride;
 }
 
-void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride)
+EXPORT void speex_resampler_get_input_stride(SpeexResamplerState *st, spx_uint32_t *stride)
 {
    *stride = st->in_stride;
 }
 
-void speex_resampler_set_output_stride(SpeexResamplerState *st, spx_uint32_t stride)
+EXPORT void speex_resampler_set_output_stride(SpeexResamplerState *st, spx_uint32_t stride)
 {
    st->out_stride = stride;
 }
 
-void speex_resampler_get_output_stride(SpeexResamplerState *st, spx_uint32_t *stride)
+EXPORT void speex_resampler_get_output_stride(SpeexResamplerState *st, spx_uint32_t *stride)
 {
    *stride = st->out_stride;
 }
 
-int speex_resampler_get_input_latency(SpeexResamplerState *st)
+EXPORT int speex_resampler_get_input_latency(SpeexResamplerState *st)
 {
   return st->filt_len / 2;
 }
 
-int speex_resampler_get_output_latency(SpeexResamplerState *st)
+EXPORT int speex_resampler_get_output_latency(SpeexResamplerState *st)
 {
   return ((st->filt_len / 2) * st->den_rate + (st->num_rate >> 1)) / st->num_rate;
 }
 
-int speex_resampler_skip_zeros(SpeexResamplerState *st)
+EXPORT int speex_resampler_skip_zeros(SpeexResamplerState *st)
 {
    spx_uint32_t i;
    for (i=0;i<st->nb_channels;i++)
@@ -1151,7 +1151,7 @@
    return RESAMPLER_ERR_SUCCESS;
 }
 
-int speex_resampler_reset_mem(SpeexResamplerState *st)
+EXPORT int speex_resampler_reset_mem(SpeexResamplerState *st)
 {
    spx_uint32_t i;
    for (i=0;i<st->nb_channels*(st->filt_len-1);i++)
@@ -1159,7 +1159,7 @@
    return RESAMPLER_ERR_SUCCESS;
 }
 
-const char *speex_resampler_strerror(int err)
+EXPORT const char *speex_resampler_strerror(int err)
 {
    switch (err)
    {

Modified: trunk/speex/libspeex/speex.c
===================================================================
--- trunk/speex/libspeex/speex.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/speex.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -48,22 +48,22 @@
 
 
 
-void *speex_encoder_init(const SpeexMode *mode)
+EXPORT void *speex_encoder_init(const SpeexMode *mode)
 {
    return mode->enc_init(mode);
 }
 
-void *speex_decoder_init(const SpeexMode *mode)
+EXPORT void *speex_decoder_init(const SpeexMode *mode)
 {
    return mode->dec_init(mode);
 }
 
-void speex_encoder_destroy(void *state)
+EXPORT void speex_encoder_destroy(void *state)
 {
    (*((SpeexMode**)state))->enc_destroy(state);
 }
 
-void speex_decoder_destroy(void *state)
+EXPORT void speex_decoder_destroy(void *state)
 {
    (*((SpeexMode**)state))->dec_destroy(state);
 }
@@ -85,7 +85,7 @@
 #ifdef FIXED_POINT
 
 #ifndef DISABLE_FLOAT_API
-int speex_encode(void *state, float *in, SpeexBits *bits)
+EXPORT int speex_encode(void *state, float *in, SpeexBits *bits)
 {
    int i;
    spx_int32_t N;
@@ -104,7 +104,7 @@
 }
 #endif /* #ifndef DISABLE_FLOAT_API */
 
-int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits)
+EXPORT int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits)
 {
    SpeexMode *mode;
    mode = *(SpeexMode**)state;
@@ -112,7 +112,7 @@
 }
 
 #ifndef DISABLE_FLOAT_API
-int speex_decode(void *state, SpeexBits *bits, float *out)
+EXPORT int speex_decode(void *state, SpeexBits *bits, float *out)
 {
    int i, ret;
    spx_int32_t N;
@@ -125,7 +125,7 @@
 }
 #endif /* #ifndef DISABLE_FLOAT_API */
 
-int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out)
+EXPORT int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out)
 {
    SpeexMode *mode = *(SpeexMode**)state;
    return (mode)->dec(state, bits, out);
@@ -133,12 +133,12 @@
 
 #else
 
-int speex_encode(void *state, float *in, SpeexBits *bits)
+EXPORT int speex_encode(void *state, float *in, SpeexBits *bits)
 {
    return (*((SpeexMode**)state))->enc(state, in, bits);
 }
 
-int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits)
+EXPORT int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits)
 {
    int i;
    spx_int32_t N;
@@ -149,12 +149,12 @@
    return (*((SpeexMode**)state))->enc(state, float_in, bits);
 }
 
-int speex_decode(void *state, SpeexBits *bits, float *out)
+EXPORT int speex_decode(void *state, SpeexBits *bits, float *out)
 {
    return (*((SpeexMode**)state))->dec(state, bits, out);
 }
 
-int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out)
+EXPORT int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out)
 {
    int i;
    spx_int32_t N;
@@ -177,12 +177,12 @@
 
 
 
-int speex_encoder_ctl(void *state, int request, void *ptr)
+EXPORT int speex_encoder_ctl(void *state, int request, void *ptr)
 {
    return (*((SpeexMode**)state))->enc_ctl(state, request, ptr);
 }
 
-int speex_decoder_ctl(void *state, int request, void *ptr)
+EXPORT int speex_decoder_ctl(void *state, int request, void *ptr)
 {
    return (*((SpeexMode**)state))->dec_ctl(state, request, ptr);
 }
@@ -215,7 +215,7 @@
 
 
 
-int speex_lib_ctl(int request, void *ptr)
+EXPORT int speex_lib_ctl(int request, void *ptr)
 {
    switch (request)
    {

Modified: trunk/speex/libspeex/speex_callbacks.c
===================================================================
--- trunk/speex/libspeex/speex_callbacks.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/speex_callbacks.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -40,7 +40,7 @@
 #include "arch.h"
 #include "os_support.h"
 
-int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state)
+EXPORT int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state)
 {
    int id;
    SpeexCallback *callback;
@@ -72,7 +72,7 @@
    return 0;
 }
 
-int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
 {
    spx_int32_t m;
    m = speex_bits_unpack_unsigned(bits, 4);
@@ -80,7 +80,7 @@
    return 0;
 }
 
-int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data)
 {
    spx_int32_t m;
    m = speex_bits_unpack_unsigned(bits, 4);
@@ -88,7 +88,7 @@
    return 0;
 }
 
-int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data)
 {
    spx_int32_t m;
    m = speex_bits_unpack_unsigned(bits, 4);
@@ -97,7 +97,7 @@
 }
 
 #ifndef DISABLE_VBR
-int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
 {
    spx_int32_t vbr;
    vbr = speex_bits_unpack_unsigned(bits, 1);
@@ -106,7 +106,7 @@
 }
 #endif /* #ifndef DISABLE_VBR */
 
-int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
 {
    spx_int32_t enh;
    enh = speex_bits_unpack_unsigned(bits, 1);
@@ -115,7 +115,7 @@
 }
 
 #ifndef DISABLE_VBR
-int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data)
 {
    float qual;
    qual = speex_bits_unpack_unsigned(bits, 4);
@@ -124,7 +124,7 @@
 }
 #endif /* #ifndef DISABLE_VBR */
 
-int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
 {
    unsigned char ch;
    ch = speex_bits_unpack_unsigned(bits, 8);
@@ -136,7 +136,7 @@
 
 
 /* Default handler for user callbacks: skip it */
-int speex_default_user_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_default_user_handler(SpeexBits *bits, void *state, void *data)
 {
    int req_size = speex_bits_unpack_unsigned(bits, 4);
    speex_bits_advance(bits, 5+8*req_size);

Modified: trunk/speex/libspeex/speex_header.c
===================================================================
--- trunk/speex/libspeex/speex_header.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/speex_header.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -83,7 +83,7 @@
 } SpeexHeader;
 */
 
-void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const SpeexMode *m)
+EXPORT void speex_init_header(SpeexHeader *header, int rate, int nb_channels, const SpeexMode *m)
 {
    int i;
    const char *h="Speex   ";
@@ -118,7 +118,7 @@
    header->reserved2 = 0;
 }
 
-char *speex_header_to_packet(SpeexHeader *header, int *size)
+EXPORT char *speex_header_to_packet(SpeexHeader *header, int *size)
 {
    SpeexHeader *le_header;
    le_header = (SpeexHeader*)speex_alloc(sizeof(SpeexHeader));
@@ -142,7 +142,7 @@
    return (char *)le_header;
 }
 
-SpeexHeader *speex_packet_to_header(char *packet, int size)
+EXPORT SpeexHeader *speex_packet_to_header(char *packet, int size)
 {
    int i;
    SpeexHeader *le_header;
@@ -194,7 +194,7 @@
 
 }
 
-void speex_header_free(void *ptr)
+EXPORT void speex_header_free(void *ptr)
 {
    speex_free(ptr);
 }

Modified: trunk/speex/libspeex/stereo.c
===================================================================
--- trunk/speex/libspeex/stereo.c	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/libspeex/stereo.c	2008-04-25 11:10:55 UTC (rev 14797)
@@ -72,14 +72,14 @@
 #define COMPATIBILITY_HACK(s) 
 #endif
 
-SpeexStereoState *speex_stereo_state_init()
+EXPORT SpeexStereoState *speex_stereo_state_init()
 {
    SpeexStereoState *stereo = speex_alloc(sizeof(SpeexStereoState));
    speex_stereo_state_reset(stereo);
    return stereo;
 }
 
-void speex_stereo_state_reset(SpeexStereoState *_stereo)
+EXPORT void speex_stereo_state_reset(SpeexStereoState *_stereo)
 {
    RealSpeexStereoState *stereo = (RealSpeexStereoState*)_stereo;
 #ifdef FIXED_POINT
@@ -99,13 +99,13 @@
 #endif   
 }
 
-void speex_stereo_state_destroy(SpeexStereoState *stereo)
+EXPORT void speex_stereo_state_destroy(SpeexStereoState *stereo)
 {
    speex_free(stereo);
 }
 
 #ifndef DISABLE_FLOAT_API
-void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits)
+EXPORT void speex_encode_stereo(float *data, int frame_size, SpeexBits *bits)
 {
    int i, tmp;
    float e_left=0, e_right=0, e_tot=0;
@@ -143,7 +143,7 @@
 }
 #endif /* #ifndef DISABLE_FLOAT_API */
 
-void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits)
+EXPORT void speex_encode_stereo_int(spx_int16_t *data, int frame_size, SpeexBits *bits)
 {
    int i, tmp;
    spx_word32_t e_left=0, e_right=0, e_tot=0;
@@ -218,7 +218,7 @@
 }
 
 #ifndef DISABLE_FLOAT_API
-void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *_stereo)
+EXPORT void speex_decode_stereo(float *data, int frame_size, SpeexStereoState *_stereo)
 {
    int i;
    spx_word32_t balance;
@@ -245,7 +245,7 @@
 }
 #endif /* #ifndef DISABLE_FLOAT_API */
 
-void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState *_stereo)
+EXPORT void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState *_stereo)
 {
    int i;
    spx_word32_t balance;
@@ -271,7 +271,7 @@
    }
 }
 
-int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data)
+EXPORT int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data)
 {
    RealSpeexStereoState *stereo;
    spx_word16_t sign=1, dexp;

Modified: trunk/speex/win32/config.h
===================================================================
--- trunk/speex/win32/config.h	2008-04-25 11:10:22 UTC (rev 14796)
+++ trunk/speex/win32/config.h	2008-04-25 11:10:55 UTC (rev 14797)
@@ -12,3 +12,6 @@
 #ifndef FIXED_POINT
 #  define FLOATING_POINT
 #endif
+
+/* We don't support visibility on Win32 */
+#define EXPORT



More information about the commits mailing list