mstorsjo / fdk-aac

A standalone library of the Fraunhofer FDK AAC code from Android.
https://sourceforge.net/projects/opencore-amr/
Other
1.18k stars 389 forks source link

GetAacDecoder(), Where is it declared and defined? #63

Closed aifer2007 closed 7 years ago

aifer2007 commented 7 years ago

In fdk-aac/libAACdec/src/aacdecoder.cpp,

LINKSPEC_CPP HANDLE_AACDECODER CAacDecoder_Open(TRANSPORT_TYPE bsFormat)    /*!< bitstream format (adif,adts,loas,...). */
{
  HANDLE_AACDECODER self;

  self = GetAacDecoder();
  if (self == NULL) {
    goto bail;
  }
...
}

GetAacDecoder return NULL all the time. I search in this respo, no file declare or define the function GetAacDecoder().

Where is GetAacDecoder() declared and defined?

mstorsjo commented 7 years ago

It is defined via a macro - see libAACdec/src/aac_ram.cpp:

C_ALLOC_MEM(AacDecoder, AAC_DECODER_INSTANCE, 1)

This expands from a macro in libSYS/include/genericStds.h:

  #define C_ALLOC_MEM(name,type,num) \
    type * Get ## name(int n) { FDK_ASSERT((n) == 0); return ((type*)FDKcalloc(num, sizeof(type))); } \
    void Free ## name(type** p) { if (p != NULL) { FDKfree(*p); *p=NULL; } } \
    UINT GetRequiredMem ## name(void) { return ALGN_SIZE_EXTRES((num) * sizeof(type)); }
aifer2007 commented 7 years ago

Thanks.

在 2017年5月22日,下午3:18,Martin Storsjö notifications@github.com 写道:

It is defined via a macro - see libAACdec/src/aac_ram.cpp:

C_ALLOC_MEM(AacDecoder, AAC_DECODER_INSTANCE, 1) This expands from a macro in libSYS/include/genericStds.h:

define C_ALLOC_MEM(name,type,num) \

type * Get ## name(int n) { FDK_ASSERT((n) == 0); return ((type*)FDKcalloc(num, sizeof(type))); } \
void Free ## name(type** p) { if (p != NULL) { FDKfree(*p); *p=NULL; } } \
UINT GetRequiredMem ## name(void) { return ALGN_SIZE_EXTRES((num) * sizeof(type)); }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mstorsjo/fdk-aac/issues/63#issuecomment-303018680, or mute the thread https://github.com/notifications/unsubscribe-auth/AG9XGg-WMmhyrPqC9nEYT2kkZrBfeBdNks5r8TapgaJpZM4Nh09A.