Mercurial > libavcodec.hg
comparison faad.c @ 4336:b7caa9237018 libavcodec
Rename variables: faad --> libfaad, faac --> libfaac, faadbin --> libfaadbin
| author | diego |
|---|---|
| date | Sat, 06 Jan 2007 23:54:01 +0000 |
| parents | 1e8621844040 |
| children | 7115a2f0854d |
comparison
equal
deleted
inserted
replaced
| 4335:d11fd43834fe | 4336:b7caa9237018 |
|---|---|
| 33 #ifndef FAADAPI | 33 #ifndef FAADAPI |
| 34 #define FAADAPI | 34 #define FAADAPI |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 /* | 37 /* |
| 38 * when CONFIG_FAADBIN is defined the libfaad will be opened at runtime | 38 * when CONFIG_LIBFAADBIN is defined the libfaad will be opened at runtime |
| 39 */ | 39 */ |
| 40 //#undef CONFIG_FAADBIN | 40 //#undef CONFIG_LIBFAADBIN |
| 41 //#define CONFIG_FAADBIN | 41 //#define CONFIG_LIBFAADBIN |
| 42 | 42 |
| 43 #ifdef CONFIG_FAADBIN | 43 #ifdef CONFIG_LIBFAADBIN |
| 44 #include <dlfcn.h> | 44 #include <dlfcn.h> |
| 45 static const char* libfaadname = "libfaad.so.0"; | 45 static const char* libfaadname = "libfaad.so.0"; |
| 46 #else | 46 #else |
| 47 #define dlopen(a) | 47 #define dlopen(a) |
| 48 #define dlclose(a) | 48 #define dlclose(a) |
| 206 static int faac_decode_init(AVCodecContext *avctx) | 206 static int faac_decode_init(AVCodecContext *avctx) |
| 207 { | 207 { |
| 208 FAACContext *s = (FAACContext *) avctx->priv_data; | 208 FAACContext *s = (FAACContext *) avctx->priv_data; |
| 209 faacDecConfigurationPtr faac_cfg; | 209 faacDecConfigurationPtr faac_cfg; |
| 210 | 210 |
| 211 #ifdef CONFIG_FAADBIN | 211 #ifdef CONFIG_LIBFAADBIN |
| 212 const char* err = 0; | 212 const char* err = 0; |
| 213 | 213 |
| 214 s->handle = dlopen(libfaadname, RTLD_LAZY); | 214 s->handle = dlopen(libfaadname, RTLD_LAZY); |
| 215 if (!s->handle) | 215 if (!s->handle) |
| 216 { | 216 { |
| 220 } | 220 } |
| 221 #define dfaac(a, b) \ | 221 #define dfaac(a, b) \ |
| 222 do { static const char* n = "faacDec" #a; \ | 222 do { static const char* n = "faacDec" #a; \ |
| 223 if ((s->faacDec ## a = b dlsym( s->handle, n )) == NULL) { err = n; break; } } while(0) | 223 if ((s->faacDec ## a = b dlsym( s->handle, n )) == NULL) { err = n; break; } } while(0) |
| 224 for(;;) { | 224 for(;;) { |
| 225 #else /* !CONFIG_FAADBIN */ | 225 #else /* !CONFIG_LIBFAADBIN */ |
| 226 #define dfaac(a, b) s->faacDec ## a = faacDec ## a | 226 #define dfaac(a, b) s->faacDec ## a = faacDec ## a |
| 227 #endif /* CONFIG_FAADBIN */ | 227 #endif /* CONFIG_LIBFAADBIN */ |
| 228 | 228 |
| 229 // resolve all needed function calls | 229 // resolve all needed function calls |
| 230 dfaac(Open, (faacDecHandle FAADAPI (*)(void))); | 230 dfaac(Open, (faacDecHandle FAADAPI (*)(void))); |
| 231 dfaac(GetCurrentConfiguration, (faacDecConfigurationPtr | 231 dfaac(GetCurrentConfiguration, (faacDecConfigurationPtr |
| 232 FAADAPI (*)(faacDecHandle))); | 232 FAADAPI (*)(faacDecHandle))); |
| 254 unsigned char*, unsigned long))); | 254 unsigned char*, unsigned long))); |
| 255 dfaac(GetErrorMessage, (char* FAADAPI (*)(unsigned char))); | 255 dfaac(GetErrorMessage, (char* FAADAPI (*)(unsigned char))); |
| 256 #endif | 256 #endif |
| 257 #undef dfacc | 257 #undef dfacc |
| 258 | 258 |
| 259 #ifdef CONFIG_FAADBIN | 259 #ifdef CONFIG_LIBFAADBIN |
| 260 break; | 260 break; |
| 261 } | 261 } |
| 262 if (err) { | 262 if (err) { |
| 263 dlclose(s->handle); | 263 dlclose(s->handle); |
| 264 av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot resolve %s in %s!\n", | 264 av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot resolve %s in %s!\n", |
