Mercurial > mplayer.hg
annotate libmpdemux/muxer.h @ 13144:29a48ea224e8
properly set linking flags for NetBSD, patch by jb13@gomerbud.com
author | diego |
---|---|
date | Thu, 26 Aug 2004 01:06:02 +0000 |
parents | 656a1b45b309 |
children | 70c446099f40 |
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 |
8585 | 10 |
11 #define MUXER_MPEG_BLOCKSIZE 2048 // 2048 or 2324 - ? | |
2529 | 12 |
13 typedef struct { | |
14 // muxer data: | |
15 int type; // audio or video | |
16 int id; // stream no | |
8585 | 17 uint32_t ckid; // chunk id (00dc 01wb etc) |
2529 | 18 double timer; |
5572
8cd761968f35
BSD-BT848 TV update patch by Charles Henrich <henrich@sigbus.com>
arpi
parents:
2652
diff
changeset
|
19 off_t size; |
12061 | 20 float aspect; // aspect ratio of this stream (set by ve_*.c) |
2529 | 21 // buffering: |
22 unsigned char *buffer; | |
23 unsigned int buffer_size; | |
2592 | 24 unsigned int buffer_len; |
8585 | 25 // mpeg block buffer: |
26 unsigned char *b_buffer; | |
27 unsigned int b_buffer_ptr; | |
2529 | 28 // source stream: |
29 void* source; // sh_audio or sh_video | |
30 int codec; // codec used for encoding. 0 means copy | |
31 // avi stream header: | |
32 AVIStreamHeader h; // Rate/Scale and SampleSize must be filled by caller! | |
33 // stream specific: | |
34 WAVEFORMATEX *wf; | |
35 BITMAPINFOHEADER *bih; // in format | |
8585 | 36 // mpeg specific: |
37 unsigned int gop_start; // frame number of this GOP start | |
38 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
|
39 // muxer of that stream |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
40 struct muxer_t *muxer; |
11222 | 41 void *priv; // private stream specific data stored by the muxer |
8585 | 42 } muxer_stream_t; |
2529 | 43 |
44 typedef struct { | |
8585 | 45 uint32_t id; |
7145
3854945aefbb
new mencoder option -info, to store copyright, title, encoder version etc in AVI
arpi
parents:
5572
diff
changeset
|
46 char *text; |
8585 | 47 } muxer_info_t; |
7145
3854945aefbb
new mencoder option -info, to store copyright, title, encoder version etc in AVI
arpi
parents:
5572
diff
changeset
|
48 |
8585 | 49 typedef struct muxer_t{ |
2529 | 50 // encoding: |
51 MainAVIHeader avih; | |
12036 | 52 off_t movi_start; |
53 off_t movi_end; | |
54 off_t file_end; // for MPEG it's system timestamp in 1/90000 s | |
2529 | 55 // index: |
56 AVIINDEXENTRY *idx; | |
57 int idx_pos; | |
58 int idx_size; | |
59 // streams: | |
8585 | 60 int num_videos; // for MPEG recalculations |
61 unsigned int sysrate; // max rate in bytes/s | |
2529 | 62 //int num_streams; |
8585 | 63 muxer_stream_t* def_v; // default video stream (for general headers) |
64 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
|
65 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
|
66 void (*cont_write_header)(struct muxer_t *); |
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
67 void (*cont_write_index)(struct muxer_t *); |
8585 | 68 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
|
69 FILE* file; |
8585 | 70 } muxer_t; |
2529 | 71 |
9007
12fc55eb3373
Cleanup of the muxer API, func parameters muxer & muxer_f eliminated.
arpi
parents:
8585
diff
changeset
|
72 muxer_t *muxer_new_muxer(int type,FILE *); |
8585 | 73 #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
|
74 #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
|
75 #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
|
76 #define muxer_write_index(muxer) muxer->cont_write_index(muxer) |
2529 | 77 |
8585 | 78 void muxer_init_muxer_avi(muxer_t *); |
79 void muxer_init_muxer_mpeg(muxer_t *); | |
12016
b962aaad2940
rawvideo muxer patch by John Earl <jwe21@cam.ac.uk>
ranma
parents:
11222
diff
changeset
|
80 void muxer_init_muxer_rawvideo(muxer_t *); |