1545
|
1 #ifndef __LIBWIN32_H
|
|
2 #define __LIBWIN32_H
|
|
3
|
3063
|
4 #ifndef NOAVIFILE_HEADERS
|
|
5 #error this header file should not be used without -DNOAVIFILE_HEADERS
|
|
6 #endif
|
1545
|
7
|
3063
|
8 // this file is only included when NOAVIFILE_HEADERS are defined
|
|
9 // serves mainly for mplayer
|
1545
|
10
|
3063
|
11 #define VFW_E_NOT_RUNNING 0x80040226
|
1545
|
12
|
3063
|
13 #include <inttypes.h>
|
1545
|
14
|
1558
|
15 //#define FATAL(a) // you don't need exception - if you want - just fill more code
|
3063
|
16 #include "wine/mmreg.h"
|
|
17 #include "wine/winreg.h"
|
|
18 #include "wine/vfw.h"
|
|
19 #include "com.h"
|
|
20
|
|
21 typedef uint32_t fourcc_t;
|
|
22
|
|
23 /*
|
|
24 typedef struct _FatalError
|
|
25 {
|
|
26 FatalError();
|
|
27 void PrintAll() {}
|
|
28 }FatalError;
|
|
29 */
|
|
30
|
|
31 typedef struct _CodecInfo
|
|
32 {
|
|
33 char* dll;
|
|
34 GUID* guid;
|
|
35 }CodecInfo;
|
|
36
|
1545
|
37
|
3063
|
38 typedef struct _CImage // public your_libvo_mem
|
|
39 {
|
|
40 char* ptr;
|
|
41
|
|
42 /*char* (*Data)();
|
|
43 {
|
|
44 return 0;
|
|
45 // pointer to memory block
|
|
46 }*/
|
|
47 /*int (*Supported)(fourcc_t csp, int bits);
|
|
48 {
|
|
49 return true;
|
|
50 // if you support such surface
|
|
51 }*/
|
|
52 }CImage;
|
2069
|
53
|
1558
|
54
|
3063
|
55 #if 0
|
|
56 struct BitmapInfo : public BITMAPINFOHEADER
|
|
57 {
|
|
58 void SetBits(int b) { return; /*fixme*/ }
|
|
59 void SetSpace(int b) { return; /*fixme*/ }
|
|
60 };
|
|
61 #endif
|
|
62
|
|
63 typedef struct _IAudioDecoder
|
1545
|
64 {
|
3063
|
65 WAVEFORMATEX in_fmt;
|
|
66 CodecInfo record;
|
|
67 /*(*IAudioDecoder)( CodecInfo * r, const WAVEFORMATEX* w);
|
|
68 {
|
|
69 memcpy(&this->record,r,sizeof(CodecInfo));
|
|
70 in_fmt = *w;
|
|
71 }*/
|
|
72 }IAudioDecoder;
|
|
73
|
|
74 /*
|
|
75 struct IAudioEncoder
|
|
76 {
|
|
77 IAudioEncoder(const CodecInfo&, WAVEFORMATEX*) {}
|
|
78 // you do not need this one...
|
|
79 };
|
|
80 */
|
|
81
|
|
82 enum CAPS
|
1558
|
83 {
|
3063
|
84 CAP_NONE = 0,
|
|
85 CAP_YUY2 = 1,
|
|
86 CAP_YV12 = 2,
|
|
87 CAP_IYUV = 4,
|
|
88 CAP_UYVY = 8,
|
|
89 CAP_YVYU = 16,
|
|
90 CAP_I420 = 32,
|
6527
|
91 CAP_YVU9 = 64,
|
|
92 CAP_IF09 = 128,
|
3063
|
93 };
|
|
94 enum DecodingMode
|
|
95 {
|
|
96 DIRECT = 0,
|
|
97 REALTIME,
|
|
98 REALTIME_QUALITY_AUTO,
|
|
99 };
|
|
100 enum DecodingState
|
|
101 {
|
|
102 STOP = 0,
|
|
103 START,
|
|
104 };
|
1545
|
105
|
3063
|
106 typedef struct _BitmapInfo
|
|
107 {
|
|
108 long biSize;
|
|
109 long biWidth;
|
|
110 long biHeight;
|
|
111 short biPlanes;
|
|
112 short biBitCount;
|
|
113 long biCompression;
|
|
114 long biSizeImage;
|
|
115 long biXPelsPerMeter;
|
|
116 long biYPelsPerMeter;
|
|
117 long biClrUsed;
|
|
118 long biClrImportant;
|
|
119 int colors[3];
|
|
120 } BitmapInfo;
|
|
121
|
|
122 typedef struct _IVideoDecoder
|
1545
|
123 {
|
3063
|
124 int VBUFSIZE;
|
|
125 int QMARKHI;
|
|
126 int QMARKLO;
|
|
127 int DMARKHI;
|
|
128 int DMARKLO;
|
1545
|
129
|
3063
|
130 /*
|
|
131 IVideoDecoder(CodecInfo& info, const BITMAPINFOHEADER& format) : record(info)
|
|
132 {
|
|
133 // implement init part
|
|
134 }
|
|
135 virtual ~IVideoDecoder();
|
|
136 void Stop()
|
|
137 {
|
|
138 }
|
|
139 void Start()
|
|
140 {
|
|
141 }
|
|
142 */
|
|
143 const CodecInfo record;
|
|
144 int m_Mode; // should we do precaching (or even change Quality on the fly)
|
|
145 int m_State;
|
|
146 int m_iDecpos;
|
|
147 int m_iPlaypos;
|
|
148 float m_fQuality; // quality for the progress bar 0..1(best)
|
|
149 int m_bCapable16b;
|
|
150
|
|
151 BITMAPINFOHEADER* m_bh; // format of input data (might be larger - e.g. huffyuv)
|
|
152 BitmapInfo m_decoder; // format of decoder output
|
|
153 BitmapInfo m_obh; // format of returned frames
|
|
154 }IVideoDecoder;
|
|
155
|
|
156 /*
|
|
157 struct IRtConfig
|
|
158 {
|
1545
|
159 };
|
3063
|
160 */
|
1545
|
161
|
|
162 // might be minimalized to contain just those which are needed by DS_VideoDecoder
|
|
163
|
|
164 #ifndef mmioFOURCC
|
|
165 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
|
|
166 ( (long)(unsigned char)(ch0) | ( (long)(unsigned char)(ch1) << 8 ) | \
|
|
167 ( (long)(unsigned char)(ch2) << 16 ) | ( (long)(unsigned char)(ch3) << 24 ) )
|
|
168 #endif /* mmioFOURCC */
|
|
169
|
|
170 /* OpenDivX */
|
|
171 #define fccMP4S mmioFOURCC('M', 'P', '4', 'S')
|
|
172 #define fccmp4s mmioFOURCC('m', 'p', '4', 's')
|
|
173 #define fccDIVX mmioFOURCC('D', 'I', 'V', 'X')
|
|
174 #define fccdivx mmioFOURCC('d', 'i', 'v', 'x')
|
|
175 #define fccDIV1 mmioFOURCC('D', 'I', 'V', '1')
|
|
176 #define fccdiv1 mmioFOURCC('d', 'i', 'v', '1')
|
|
177
|
|
178 /* DivX codecs */
|
|
179 #define fccDIV2 mmioFOURCC('D', 'I', 'V', '2')
|
|
180 #define fccdiv2 mmioFOURCC('d', 'i', 'v', '2')
|
|
181 #define fccDIV3 mmioFOURCC('D', 'I', 'V', '3')
|
|
182 #define fccdiv3 mmioFOURCC('d', 'i', 'v', '3')
|
|
183 #define fccDIV4 mmioFOURCC('D', 'I', 'V', '4')
|
|
184 #define fccdiv4 mmioFOURCC('d', 'i', 'v', '4')
|
|
185 #define fccDIV5 mmioFOURCC('D', 'I', 'V', '5')
|
|
186 #define fccdiv5 mmioFOURCC('d', 'i', 'v', '5')
|
|
187 #define fccDIV6 mmioFOURCC('D', 'I', 'V', '6')
|
|
188 #define fccdiv6 mmioFOURCC('d', 'i', 'v', '6')
|
|
189 #define fccMP41 mmioFOURCC('M', 'P', '4', '1')
|
|
190 #define fccmp41 mmioFOURCC('m', 'p', '4', '1')
|
|
191 #define fccMP43 mmioFOURCC('M', 'P', '4', '3')
|
|
192 #define fccmp43 mmioFOURCC('m', 'p', '4', '3')
|
|
193 /* old ms mpeg-4 codecs */
|
|
194 #define fccMP42 mmioFOURCC('M', 'P', '4', '2')
|
|
195 #define fccmp42 mmioFOURCC('m', 'p', '4', '2')
|
|
196 #define fccMPG4 mmioFOURCC('M', 'P', 'G', '4')
|
|
197 #define fccmpg4 mmioFOURCC('m', 'p', 'g', '4')
|
|
198 /* Windows media codecs */
|
|
199 #define fccWMV1 mmioFOURCC('W', 'M', 'V', '1')
|
|
200 #define fccwmv1 mmioFOURCC('w', 'm', 'v', '1')
|
|
201 #define fccWMV2 mmioFOURCC('W', 'M', 'V', '2')
|
|
202 #define fccwmv2 mmioFOURCC('w', 'm', 'v', '2')
|
|
203 #define fccMWV1 mmioFOURCC('M', 'W', 'V', '1')
|
|
204
|
|
205 /* Angel codecs */
|
|
206 #define fccAP41 mmioFOURCC('A', 'P', '4', '1')
|
|
207 #define fccap41 mmioFOURCC('a', 'p', '4', '1')
|
|
208 #define fccAP42 mmioFOURCC('A', 'P', '4', '2')
|
|
209 #define fccap42 mmioFOURCC('a', 'p', '4', '2')
|
|
210
|
|
211 /* other codecs */
|
|
212 #define fccIV31 mmioFOURCC('I', 'V', '3', '1')
|
|
213 #define fcciv31 mmioFOURCC('i', 'v', '3', '1')
|
|
214 #define fccIV32 mmioFOURCC('I', 'V', '3', '2')
|
|
215 #define fcciv32 mmioFOURCC('i', 'v', '3', '2')
|
|
216 #define fccIV41 mmioFOURCC('I', 'V', '4', '1')
|
|
217 #define fcciv41 mmioFOURCC('i', 'v', '4', '1')
|
|
218 #define fccIV50 mmioFOURCC('I', 'V', '5', '0')
|
|
219 #define fcciv50 mmioFOURCC('i', 'v', '5', '0')
|
|
220 #define fccI263 mmioFOURCC('I', '2', '6', '3')
|
|
221 #define fcci263 mmioFOURCC('i', '2', '6', '3')
|
|
222
|
|
223 #define fccMJPG mmioFOURCC('M', 'J', 'P', 'G')
|
|
224 #define fccmjpg mmioFOURCC('m', 'j', 'p', 'g')
|
|
225
|
|
226 #define fccHFYU mmioFOURCC('H', 'F', 'Y', 'U')
|
|
227
|
|
228 #define fcccvid mmioFOURCC('c', 'v', 'i', 'd')
|
|
229 #define fccdvsd mmioFOURCC('d', 'v', 's', 'd')
|
|
230
|
|
231 /* Ati codecs */
|
|
232 #define fccVCR2 mmioFOURCC('V', 'C', 'R', '2')
|
|
233 #define fccVCR1 mmioFOURCC('V', 'C', 'R', '1')
|
|
234 #define fccVYUY mmioFOURCC('V', 'Y', 'U', 'Y')
|
6527
|
235 #define fccIYU9 mmioFOURCC('I', 'Y', 'U', '9') // it was defined as fccYVU9
|
1545
|
236
|
|
237 /* Asus codecs */
|
|
238 #define fccASV1 mmioFOURCC('A', 'S', 'V', '1')
|
|
239 #define fccASV2 mmioFOURCC('A', 'S', 'V', '2')
|
|
240
|
|
241 /* Microsoft video */
|
|
242 #define fcccram mmioFOURCC('c', 'r', 'a', 'm')
|
|
243 #define fccCRAM mmioFOURCC('C', 'R', 'A', 'M')
|
|
244 #define fccMSVC mmioFOURCC('M', 'S', 'V', 'C')
|
|
245
|
|
246
|
|
247 #define fccMSZH mmioFOURCC('M', 'S', 'Z', 'H')
|
|
248
|
|
249 #define fccZLIB mmioFOURCC('Z', 'L', 'I', 'B')
|
|
250
|
|
251 #define fccTM20 mmioFOURCC('T', 'M', '2', '0')
|
|
252
|
|
253 #define fccYUV mmioFOURCC('Y', 'U', 'V', ' ')
|
|
254 #define fccYUY2 mmioFOURCC('Y', 'U', 'Y', '2')
|
|
255 #define fccYV12 mmioFOURCC('Y', 'V', '1', '2')/* Planar mode: Y + V + U (3 planes) */
|
|
256 #define fccI420 mmioFOURCC('I', '4', '2', '0')
|
|
257 #define fccIYUV mmioFOURCC('I', 'Y', 'U', 'V')/* Planar mode: Y + U + V (3 planes) */
|
|
258 #define fccUYVY mmioFOURCC('U', 'Y', 'V', 'Y')/* Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
|
259 #define fccYVYU mmioFOURCC('Y', 'V', 'Y', 'U')/* Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
6527
|
260 #define fccYVU9 mmioFOURCC('Y', 'V', 'U', '9')/* Planar 4:1:0 */
|
|
261 #define fccIF09 mmioFOURCC('I', 'F', '0', '9')/* Planar 4:1:0 + delta */
|
1545
|
262
|
|
263 #endif
|