Mercurial > mplayer.hg
annotate libmpdemux/stheader.h @ 8152:4b02f73cb4b9
dlopen() support for ad and vd
author | alex |
---|---|
date | Mon, 11 Nov 2002 17:28:41 +0000 |
parents | 10698ce4b2a4 |
children | bffdd162d034 |
rev | line source |
---|---|
4933 | 1 #ifndef __ST_HEADER_H |
2 #define __ST_HEADER_H 1 | |
3 | |
7471 | 4 // for AVIStreamHeader: |
2338 | 5 #include "wine/avifmt.h" |
7471 | 6 |
7 #ifndef _WAVEFORMATEX_ | |
8 #define _WAVEFORMATEX_ | |
9 typedef struct __attribute__((__packed__)) _WAVEFORMATEX { | |
10 WORD wFormatTag; | |
11 WORD nChannels; | |
12 DWORD nSamplesPerSec; | |
13 DWORD nAvgBytesPerSec; | |
14 WORD nBlockAlign; | |
15 WORD wBitsPerSample; | |
16 WORD cbSize; | |
17 } WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; | |
18 #endif /* _WAVEFORMATEX_ */ | |
291 | 19 |
7471 | 20 #ifndef _BITMAPINFOHEADER_ |
21 #define _BITMAPINFOHEADER_ | |
22 typedef struct __attribute__((__packed__)) | |
23 { | |
24 int biSize; | |
25 int biWidth; | |
26 int biHeight; | |
27 short biPlanes; | |
28 short biBitCount; | |
29 int biCompression; | |
30 int biSizeImage; | |
31 int biXPelsPerMeter; | |
32 int biYPelsPerMeter; | |
33 int biClrUsed; | |
34 int biClrImportant; | |
35 } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; | |
36 typedef struct { | |
37 BITMAPINFOHEADER bmiHeader; | |
38 int bmiColors[1]; | |
39 } BITMAPINFO, *LPBITMAPINFO; | |
40 #endif | |
41 | |
42 // Stream headers: | |
4196 | 43 |
291 | 44 typedef struct { |
45 demux_stream_t *ds; | |
7467 | 46 struct codecs_st *codec; |
303 | 47 unsigned int format; |
1656 | 48 int inited; |
8057 | 49 float delay; // relative (to sh_video->timer) time in audio stream |
291 | 50 // output format: |
7467 | 51 int sample_format; |
291 | 52 int samplerate; |
53 int samplesize; | |
54 int channels; | |
746 | 55 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) |
56 int i_bps; // == bitrate (compressed bytes/sec) | |
296 | 57 // in buffers: |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
58 int audio_in_minsize; // max. compressed packet size (== min. in buffer size) |
291 | 59 char* a_in_buffer; |
60 int a_in_buffer_len; | |
61 int a_in_buffer_size; | |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
62 // decoder buffers: |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
63 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize) |
296 | 64 char* a_buffer; |
65 int a_buffer_len; | |
66 int a_buffer_size; | |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
67 // output buffers: |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
68 char* a_out_buffer; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
69 int a_out_buffer_len; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
70 int a_out_buffer_size; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
71 // void* audio_out; // the audio_out handle, used for this audio stream |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
72 void* afilter; // the audio filter stream |
8152 | 73 #ifdef DYNAMIC_PLUGINS |
74 void *dec_handle; | |
75 #endif | |
7467 | 76 // win32-compatible codec parameters: |
291 | 77 AVIStreamHeader audio; |
7467 | 78 WAVEFORMATEX* wf; |
79 // codec-specific: | |
3642
2cef9d562af0
void* context added - it should keep the codec-specific stuff (struct ptr or HANDLE)
arpi
parents:
2567
diff
changeset
|
80 void* context; // codec-specific stuff (usually HANDLE or struct pointer) |
7467 | 81 unsigned char* codecdata; // extra header data passed from demuxer to codec |
5301 | 82 int codecdata_len; |
291 | 83 } sh_audio_t; |
84 | |
85 typedef struct { | |
86 demux_stream_t *ds; | |
7467 | 87 struct codecs_st *codec; |
303 | 88 unsigned int format; |
1656 | 89 int inited; |
8057 | 90 float timer; // absolute time in video stream, since last start/seek |
7467 | 91 // frame counters: |
92 float num_frames; // number of frames played | |
93 int num_frames_decoded; // number of frames decoded | |
94 // output format: (set by demuxer) | |
95 float fps; // frames per second (set only if constant fps) | |
96 float frametime; // 1/fps | |
97 float aspect; // aspect ratio stored in the file (for prescaling) | |
98 int i_bps; // == bitrate (compressed bytes/sec) | |
99 int disp_w,disp_h; // display size (filled by fileformat parser) | |
100 // output driver/filters: (set by libmpcodecs core) | |
303 | 101 unsigned int outfmtidx; |
7467 | 102 void* video_out; // the video_out handle, used for this video stream |
103 void* vfilter; // the video filter chain, used for this video stream | |
104 int vf_inited; | |
8152 | 105 #ifdef DYNAMIC_PLUGINS |
106 void *dec_handle; | |
107 #endif | |
7467 | 108 // win32-compatible codec parameters: |
291 | 109 AVIStreamHeader video; |
7467 | 110 BITMAPINFOHEADER* bih; |
111 // codec-specific: | |
112 void* context; // codec-specific stuff (usually HANDLE or struct pointer) | |
291 | 113 } sh_video_t; |
114 | |
7467 | 115 // demuxer.c: |
1289 | 116 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id); |
117 sh_video_t* new_sh_video(demuxer_t *demuxer,int id); | |
5084 | 118 void free_sh_audio(sh_audio_t *sh); |
119 void free_sh_video(sh_video_t *sh); | |
426 | 120 |
7467 | 121 // video.c: |
2567 | 122 int video_read_properties(sh_video_t *sh_video); |
123 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); | |
4933 | 124 |
125 #endif |