Commit e3b7dceb authored by jm's avatar jm
Browse files

Patch by Thorvald Natvig: uses gcc visibility options to only export the

required symbols in the DSO


git-svn-id: http://svn.xiph.org/trunk/speex@14797 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent 14c8411f
......@@ -72,6 +72,27 @@ has_alloca=no
)
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)
......
......@@ -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 @@ void speex_bits_init(SpeexBits *bits)
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 @@ void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
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_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size)
}
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 @@ void speex_bits_reset(SpeexBits *bits)
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 @@ static void speex_bits_flush(SpeexBits *bits)
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 @@ void speex_bits_read_whole_bytes(SpeexBits *bits, char *chars, int nbytes)
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 @@ int speex_bits_write(SpeexBits *bits, char *chars, int max_nbytes)
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 @@ int speex_bits_write_whole_bytes(SpeexBits *bits, char *chars, int max_nbytes)
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 @@ void speex_bits_pack(SpeexBits *bits, int data, int nbBits)
}
}
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 @@ int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
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 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
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 @@ unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits)
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 @@ int speex_bits_peek(SpeexBits *bits)
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 @@ void speex_bits_advance(SpeexBits *bits, int n)
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 @@ int speex_bits_remaining(SpeexBits *bits)
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);
......
......@@ -48,7 +48,7 @@ struct SpeexBuffer_ {
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 @@ SpeexBuffer *speex_buffer_init(int size)
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 @@ int speex_buffer_write(SpeexBuffer *st, void *_data, int len)
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 @@ int speex_buffer_writezeros(SpeexBuffer *st, int len)
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 @@ int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
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)
......
......@@ -269,7 +269,7 @@ static spx_int16_t compute_opt_delay(JitterBuffer *jitter)
/** 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 @@ JitterBuffer *jitter_buffer_init(int step_size)
}
/** 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 @@ void jitter_buffer_reset(JitterBuffer *jitter)
}
/** 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 @@ static void shift_timings(JitterBuffer *jitter, spx_int16_t amount)
/** 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 @@ void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *packet)
}
/** 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(JitterBuffer *jitter, JitterBufferPacket *packet, spx_int3
}
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 @@ static int _jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket
}
/* 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 @@ int jitter_buffer_update_delay(JitterBuffer *jitter, JitterBufferPacket *packet,
}
/** 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 @@ void jitter_buffer_tick(JitterBuffer *jitter)
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 @@ void jitter_buffer_remaining_span(JitterBuffer *jitter, spx_uint32_t rem)
/* 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)
......
......@@ -378,7 +378,7 @@ static void dump_audio(const spx_int16_t *rec, const spx_int16_t *play, const sp
#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 @@ SpeexEchoState *speex_echo_state_init(int frame_size, int filter_length)
}
/** 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 @@ void speex_echo_state_reset(SpeexEchoState *st)
}
/** 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 @@ void speex_echo_state_destroy(SpeexEchoState *st)
#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_capture(SpeexEchoState *st, const spx_int16_t *rec, spx_int16_t
}
}
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 @@ void speex_echo_playback(SpeexEchoState *st, const spx_int16_t *play)
}
/** 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 @@ void speex_echo_get_residual(SpeexEchoState *st, spx_word32_t *residual_echo, in
}
int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr)
EXPORT int speex_echo_ctl(SpeexEchoState *st, int request, void *ptr)
{
switch(request)
{
......
......@@ -337,7 +337,7 @@ static const SpeexNBMode nb_mode = {
/* 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 @@ const SpeexMode speex_nb_mode = {
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);
}
......
......@@ -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 @@ static const SpeexSBMode sb_wb_mode = {
};
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 @@ int wb_mode_query(const void *mode, int request, void *ptr)
}
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 @@ const SpeexMode speex_uwb_mode = {
/* 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;
......
......@@ -392,7 +392,7 @@ static void compute_gain_floor(int noise_suppress, int effective_echo_suppress,
}
#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 @@ SpeexPreprocessState *speex_preprocess_state_init(int frame_size, int sampling_r
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 @@ static void update_noise_prob(SpeexPreprocessState *st)
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 @@ int speex_preprocess_run(SpeexPreprocessState *st, spx_int16_t *x)
}
}
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 @@ void speex_preprocess_estimate_update(SpeexPreprocessState *st, spx_int16_t *x)
}
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;
......
......@@ -721,12 +721,12 @@ static void update_filter(SpeexResamplerState *st)
}
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 @@ SpeexResamplerState *speex_resampler_init_frac(spx_uint32_t nb_channels, spx_uin
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 @@ static int speex_resampler_process_native(SpeexResamplerState *st, spx_uint32_t
#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 @@ int speex_resampler_process_float(SpeexResamplerState *st, spx_uint32_t channel_
#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 @@ int speex_resampler_process_int(SpeexResamplerState *st, spx_uint32_t channel_in
}
#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_float(SpeexResamplerState *st, const flo
}
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 @@ int speex_resampler_process_interleaved_int(SpeexResamplerState *st, const spx_i
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 @@ int speex_resampler_set_rate_frac(SpeexResamplerState *st, spx_uint32_t ratio_nu
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 @@ int speex_resampler_set_quality(SpeexResamplerState *st, int quality)
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;
}