2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer 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 along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <sys/types.h>
27 #include "libmpdemux/aviheader.h"
28 #include "libmpdemux/ms_hdr.h"
29 #include "stream/stream.h"
30 #include "libmpdemux/muxer.h"
36 #include "ae_toolame.h"
43 #ifdef CONFIG_LIBAVCODEC
52 #include "ae_twolame.h"
55 audio_encoder_t
*new_audio_encoder(muxer_stream_t
*stream
, audio_encoding_params_t
*params
)
58 audio_encoder_t
*encoder
;
62 encoder
= calloc(1, sizeof(audio_encoder_t
));
63 memcpy(&encoder
->params
, params
, sizeof(audio_encoding_params_t
));
64 encoder
->stream
= stream
;
69 ris
= mpae_init_pcm(encoder
);
73 ris
= mpae_init_toolame(encoder
);
76 #ifdef CONFIG_LIBAVCODEC
78 ris
= mpae_init_lavc(encoder
);
83 ris
= mpae_init_lame(encoder
);
88 ris
= mpae_init_faac(encoder
);
93 ris
= mpae_init_twolame(encoder
);
106 encoder
->bind(encoder
, stream
);
107 encoder
->decode_buffer
= malloc(encoder
->decode_buffer_size
);
108 if(! encoder
->decode_buffer
)
114 encoder
->codec
= stream
->codec
;