2529
|
1
|
|
2 #define AVIWRITE_MAX_STREAMS 16
|
|
3
|
|
4 #define AVIWRITE_TYPE_VIDEO 0
|
|
5 #define AVIWRITE_TYPE_AUDIO 1
|
|
6
|
|
7 typedef struct {
|
|
8 // muxer data:
|
|
9 int type; // audio or video
|
|
10 int id; // stream no
|
|
11 unsigned int ckid; // chunk id (00dc 01wb etc)
|
|
12 double timer;
|
|
13 // buffering:
|
|
14 unsigned char *buffer;
|
|
15 unsigned int buffer_size;
|
|
16 // source stream:
|
|
17 void* source; // sh_audio or sh_video
|
|
18 int codec; // codec used for encoding. 0 means copy
|
|
19 // avi stream header:
|
|
20 AVIStreamHeader h; // Rate/Scale and SampleSize must be filled by caller!
|
|
21 // stream specific:
|
|
22 WAVEFORMATEX *wf;
|
|
23 BITMAPINFOHEADER *bih; // in format
|
|
24 } aviwrite_stream_t;
|
|
25
|
|
26 typedef struct {
|
|
27 // encoding:
|
|
28 MainAVIHeader avih;
|
|
29 unsigned int movi_start;
|
|
30 unsigned int movi_end;
|
|
31 unsigned int file_end;
|
|
32 // index:
|
|
33 AVIINDEXENTRY *idx;
|
|
34 int idx_pos;
|
|
35 int idx_size;
|
|
36 // streams:
|
|
37 //int num_streams;
|
|
38 aviwrite_stream_t* def_v; // default video stream (for general headers)
|
|
39 aviwrite_stream_t* streams[AVIWRITE_MAX_STREAMS];
|
|
40 } aviwrite_t;
|
|
41
|
|
42 aviwrite_stream_t* aviwrite_new_stream(aviwrite_t *muxer,int type);
|
|
43 aviwrite_t* aviwrite_new_muxer();
|
|
44 void aviwrite_write_chunk(aviwrite_t *muxer,aviwrite_stream_t *s, FILE *f,int len,unsigned int flags);
|
|
45 void aviwrite_write_header(aviwrite_t *muxer,FILE *f);
|
|
46 void aviwrite_write_index(aviwrite_t *muxer,FILE *f);
|
|
47
|
|
48
|
|
49
|