annotate libmpcodecs/ae.h @ 21413:06d63614eeaa

permit to specify the sizes of the decoders' buffers
author nicodvb
date Fri, 01 Dec 2006 23:51:51 +0000
parents c23ca41ad996
children 3f0d00abc073
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15234
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
1
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
2 #ifndef __MPAE_H__
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
3 #define __MPAE_H__
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
4
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
5 #define ACODEC_COPY 0
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
6 #define ACODEC_PCM 1
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
7 #define ACODEC_VBRMP3 2
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
8 #define ACODEC_NULL 3
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
9 #define ACODEC_LAVC 4
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
10 #define ACODEC_TOOLAME 5
15258
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
11 #define ACODEC_FAAC 6
15359
af245d15f502 added twolame mp2 audio encoder
nicodvb
parents: 15258
diff changeset
12 #define ACODEC_TWOLAME 7
15234
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
13
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
14 #define AE_NEEDS_COMPRESSED_INPUT 1
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
15
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
16 typedef struct {
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
17 int channels;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
18 int sample_rate;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
19 int bitrate;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
20 int samples_per_frame;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
21 int audio_preload;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
22 } audio_encoding_params_t;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
23
15258
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
24 typedef struct audio_encoder_s {
15234
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
25 int codec;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
26 int flags;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
27 muxer_stream_t *stream;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
28 audio_encoding_params_t params;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
29 int audio_preload; //in ms
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
30 int input_format;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
31 int min_buffer_size, max_buffer_size; //for init_audio_filters
17122
c23ca41ad996 more warning fixes
ods15
parents: 15359
diff changeset
32 unsigned char *decode_buffer;
15234
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
33 int decode_buffer_size;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
34 int decode_buffer_len;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
35 void *priv;
15258
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
36 int (*bind)(struct audio_encoder_s*, muxer_stream_t*);
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
37 int (*get_frame_size)(struct audio_encoder_s*);
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
38 int (*set_decoded_len)(struct audio_encoder_s *encoder, int len);
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
39 int (*encode)(struct audio_encoder_s *encoder, uint8_t *dest, void *src, int nsamples, int max_size);
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
40 void (*fixup)(struct audio_encoder_s *encoder);
c2979462805a fixed wrong function pointers definitions
nicodvb
parents: 15234
diff changeset
41 int (*close)(struct audio_encoder_s *encoder);
15234
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
42 } audio_encoder_t;
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
43
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
44 audio_encoder_t *new_audio_encoder(muxer_stream_t *stream, audio_encoding_params_t *params);
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
45
e84a6ae9d51e audio encoding reworked
nicodvb
parents:
diff changeset
46 #endif