Mercurial > mplayer.hg
annotate libmpdemux/muxer.h @ 16566:df3786dcf520
remove duplicate entry
author | gpoirier |
---|---|
date | Fri, 23 Sep 2005 09:56:41 +0000 |
parents | 7b0599d9614a |
children | dd5be8f8d16d |
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 | |
12016
b962aaad2940
rawvideo muxer patch by John Earl <jwe21@cam.ac.uk>
ranma
parents:
11222
diff
changeset
|
9 #define MUXER_TYPE_RAWVIDEO 2 |
14757
7a2adc5e8928
initial, extremely experimental, libavformat muxer; don't expect anything to work yet
nicodvb
parents:
14753
diff
changeset
|
10 #define MUXER_TYPE_LAVF 3 |
15754 | 11 #define MUXER_TYPE_RAWAUDIO 4 |
8585 | 12 |
2529 | 13 |
14 typedef struct { | |
15 // muxer data: | |
16 int type; // audio or video | |
17 int id; // stream no | |
8585 | 18 uint32_t ckid; // chunk id (00dc 01wb etc) |
2529 | 19 double timer; |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
2652
diff
changeset
|
20 off_t size; |
12061 | 21 float aspect; // aspect ratio of this stream (set by ve_*.c) |
2529 | 22 // buffering: |
23 unsigned char *buffer; | |
24 unsigned int buffer_size; | |
2592 | 25 unsigned int buffer_len; |
8585 | 26 // mpeg block buffer: |
27 unsigned char *b_buffer; | |
14753
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
28 unsigned int b_buffer_size; //size of b_buffer |
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
29 unsigned int b_buffer_ptr; //index to next data to write |
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
30 unsigned int b_buffer_len; //len of next data to write |
2529 | 31 // source stream: |
32 void* source; // sh_audio or sh_video | |
33 int codec; // codec used for encoding. 0 means copy | |
34 // avi stream header: | |
35 AVIStreamHeader h; // Rate/Scale and SampleSize must be filled by caller! | |
36 // stream specific: | |
37 WAVEFORMATEX *wf; | |
38 BITMAPINFOHEADER *bih; // in format | |
8585 | 39 // mpeg specific: |
40 unsigned int gop_start; // frame number of this GOP start | |
41 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
|
42 // muxer of that stream |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
43 struct muxer_t *muxer; |
11222 | 44 void *priv; // private stream specific data stored by the muxer |
8585 | 45 } muxer_stream_t; |
2529 | 46 |
47 typedef struct { | |
8585 | 48 uint32_t id; |
7145
3854945aefbb
new mencoder option -info, to store copyright, title, encoder version etc in AVI
arpi
parents:
5572
diff
changeset
|
49 char *text; |
8585 | 50 } muxer_info_t; |
7145
3854945aefbb
new mencoder option -info, to store copyright, title, encoder version etc in AVI
arpi
parents:
5572
diff
changeset
|
51 |
8585 | 52 typedef struct muxer_t{ |
2529 | 53 // encoding: |
54 MainAVIHeader avih; | |
12036 | 55 off_t movi_start; |
56 off_t movi_end; | |
57 off_t file_end; // for MPEG it's system timestamp in 1/90000 s | |
2529 | 58 // index: |
59 AVIINDEXENTRY *idx; | |
60 int idx_pos; | |
61 int idx_size; | |
62 // streams: | |
8585 | 63 int num_videos; // for MPEG recalculations |
14753
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
64 int num_audios; |
8585 | 65 unsigned int sysrate; // max rate in bytes/s |
2529 | 66 //int num_streams; |
8585 | 67 muxer_stream_t* def_v; // default video stream (for general headers) |
68 muxer_stream_t* streams[MUXER_MAX_STREAMS]; | |
14753
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
69 void (*fix_stream_parameters)(muxer_stream_t *); |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
70 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
|
71 void (*cont_write_header)(struct muxer_t *); |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
72 void (*cont_write_index)(struct muxer_t *); |
8585 | 73 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
|
74 FILE* file; |
14753
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
75 void *priv; |
8585 | 76 } muxer_t; |
2529 | 77 |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
78 muxer_t *muxer_new_muxer(int type,FILE *); |
8585 | 79 #define muxer_new_stream(muxer,a) muxer->cont_new_stream(muxer,a) |
14753
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
80 #define muxer_stream_fix_parameters(muxer, a) muxer->fix_stream_parameters(a) |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
81 #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
|
82 #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
|
83 #define muxer_write_index(muxer) muxer->cont_write_index(muxer) |
2529 | 84 |
14753
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
85 int muxer_init_muxer_avi(muxer_t *); |
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
86 int muxer_init_muxer_mpeg(muxer_t *); |
70c446099f40
new mpeg muxer compatible with dvd/[s]vcd; small changes in the muxer layer (sanity checks in the muxer_init functions)
nicodvb
parents:
12061
diff
changeset
|
87 int muxer_init_muxer_rawvideo(muxer_t *); |
14955 | 88 int muxer_init_muxer_lavf(muxer_t *); |
15754 | 89 int muxer_init_muxer_rawaudio(muxer_t *); |