changed VISIBLE macro back to NEAACDECAPI and specify visibility attribute for gcc, and nothing for Visual Studio (continuing using the .def file); also removed CDECL, as everything is wrapped in a extern "C" {} scope
Michael Fink
6 years ago
59 | 59 | |
60 | 60 | #ifdef _WIN32 |
61 | 61 | #pragma pack(push, 8) |
62 | #ifndef CDECL | |
63 | #define CDECL __cdecl | |
64 | #endif | |
65 | #define VISIBLE __declspec( dllexport ) | |
62 | #define NEAACDECAPI | |
66 | 63 | #elif defined(__GNUC__) && __GNUC__ >= 4 |
67 | #define CDECL | |
68 | #define VISIBLE __attribute__((visibility("default"))) | |
64 | #define NEAACDECAPI __attribute__((visibility("default"))) | |
69 | 65 | #else |
70 | #define CDECL | |
71 | #define VISIBLE | |
66 | #define NEAACDECAPI | |
72 | 67 | #endif |
73 | 68 | |
74 | 69 | #define FAAD2_VERSION "unknown" |
200 | 195 | unsigned char ps; |
201 | 196 | } NeAACDecFrameInfo; |
202 | 197 | |
203 | VISIBLE char* CDECL NeAACDecGetErrorMessage(unsigned char errcode); | |
204 | ||
205 | VISIBLE unsigned long CDECL NeAACDecGetCapabilities(void); | |
206 | ||
207 | VISIBLE NeAACDecHandle CDECL NeAACDecOpen(void); | |
208 | ||
209 | VISIBLE NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder); | |
210 | ||
211 | VISIBLE unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hDecoder, | |
198 | NEAACDECAPI char* NeAACDecGetErrorMessage(unsigned char errcode); | |
199 | ||
200 | NEAACDECAPI unsigned long NeAACDecGetCapabilities(void); | |
201 | ||
202 | NEAACDECAPI NeAACDecHandle NeAACDecOpen(void); | |
203 | ||
204 | NEAACDECAPI NeAACDecConfigurationPtr NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder); | |
205 | ||
206 | NEAACDECAPI unsigned char NeAACDecSetConfiguration(NeAACDecHandle hDecoder, | |
212 | 207 | NeAACDecConfigurationPtr config); |
213 | 208 | |
214 | 209 | /* Init the library based on info from the AAC file (ADTS/ADIF) */ |
215 | VISIBLE long CDECL NeAACDecInit(NeAACDecHandle hDecoder, | |
210 | NEAACDECAPI long NeAACDecInit(NeAACDecHandle hDecoder, | |
216 | 211 | unsigned char *buffer, |
217 | 212 | unsigned long buffer_size, |
218 | 213 | unsigned long *samplerate, |
219 | 214 | unsigned char *channels); |
220 | 215 | |
221 | 216 | /* Init the library using a DecoderSpecificInfo */ |
222 | VISIBLE char CDECL NeAACDecInit2(NeAACDecHandle hDecoder, | |
217 | NEAACDECAPI char NeAACDecInit2(NeAACDecHandle hDecoder, | |
223 | 218 | unsigned char *pBuffer, |
224 | 219 | unsigned long SizeOfDecoderSpecificInfo, |
225 | 220 | unsigned long *samplerate, |
226 | 221 | unsigned char *channels); |
227 | 222 | |
228 | 223 | /* Init the library for DRM */ |
229 | VISIBLE char CDECL NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate, | |
224 | NEAACDECAPI char NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate, | |
230 | 225 | unsigned char channels); |
231 | 226 | |
232 | VISIBLE void CDECL NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame); | |
233 | ||
234 | VISIBLE void CDECL NeAACDecClose(NeAACDecHandle hDecoder); | |
235 | ||
236 | VISIBLE void* CDECL NeAACDecDecode(NeAACDecHandle hDecoder, | |
227 | NEAACDECAPI void NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame); | |
228 | ||
229 | NEAACDECAPI void NeAACDecClose(NeAACDecHandle hDecoder); | |
230 | ||
231 | NEAACDECAPI void* NeAACDecDecode(NeAACDecHandle hDecoder, | |
237 | 232 | NeAACDecFrameInfo *hInfo, |
238 | 233 | unsigned char *buffer, |
239 | 234 | unsigned long buffer_size); |
240 | 235 | |
241 | VISIBLE void* CDECL NeAACDecDecode2(NeAACDecHandle hDecoder, | |
236 | NEAACDECAPI void* NeAACDecDecode2(NeAACDecHandle hDecoder, | |
242 | 237 | NeAACDecFrameInfo *hInfo, |
243 | 238 | unsigned char *buffer, |
244 | 239 | unsigned long buffer_size, |
245 | 240 | void **sample_buffer, |
246 | 241 | unsigned long sample_buffer_size); |
247 | 242 | |
248 | VISIBLE char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer, | |
243 | NEAACDECAPI char NeAACDecAudioSpecificConfig(unsigned char *pBuffer, | |
249 | 244 | unsigned long buffer_size, |
250 | 245 | mp4AudioSpecificConfig *mp4ASC); |
251 | 246 | |
252 | 247 | /* Get version and copyright strings */ |
253 | VISIBLE int CDECL NeAACDecGetVersion(char **faad_id_string, | |
248 | NEAACDECAPI int NeAACDecGetVersion(char **faad_id_string, | |
254 | 249 | char **faad_copyright_string); |
255 | 250 | |
256 | 251 | #ifdef _WIN32 |
63 | 63 | NeAACDecFrameInfo *hInfo); |
64 | 64 | |
65 | 65 | |
66 | VISIBLE int CDECL NeAACDecGetVersion(char **faad_id_string, | |
66 | int NeAACDecGetVersion(char **faad_id_string, | |
67 | 67 | char **faad_copyright_string) |
68 | 68 | { |
69 | 69 | static char *libfaadName = PACKAGE_VERSION; |
80 | 80 | |
81 | 81 | return 0; |
82 | 82 | } |
83 | VISIBLE char* CDECL NeAACDecGetErrorMessage(unsigned char errcode) | |
83 | ||
84 | char* NeAACDecGetErrorMessage(unsigned char errcode) | |
84 | 85 | { |
85 | 86 | if (errcode >= NUM_ERROR_MESSAGES) |
86 | 87 | return NULL; |
87 | 88 | return err_msg[errcode]; |
88 | 89 | } |
89 | 90 | |
90 | VISIBLE unsigned long CDECL NeAACDecGetCapabilities(void) | |
91 | unsigned long NeAACDecGetCapabilities(void) | |
91 | 92 | { |
92 | 93 | uint32_t cap = 0; |
93 | 94 | |
114 | 115 | } |
115 | 116 | |
116 | 117 | const unsigned char mes[] = { 0x67,0x20,0x61,0x20,0x20,0x20,0x6f,0x20,0x72,0x20,0x65,0x20,0x6e,0x20,0x20,0x20,0x74,0x20,0x68,0x20,0x67,0x20,0x69,0x20,0x72,0x20,0x79,0x20,0x70,0x20,0x6f,0x20,0x63 }; |
117 | VISIBLE NeAACDecHandle CDECL NeAACDecOpen(void) | |
118 | NeAACDecHandle NeAACDecOpen(void) | |
118 | 119 | { |
119 | 120 | uint8_t i; |
120 | 121 | NeAACDecStruct *hDecoder = NULL; |
175 | 176 | return hDecoder; |
176 | 177 | } |
177 | 178 | |
178 | VISIBLE NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder) | |
179 | NeAACDecConfigurationPtr NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder) | |
179 | 180 | { |
180 | 181 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
181 | 182 | if (hDecoder) |
188 | 189 | return NULL; |
189 | 190 | } |
190 | 191 | |
191 | VISIBLE unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hpDecoder, | |
192 | unsigned char NeAACDecSetConfiguration(NeAACDecHandle hpDecoder, | |
192 | 193 | NeAACDecConfigurationPtr config) |
193 | 194 | { |
194 | 195 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
251 | 252 | } |
252 | 253 | |
253 | 254 | |
254 | VISIBLE long CDECL NeAACDecInit(NeAACDecHandle hpDecoder, | |
255 | long NeAACDecInit(NeAACDecHandle hpDecoder, | |
255 | 256 | unsigned char *buffer, |
256 | 257 | unsigned long buffer_size, |
257 | 258 | unsigned long *samplerate, |
385 | 386 | } |
386 | 387 | |
387 | 388 | /* Init the library using a DecoderSpecificInfo */ |
388 | VISIBLE char CDECL NeAACDecInit2(NeAACDecHandle hpDecoder, | |
389 | char NeAACDecInit2(NeAACDecHandle hpDecoder, | |
389 | 390 | unsigned char *pBuffer, |
390 | 391 | unsigned long SizeOfDecoderSpecificInfo, |
391 | 392 | unsigned long *samplerate, |
479 | 480 | } |
480 | 481 | |
481 | 482 | #ifdef DRM |
482 | VISIBLE char CDECL NeAACDecInitDRM(NeAACDecHandle *hpDecoder, | |
483 | char NeAACDecInitDRM(NeAACDecHandle *hpDecoder, | |
483 | 484 | unsigned long samplerate, |
484 | 485 | unsigned char channels) |
485 | 486 | { |
522 | 523 | } |
523 | 524 | #endif |
524 | 525 | |
525 | VISIBLE void CDECL NeAACDecClose(NeAACDecHandle hpDecoder) | |
526 | void NeAACDecClose(NeAACDecHandle hpDecoder) | |
526 | 527 | { |
527 | 528 | uint8_t i; |
528 | 529 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
576 | 577 | if (hDecoder) faad_free(hDecoder); |
577 | 578 | } |
578 | 579 | |
579 | VISIBLE void CDECL NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, long frame) | |
580 | void NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, long frame) | |
580 | 581 | { |
581 | 582 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
582 | 583 | if (hDecoder) |
806 | 807 | } |
807 | 808 | } |
808 | 809 | |
809 | VISIBLE void* CDECL NeAACDecDecode(NeAACDecHandle hpDecoder, | |
810 | void* NeAACDecDecode(NeAACDecHandle hpDecoder, | |
810 | 811 | NeAACDecFrameInfo *hInfo, |
811 | 812 | unsigned char *buffer, |
812 | 813 | unsigned long buffer_size) |
815 | 816 | return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0); |
816 | 817 | } |
817 | 818 | |
818 | VISIBLE void* CDECL NeAACDecDecode2(NeAACDecHandle hpDecoder, | |
819 | void* NeAACDecDecode2(NeAACDecHandle hpDecoder, | |
819 | 820 | NeAACDecFrameInfo *hInfo, |
820 | 821 | unsigned char *buffer, |
821 | 822 | unsigned long buffer_size, |