Mercurial > mplayer.hg
annotate libmpdemux/muxer.h @ 9839:ab635db0c549
mode changes should occur to all the consoles
author | gabucino |
---|---|
date | Sun, 06 Apr 2003 10:06:31 +0000 |
parents | 12fc55eb3373 |
children | b82e3ecb11e0 |
rev | line source |
---|---|
2529 | 1 |
8585 | 2 #define MUXER_MAX_STREAMS 16 |
2529 | 3 |
8585 | 4 #define MUXER_TYPE_VIDEO 0 |
5 #define MUXER_TYPE_AUDIO 1 | |
6 | |
7 #define MUXER_TYPE_AVI 0 | |
8 #define MUXER_TYPE_MPEG 1 | |
9 | |
10 #define MUXER_MPEG_BLOCKSIZE 2048 // 2048 or 2324 - ? | |
2529 | 11 |
12 typedef struct { | |
13 // muxer data: | |
14 int type; // audio or video | |
15 int id; // stream no | |
8585 | 16 uint32_t ckid; // chunk id (00dc 01wb etc) |
2529 | 17 double timer; |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
2652
diff
changeset
|
18 off_t size; |
2529 | 19 // buffering: |
20 unsigned char *buffer; | |
21 unsigned int buffer_size; | |
2592 | 22 unsigned int buffer_len; |
8585 | 23 // mpeg block buffer: |
24 unsigned char *b_buffer; | |
25 unsigned int b_buffer_ptr; | |
2529 | 26 // source stream: |
27 void* source; // sh_audio or sh_video | |
28 int codec; // codec used for encoding. 0 means copy | |
29 // avi stream header: | |
30 AVIStreamHeader h; // Rate/Scale and SampleSize must be filled by caller! | |
31 // stream specific: | |
32 WAVEFORMATEX *wf; | |
33 BITMAPINFOHEADER *bih; // in format | |
8585 | 34 // mpeg specific: |
35 unsigned int gop_start; // frame number of this GOP start | |
36 size_t ipb[3]; // sizes of I/P/B frames | |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
37 // muxer of that stream |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
38 struct muxer_t *muxer; |
8585 | 39 } muxer_stream_t; |
2529 | 40 |
41 typedef struct { | |
8585 | 42 uint32_t id; |
7145
3854945aefbb
new mencoder option -info, to store copyright, title, encoder version etc in AVI
arpi
parents:
5572
diff
changeset
|
43 char *text; |
8585 | 44 } muxer_info_t; |
7145
3854945aefbb
new mencoder option -info, to store copyright, title, encoder version etc in AVI
arpi
parents:
5572
diff
changeset
|
45 |
8585 | 46 typedef struct muxer_t{ |
2529 | 47 // encoding: |
48 MainAVIHeader avih; | |
49 unsigned int movi_start; | |
50 unsigned int movi_end; | |
8585 | 51 unsigned int file_end; // for MPEG it's system timestamp in 1/90000 s |
2529 | 52 // index: |
53 AVIINDEXENTRY *idx; | |
54 int idx_pos; | |
55 int idx_size; | |
56 // streams: | |
8585 | 57 int num_videos; // for MPEG recalculations |
58 unsigned int sysrate; // max rate in bytes/s | |
2529 | 59 //int num_streams; |
8585 | 60 muxer_stream_t* def_v; // default video stream (for general headers) |
61 muxer_stream_t* streams[MUXER_MAX_STREAMS]; | |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
62 void (*cont_write_chunk)(muxer_stream_t *,size_t,unsigned int); |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
63 void (*cont_write_header)(struct muxer_t *); |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
64 void (*cont_write_index)(struct muxer_t *); |
8585 | 65 muxer_stream_t* (*cont_new_stream)(struct muxer_t *,int); |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
66 FILE* file; |
8585 | 67 } muxer_t; |
2529 | 68 |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
69 muxer_t *muxer_new_muxer(int type,FILE *); |
8585 | 70 #define muxer_new_stream(muxer,a) muxer->cont_new_stream(muxer,a) |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
71 #define muxer_write_chunk(a,b,c) a->muxer->cont_write_chunk(a,b,c) |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
72 #define muxer_write_header(muxer) muxer->cont_write_header(muxer) |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
73 #define muxer_write_index(muxer) muxer->cont_write_index(muxer) |
2529 | 74 |
8585 | 75 void muxer_init_muxer_avi(muxer_t *); |
76 void muxer_init_muxer_mpeg(muxer_t *); | |
2529 | 77 |