1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
/***************************************************************************
*
* (C) copyright Fraunhofer - IIS (2001)
* All Rights Reserved
*
* $Header: /cvs/root/winamp/aacdec/incs/mp4AudioDecIfc.h,v 1.3 2012/05/08 20:16:49 audiodsp Exp $
* project : MPEG-4 Audio Decoder
* contents/description: interface to mpeg-4 audio decoder
*
* This software and/or program is protected by copyright law and
* international treaties. Any reproduction or distribution of this
* software and/or program, or any portion of it, may result in severe
* civil and criminal penalties, and will be prosecuted to the maximum
* extent possible under law.
*
\***************************************************************************/
#ifndef __MP4AUDIODECIFC_H__
#define __MP4AUDIODECIFC_H__
#include "mp4dec_helpers/err_code.h"
#include "mp4dec_asc/audiospecificconfig_c.h"
#include "mp4dec_helpers/usrparam.h"
#include "mp4dec_helpers/aubuffer_c.h"
#include "mp4dec_helpers/cubuffer_c.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#if defined(WIN32) || defined(WIN64)
#pragma pack(push, 8)
#endif
/* data types */
typedef struct mp4AudioDecoder_VersionInfo {
char dateTime[80];
char versionNo[40];
char options[1024];
char options_ext[4096];
} mp4AudioDecoder_VersionInfo;
/* Opaque declaration of decoder handle */
struct mp4AudioDecoder;
typedef struct mp4AudioDecoder* mp4AudioDecoderHandle;
/* mandatory decoder functions */
mp4AudioDecoderHandle MP4AUDIODECAPI mp4AudioDecoder_Create(
const struct CSAudioSpecificConfig * const asc[],
const unsigned int noOfLayers
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_SetParam(
const mp4AudioDecoderHandle self,
const unsigned int param,
const float value
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_DecodeFrame(
mp4AudioDecoderHandle self,
struct CAccessUnit* auBuffer[],
struct CCompositionUnit* cuBuffer
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_Destroy(mp4AudioDecoderHandle* self);
/* utility functions */
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_Reset(
mp4AudioDecoderHandle self,
const unsigned int param,
int value
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_Flush(
mp4AudioDecoderHandle self,
struct CCompositionUnit* cuBuffer
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetBufferFullness(
const mp4AudioDecoderHandle self,
const unsigned int layer,
unsigned int* bufferfullness
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetSamplesPerFrame(
const mp4AudioDecoderHandle self,
unsigned int* spf
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_SetOutputLayer(
const mp4AudioDecoderHandle self,
const unsigned int outputLayer
);
/* MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_SetSpeedPitch( */
/* const mp4AudioDecoderHandle self, */
/* const float speedChangeFactor, */
/* const float pitchChangeFactor */
/* ); */
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetLastError(const mp4AudioDecoderHandle self);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetLibraryVersion(mp4AudioDecoder_VersionInfo* versionInfo);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascParse(
const unsigned char* decSpecificInfoBuf,
const unsigned int decSpecificInfoBuf_len,
struct CSAudioSpecificConfig* asc
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascParseStream(
const unsigned char* decSpecificInfoBuf,
struct CSAudioSpecificConfig* asc,
int* bitsRead
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascParseExt(
const unsigned char* const decSpecificInfoBuf[],
const unsigned int decSpecificInfoBuf_len[],
const unsigned int avgBitrate[],
const unsigned int streams,
unsigned int* layers, /* out */
struct CSAudioSpecificConfig* asc[], /* out */
unsigned int streamsPerLayer[] /* out */
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_ascPrint(
unsigned int layers, /* in */
struct CSAudioSpecificConfig* asc[], /* in */
unsigned int stringLen, /* in */
unsigned char string[] /* ptr in, content out */
);
MP4_RESULT MP4AUDIODECAPI mp4AudioDecoder_GetPcmWidth(
const unsigned char* const decSpecificInfoBuf[],
const unsigned int decSpecificInfoBuf_len[],
const unsigned int streams,
unsigned int* pcmwidth /* out */
);
#if defined(WIN32) || defined(WIN64)
#pragma pack(pop)
#endif
#ifdef __cplusplus
}
#endif
#endif /* __MP4AUDIODECIFC_H__ */
|