2
FAAC - codec plugin for Cooledit
3
Copyright (C) 2004 Antonio Foranna
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
The author can be contacted at:
19
ntnfrn_email-temp@yahoo.it
40
#include "CRegistry.h"
56
// make this higher to support files with more channels
57
#define MAX_CHANNELS 6
58
#if FAAD_MIN_STREAMSIZE<2048
59
#undef FAAD_MIN_STREAMSIZE
60
// 960 for LD or else 1024 (expanded to 2048 for HE-AAC)
61
#define FAAD_MIN_STREAMSIZE 2048
64
#define FAAD_STREAMSIZE (FAAD_MIN_STREAMSIZE*MAX_CHANNELS)
68
// -----------------------------------------------------------------------------------------------
72
/* FAAD file buffering routines */
74
long bytes_into_buffer;
77
unsigned char *buffer;
81
// -----------------------------------------------------------------------------------------------
92
// -----------------------------------------------------------------------------------------------
99
faacDecConfiguration DecCfg;
101
// -----------------------------------------------------------------------------------------------
103
typedef struct input_tag // any special vars associated with input file
106
MP4FileHandle mp4File;
107
MP4SampleId sampleId,
114
DWORD src_size; // size of compressed file
116
DWORD bytes_read; // from file
117
long bytes_consumed; // from buffer by faadDecDecode
118
long bytes_into_buffer;
119
unsigned char *buffer;
122
DWORD bytesconsumed; // to decode current frame by faadDecDecode
126
faacDecHandle hDecoder;
127
faadAACInfo file_info;
128
faacDecFrameInfo frameInfo;
129
DWORD len_ms; // length of file in milliseconds
133
DWORD dst_size; // size of decoded file. Cooledit needs it to update its progress bar
134
//char *src_name; // name of compressed file
137
// -----------------------------------------------------------------------------------------------
142
virtual int GetAACTrack(MP4FileHandle infile);
143
long id3v2_TagSize(aac_buffer *b);
144
int fill_buffer(aac_buffer *b);
145
void advance_buffer(aac_buffer *b, int bytes);
146
int adts_parse(aac_buffer *b, int *bitrate, float *length);
147
void GetAACInfos(aac_buffer *b, DWORD *header_type, float *song_length, int *pbitrate, long filesize);
148
int IsMP4(LPSTR lpstrFilename);
150
virtual void DisplayError(char *ProcName, char *str);
151
virtual HANDLE ERROR_getInfos(char *str) { DisplayError("getInfos", str); return NULL; }
152
virtual int ERROR_processData(char *str) { DisplayError("processData", str); return 0; }
153
virtual void showInfo(MYINPUT *mi) {}
154
virtual void showProgress(MYINPUT *mi) {}
155
virtual void setFaadCfg(faacDecHandle hDecoder);
158
Cfaad(HANDLE hInput=NULL);
161
static void ReadCfgDec(MY_DEC_CFG *cfg);
162
static void WriteCfgDec(MY_DEC_CFG *cfg);
163
virtual HANDLE getInfos(LPSTR lpstrFilename);
164
virtual int processData(HANDLE hInput, unsigned char far *bufout, long lBytes);
167
// bool BlockSeeking;