Simplify, do not duplicate buffer size calculation
[mplayer/glamo.git] / libmpcodecs / ae.h
blob133b486a2aeea2519b02326eba4bb8f6cdf15c18
1 #ifndef MPLAYER_AE_H
2 #define MPLAYER_AE_H
4 #include "libmpdemux/muxer.h"
6 #define ACODEC_COPY 0
7 #define ACODEC_PCM 1
8 #define ACODEC_VBRMP3 2
9 #define ACODEC_NULL 3
10 #define ACODEC_LAVC 4
11 #define ACODEC_TOOLAME 5
12 #define ACODEC_FAAC 6
13 #define ACODEC_TWOLAME 7
15 #define AE_NEEDS_COMPRESSED_INPUT 1
17 typedef struct {
18 int channels;
19 int sample_rate;
20 int bitrate;
21 int samples_per_frame;
22 int audio_preload;
23 } audio_encoding_params_t;
25 typedef struct audio_encoder_s {
26 int codec;
27 int flags;
28 muxer_stream_t *stream;
29 audio_encoding_params_t params;
30 int audio_preload; //in ms
31 int input_format;
32 int min_buffer_size, max_buffer_size; //for init_audio_filters
33 unsigned char *decode_buffer;
34 int decode_buffer_size;
35 int decode_buffer_len;
36 void *priv;
37 int (*bind)(struct audio_encoder_s*, muxer_stream_t*);
38 int (*get_frame_size)(struct audio_encoder_s*);
39 int (*set_decoded_len)(struct audio_encoder_s *encoder, int len);
40 int (*encode)(struct audio_encoder_s *encoder, uint8_t *dest, void *src, int nsamples, int max_size);
41 void (*fixup)(struct audio_encoder_s *encoder);
42 int (*close)(struct audio_encoder_s *encoder);
43 } audio_encoder_t;
45 audio_encoder_t *new_audio_encoder(muxer_stream_t *stream, audio_encoding_params_t *params);
47 #endif /* MPLAYER_AE_H */