Skip to content
Snippets Groups Projects
Commit 3870ddb6 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Only export the CELT calls when CUSTOM_MODES is defined

parent 6cd4e2cd
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment