renamed ATTR to VISIBLE; added dllexport attribute
Krzysztof Nikiel
6 years ago
59 | 59 | |
60 | 60 | #ifdef _WIN32 |
61 | 61 | #pragma pack(push, 8) |
62 | #define CDECL __cdecl | |
63 | #define ATTR | |
62 | #ifndef CDECL | |
63 | #define CDECL __cdecl | |
64 | #endif | |
65 | #define VISIBLE __declspec( dllexport ) | |
64 | 66 | #elif defined(__GNUC__) && __GNUC__ >= 4 |
65 | 67 | #define CDECL |
66 | #define ATTR __attribute__((visibility("default"))) | |
68 | #define VISIBLE __attribute__((visibility("default"))) | |
67 | 69 | #else |
68 | 70 | #define CDECL |
69 | #define ATTR | |
71 | #define VISIBLE | |
70 | 72 | #endif |
71 | 73 | |
72 | 74 | #define FAAD2_VERSION "unknown" |
198 | 200 | unsigned char ps; |
199 | 201 | } NeAACDecFrameInfo; |
200 | 202 | |
201 | ATTR char* CDECL NeAACDecGetErrorMessage(unsigned char errcode); | |
202 | ||
203 | ATTR unsigned long CDECL NeAACDecGetCapabilities(void); | |
204 | ||
205 | ATTR NeAACDecHandle CDECL NeAACDecOpen(void); | |
206 | ||
207 | ATTR NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder); | |
208 | ||
209 | ATTR unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hDecoder, | |
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, | |
210 | 212 | NeAACDecConfigurationPtr config); |
211 | 213 | |
212 | 214 | /* Init the library based on info from the AAC file (ADTS/ADIF) */ |
213 | ATTR long CDECL NeAACDecInit(NeAACDecHandle hDecoder, | |
215 | VISIBLE long CDECL NeAACDecInit(NeAACDecHandle hDecoder, | |
214 | 216 | unsigned char *buffer, |
215 | 217 | unsigned long buffer_size, |
216 | 218 | unsigned long *samplerate, |
217 | 219 | unsigned char *channels); |
218 | 220 | |
219 | 221 | /* Init the library using a DecoderSpecificInfo */ |
220 | ATTR char CDECL NeAACDecInit2(NeAACDecHandle hDecoder, | |
222 | VISIBLE char CDECL NeAACDecInit2(NeAACDecHandle hDecoder, | |
221 | 223 | unsigned char *pBuffer, |
222 | 224 | unsigned long SizeOfDecoderSpecificInfo, |
223 | 225 | unsigned long *samplerate, |
224 | 226 | unsigned char *channels); |
225 | 227 | |
226 | 228 | /* Init the library for DRM */ |
227 | ATTR char CDECL NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate, | |
229 | VISIBLE char CDECL NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate, | |
228 | 230 | unsigned char channels); |
229 | 231 | |
230 | ATTR void CDECL NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame); | |
231 | ||
232 | ATTR void CDECL NeAACDecClose(NeAACDecHandle hDecoder); | |
233 | ||
234 | ATTR void* CDECL NeAACDecDecode(NeAACDecHandle hDecoder, | |
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, | |
235 | 237 | NeAACDecFrameInfo *hInfo, |
236 | 238 | unsigned char *buffer, |
237 | 239 | unsigned long buffer_size); |
238 | 240 | |
239 | ATTR void* CDECL NeAACDecDecode2(NeAACDecHandle hDecoder, | |
241 | VISIBLE void* CDECL NeAACDecDecode2(NeAACDecHandle hDecoder, | |
240 | 242 | NeAACDecFrameInfo *hInfo, |
241 | 243 | unsigned char *buffer, |
242 | 244 | unsigned long buffer_size, |
243 | 245 | void **sample_buffer, |
244 | 246 | unsigned long sample_buffer_size); |
245 | 247 | |
246 | ATTR char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer, | |
248 | VISIBLE char CDECL NeAACDecAudioSpecificConfig(unsigned char *pBuffer, | |
247 | 249 | unsigned long buffer_size, |
248 | 250 | mp4AudioSpecificConfig *mp4ASC); |
249 | 251 | |
250 | 252 | /* Get version and copyright strings */ |
251 | ATTR int CDECL NeAACDecGetVersion(char **faad_id_string, | |
253 | VISIBLE int CDECL NeAACDecGetVersion(char **faad_id_string, | |
252 | 254 | char **faad_copyright_string); |
253 | 255 | |
254 | 256 | #ifdef _WIN32 |
63 | 63 | NeAACDecFrameInfo *hInfo); |
64 | 64 | |
65 | 65 | |
66 | ATTR int CDECL NeAACDecGetVersion(char **faad_id_string, | |
66 | VISIBLE int CDECL 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 | ATTR char* CDECL NeAACDecGetErrorMessage(unsigned char errcode) | |
83 | VISIBLE char* CDECL NeAACDecGetErrorMessage(unsigned char errcode) | |
84 | 84 | { |
85 | 85 | if (errcode >= NUM_ERROR_MESSAGES) |
86 | 86 | return NULL; |
87 | 87 | return err_msg[errcode]; |
88 | 88 | } |
89 | 89 | |
90 | ATTR unsigned long CDECL NeAACDecGetCapabilities(void) | |
90 | VISIBLE unsigned long CDECL NeAACDecGetCapabilities(void) | |
91 | 91 | { |
92 | 92 | uint32_t cap = 0; |
93 | 93 | |
114 | 114 | } |
115 | 115 | |
116 | 116 | 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 | ATTR NeAACDecHandle CDECL NeAACDecOpen(void) | |
117 | VISIBLE NeAACDecHandle CDECL NeAACDecOpen(void) | |
118 | 118 | { |
119 | 119 | uint8_t i; |
120 | 120 | NeAACDecStruct *hDecoder = NULL; |
175 | 175 | return hDecoder; |
176 | 176 | } |
177 | 177 | |
178 | ATTR NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder) | |
178 | VISIBLE NeAACDecConfigurationPtr CDECL NeAACDecGetCurrentConfiguration(NeAACDecHandle hpDecoder) | |
179 | 179 | { |
180 | 180 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
181 | 181 | if (hDecoder) |
188 | 188 | return NULL; |
189 | 189 | } |
190 | 190 | |
191 | ATTR unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hpDecoder, | |
191 | VISIBLE unsigned char CDECL NeAACDecSetConfiguration(NeAACDecHandle hpDecoder, | |
192 | 192 | NeAACDecConfigurationPtr config) |
193 | 193 | { |
194 | 194 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
251 | 251 | } |
252 | 252 | |
253 | 253 | |
254 | ATTR long CDECL NeAACDecInit(NeAACDecHandle hpDecoder, | |
254 | VISIBLE long CDECL NeAACDecInit(NeAACDecHandle hpDecoder, | |
255 | 255 | unsigned char *buffer, |
256 | 256 | unsigned long buffer_size, |
257 | 257 | unsigned long *samplerate, |
385 | 385 | } |
386 | 386 | |
387 | 387 | /* Init the library using a DecoderSpecificInfo */ |
388 | ATTR char CDECL NeAACDecInit2(NeAACDecHandle hpDecoder, | |
388 | VISIBLE char CDECL NeAACDecInit2(NeAACDecHandle hpDecoder, | |
389 | 389 | unsigned char *pBuffer, |
390 | 390 | unsigned long SizeOfDecoderSpecificInfo, |
391 | 391 | unsigned long *samplerate, |
479 | 479 | } |
480 | 480 | |
481 | 481 | #ifdef DRM |
482 | ATTR char CDECL NeAACDecInitDRM(NeAACDecHandle *hpDecoder, | |
482 | VISIBLE char CDECL NeAACDecInitDRM(NeAACDecHandle *hpDecoder, | |
483 | 483 | unsigned long samplerate, |
484 | 484 | unsigned char channels) |
485 | 485 | { |
522 | 522 | } |
523 | 523 | #endif |
524 | 524 | |
525 | ATTR void CDECL NeAACDecClose(NeAACDecHandle hpDecoder) | |
525 | VISIBLE void CDECL NeAACDecClose(NeAACDecHandle hpDecoder) | |
526 | 526 | { |
527 | 527 | uint8_t i; |
528 | 528 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
576 | 576 | if (hDecoder) faad_free(hDecoder); |
577 | 577 | } |
578 | 578 | |
579 | ATTR void CDECL NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, long frame) | |
579 | VISIBLE void CDECL NeAACDecPostSeekReset(NeAACDecHandle hpDecoder, long frame) | |
580 | 580 | { |
581 | 581 | NeAACDecStruct* hDecoder = (NeAACDecStruct*)hpDecoder; |
582 | 582 | if (hDecoder) |
806 | 806 | } |
807 | 807 | } |
808 | 808 | |
809 | ATTR void* CDECL NeAACDecDecode(NeAACDecHandle hpDecoder, | |
809 | VISIBLE void* CDECL NeAACDecDecode(NeAACDecHandle hpDecoder, | |
810 | 810 | NeAACDecFrameInfo *hInfo, |
811 | 811 | unsigned char *buffer, |
812 | 812 | unsigned long buffer_size) |
815 | 815 | return aac_frame_decode(hDecoder, hInfo, buffer, buffer_size, NULL, 0); |
816 | 816 | } |
817 | 817 | |
818 | ATTR void* CDECL NeAACDecDecode2(NeAACDecHandle hpDecoder, | |
818 | VISIBLE void* CDECL NeAACDecDecode2(NeAACDecHandle hpDecoder, | |
819 | 819 | NeAACDecFrameInfo *hInfo, |
820 | 820 | unsigned char *buffer, |
821 | 821 | unsigned long buffer_size, |