15234
|
1
|
|
2 #ifndef __MPAE_H__
|
|
3 #define __MPAE_H__
|
|
4
|
|
5 #define ACODEC_COPY 0
|
|
6 #define ACODEC_PCM 1
|
|
7 #define ACODEC_VBRMP3 2
|
|
8 #define ACODEC_NULL 3
|
|
9 #define ACODEC_LAVC 4
|
|
10 #define ACODEC_TOOLAME 5
|
15258
|
11 #define ACODEC_FAAC 6
|
15359
|
12 #define ACODEC_TWOLAME 7
|
15234
|
13
|
|
14 #define AE_NEEDS_COMPRESSED_INPUT 1
|
|
15
|
|
16 typedef struct {
|
|
17 int channels;
|
|
18 int sample_rate;
|
|
19 int bitrate;
|
|
20 int samples_per_frame;
|
|
21 int audio_preload;
|
|
22 } audio_encoding_params_t;
|
|
23
|
15258
|
24 typedef struct audio_encoder_s {
|
15234
|
25 int codec;
|
|
26 int flags;
|
|
27 muxer_stream_t *stream;
|
|
28 audio_encoding_params_t params;
|
|
29 int audio_preload; //in ms
|
|
30 int input_format;
|
|
31 int min_buffer_size, max_buffer_size; //for init_audio_filters
|
|
32 int *decode_buffer;
|
|
33 int decode_buffer_size;
|
|
34 int decode_buffer_len;
|
|
35 void *priv;
|
15258
|
36 int (*bind)(struct audio_encoder_s*, muxer_stream_t*);
|
|
37 int (*get_frame_size)(struct audio_encoder_s*);
|
|
38 int (*set_decoded_len)(struct audio_encoder_s *encoder, int len);
|
|
39 int (*encode)(struct audio_encoder_s *encoder, uint8_t *dest, void *src, int nsamples, int max_size);
|
|
40 void (*fixup)(struct audio_encoder_s *encoder);
|
|
41 int (*close)(struct audio_encoder_s *encoder);
|
15234
|
42 } audio_encoder_t;
|
|
43
|
|
44 audio_encoder_t *new_audio_encoder(muxer_stream_t *stream, audio_encoding_params_t *params);
|
|
45
|
|
46 #endif
|