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
|
|
11
|
|
12 #define AE_NEEDS_COMPRESSED_INPUT 1
|
|
13
|
|
14 typedef struct {
|
|
15 int channels;
|
|
16 int sample_rate;
|
|
17 int bitrate;
|
|
18 int samples_per_frame;
|
|
19 int audio_preload;
|
|
20 } audio_encoding_params_t;
|
|
21
|
|
22 typedef struct {
|
|
23 int codec;
|
|
24 int flags;
|
|
25 muxer_stream_t *stream;
|
|
26 audio_encoding_params_t params;
|
|
27 int audio_preload; //in ms
|
|
28 int input_format;
|
|
29 int min_buffer_size, max_buffer_size; //for init_audio_filters
|
|
30 int *decode_buffer;
|
|
31 int decode_buffer_size;
|
|
32 int decode_buffer_len;
|
|
33 void *priv;
|
|
34 int (*bind)(void*, muxer_stream_t*);
|
|
35 int (*get_frame_size)(void*);
|
|
36 int (*set_decoded_len)(void *encoder, int len);
|
|
37 int (*encode)(void *encoder, uint8_t *dest, void *src, int nsamples, int max_size);
|
|
38 int (*fixup)();
|
|
39 int (*close)();
|
|
40 } audio_encoder_t;
|
|
41
|
|
42 audio_encoder_t *new_audio_encoder(muxer_stream_t *stream, audio_encoding_params_t *params);
|
|
43
|
|
44 #endif
|