annotate libmpdemux/aviwrite.h @ 2533:36a9317a2afc

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