diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-09-01 15:22:37 -0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2011-09-01 15:22:37 -0400 |
commit | 3870ddb665f987c139c8ca6477a152868c1c6f6e (patch) | |
tree | 3999139475165dec24964969406966a05c6de779 | |
parent | 6cd4e2cd010b50cdba9991252ed1ff83ff9a8392 (diff) | |
download | opus-3870ddb665f987c139c8ca6477a152868c1c6f6e.tar.gz |
Only export the CELT calls when CUSTOM_MODES is defined
-rw-r--r-- | libcelt/opus_custom.h | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/libcelt/opus_custom.h b/libcelt/opus_custom.h index 973e3ffd..2ffd9592 100644 --- a/libcelt/opus_custom.h +++ b/libcelt/opus_custom.h @@ -42,6 +42,12 @@ extern "C" { #endif +#ifdef CUSTOM_MODES +#define OPUS_CUSTOM_EXPORT OPUS_EXPORT +#else +#define OPUS_CUSTOM_EXPORT +#endif + /** Contains the state of an encoder. One encoder state is needed for each stream. It is initialised once at the beginning of the stream. Do *not* re-initialise the state for every frame. @@ -73,19 +79,19 @@ typedef struct CELTMode CELTMode; @param error Returned error code (if NULL, no error will be returned) @return A newly created mode */ -OPUS_EXPORT CELTMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error); +OPUS_CUSTOM_EXPORT CELTMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error); /** Destroys a mode struct. Only call this after all encoders and decoders using this mode are destroyed as well. @param mode Mode to be destroyed */ -OPUS_EXPORT void opus_custom_mode_destroy(CELTMode *mode); +OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(CELTMode *mode); /* Encoder */ -OPUS_EXPORT int opus_custom_encoder_get_size(const CELTMode *mode, int channels); +OPUS_CUSTOM_EXPORT int opus_custom_encoder_get_size(const CELTMode *mode, int channels); /** Creates a new encoder state. Each stream needs its own encoder state (can't be shared across simultaneous streams). @@ -96,14 +102,14 @@ OPUS_EXPORT int opus_custom_encoder_get_size(const CELTMode *mode, int channels) @param error Returns an error code @return Newly created encoder state. */ -OPUS_EXPORT CELTEncoder *opus_custom_encoder_create(const CELTMode *mode, int channels, int *error); +OPUS_CUSTOM_EXPORT CELTEncoder *opus_custom_encoder_create(const CELTMode *mode, int channels, int *error); -OPUS_EXPORT int opus_custom_encoder_init(CELTEncoder *st, const CELTMode *mode, int channels); +OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(CELTEncoder *st, const CELTMode *mode, int channels); /** Destroys a an encoder state. @param st Encoder state to be destroyed */ -OPUS_EXPORT void opus_custom_encoder_destroy(CELTEncoder *st); +OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(CELTEncoder *st); /** Encodes a frame of audio. @param st Encoder state @@ -123,7 +129,7 @@ OPUS_EXPORT void opus_custom_encoder_destroy(CELTEncoder *st); * the length returned be somehow transmitted to the decoder. Otherwise, no * decoding is possible. */ -OPUS_EXPORT int opus_custom_encode_float(CELTEncoder *st, const float *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes); +OPUS_CUSTOM_EXPORT int opus_custom_encode_float(CELTEncoder *st, const float *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes); /** Encodes a frame of audio. @param st Encoder state @@ -139,7 +145,7 @@ OPUS_EXPORT int opus_custom_encode_float(CELTEncoder *st, const float *pcm, int * the length returned be somehow transmitted to the decoder. Otherwise, no * decoding is possible. */ -OPUS_EXPORT int opus_custom_encode(CELTEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes); +OPUS_CUSTOM_EXPORT int opus_custom_encode(CELTEncoder *st, const opus_int16 *pcm, int frame_size, unsigned char *compressed, int maxCompressedBytes); /** Query and set encoder parameters @param st Encoder state @@ -147,13 +153,13 @@ OPUS_EXPORT int opus_custom_encode(CELTEncoder *st, const opus_int16 *pcm, int f @param value Pointer to a 32-bit int value @return Error code */ -OPUS_EXPORT int opus_custom_encoder_ctl(CELTEncoder * restrict st, int request, ...); +OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(CELTEncoder * restrict st, int request, ...); /* Decoder */ -OPUS_EXPORT int opus_custom_decoder_get_size(const CELTMode *mode, int channels); +OPUS_CUSTOM_EXPORT int opus_custom_decoder_get_size(const CELTMode *mode, int channels); /** Creates a new decoder state. Each stream needs its own decoder state (can't be shared across simultaneous streams). @@ -163,14 +169,14 @@ OPUS_EXPORT int opus_custom_decoder_get_size(const CELTMode *mode, int channels) @param error Returns an error code @return Newly created decoder state. */ -OPUS_EXPORT CELTDecoder *opus_custom_decoder_create(const CELTMode *mode, int channels, int *error); +OPUS_CUSTOM_EXPORT CELTDecoder *opus_custom_decoder_create(const CELTMode *mode, int channels, int *error); -OPUS_EXPORT int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels); +OPUS_CUSTOM_EXPORT int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channels); /** Destroys a a decoder state. @param st Decoder state to be destroyed */ -OPUS_EXPORT void opus_custom_decoder_destroy(CELTDecoder *st); +OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(CELTDecoder *st); /** Decodes a frame of audio. @param st Decoder state @@ -181,7 +187,7 @@ OPUS_EXPORT void opus_custom_decoder_destroy(CELTDecoder *st); returned here in float format. @return Error code. */ -OPUS_EXPORT int opus_custom_decode_float(CELTDecoder *st, const unsigned char *data, int len, float *pcm, int frame_size); +OPUS_CUSTOM_EXPORT int opus_custom_decode_float(CELTDecoder *st, const unsigned char *data, int len, float *pcm, int frame_size); /** Decodes a frame of audio. @param st Decoder state @@ -192,7 +198,7 @@ OPUS_EXPORT int opus_custom_decode_float(CELTDecoder *st, const unsigned char *d returned here in 16-bit PCM format (native endian). @return Error code. */ -OPUS_EXPORT int opus_custom_decode(CELTDecoder *st, const unsigned char *data, int len, opus_int16 *pcm, int frame_size); +OPUS_CUSTOM_EXPORT int opus_custom_decode(CELTDecoder *st, const unsigned char *data, int len, opus_int16 *pcm, int frame_size); /** Query and set decoder parameters @param st Decoder state @@ -200,7 +206,7 @@ OPUS_EXPORT int opus_custom_decode(CELTDecoder *st, const unsigned char *data, i @param value Pointer to a 32-bit int value @return Error code */ -OPUS_EXPORT int opus_custom_decoder_ctl(CELTDecoder * restrict st, int request, ...); +OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(CELTDecoder * restrict st, int request, ...); #ifdef __cplusplus |