37 #define FAAC_DELAY_SAMPLES 1024
68 faacEncConfigurationPtr faac_cfg;
69 unsigned long samples_input, max_bytes_output;
81 &samples_input, &max_bytes_output);
89 faac_cfg = faacEncGetCurrentConfiguration(s->
faac_handle);
90 if (faac_cfg->version != FAAC_CFG_VERSION) {
91 av_log(avctx,
AV_LOG_ERROR,
"wrong libfaac version (compiled for: %d, using %d)\n", FAAC_CFG_VERSION, faac_cfg->version);
99 faac_cfg->aacObjectType =
MAIN;
103 faac_cfg->aacObjectType = LOW;
106 faac_cfg->aacObjectType = SSR;
109 faac_cfg->aacObjectType = LTP;
116 faac_cfg->mpegVersion = MPEG4;
117 faac_cfg->useTns = 0;
118 faac_cfg->allowMidside = 1;
120 faac_cfg->bandWidth = avctx->
cutoff;
122 faac_cfg->bitRate = 0;
125 faac_cfg->outputFormat = 1;
126 faac_cfg->inputFormat = FAAC_INPUT_16BIT;
138 unsigned long decoder_specific_info_size;
140 if (!faacEncGetDecoderSpecificInfo(s->
faac_handle, &buffer,
141 &decoder_specific_info_size)) {
149 faac_cfg->outputFormat = 0;
154 if (!faacEncSetConfiguration(s->
faac_handle, faac_cfg)) {
170 const AVFrame *frame,
int *got_packet_ptr)
173 int bytes_written, ret;
174 int num_samples = frame ? frame->
nb_samples : 0;
182 bytes_written = faacEncEncode(s->
faac_handle, samples,
185 if (bytes_written < 0) {
187 return bytes_written;
203 avpkt->
size = bytes_written;