37 #define FAAC_DELAY_SAMPLES 1024
48 #if FF_API_OLD_ENCODE_AUDIO
70 faacEncConfigurationPtr faac_cfg;
71 unsigned long samples_input, max_bytes_output;
83 &samples_input, &max_bytes_output);
91 faac_cfg = faacEncGetCurrentConfiguration(s->
faac_handle);
92 if (faac_cfg->version != FAAC_CFG_VERSION) {
93 av_log(avctx,
AV_LOG_ERROR,
"wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
101 faac_cfg->aacObjectType =
MAIN;
105 faac_cfg->aacObjectType = LOW;
108 faac_cfg->aacObjectType = SSR;
111 faac_cfg->aacObjectType = LTP;
118 faac_cfg->mpegVersion = MPEG4;
119 faac_cfg->useTns = 0;
120 faac_cfg->allowMidside = 1;
122 faac_cfg->bandWidth = avctx->
cutoff;
124 faac_cfg->bitRate = 0;
127 faac_cfg->outputFormat = 1;
128 faac_cfg->inputFormat = FAAC_INPUT_16BIT;
135 #if FF_API_OLD_ENCODE_AUDIO
148 unsigned long decoder_specific_info_size;
150 if (!faacEncGetDecoderSpecificInfo(s->
faac_handle, &buffer,
151 &decoder_specific_info_size)) {
159 faac_cfg->outputFormat = 0;
164 if (!faacEncSetConfiguration(s->
faac_handle, faac_cfg)) {
183 int bytes_written, ret;
184 int num_samples = frame ? frame->
nb_samples : 0;
192 bytes_written = faacEncEncode(s->
faac_handle, samples,
195 if (bytes_written < 0) {
197 return bytes_written;
213 avpkt->
size = bytes_written;