| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
#include <smooth.h> |
| 14 |
|
| 15 |
#ifdef callbacks |
| 16 |
# undef callbacks |
| 17 |
#endif |
| 18 |
|
| 19 |
#include <fdk-aac/aacdecoder_lib.h> |
| 20 |
#include <mp4v2/mp4v2.h> |
| 21 |
|
| 22 |
using namespace smooth; |
| 23 |
using namespace smooth::System; |
| 24 |
|
| 25 |
extern DynamicLoader *fdkaacdll; |
| 26 |
extern DynamicLoader *mp4v2dll; |
| 27 |
|
| 28 |
Bool LoadFDKAACDLL(); |
| 29 |
Void FreeFDKAACDLL(); |
| 30 |
|
| 31 |
Bool LoadMP4v2DLL(); |
| 32 |
Void FreeMP4v2DLL(); |
| 33 |
|
| 34 |
typedef HANDLE_AACDECODER (LINKSPEC_H *AACDECODER_OPEN) (TRANSPORT_TYPE, UINT); |
| 35 |
typedef AAC_DECODER_ERROR (LINKSPEC_H *AACDECODER_CONFIGRAW) (HANDLE_AACDECODER, UCHAR *[], const UINT []); |
| 36 |
typedef AAC_DECODER_ERROR (LINKSPEC_H *AACDECODER_FILL) (HANDLE_AACDECODER, UCHAR *[], const UINT [], UINT *); |
| 37 |
typedef CStreamInfo * (LINKSPEC_H *AACDECODER_GETSTREAMINFO) (HANDLE_AACDECODER); |
| 38 |
typedef AAC_DECODER_ERROR (LINKSPEC_H *AACDECODER_DECODEFRAME) (HANDLE_AACDECODER, INT_PCM *, const INT, const UINT); |
| 39 |
typedef void (LINKSPEC_H *AACDECODER_CLOSE) (HANDLE_AACDECODER); |
| 40 |
typedef INT (LINKSPEC_H *AACDECODER_GETLIBINFO) (LIB_INFO *); |
| 41 |
|
| 42 |
extern AACDECODER_OPEN ex_aacDecoder_Open; |
| 43 |
extern AACDECODER_CONFIGRAW ex_aacDecoder_ConfigRaw; |
| 44 |
extern AACDECODER_FILL ex_aacDecoder_Fill; |
| 45 |
extern AACDECODER_GETSTREAMINFO ex_aacDecoder_GetStreamInfo; |
| 46 |
extern AACDECODER_DECODEFRAME ex_aacDecoder_DecodeFrame; |
| 47 |
extern AACDECODER_CLOSE ex_aacDecoder_Close; |
| 48 |
extern AACDECODER_GETLIBINFO ex_aacDecoder_GetLibInfo; |
| 49 |
|
| 50 |
typedef MP4FileHandle (*MP4READ) (const char *); |
| 51 |
typedef MP4FileHandle (*MP4READCALLBACKS) (const MP4IOCallbacks *, void *); |
| 52 |
typedef void (*MP4CLOSE) (MP4FileHandle, uint32_t); |
| 53 |
typedef void (*MP4FREE) (void *); |
| 54 |
typedef MP4TrackId (*MP4FINDTRACKID) (MP4FileHandle, uint16_t, const char *, uint8_t); |
| 55 |
typedef uint8_t (*MP4GETTRACKAUDIOMPEG4TYPE) (MP4FileHandle, MP4TrackId); |
| 56 |
typedef int (*MP4GETTRACKAUDIOCHANNELS) (MP4FileHandle, MP4TrackId); |
| 57 |
typedef bool (*MP4GETTRACKESCONFIGURATION) (MP4FileHandle, MP4TrackId, uint8_t **, uint32_t *); |
| 58 |
typedef uint32_t (*MP4GETTRACKTIMESCALE) (MP4FileHandle, MP4TrackId); |
| 59 |
typedef MP4SampleId (*MP4GETTRACKNUMBEROFSAMPLES) (MP4FileHandle, MP4TrackId); |
| 60 |
typedef MP4Timestamp (*MP4GETSAMPLETIME) (MP4FileHandle, MP4TrackId, MP4SampleId); |
| 61 |
typedef MP4SampleId (*MP4GETSAMPLEIDFROMTIME) (MP4FileHandle, MP4TrackId, MP4Timestamp, bool); |
| 62 |
typedef uint32_t (*MP4GETSAMPLESIZE) (MP4FileHandle, MP4TrackId, MP4SampleId); |
| 63 |
typedef bool (*MP4READSAMPLE) (MP4FileHandle, MP4TrackId, MP4SampleId, uint8_t **, uint32_t *, MP4Timestamp *, MP4Duration *, MP4Duration *, bool *); |
| 64 |
typedef MP4ItmfItemList * (*MP4ITMFGETITEMSBYMEANING) (MP4FileHandle, const char *, const char *); |
| 65 |
typedef void (*MP4ITMFITEMLISTFREE) (MP4ItmfItemList *); |
| 66 |
|
| 67 |
extern MP4READ ex_MP4Read; |
| 68 |
extern MP4READCALLBACKS ex_MP4ReadCallbacks; |
| 69 |
extern MP4CLOSE ex_MP4Close; |
| 70 |
extern MP4FREE ex_MP4Free; |
| 71 |
extern MP4FINDTRACKID ex_MP4FindTrackId; |
| 72 |
extern MP4GETTRACKAUDIOMPEG4TYPE ex_MP4GetTrackAudioMpeg4Type; |
| 73 |
extern MP4GETTRACKAUDIOCHANNELS ex_MP4GetTrackAudioChannels; |
| 74 |
extern MP4GETTRACKESCONFIGURATION ex_MP4GetTrackESConfiguration; |
| 75 |
extern MP4GETTRACKTIMESCALE ex_MP4GetTrackTimeScale; |
| 76 |
extern MP4GETTRACKNUMBEROFSAMPLES ex_MP4GetTrackNumberOfSamples; |
| 77 |
extern MP4GETSAMPLETIME ex_MP4GetSampleTime; |
| 78 |
extern MP4GETSAMPLEIDFROMTIME ex_MP4GetSampleIdFromTime; |
| 79 |
extern MP4GETSAMPLESIZE ex_MP4GetSampleSize; |
| 80 |
extern MP4READSAMPLE ex_MP4ReadSample; |
| 81 |
extern MP4ITMFGETITEMSBYMEANING ex_MP4ItmfGetItemsByMeaning; |
| 82 |
extern MP4ITMFITEMLISTFREE ex_MP4ItmfItemListFree; |