Mercurial > mplayer.hg
annotate libmpdemux/stheader.h @ 10857:608666e629b2
warning fix (missing C initializer)
author | pl |
---|---|
date | Fri, 12 Sep 2003 15:54:28 +0000 |
parents | 14fa6a121a47 |
children | 0db4a3a5b01d |
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 | |
8965 | 94 // timing (mostly for mpeg): |
95 float pts; // predicted/interpolated PTS of the current frame | |
96 float i_pts; // PTS for the _next_ I/P frame | |
7467 | 97 // output format: (set by demuxer) |
98 float fps; // frames per second (set only if constant fps) | |
99 float frametime; // 1/fps | |
100 float aspect; // aspect ratio stored in the file (for prescaling) | |
101 int i_bps; // == bitrate (compressed bytes/sec) | |
102 int disp_w,disp_h; // display size (filled by fileformat parser) | |
103 // output driver/filters: (set by libmpcodecs core) | |
303 | 104 unsigned int outfmtidx; |
7467 | 105 void* video_out; // the video_out handle, used for this video stream |
106 void* vfilter; // the video filter chain, used for this video stream | |
107 int vf_inited; | |
8152 | 108 #ifdef DYNAMIC_PLUGINS |
109 void *dec_handle; | |
110 #endif | |
7467 | 111 // win32-compatible codec parameters: |
291 | 112 AVIStreamHeader video; |
7467 | 113 BITMAPINFOHEADER* bih; |
8158 | 114 void* ImageDesc; // for quicktime codecs |
7467 | 115 // codec-specific: |
116 void* context; // codec-specific stuff (usually HANDLE or struct pointer) | |
291 | 117 } sh_video_t; |
118 | |
7467 | 119 // demuxer.c: |
1289 | 120 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id); |
121 sh_video_t* new_sh_video(demuxer_t *demuxer,int id); | |
5084 | 122 void free_sh_audio(sh_audio_t *sh); |
123 void free_sh_video(sh_video_t *sh); | |
426 | 124 |
7467 | 125 // video.c: |
2567 | 126 int video_read_properties(sh_video_t *sh_video); |
127 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); | |
4933 | 128 |
129 #endif |