37 #define FAAC_DELAY_SAMPLES 1024
49 #if FF_API_OLD_ENCODE_AUDIO
71 faacEncConfigurationPtr faac_cfg;
72 unsigned long samples_input, max_bytes_output;
84 &samples_input, &max_bytes_output);
92 faac_cfg = faacEncGetCurrentConfiguration(s->
faac_handle);
93 if (faac_cfg->version != FAAC_CFG_VERSION) {
94 av_log(avctx,
AV_LOG_ERROR,
"wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
102 faac_cfg->aacObjectType =
MAIN;
106 faac_cfg->aacObjectType = LOW;
109 faac_cfg->aacObjectType = SSR;
112 faac_cfg->aacObjectType = LTP;
119 faac_cfg->mpegVersion = MPEG4;
120 faac_cfg->useTns = 0;
121 faac_cfg->allowMidside = 1;
123 faac_cfg->bandWidth = avctx->
cutoff;
125 faac_cfg->bitRate = 0;
128 faac_cfg->outputFormat = 1;
129 faac_cfg->inputFormat = FAAC_INPUT_16BIT;
136 #if FF_API_OLD_ENCODE_AUDIO
149 unsigned long decoder_specific_info_size;
151 if (!faacEncGetDecoderSpecificInfo(s->
faac_handle, &buffer,
152 &decoder_specific_info_size)) {
160 faac_cfg->outputFormat = 0;
165 if (!faacEncSetConfiguration(s->
faac_handle, faac_cfg)) {
181 const AVFrame *frame,
int *got_packet_ptr)
184 int bytes_written, ret;
185 int num_samples = frame ? frame->
nb_samples : 0;
193 bytes_written = faacEncEncode(s->
faac_handle, samples,
196 if (bytes_written < 0) {
198 return bytes_written;
214 avpkt->
size = bytes_written;