Mercurial > mplayer.hg
annotate loader/wine/vfw.h @ 18001:a2683ee7cb5a
fix descrambling of asf file,
where signed buffer could cause erroneous values to be filled in descrable variables,
add misssing check for one of these variables
and restore sign of these variables as insurance that these checks will work even in such case.
author | iive |
---|---|
date | Thu, 30 Mar 2006 23:06:18 +0000 |
parents | f5537cc95b02 |
children | 0783dd397f74 |
rev | line source |
---|---|
15166
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
1 /* |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
2 * Modified for use with MPlayer, detailed CVS changelog at |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
3 * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
4 * $Id$ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
5 */ |
f5537cc95b02
Mark modified imported files as such to comply with GPL ¡ø2a.
diego
parents:
13182
diff
changeset
|
6 |
1 | 7 #ifndef __WINE_VFW_H |
8 #define __WINE_VFW_H | |
9 //#include "pshpack1.h" | |
10 #ifdef __cplusplus | |
11 extern "C" { | |
12 #endif | |
13 #ifndef __WINE_WINGDI_H | |
14 | |
3131 | 15 typedef struct __attribute__((__packed__)) |
1 | 16 { |
17 short bfType; | |
18 long bfSize; | |
19 short bfReserved1; | |
20 short bfReserved2; | |
21 long bfOffBits; | |
22 } BITMAPFILEHEADER; | |
23 | |
128 | 24 #ifndef _BITMAPINFOHEADER_ |
25 #define _BITMAPINFOHEADER_ | |
3131 | 26 typedef struct __attribute__((__packed__)) |
1 | 27 { |
13182 | 28 long biSize; |
29 long biWidth; | |
30 long biHeight; | |
1 | 31 short biPlanes; |
32 short biBitCount; | |
13182 | 33 long biCompression; |
34 long biSizeImage; | |
35 long biXPelsPerMeter; | |
36 long biYPelsPerMeter; | |
37 long biClrUsed; | |
38 long biClrImportant; | |
1 | 39 } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; |
40 typedef struct { | |
41 BITMAPINFOHEADER bmiHeader; | |
42 int bmiColors[1]; | |
43 } BITMAPINFO, *LPBITMAPINFO; | |
44 #endif | |
128 | 45 |
46 #endif | |
1 | 47 #define VFWAPI |
48 #define VFWAPIV | |
49 #ifndef __WINE_WINDEF_H | |
50 typedef long (__stdcall__ *DRIVERPROC)(long,HDRVR,unsigned int,long,long); | |
51 #endif | |
52 | |
53 | |
54 | |
55 #ifndef mmioFOURCC | |
56 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \ | |
57 ( (long)(unsigned char)(ch0) | ( (long)(unsigned char)(ch1) << 8 ) | \ | |
58 ( (long)(unsigned char)(ch2) << 16 ) | ( (long)(unsigned char)(ch3) << 24 ) ) | |
59 #endif | |
60 | |
61 #ifndef aviTWOCC | |
62 #define aviTWOCC(ch0, ch1) ((short)(unsigned char)(ch0) | ((short)(unsigned char)(ch1) << 8)) | |
63 #endif | |
64 | |
65 #define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c') | |
66 #define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c') | |
67 | |
68 | |
69 /* Installable Compressor M? */ | |
70 | |
71 /* HIC struct (same layout as Win95 one) */ | |
72 typedef struct tagWINE_HIC { | |
73 long magic; /* 00: 'Smag' */ | |
74 HANDLE curthread; /* 04: */ | |
75 long type; /* 08: */ | |
76 long handler; /* 0C: */ | |
77 HDRVR hdrv; /* 10: */ | |
7386 | 78 long driverid; /* 14:(handled by SendDriverMessage)*/ |
1 | 79 DRIVERPROC driverproc; /* 18:(handled by SendDriverMessage)*/ |
80 long x1; /* 1c: name? */ | |
81 short x2; /* 20: */ | |
82 long x3; /* 22: */ | |
83 /* 26: */ | |
84 } WINE_HIC; | |
85 | |
86 /* error return codes */ | |
87 #define ICERR_OK 0 | |
88 #define ICERR_DONTDRAW 1 | |
89 #define ICERR_NEWPALETTE 2 | |
90 #define ICERR_GOTOKEYFRAME 3 | |
91 #define ICERR_STOPDRAWING 4 | |
92 | |
93 #define ICERR_UNSUPPORTED -1 | |
94 #define ICERR_BADFORMAT -2 | |
95 #define ICERR_MEMORY -3 | |
96 #define ICERR_INTERNAL -4 | |
97 #define ICERR_BADFLAGS -5 | |
98 #define ICERR_BADPARAM -6 | |
99 #define ICERR_BADSIZE -7 | |
100 #define ICERR_BADHANDLE -8 | |
101 #define ICERR_CANTUPDATE -9 | |
102 #define ICERR_ABORT -10 | |
103 #define ICERR_ERROR -100 | |
104 #define ICERR_BADBITDEPTH -200 | |
105 #define ICERR_BADIMAGESIZE -201 | |
106 | |
107 #define ICERR_CUSTOM -400 | |
108 | |
109 /* ICM Messages */ | |
110 #define ICM_USER (DRV_USER+0x0000) | |
111 | |
112 /* ICM driver message range */ | |
113 #define ICM_RESERVED_LOW (DRV_USER+0x1000) | |
114 #define ICM_RESERVED_HIGH (DRV_USER+0x2000) | |
115 #define ICM_RESERVED ICM_RESERVED_LOW | |
116 | |
117 #define ICM_GETSTATE (ICM_RESERVED+0) | |
118 #define ICM_SETSTATE (ICM_RESERVED+1) | |
119 #define ICM_GETINFO (ICM_RESERVED+2) | |
120 | |
121 #define ICM_CONFIGURE (ICM_RESERVED+10) | |
122 #define ICM_ABOUT (ICM_RESERVED+11) | |
123 /* */ | |
124 | |
125 #define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30) | |
126 #define ICM_GETQUALITY (ICM_RESERVED+31) | |
127 #define ICM_SETQUALITY (ICM_RESERVED+32) | |
128 | |
129 #define ICM_SET (ICM_RESERVED+40) | |
130 #define ICM_GET (ICM_RESERVED+41) | |
131 | |
132 /* 2 constant FOURCC codes */ | |
133 #define ICM_FRAMERATE mmioFOURCC('F','r','m','R') | |
134 #define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R') | |
135 | |
136 #define ICM_COMPRESS_GET_FORMAT (ICM_USER+4) | |
137 #define ICM_COMPRESS_GET_SIZE (ICM_USER+5) | |
138 #define ICM_COMPRESS_QUERY (ICM_USER+6) | |
139 #define ICM_COMPRESS_BEGIN (ICM_USER+7) | |
140 #define ICM_COMPRESS (ICM_USER+8) | |
141 #define ICM_COMPRESS_END (ICM_USER+9) | |
142 | |
143 #define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10) | |
144 #define ICM_DECOMPRESS_QUERY (ICM_USER+11) | |
145 #define ICM_DECOMPRESS_BEGIN (ICM_USER+12) | |
146 #define ICM_DECOMPRESS (ICM_USER+13) | |
147 #define ICM_DECOMPRESS_END (ICM_USER+14) | |
148 #define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29) | |
149 #define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30) | |
150 | |
151 #define ICM_DRAW_QUERY (ICM_USER+31) | |
152 #define ICM_DRAW_BEGIN (ICM_USER+15) | |
153 #define ICM_DRAW_GET_PALETTE (ICM_USER+16) | |
154 #define ICM_DRAW_START (ICM_USER+18) | |
155 #define ICM_DRAW_STOP (ICM_USER+19) | |
156 #define ICM_DRAW_END (ICM_USER+21) | |
157 #define ICM_DRAW_GETTIME (ICM_USER+32) | |
158 #define ICM_DRAW (ICM_USER+33) | |
159 #define ICM_DRAW_WINDOW (ICM_USER+34) | |
160 #define ICM_DRAW_SETTIME (ICM_USER+35) | |
161 #define ICM_DRAW_REALIZE (ICM_USER+36) | |
162 #define ICM_DRAW_FLUSH (ICM_USER+37) | |
163 #define ICM_DRAW_RENDERBUFFER (ICM_USER+38) | |
164 | |
165 #define ICM_DRAW_START_PLAY (ICM_USER+39) | |
166 #define ICM_DRAW_STOP_PLAY (ICM_USER+40) | |
167 | |
168 #define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50) | |
169 #define ICM_DRAW_CHANGEPALETTE (ICM_USER+51) | |
170 | |
171 #define ICM_GETBUFFERSWANTED (ICM_USER+41) | |
172 | |
173 #define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42) | |
174 | |
175 #define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60) | |
176 #define ICM_DECOMPRESSEX_QUERY (ICM_USER+61) | |
177 #define ICM_DECOMPRESSEX (ICM_USER+62) | |
178 #define ICM_DECOMPRESSEX_END (ICM_USER+63) | |
179 | |
180 #define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70) | |
181 #define ICM_SET_STATUS_PROC (ICM_USER+72) | |
182 | |
183 /* structs */ | |
184 | |
185 typedef struct { | |
186 long dwSize; /* 00: size */ | |
187 long fccType; /* 04: type 'vidc' usually */ | |
188 long fccHandler; /* 08: */ | |
189 long dwVersion; /* 0c: version of compman opening you */ | |
190 long dwFlags; /* 10: LOshort is type specific */ | |
191 LRESULT dwError; /* 14: */ | |
192 void* pV1Reserved; /* 18: */ | |
193 void* pV2Reserved; /* 1c: */ | |
194 long dnDevNode; /* 20: */ | |
195 /* 24: */ | |
196 } ICOPEN,*LPICOPEN; | |
197 | |
198 #define ICCOMPRESS_KEYFRAME 0x00000001L | |
199 | |
200 typedef struct { | |
201 long dwFlags; | |
202 LPBITMAPINFOHEADER lpbiOutput; | |
203 void* lpOutput; | |
204 LPBITMAPINFOHEADER lpbiInput; | |
7386 | 205 const void* lpInput; |
1 | 206 long* lpckid; |
207 long* lpdwFlags; | |
208 long lFrameNum; | |
209 long dwFrameSize; | |
210 long dwQuality; | |
211 LPBITMAPINFOHEADER lpbiPrev; | |
212 void* lpPrev; | |
213 } ICCOMPRESS; | |
214 | |
215 long VFWAPIV ICCompress( | |
7386 | 216 HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData, |
217 LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid, | |
1 | 218 long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality, |
7386 | 219 LPBITMAPINFOHEADER lpbiPrev,void* lpPrev |
1 | 220 ); |
221 | |
222 | |
223 #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \ | |
224 ICSendMessage( \ | |
225 hic,ICM_COMPRESS_GET_FORMAT,(long)(void*)(lpbiInput), \ | |
226 (long)(void*)(lpbiOutput) \ | |
227 ) | |
228 | |
229 #define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL) | |
230 | |
231 #define ICGetDefaultKeyFrameRate(hic,lpint) \ | |
232 ICSendMessage( \ | |
233 hic, ICM_GETDEFAULTKEYFRAMERATE, \ | |
234 (long)(void*)(lpint), \ | |
235 0 ) | |
236 | |
237 #define ICGetDefaultQuality(hic,lpint) \ | |
238 ICSendMessage( \ | |
239 hic, ICM_GETDEFAULTQUALITY, \ | |
240 (long)(void*)(lpint), \ | |
241 0 ) | |
242 | |
243 | |
244 #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \ | |
245 ICSendMessage( \ | |
246 hic, ICM_COMPRESS_BEGIN, (long)(void*)(lpbiInput), \ | |
247 (long)(void*)(lpbiOutput) \ | |
248 ) | |
249 | |
250 #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \ | |
251 ICSendMessage( \ | |
252 hic, ICM_COMPRESS_GET_SIZE, (long)(void*)(lpbiInput), \ | |
253 (long)(void*)(lpbiOutput) \ | |
254 ) | |
255 | |
256 #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \ | |
257 ICSendMessage( \ | |
258 hic, ICM_COMPRESS_QUERY, (long)(void*)(lpbiInput), \ | |
259 (long)(void*)(lpbiOutput) \ | |
260 ) | |
261 | |
262 | |
263 #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0) | |
264 | |
265 /* ICCOMPRESSFRAMES.dwFlags */ | |
266 #define ICCOMPRESSFRAMES_PADDING 0x00000001 | |
267 typedef struct { | |
268 long dwFlags; | |
269 LPBITMAPINFOHEADER lpbiOutput; | |
270 LPARAM lOutput; | |
271 LPBITMAPINFOHEADER lpbiInput; | |
272 LPARAM lInput; | |
273 long lStartFrame; | |
274 long lFrameCount; | |
275 long lQuality; | |
276 long lDataRate; | |
277 long lKeyRate; | |
278 long dwRate; | |
279 long dwScale; | |
280 long dwOverheadPerFrame; | |
281 long dwReserved2; | |
282 long CALLBACK (*GetData)(LPARAM lInput,long lFrame,void* lpBits,long len); | |
283 long CALLBACK (*PutData)(LPARAM lOutput,long lFrame,void* lpBits,long len); | |
284 } ICCOMPRESSFRAMES; | |
285 | |
286 /* Values for wMode of ICOpen() */ | |
287 #define ICMODE_COMPRESS 1 | |
288 #define ICMODE_DECOMPRESS 2 | |
289 #define ICMODE_FASTDECOMPRESS 3 | |
290 #define ICMODE_QUERY 4 | |
291 #define ICMODE_FASTCOMPRESS 5 | |
292 #define ICMODE_DRAW 8 | |
293 | |
294 /* quality flags */ | |
295 #define ICQUALITY_LOW 0 | |
296 #define ICQUALITY_HIGH 10000 | |
297 #define ICQUALITY_DEFAULT -1 | |
298 | |
299 typedef struct { | |
300 long dwSize; /* 00: */ | |
301 long fccType; /* 04:compressor type 'vidc' 'audc' */ | |
302 long fccHandler; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/ | |
303 long dwFlags; /* 0c:flags LOshort is type specific */ | |
304 long dwVersion; /* 10:version of the driver */ | |
305 long dwVersionICM; /* 14:version of the ICM used */ | |
306 /* | |
307 * under Win32, the driver always returns UNICODE strings. | |
308 */ | |
309 WCHAR szName[16]; /* 18:short name */ | |
310 WCHAR szDescription[128]; /* 38:long name */ | |
311 WCHAR szDriver[128]; /* 138:driver that contains compressor*/ | |
312 /* 238: */ | |
313 } ICINFO; | |
314 | |
315 /* ICINFO.dwFlags */ | |
316 #define VIDCF_QUALITY 0x0001 /* supports quality */ | |
317 #define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */ | |
318 #define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */ | |
319 #define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */ | |
320 #define VIDCF_DRAW 0x0010 /* supports drawing */ | |
321 #define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */ | |
322 #define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */ | |
323 #define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */ | |
324 | |
325 #define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD) | |
326 | |
327 | |
328 /* function shortcuts */ | |
329 /* ICM_ABOUT */ | |
330 #define ICMF_ABOUT_QUERY 0x00000001 | |
331 | |
332 #define ICQueryAbout(hic) \ | |
333 (ICSendMessage(hic,ICM_ABOUT,(long)-1,ICMF_ABOUT_QUERY)==ICERR_OK) | |
334 | |
335 #define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(long)(unsigned int)(hwnd),0) | |
336 | |
337 /* ICM_CONFIGURE */ | |
338 #define ICMF_CONFIGURE_QUERY 0x00000001 | |
339 #define ICQueryConfigure(hic) \ | |
340 (ICSendMessage(hic,ICM_CONFIGURE,(long)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK) | |
341 | |
342 #define ICConfigure(hic,hwnd) \ | |
343 ICSendMessage(hic,ICM_CONFIGURE,(long)(unsigned int)(hwnd),0) | |
344 | |
345 /* Decompression stuff */ | |
346 #define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */ | |
347 #define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */ | |
348 #define ICDECOMPRESS_PREROL 0x20000000 /* this frame is before real start */ | |
349 #define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */ | |
350 #define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */ | |
351 | |
352 typedef struct { | |
353 long dwFlags; /* flags (from AVI index...) */ | |
354 LPBITMAPINFOHEADER lpbiInput; /* BITMAPINFO of compressed data */ | |
7386 | 355 const void* lpInput; /* compressed data */ |
1 | 356 LPBITMAPINFOHEADER lpbiOutput; /* DIB to decompress to */ |
357 void* lpOutput; | |
358 long ckid; /* ckid from AVI file */ | |
359 } ICDECOMPRESS; | |
360 | |
361 typedef struct { | |
362 long dwFlags; | |
7386 | 363 LPBITMAPINFOHEADER lpbiSrc; |
364 const void* lpSrc; | |
1 | 365 LPBITMAPINFOHEADER lpbiDst; |
366 void* lpDst; | |
367 | |
368 /* changed for ICM_DECOMPRESSEX */ | |
369 INT xDst; /* destination rectangle */ | |
370 INT yDst; | |
371 INT dxDst; | |
372 INT dyDst; | |
373 | |
374 INT xSrc; /* source rectangle */ | |
375 INT ySrc; | |
376 INT dxSrc; | |
377 INT dySrc; | |
378 } ICDECOMPRESSEX; | |
379 | |
380 | |
381 long VFWAPIV ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits); | |
1297 | 382 long VFWAPIV ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits); |
1312 | 383 long VFWAPIV ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi); |
1 | 384 |
385 | |
386 #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \ | |
387 ICSendMessage( \ | |
388 hic, ICM_DECOMPRESS_BEGIN, (long)(void*)(lpbiInput), \ | |
389 (long)(void*)(lpbiOutput) \ | |
390 ) | |
391 | |
1297 | 392 #define ICDecompressBeginEx(hic, lpbiInput, lpbiOutput) \ |
393 ICUniversalEx( \ | |
1321
2712e787f872
Remove some superfluous casts. Fixes a few compile warnings.
jkeil
parents:
1312
diff
changeset
|
394 hic, ICM_DECOMPRESSEX_BEGIN, (lpbiInput), \ |
2712e787f872
Remove some superfluous casts. Fixes a few compile warnings.
jkeil
parents:
1312
diff
changeset
|
395 (lpbiOutput) \ |
1297 | 396 ) |
397 | |
1321
2712e787f872
Remove some superfluous casts. Fixes a few compile warnings.
jkeil
parents:
1312
diff
changeset
|
398 #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \ |
1 | 399 ICSendMessage( \ |
400 hic,ICM_DECOMPRESS_QUERY, (long)(void*)(lpbiInput), \ | |
401 (long) (void*)(lpbiOutput) \ | |
402 ) | |
403 | |
1297 | 404 #define ICDecompressQueryEx(hic, lpbiInput, lpbiOutput) \ |
405 ICUniversalEx( \ | |
1321
2712e787f872
Remove some superfluous casts. Fixes a few compile warnings.
jkeil
parents:
1312
diff
changeset
|
406 hic,ICM_DECOMPRESSEX_QUERY, (lpbiInput), \ |
2712e787f872
Remove some superfluous casts. Fixes a few compile warnings.
jkeil
parents:
1312
diff
changeset
|
407 (lpbiOutput) \ |
1297 | 408 ) |
409 | |
1 | 410 #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \ |
411 ((long)ICSendMessage( \ | |
412 hic,ICM_DECOMPRESS_GET_FORMAT, (long)(void*)(lpbiInput), \ | |
413 (long)(void*)(lpbiOutput) \ | |
414 )) | |
415 | |
416 #define ICDecompressGetFormatSize(hic, lpbi) \ | |
417 ICDecompressGetFormat(hic, lpbi, NULL) | |
418 | |
419 #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \ | |
420 ICSendMessage( \ | |
421 hic, ICM_DECOMPRESS_GET_PALETTE, (long)(void*)(lpbiInput), \ | |
422 (long)(void*)(lpbiOutput) \ | |
423 ) | |
424 | |
425 #define ICDecompressSetPalette(hic,lpbiPalette) \ | |
426 ICSendMessage( \ | |
427 hic,ICM_DECOMPRESS_SET_PALETTE, \ | |
428 (long)(void*)(lpbiPalette),0 \ | |
429 ) | |
430 | |
431 #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0) | |
7678
693a19e1c98e
VfwEx uninit crash fixed, bugreport by Wolfgang Thiess <wollet1@gmx.net>
arpi
parents:
7386
diff
changeset
|
432 #define ICDecompressEndEx(hic) ICSendMessage(hic,ICM_DECOMPRESSEX_END, 0, 0) |
1 | 433 |
434 #define ICDRAW_QUERY 0x00000001L /* test for support */ | |
435 #define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */ | |
436 #define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */ | |
437 | |
438 | |
439 WIN_BOOL VFWAPI ICInfo(long fccType, long fccHandler, ICINFO * lpicinfo); | |
440 LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, long cb); | |
441 HIC VFWAPI ICOpen(long fccType, long fccHandler, UINT wMode); | |
7386 | 442 //HIC VFWAPI ICOpenFunction(long fccType, long fccHandler, unsigned int wMode, void* lpfnHandler); |
1 | 443 |
444 LRESULT VFWAPI ICClose(HIC hic); | |
445 LRESULT VFWAPI ICSendMessage(HIC hic, unsigned int msg, long dw1, long dw2); | |
7386 | 446 //HIC VFWAPI ICLocate(long fccType, long fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, short wFlags); |
1 | 447 |
1307
d8c1b0b38edc
Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents:
1297
diff
changeset
|
448 int VFWAPI ICDoSomething(void); |
1 | 449 |
450 long VFWAPIV ICDrawBegin( | |
451 HIC hic, | |
452 long dwFlags,/* flags */ | |
453 HPALETTE hpal, /* palette to draw with */ | |
454 HWND hwnd, /* window to draw to */ | |
455 HDC hdc, /* HDC to draw to */ | |
456 INT xDst, /* destination rectangle */ | |
457 INT yDst, | |
458 INT dxDst, | |
459 INT dyDst, | |
460 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */ | |
461 INT xSrc, /* source rectangle */ | |
462 INT ySrc, | |
463 INT dxSrc, | |
464 INT dySrc, | |
465 long dwRate, /* frames/second = (dwRate/dwScale) */ | |
466 long dwScale | |
467 ); | |
468 | |
469 /* as passed to ICM_DRAW_BEGIN (FIXME: correct only for Win32?) */ | |
470 typedef struct { | |
471 long dwFlags; | |
472 HPALETTE hpal; | |
473 HWND hwnd; | |
474 HDC hdc; | |
475 INT xDst; | |
476 INT yDst; | |
477 INT dxDst; | |
478 INT dyDst; | |
479 LPBITMAPINFOHEADER lpbi; | |
480 INT xSrc; | |
481 INT ySrc; | |
482 INT dxSrc; | |
483 INT dySrc; | |
484 long dwRate; | |
485 long dwScale; | |
486 } ICDRAWBEGIN; | |
487 | |
488 #define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */ | |
489 #define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */ | |
490 #define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */ | |
491 #define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */ | |
492 #define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */ | |
493 | |
494 typedef struct { | |
495 long dwFlags; | |
496 void* lpFormat; | |
497 void* lpData; | |
498 long cbData; | |
499 long lTime; | |
500 } ICDRAW; | |
501 | |
502 long VFWAPIV ICDraw(HIC hic,long dwFlags,void* lpFormat,void* lpData,long cbData,long lTime); | |
503 | |
504 | |
505 #define AVIGETFRAMEF_BESTDISPLAYFMT 1 | |
506 | |
507 typedef struct _AVISTREAMINFOA { | |
508 long fccType; | |
509 long fccHandler; | |
510 long dwFlags; /* AVIIF_* */ | |
511 long dwCaps; | |
512 short wPriority; | |
513 short wLanguage; | |
514 long dwScale; | |
515 long dwRate; /* dwRate / dwScale == samples/second */ | |
516 long dwStart; | |
517 long dwLength; /* In units above... */ | |
518 long dwInitialFrames; | |
519 long dwSuggestedBufferSize; | |
520 long dwQuality; | |
521 long dwSampleSize; | |
522 RECT rcFrame; | |
523 long dwEditCount; | |
524 long dwFormatChangeCount; | |
525 char szName[64]; | |
526 } AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA; | |
527 | |
528 typedef struct _AVISTREAMINFOW { | |
529 long fccType; | |
530 long fccHandler; | |
531 long dwFlags; | |
532 long dwCaps; | |
533 short wPriority; | |
534 short wLanguage; | |
535 long dwScale; | |
536 long dwRate; /* dwRate / dwScale == samples/second */ | |
537 long dwStart; | |
538 long dwLength; /* In units above... */ | |
539 long dwInitialFrames; | |
540 long dwSuggestedBufferSize; | |
541 long dwQuality; | |
542 long dwSampleSize; | |
543 RECT rcFrame; | |
544 long dwEditCount; | |
545 long dwFormatChangeCount; | |
546 short szName[64]; | |
547 } AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW; | |
548 DECL_WINELIB_TYPE_AW(AVISTREAMINFO) | |
549 DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO) | |
550 DECL_WINELIB_TYPE_AW(PAVISTREAMINFO) | |
551 | |
552 #define AVISTREAMINFO_DISABLED 0x00000001 | |
553 #define AVISTREAMINFO_FORMATCHANGES 0x00010000 | |
554 | |
555 /* AVIFILEINFO.dwFlags */ | |
556 #define AVIFILEINFO_HASINDEX 0x00000010 | |
557 #define AVIFILEINFO_MUSTUSEINDEX 0x00000020 | |
558 #define AVIFILEINFO_ISINTERLEAVED 0x00000100 | |
559 #define AVIFILEINFO_WASCAPTUREFILE 0x00010000 | |
560 #define AVIFILEINFO_COPYRIGHTED 0x00020000 | |
561 | |
562 /* AVIFILEINFO.dwCaps */ | |
563 #define AVIFILECAPS_CANREAD 0x00000001 | |
564 #define AVIFILECAPS_CANWRITE 0x00000002 | |
565 #define AVIFILECAPS_ALLKEYFRAMES 0x00000010 | |
566 #define AVIFILECAPS_NOCOMPRESSION 0x00000020 | |
567 | |
568 typedef struct _AVIFILEINFOW { | |
569 long dwMaxBytesPerSec; | |
570 long dwFlags; | |
571 long dwCaps; | |
572 long dwStreams; | |
573 long dwSuggestedBufferSize; | |
574 long dwWidth; | |
575 long dwHeight; | |
576 long dwScale; | |
577 long dwRate; | |
578 long dwLength; | |
579 long dwEditCount; | |
580 short szFileType[64]; | |
581 } AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW; | |
582 | |
583 typedef struct _AVIFILEINFOA { | |
584 long dwMaxBytesPerSec; | |
585 long dwFlags; | |
586 long dwCaps; | |
587 long dwStreams; | |
588 long dwSuggestedBufferSize; | |
589 long dwWidth; | |
590 long dwHeight; | |
591 long dwScale; | |
592 long dwRate; | |
593 long dwLength; | |
594 long dwEditCount; | |
595 char szFileType[64]; | |
596 } AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA; | |
597 | |
598 DECL_WINELIB_TYPE_AW(AVIFILEINFO) | |
599 DECL_WINELIB_TYPE_AW(PAVIFILEINFO) | |
600 DECL_WINELIB_TYPE_AW(LPAVIFILEINFO) | |
601 | |
602 /* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */ | |
603 #define AVICOMPRESSF_INTERLEAVE 0x00000001 | |
604 #define AVICOMPRESSF_DATARATE 0x00000002 | |
605 #define AVICOMPRESSF_KEYFRAMES 0x00000004 | |
606 #define AVICOMPRESSF_VALID 0x00000008 | |
607 | |
608 typedef struct { | |
609 long fccType; /* stream type, for consistency */ | |
610 long fccHandler; /* compressor */ | |
611 long dwKeyFrameEvery; /* keyframe rate */ | |
612 long dwQuality; /* compress quality 0-10,000 */ | |
613 long dwBytesPerSecond; /* unsigned chars per second */ | |
614 long dwFlags; /* flags... see below */ | |
615 void* lpFormat; /* save format */ | |
616 long cbFormat; | |
617 void* lpParms; /* compressor options */ | |
618 long cbParms; | |
619 long dwInterleaveEvery; /* for non-video streams only */ | |
620 } AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS; | |
621 | |
622 | |
623 | |
624 typedef struct { | |
625 long cbSize; // set to sizeof(COMPVARS) before | |
626 // calling ICCompressorChoose | |
627 long dwFlags; // see below... | |
628 HIC hic; // HIC of chosen compressor | |
629 long fccType; // basically ICTYPE_VIDEO | |
630 long fccHandler; // handler of chosen compressor or | |
631 // "" or "DIB " | |
632 LPBITMAPINFO lpbiIn; // input format | |
633 LPBITMAPINFO lpbiOut; // output format - will compress to this | |
634 void* lpBitsOut; | |
635 void* lpBitsPrev; | |
636 long lFrame; | |
637 long lKey; // key frames how often? | |
638 long lDataRate; // desired data rate KB/Sec | |
639 long lQ; // desired quality | |
640 long lKeyCount; | |
641 void* lpState; // state of compressor | |
642 long cbState; // size of the state | |
643 } COMPVARS, *PCOMPVARS; | |
644 | |
645 // FLAGS for dwFlags element of COMPVARS structure: | |
646 | |
647 | |
648 #define AVIERR_OK 0 | |
649 #define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error) | |
650 | |
651 #define AVIERR_UNSUPPORTED MAKE_AVIERR(101) | |
652 #define AVIERR_BADFORMAT MAKE_AVIERR(102) | |
653 #define AVIERR_MEMORY MAKE_AVIERR(103) | |
654 #define AVIERR_INTERNAL MAKE_AVIERR(104) | |
655 #define AVIERR_BADFLAGS MAKE_AVIERR(105) | |
656 #define AVIERR_BADPARAM MAKE_AVIERR(106) | |
657 #define AVIERR_BADSIZE MAKE_AVIERR(107) | |
658 #define AVIERR_BADHANDLE MAKE_AVIERR(108) | |
659 #define AVIERR_FILEREAD MAKE_AVIERR(109) | |
660 #define AVIERR_FILEWRITE MAKE_AVIERR(110) | |
661 #define AVIERR_FILEOPEN MAKE_AVIERR(111) | |
662 #define AVIERR_COMPRESSOR MAKE_AVIERR(112) | |
663 #define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113) | |
664 #define AVIERR_READONLY MAKE_AVIERR(114) | |
665 #define AVIERR_NODATA MAKE_AVIERR(115) | |
666 #define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116) | |
667 #define AVIERR_CANTCOMPRESS MAKE_AVIERR(117) | |
668 #define AVIERR_USERABORT MAKE_AVIERR(198) | |
669 #define AVIERR_ERROR MAKE_AVIERR(199) | |
670 | |
671 #ifdef __cplusplus | |
672 } | |
673 #endif | |
674 #endif /* __WINE_VFW_H */ |