ref: 6fe45a5e4f4a23f8050f33a5279d2d9c95eda6e8
parent: e05aaf22db2aa3835852efc581b785224d3c91ac
author: Jean-Marc Valin <[email protected]>
date: Fri Apr 29 16:09:19 EDT 2011
Getting shared libraries to build
--- a/src/opus.h
+++ b/src/opus.h
@@ -32,7 +32,7 @@
extern "C" {
#endif
-#if defined(__GNUC__) && defined(CELT_BUILD)
+#if defined(__GNUC__) && defined(OPUS_BUILD)
#define EXPORT __attribute__ ((visibility ("default")))
#elif defined(WIN32)
#define EXPORT __declspec(dllexport)
@@ -133,36 +133,36 @@
typedef struct OpusEncoder OpusEncoder;
typedef struct OpusDecoder OpusDecoder;
-OpusEncoder *opus_encoder_create(int Fs, int channels);
+EXPORT OpusEncoder *opus_encoder_create(int Fs, int channels);
/* returns length of data payload (in bytes) */
-int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
+EXPORT int opus_encode(OpusEncoder *st, const short *pcm, int frame_size,
unsigned char *data, int max_data_bytes);
-void opus_encoder_destroy(OpusEncoder *st);
+EXPORT void opus_encoder_destroy(OpusEncoder *st);
-int opus_encoder_ctl(OpusEncoder *st, int request, ...);
+EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...);
-OpusDecoder *opus_decoder_create(int Fs, int channels);
+EXPORT OpusDecoder *opus_decoder_create(int Fs, int channels);
/* returns (CELT) error code */
-int opus_decode(OpusDecoder *st, const unsigned char *data, int len,
+EXPORT int opus_decode(OpusDecoder *st, const unsigned char *data, int len,
short *pcm, int frame_size, int decode_fec);
-int opus_decoder_ctl(OpusDecoder *st, int request, ...);
+EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...);
-void opus_decoder_destroy(OpusDecoder *st);
+EXPORT void opus_decoder_destroy(OpusDecoder *st);
-int opus_packet_get_bandwidth(const unsigned char *data);
-int opus_packet_get_samples_per_frame(const unsigned char *data, int Fs);
-int opus_packet_get_nb_channels(const unsigned char *data);
-int opus_packet_get_nb_frames(const unsigned char packet[], int len);
-int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], int len);
+EXPORT int opus_packet_get_bandwidth(const unsigned char *data);
+EXPORT int opus_packet_get_samples_per_frame(const unsigned char *data, int Fs);
+EXPORT int opus_packet_get_nb_channels(const unsigned char *data);
+EXPORT int opus_packet_get_nb_frames(const unsigned char packet[], int len);
+EXPORT int opus_decoder_get_nb_samples(const OpusDecoder *dec, const unsigned char packet[], int len);
#if OPUS_TEST_RANGE_CODER_STATE
-int opus_encoder_get_final_range(OpusEncoder *st);
-int opus_decoder_get_final_range(OpusDecoder *st);
+EXPORT int opus_encoder_get_final_range(OpusEncoder *st);
+EXPORT int opus_decoder_get_final_range(OpusDecoder *st);
#endif