Added a few missing imports.
[wine/hacks.git] / include / vfw.h
blobf6554e11641e506de5cb7c1c17205e462aeaa875
1 #ifndef __WINE_VFW_H
2 #define __WINE_VFW_H
4 #include "windef.h"
5 #include "mmsystem.h"
6 #include "wingdi.h"
7 #include "unknwn.h"
9 #define VFWAPI WINAPI
10 #define VFWAPIV WINAPIV
12 #ifdef __cplusplus
13 extern "C" {
14 #endif /* __cplusplus */
16 typedef HANDLE16 HDRAWDIB16;
17 typedef HANDLE HDRAWDIB;
19 HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCSTR szFile);
20 HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCWSTR szFile);
21 #define MCIWndCreate WINELIB_NAME_AW(MCIWndCreate)
22 DWORD VFWAPI VideoForWindowsVersion(void);
23 LONG VFWAPI InitVFW(void);
24 LONG VFWAPI TermVFW(void);
26 #ifndef mmioFOURCC
27 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
28 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
29 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
30 #endif
32 #ifndef aviTWOCC
33 #define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
34 #endif
36 #define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
37 #define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
39 /*****************************************************************************
40 * Predeclare the interfaces
42 typedef struct IAVIStream IAVIStream,*PAVISTREAM;
43 typedef struct IAVIFile IAVIFile,*PAVIFILE;
44 typedef struct IGetFrame IGetFrame,*PGETFRAME;
46 /* Installable Compressor Manager */
48 DECLARE_HANDLE(HIC);
50 #ifdef __WINE__
51 /* HIC struct (same layout as Win95 one) */
52 typedef struct tagWINE_HIC {
53 DWORD magic; /* 00: 'Smag' */
54 HANDLE curthread; /* 04: */
55 DWORD type; /* 08: */
56 DWORD handler; /* 0C: */
57 HDRVR hdrv; /* 10: */
58 DWORD private; /* 14:(handled by SendDriverMessage)*/
59 FARPROC driverproc; /* 18:(handled by SendDriverMessage)*/
60 DWORD x1; /* 1c: name? */
61 WORD x2; /* 20: */
62 DWORD x3; /* 22: */
63 /* 26: */
64 } WINE_HIC;
65 #endif
67 /* error return codes */
68 #define ICERR_OK 0
69 #define ICERR_DONTDRAW 1
70 #define ICERR_NEWPALETTE 2
71 #define ICERR_GOTOKEYFRAME 3
72 #define ICERR_STOPDRAWING 4
74 #define ICERR_UNSUPPORTED -1
75 #define ICERR_BADFORMAT -2
76 #define ICERR_MEMORY -3
77 #define ICERR_INTERNAL -4
78 #define ICERR_BADFLAGS -5
79 #define ICERR_BADPARAM -6
80 #define ICERR_BADSIZE -7
81 #define ICERR_BADHANDLE -8
82 #define ICERR_CANTUPDATE -9
83 #define ICERR_ABORT -10
84 #define ICERR_ERROR -100
85 #define ICERR_BADBITDEPTH -200
86 #define ICERR_BADIMAGESIZE -201
88 #define ICERR_CUSTOM -400
90 /* ICM Messages */
91 #define ICM_USER (DRV_USER+0x0000)
93 /* ICM driver message range */
94 #define ICM_RESERVED_LOW (DRV_USER+0x1000)
95 #define ICM_RESERVED_HIGH (DRV_USER+0x2000)
96 #define ICM_RESERVED ICM_RESERVED_LOW
98 #define ICM_GETSTATE (ICM_RESERVED+0)
99 #define ICM_SETSTATE (ICM_RESERVED+1)
100 #define ICM_GETINFO (ICM_RESERVED+2)
102 #define ICM_CONFIGURE (ICM_RESERVED+10)
103 #define ICM_ABOUT (ICM_RESERVED+11)
104 /* */
106 #define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30)
107 #define ICM_GETQUALITY (ICM_RESERVED+31)
108 #define ICM_SETQUALITY (ICM_RESERVED+32)
110 #define ICM_SET (ICM_RESERVED+40)
111 #define ICM_GET (ICM_RESERVED+41)
113 /* 2 constant FOURCC codes */
114 #define ICM_FRAMERATE mmioFOURCC('F','r','m','R')
115 #define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R')
117 #define ICM_COMPRESS_GET_FORMAT (ICM_USER+4)
118 #define ICM_COMPRESS_GET_SIZE (ICM_USER+5)
119 #define ICM_COMPRESS_QUERY (ICM_USER+6)
120 #define ICM_COMPRESS_BEGIN (ICM_USER+7)
121 #define ICM_COMPRESS (ICM_USER+8)
122 #define ICM_COMPRESS_END (ICM_USER+9)
124 #define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10)
125 #define ICM_DECOMPRESS_QUERY (ICM_USER+11)
126 #define ICM_DECOMPRESS_BEGIN (ICM_USER+12)
127 #define ICM_DECOMPRESS (ICM_USER+13)
128 #define ICM_DECOMPRESS_END (ICM_USER+14)
129 #define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29)
130 #define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30)
132 #define ICM_DRAW_QUERY (ICM_USER+31)
133 #define ICM_DRAW_BEGIN (ICM_USER+15)
134 #define ICM_DRAW_GET_PALETTE (ICM_USER+16)
135 #define ICM_DRAW_START (ICM_USER+18)
136 #define ICM_DRAW_STOP (ICM_USER+19)
137 #define ICM_DRAW_END (ICM_USER+21)
138 #define ICM_DRAW_GETTIME (ICM_USER+32)
139 #define ICM_DRAW (ICM_USER+33)
140 #define ICM_DRAW_WINDOW (ICM_USER+34)
141 #define ICM_DRAW_SETTIME (ICM_USER+35)
142 #define ICM_DRAW_REALIZE (ICM_USER+36)
143 #define ICM_DRAW_FLUSH (ICM_USER+37)
144 #define ICM_DRAW_RENDERBUFFER (ICM_USER+38)
146 #define ICM_DRAW_START_PLAY (ICM_USER+39)
147 #define ICM_DRAW_STOP_PLAY (ICM_USER+40)
149 #define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50)
150 #define ICM_DRAW_CHANGEPALETTE (ICM_USER+51)
152 #define ICM_GETBUFFERSWANTED (ICM_USER+41)
154 #define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42)
156 #define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60)
157 #define ICM_DECOMPRESSEX_QUERY (ICM_USER+61)
158 #define ICM_DECOMPRESSEX (ICM_USER+62)
159 #define ICM_DECOMPRESSEX_END (ICM_USER+63)
161 #define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70)
162 #define ICM_SET_STATUS_PROC (ICM_USER+72)
164 /* structs */
166 /* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway
167 * have not been changed. If a structure is later extended, you may need to create
168 * two versions of it.
171 typedef struct {
172 DWORD dwSize; /* 00: size */
173 DWORD fccType; /* 04: type 'vidc' usually */
174 DWORD fccHandler; /* 08: */
175 DWORD dwVersion; /* 0c: version of compman opening you */
176 DWORD dwFlags; /* 10: LOWORD is type specific */
177 LRESULT dwError; /* 14: */
178 LPVOID pV1Reserved; /* 18: */
179 LPVOID pV2Reserved; /* 1c: */
180 DWORD dnDevNode; /* 20: */
181 /* 24: */
182 } ICOPEN,*LPICOPEN;
184 #define ICCOMPRESS_KEYFRAME 0x00000001L
186 typedef struct {
187 DWORD dwFlags;
188 LPBITMAPINFOHEADER lpbiOutput;
189 LPVOID lpOutput;
190 LPBITMAPINFOHEADER lpbiInput;
191 LPVOID lpInput;
192 LPDWORD lpckid;
193 LPDWORD lpdwFlags;
194 LONG lFrameNum;
195 DWORD dwFrameSize;
196 DWORD dwQuality;
197 LPBITMAPINFOHEADER lpbiPrev;
198 LPVOID lpPrev;
199 } ICCOMPRESS;
201 DWORD VFWAPIV ICCompress(
202 HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
203 LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
204 LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
205 LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev
208 #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
209 ICSendMessage( \
210 hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput), \
211 (DWORD)(LPVOID)(lpbiOutput) \
214 #define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
216 #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
217 ICSendMessage( \
218 hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
219 (DWORD)(LPVOID)(lpbiOutput) \
222 #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
223 ICSendMessage( \
224 hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \
225 (DWORD)(LPVOID)(lpbiOutput) \
228 #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
229 ICSendMessage( \
230 hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
231 (DWORD)(LPVOID)(lpbiOutput) \
234 #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
236 /* ICCOMPRESSFRAMES.dwFlags */
237 #define ICCOMPRESSFRAMES_PADDING 0x00000001
238 typedef struct {
239 DWORD dwFlags;
240 LPBITMAPINFOHEADER lpbiOutput;
241 LPARAM lOutput;
242 LPBITMAPINFOHEADER lpbiInput;
243 LPARAM lInput;
244 LONG lStartFrame;
245 LONG lFrameCount;
246 LONG lQuality;
247 LONG lDataRate;
248 LONG lKeyRate;
249 DWORD dwRate;
250 DWORD dwScale;
251 DWORD dwOverheadPerFrame;
252 DWORD dwReserved2;
253 LONG CALLBACK (*GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len);
254 LONG CALLBACK (*PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len);
255 } ICCOMPRESSFRAMES;
257 typedef struct {
258 DWORD dwFlags;
259 LPARAM lParam;
260 /* messages for Status callback */
261 #define ICSTATUS_START 0
262 #define ICSTATUS_STATUS 1
263 #define ICSTATUS_END 2
264 #define ICSTATUS_ERROR 3
265 #define ICSTATUS_YIELD 4
266 /* FIXME: some X11 libs define Status as int... */
267 /* LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l); */
268 LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l);
269 } ICSETSTATUSPROC;
271 /* Values for wMode of ICOpen() */
272 #define ICMODE_COMPRESS 1
273 #define ICMODE_DECOMPRESS 2
274 #define ICMODE_FASTDECOMPRESS 3
275 #define ICMODE_QUERY 4
276 #define ICMODE_FASTCOMPRESS 5
277 #define ICMODE_DRAW 8
279 /* quality flags */
280 #define ICQUALITY_LOW 0
281 #define ICQUALITY_HIGH 10000
282 #define ICQUALITY_DEFAULT -1
284 typedef struct {
285 DWORD dwSize; /* 00: */
286 DWORD fccType; /* 04:compressor type 'vidc' 'audc' */
287 DWORD fccHandler; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
288 DWORD dwFlags; /* 0c:flags LOWORD is type specific */
289 DWORD dwVersion; /* 10:version of the driver */
290 DWORD dwVersionICM; /* 14:version of the ICM used */
292 * under Win32, the driver always returns UNICODE strings.
294 WCHAR szName[16]; /* 18:short name */
295 WCHAR szDescription[128]; /* 38:long name */
296 WCHAR szDriver[128]; /* 138:driver that contains compressor*/
297 /* 238: */
298 } ICINFO;
300 #include "pshpack1.h"
302 typedef struct {
303 DWORD dwSize;
304 DWORD fccType;
305 DWORD fccHandler;
306 DWORD dwFlags;
307 DWORD dwVersion;
308 DWORD dwVersionICM;
310 * under Win16, normal chars are used
312 CHAR szName[16];
313 CHAR szDescription[128];
314 CHAR szDriver[128];
315 } ICINFO16;
317 #include "poppack.h"
319 /* ICINFO.dwFlags */
320 #define VIDCF_QUALITY 0x0001 /* supports quality */
321 #define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */
322 #define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */
323 #define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */
324 #define VIDCF_DRAW 0x0010 /* supports drawing */
325 #define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */
326 #define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */
327 #define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */
329 #define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
332 /* function shortcuts */
333 /* ICM_ABOUT */
334 #define ICMF_ABOUT_QUERY 0x00000001
336 #define ICQueryAbout(hic) \
337 (ICSendMessage(hic,ICM_ABOUT,(DWORD)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
339 #define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD)(UINT)(hwnd),0)
341 /* ICM_CONFIGURE */
342 #define ICMF_CONFIGURE_QUERY 0x00000001
343 #define ICQueryConfigure(hic) \
344 (ICSendMessage(hic,ICM_CONFIGURE,(DWORD)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
346 #define ICConfigure(hic,hwnd) \
347 ICSendMessage(hic,ICM_CONFIGURE,(DWORD)(UINT)(hwnd),0)
349 /* Decompression stuff */
350 #define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */
351 #define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */
352 #define ICDECOMPRESS_PREROLL 0x20000000 /* this frame is before real start */
353 #define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */
354 #define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */
356 typedef struct {
357 DWORD dwFlags; /* flags (from AVI index...) */
358 LPBITMAPINFOHEADER lpbiInput; /* BITMAPINFO of compressed data */
359 LPVOID lpInput; /* compressed data */
360 LPBITMAPINFOHEADER lpbiOutput; /* DIB to decompress to */
361 LPVOID lpOutput;
362 DWORD ckid; /* ckid from AVI file */
363 } ICDECOMPRESS;
365 typedef struct {
366 DWORD dwFlags;
367 LPBITMAPINFOHEADER lpbiSrc;
368 LPVOID lpSrc;
369 LPBITMAPINFOHEADER lpbiDst;
370 LPVOID lpDst;
372 /* changed for ICM_DECOMPRESSEX */
373 INT xDst; /* destination rectangle */
374 INT yDst;
375 INT dxDst;
376 INT dyDst;
378 INT xSrc; /* source rectangle */
379 INT ySrc;
380 INT dxSrc;
381 INT dySrc;
382 } ICDECOMPRESSEX;
384 #include "pshpack1.h"
386 typedef struct {
387 DWORD dwFlags;
388 LPBITMAPINFOHEADER lpbiSrc;
389 LPVOID lpSrc;
390 LPBITMAPINFOHEADER lpbiDst;
391 LPVOID lpDst;
393 INT16 xDst; /* destination rectangle */
394 INT16 yDst;
395 INT16 dxDst;
396 INT16 dyDst;
398 INT16 xSrc; /* source rectangle */
399 INT16 ySrc;
400 INT16 dxSrc;
401 INT16 dySrc;
402 } ICDECOMPRESSEX16;
404 #include "poppack.h"
406 DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits);
408 #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
409 ICSendMessage( \
410 hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
411 (DWORD)(LPVOID)(lpbiOutput) \
414 #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
415 ICSendMessage( \
416 hic,ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
417 (DWORD) (LPVOID)(lpbiOutput) \
420 #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
421 ((LONG)ICSendMessage( \
422 hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), \
423 (DWORD)(LPVOID)(lpbiOutput) \
426 #define ICDecompressGetFormatSize(hic, lpbi) \
427 ICDecompressGetFormat(hic, lpbi, NULL)
429 #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
430 ICSendMessage( \
431 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), \
432 (DWORD)(LPVOID)(lpbiOutput) \
435 #define ICDecompressSetPalette(hic,lpbiPalette) \
436 ICSendMessage( \
437 hic,ICM_DECOMPRESS_SET_PALETTE, \
438 (DWORD)(LPVOID)(lpbiPalette),0 \
441 #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
443 LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
444 LRESULT VFWAPI ICSendMessage16(HIC16 hic, UINT16 msg, DWORD dw1, DWORD dw2);
446 static LRESULT VFWAPI inline ICDecompressEx(HIC hic, DWORD dwFlags,
447 LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc,
448 int xSrc, int ySrc, int dxSrc, int dySrc,
449 LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst,
450 int xDst, int yDst, int dxDst, int dyDst)
452 ICDECOMPRESSEX ic;
454 ic.dwFlags = dwFlags;
455 ic.lpbiSrc = lpbiSrc;
456 ic.lpSrc = lpSrc;
457 ic.xSrc = xSrc;
458 ic.ySrc = ySrc;
459 ic.dxSrc = dxSrc;
460 ic.dySrc = dySrc;
461 ic.lpbiDst = lpbiDst;
462 ic.lpDst = lpDst;
463 ic.xDst = xDst;
464 ic.yDst = yDst;
465 ic.dxDst = dxDst;
466 ic.dyDst = dyDst;
467 return ICSendMessage(hic, ICM_DECOMPRESSEX, (DWORD)&ic, sizeof(ic));
470 static LRESULT VFWAPI inline ICDecompressExBegin(HIC hic, DWORD dwFlags,
471 LPBITMAPINFOHEADER lpbiSrc,
472 LPVOID lpSrc,
473 int xSrc, int ySrc, int dxSrc, int dySrc,
474 LPBITMAPINFOHEADER lpbiDst,
475 LPVOID lpDst,
476 int xDst,
477 int yDst,
478 int dxDst,
479 int dyDst)
481 ICDECOMPRESSEX ic;
483 ic.dwFlags = dwFlags;
484 ic.lpbiSrc = lpbiSrc;
485 ic.lpSrc = lpSrc;
486 ic.xSrc = xSrc;
487 ic.ySrc = ySrc;
488 ic.dxSrc = dxSrc;
489 ic.dySrc = dySrc;
490 ic.lpbiDst = lpbiDst;
491 ic.lpDst = lpDst;
492 ic.xDst = xDst;
493 ic.yDst = yDst;
494 ic.dxDst = dxDst;
495 ic.dyDst = dyDst;
496 return ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, (DWORD)&ic, sizeof(ic));
498 static LRESULT VFWAPI inline ICDecompressExQuery(HIC hic, DWORD dwFlags,
499 LPBITMAPINFOHEADER lpbiSrc,
500 LPVOID lpSrc,
501 int xSrc, int ySrc, int dxSrc, int dySrc,
502 LPBITMAPINFOHEADER lpbiDst,
503 LPVOID lpDst,
504 int xDst,
505 int yDst,
506 int dxDst,
507 int dyDst)
509 ICDECOMPRESSEX ic;
511 ic.dwFlags = dwFlags;
512 ic.lpbiSrc = lpbiSrc;
513 ic.lpSrc = lpSrc;
514 ic.xSrc = xSrc;
515 ic.ySrc = ySrc;
516 ic.dxSrc = dxSrc;
517 ic.dySrc = dySrc;
518 ic.lpbiDst = lpbiDst;
519 ic.lpDst = lpDst;
520 ic.xDst = xDst;
521 ic.yDst = yDst;
522 ic.dxDst = dxDst;
523 ic.dyDst = dyDst;
524 return ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, (DWORD)&ic, sizeof(ic));
527 #define ICDecompressExEnd(hic) \
528 ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
530 #define ICDRAW_QUERY 0x00000001L /* test for support */
531 #define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
532 #define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
533 #define ICDRAW_ANIMATE 0x00000008L /* expect palette animation */
534 #define ICDRAW_CONTINUE 0x00000010L /* draw is a continuation of previous draw */
535 #define ICDRAW_MEMORYDC 0x00000020L /* DC is offscreen, by the way */
536 #define ICDRAW_UPDATING 0x00000040L /* We're updating, as opposed to playing */
537 #define ICDRAW_RENDER 0x00000080L /* used to render data not draw it */
538 #define ICDRAW_BUFFER 0x00000100L /* buffer data offscreen, we will need to update it */
540 #define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \
541 ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS)
543 #define ICDrawOpen(fccType, fccHandler, lpbiIn) \
544 ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW)
546 HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
547 LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality,
548 LONG* plSize);
550 HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
551 LPVOID lpBits, LPBITMAPINFO lpbiOut);
553 BOOL VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
554 BOOL VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags);
555 BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags);
556 LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb);
557 HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
558 HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHangler, UINT16 wMode);
559 HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler);
561 LRESULT VFWAPI ICClose(HIC hic);
562 HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
563 HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
564 HIC VFWAPI ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy);
566 /* Values for wFlags of ICInstall() */
567 #define ICINSTALL_UNICODE 0x8000
568 #define ICINSTALL_FUNCTION 0x0001
569 #define ICINSTALL_DRIVER 0x0002
570 #define ICINSTALL_HDRV 0x0004
571 #define ICINSTALL_DRIVERW 0x8002
573 #define ICGetState(hic, pv, cb) \
574 ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
575 #define ICSetState(hic, pv, cb) \
576 ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
577 #define ICGetStateSize(hic) \
578 ICGetState(hic, NULL, 0)
580 static DWORD inline ICGetDefaultQuality(HIC hic)
582 DWORD dwICValue;
583 ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD));
584 return dwICValue;
587 static DWORD inline ICGetDefaultKeyFrameRate(HIC hic)
589 DWORD dwICValue;
590 ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD));
591 return dwICValue;
594 #define ICDrawWindow(hic, prc) \
595 ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT))
597 /* As passed to ICM_DRAW_SUGGESTFORMAT */
598 typedef struct {
599 DWORD dwFlags;
600 LPBITMAPINFOHEADER lpbiIn;
601 LPBITMAPINFOHEADER lpbiSuggest;
602 INT dxSrc;
603 INT dySrc;
604 INT dxDst;
605 INT dyDst;
606 HIC hicDecompressor;
607 } ICDRAWSUGGEST;
609 typedef struct {
610 DWORD dwFlags;
611 LPBITMAPINFOHEADER lpbiIn;
612 LPBITMAPINFOHEADER lpbiSuggest;
613 INT16 dxSrc;
614 INT16 dySrc;
615 INT16 dxDst;
616 INT16 dyDst;
617 HIC16 hicDecompressor;
618 } ICDRAWSUGGEST16;
620 typedef struct {
621 DWORD dwFlags;
622 int iStart;
623 int iLen;
624 LPPALETTEENTRY lppe;
625 } ICPALETTE;
627 DWORD VFWAPIV ICDrawBegin(
628 HIC hic,
629 DWORD dwFlags,/* flags */
630 HPALETTE hpal, /* palette to draw with */
631 HWND hwnd, /* window to draw to */
632 HDC hdc, /* HDC to draw to */
633 INT xDst, /* destination rectangle */
634 INT yDst,
635 INT dxDst,
636 INT dyDst,
637 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
638 INT xSrc, /* source rectangle */
639 INT ySrc,
640 INT dxSrc,
641 INT dySrc,
642 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
643 DWORD dwScale
646 DWORD VFWAPIV ICDrawBegin16(
647 HIC16 hic,
648 DWORD dwFlags,/* flags */
649 HPALETTE16 hpal, /* palette to draw with */
650 HWND16 hwnd, /* window to draw to */
651 HDC16 hdc, /* HDC to draw to */
652 INT16 xDst, /* destination rectangle */
653 INT16 yDst,
654 INT16 dxDst,
655 INT16 dyDst,
656 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
657 INT16 xSrc, /* source rectangle */
658 INT16 ySrc,
659 INT16 dxSrc,
660 INT16 dySrc,
661 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
662 DWORD dwScale
665 /* as passed to ICM_DRAW_BEGIN */
666 typedef struct {
667 DWORD dwFlags;
668 HPALETTE hpal;
669 HWND hwnd;
670 HDC hdc;
671 INT xDst;
672 INT yDst;
673 INT dxDst;
674 INT dyDst;
675 LPBITMAPINFOHEADER lpbi;
676 INT xSrc;
677 INT ySrc;
678 INT dxSrc;
679 INT dySrc;
680 DWORD dwRate;
681 DWORD dwScale;
682 } ICDRAWBEGIN;
684 #include "pshpack1.h"
686 typedef struct {
687 DWORD dwFlags;
688 HPALETTE16 hpal;
689 HWND16 hwnd;
690 HDC16 hdc;
691 INT16 xDst;
692 INT16 yDst;
693 INT16 dxDst;
694 INT16 dyDst;
695 LPBITMAPINFOHEADER lpbi;
696 INT16 xSrc;
697 INT16 ySrc;
698 INT16 dxSrc;
699 INT16 dySrc;
700 DWORD dwRate;
701 DWORD dwScale;
702 } ICDRAWBEGIN16;
704 #include "poppack.h"
706 #define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */
707 #define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */
708 #define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */
709 #define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */
710 #define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */
712 typedef struct {
713 DWORD dwFlags;
714 LPVOID lpFormat;
715 LPVOID lpData;
716 DWORD cbData;
717 LONG lTime;
718 } ICDRAW;
720 DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime);
722 static LRESULT VFWAPI inline ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn,
723 LPBITMAPINFOHEADER lpbiOut,
724 int dxSrc, int dySrc,
725 int dxDst, int dyDst,
726 HIC hicDecomp)
728 ICDRAWSUGGEST ic;
730 ic.lpbiIn = lpbiIn;
731 ic.lpbiSuggest = lpbiOut;
732 ic.dxSrc = dxSrc;
733 ic.dySrc = dySrc;
734 ic.dxDst = dxDst;
735 ic.dyDst = dyDst;
736 ic.hicDecompressor = hicDecomp;
737 return ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, (DWORD)&ic, sizeof(ic));
740 #define ICDrawQuery(hic, lpbiInput) \
741 ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L)
743 #define ICDrawChangePalette(hic, lpbiInput) \
744 ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L)
746 #define ICGetBuffersWanted(hic, lpdwBuffers) \
747 ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0)
749 #define ICDrawEnd(hic) \
750 ICSendMessage(hic, ICM_DRAW_END, 0, 0)
752 #define ICDrawStart(hic) \
753 ICSendMessage(hic, ICM_DRAW_START, 0, 0)
755 #define ICDrawStartPlay(hic, lFrom, lTo) \
756 ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo))
758 #define ICDrawStop(hic) \
759 ICSendMessage(hic, ICM_DRAW_STOP, 0, 0)
761 #define ICDrawStopPlay(hic) \
762 ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0)
764 #define ICDrawGetTime(hic, lplTime) \
765 ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0)
767 #define ICDrawSetTime(hic, lTime) \
768 ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0)
770 #define ICDrawRealize(hic, hdc, fBackground) \
771 ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground))
773 #define ICDrawFlush(hic) \
774 ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0)
776 #define ICDrawRenderBuffer(hic) \
777 ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0)
779 static LRESULT VFWAPI inline ICSetStatusProc(HIC hic, DWORD dwFlags, LRESULT lParam,
780 LONG (CALLBACK *fpfnStatus)(LPARAM, UINT, LONG))
782 ICSETSTATUSPROC ic;
784 ic.dwFlags = dwFlags;
785 ic.lParam = lParam;
786 /* FIXME: see comment in ICSETSTATUSPROC definition */
787 ic.zStatus = fpfnStatus;
789 return ICSendMessage(hic, ICM_SET_STATUS_PROC, (DWORD)&ic, sizeof(ic));
792 typedef struct {
793 LONG cbSize;
794 DWORD dwFlags;
795 HIC hic;
796 DWORD fccType;
797 DWORD fccHandler;
798 LPBITMAPINFO lpbiIn;
799 LPBITMAPINFO lpbiOut;
800 LPVOID lpBitsOut;
801 LPVOID lpBitsPrev;
802 LONG lFrame;
803 LONG lKey;
804 LONG lDataRate;
805 LONG lQ;
806 LONG lKeyCount;
807 LPVOID lpState;
808 LONG cbState;
809 } COMPVARS, *PCOMPVARS;
811 #define ICMF_COMPVARS_VALID 0x00000001
813 BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData,
814 PCOMPVARS pc, LPSTR lpszTitle);
816 #define ICMF_CHOOSE_KEYFRAME 0x0001
817 #define ICMF_CHOOSE_DATARATE 0x0002
818 #define ICMF_CHOOSE_PREVIEW 0x0004
819 #define ICMF_CHOOSE_ALLCOMPRESSORS 0x0008
821 BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn);
822 void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc);
824 LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits,
825 BOOL *pfKey, LONG *plSize);
826 void VFWAPI ICCompressorFree(PCOMPVARS pc);
828 /********************* AVIFILE function declarations *************************/
829 #define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
830 #define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
831 #define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
832 #define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
833 #define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
834 #define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
835 #define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
836 #define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
838 #define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
839 #define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
841 #define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
843 #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
844 #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
845 #define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
846 #define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
848 /* Basic chunk types */
849 #define cktypeDIBbits aviTWOCC('d', 'b')
850 #define cktypeDIBcompressed aviTWOCC('d', 'c')
851 #define cktypePALchange aviTWOCC('p', 'c')
852 #define cktypeWAVEbytes aviTWOCC('w', 'b')
854 /* Chunk id to use for extra chunks for padding. */
855 #define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
857 /* AVIFileHdr.dwFlags */
858 #define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
859 #define AVIF_MUSTUSEINDEX 0x00000020
860 #define AVIF_ISINTERLEAVED 0x00000100
861 #define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames*/
862 #define AVIF_WASCAPTUREFILE 0x00010000
863 #define AVIF_COPYRIGHTED 0x00020000
865 #define AVI_HEADERSIZE 2048
867 typedef struct _MainAVIHeader
869 DWORD dwMicroSecPerFrame;
870 DWORD dwMaxBytesPerSec;
871 DWORD dwPaddingGranularity;
872 DWORD dwFlags;
873 DWORD dwTotalFrames;
874 DWORD dwInitialFrames;
875 DWORD dwStreams;
876 DWORD dwSuggestedBufferSize;
877 DWORD dwWidth;
878 DWORD dwHeight;
879 DWORD dwReserved[4];
880 } MainAVIHeader;
882 /* AVIStreamHeader.dwFlags */
883 #define AVISF_DISABLED 0x00000001
884 #define AVISF_VIDEO_PALCHANGES 0x00010000
886 typedef struct {
887 FOURCC fccType;
888 FOURCC fccHandler;
889 DWORD dwFlags; /* AVISF_* */
890 WORD wPriority;
891 WORD wLanguage;
892 DWORD dwInitialFrames;
893 DWORD dwScale;
894 DWORD dwRate; /* dwRate / dwScale == samples/second */
895 DWORD dwStart;
896 DWORD dwLength; /* In units above... */
897 DWORD dwSuggestedBufferSize;
898 DWORD dwQuality;
899 DWORD dwSampleSize;
900 RECT16 rcFrame; /* word.word - word.word in file */
901 } AVIStreamHeader;
903 /* AVIINDEXENTRY.dwFlags */
904 #define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */
905 #define AVIIF_TWOCC 0x00000002
906 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
908 #define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */
909 #define AVIIF_COMPUSE 0x0FFF0000
911 typedef struct _AVIINDEXENTRY {
912 DWORD ckid;
913 DWORD dwFlags;
914 DWORD dwChunkOffset;
915 DWORD dwChunkLength;
916 } AVIINDEXENTRY;
918 typedef struct _AVIPALCHANGE {
919 BYTE bFirstEntry;
920 BYTE bNumEntries;
921 WORD wFlags; /* pad */
922 PALETTEENTRY peNew[1];
923 } AVIPALCHANGE;
925 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
927 #define AVIGETFRAMEF_BESTDISPLAYFMT 1
929 typedef struct _AVISTREAMINFOA {
930 DWORD fccType;
931 DWORD fccHandler;
932 DWORD dwFlags; /* AVIIF_* */
933 DWORD dwCaps;
934 WORD wPriority;
935 WORD wLanguage;
936 DWORD dwScale;
937 DWORD dwRate; /* dwRate / dwScale == samples/second */
938 DWORD dwStart;
939 DWORD dwLength; /* In units above... */
940 DWORD dwInitialFrames;
941 DWORD dwSuggestedBufferSize;
942 DWORD dwQuality;
943 DWORD dwSampleSize;
944 RECT rcFrame;
945 DWORD dwEditCount;
946 DWORD dwFormatChangeCount;
947 CHAR szName[64];
948 } AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
950 typedef struct _AVISTREAMINFOW {
951 DWORD fccType;
952 DWORD fccHandler;
953 DWORD dwFlags;
954 DWORD dwCaps;
955 WORD wPriority;
956 WORD wLanguage;
957 DWORD dwScale;
958 DWORD dwRate; /* dwRate / dwScale == samples/second */
959 DWORD dwStart;
960 DWORD dwLength; /* In units above... */
961 DWORD dwInitialFrames;
962 DWORD dwSuggestedBufferSize;
963 DWORD dwQuality;
964 DWORD dwSampleSize;
965 RECT rcFrame;
966 DWORD dwEditCount;
967 DWORD dwFormatChangeCount;
968 WCHAR szName[64];
969 } AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
970 DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
971 DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
972 DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
974 #define AVISTREAMINFO_DISABLED 0x00000001
975 #define AVISTREAMINFO_FORMATCHANGES 0x00010000
977 /* AVIFILEINFO.dwFlags */
978 #define AVIFILEINFO_HASINDEX 0x00000010
979 #define AVIFILEINFO_MUSTUSEINDEX 0x00000020
980 #define AVIFILEINFO_ISINTERLEAVED 0x00000100
981 #define AVIFILEINFO_WASCAPTUREFILE 0x00010000
982 #define AVIFILEINFO_COPYRIGHTED 0x00020000
984 /* AVIFILEINFO.dwCaps */
985 #define AVIFILECAPS_CANREAD 0x00000001
986 #define AVIFILECAPS_CANWRITE 0x00000002
987 #define AVIFILECAPS_ALLKEYFRAMES 0x00000010
988 #define AVIFILECAPS_NOCOMPRESSION 0x00000020
990 typedef struct _AVIFILEINFOW {
991 DWORD dwMaxBytesPerSec;
992 DWORD dwFlags;
993 DWORD dwCaps;
994 DWORD dwStreams;
995 DWORD dwSuggestedBufferSize;
996 DWORD dwWidth;
997 DWORD dwHeight;
998 DWORD dwScale;
999 DWORD dwRate;
1000 DWORD dwLength;
1001 DWORD dwEditCount;
1002 WCHAR szFileType[64];
1003 } AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
1004 typedef struct _AVIFILEINFOA {
1005 DWORD dwMaxBytesPerSec;
1006 DWORD dwFlags;
1007 DWORD dwCaps;
1008 DWORD dwStreams;
1009 DWORD dwSuggestedBufferSize;
1010 DWORD dwWidth;
1011 DWORD dwHeight;
1012 DWORD dwScale;
1013 DWORD dwRate;
1014 DWORD dwLength;
1015 DWORD dwEditCount;
1016 CHAR szFileType[64];
1017 } AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
1018 DECL_WINELIB_TYPE_AW(AVIFILEINFO)
1019 DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
1020 DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
1022 /* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
1023 #define AVICOMPRESSF_INTERLEAVE 0x00000001
1024 #define AVICOMPRESSF_DATARATE 0x00000002
1025 #define AVICOMPRESSF_KEYFRAMES 0x00000004
1026 #define AVICOMPRESSF_VALID 0x00000008
1028 typedef struct {
1029 DWORD fccType; /* stream type, for consistency */
1030 DWORD fccHandler; /* compressor */
1031 DWORD dwKeyFrameEvery; /* keyframe rate */
1032 DWORD dwQuality; /* compress quality 0-10,000 */
1033 DWORD dwBytesPerSecond; /* bytes per second */
1034 DWORD dwFlags; /* flags... see below */
1035 LPVOID lpFormat; /* save format */
1036 DWORD cbFormat;
1037 LPVOID lpParms; /* compressor options */
1038 DWORD cbParms;
1039 DWORD dwInterleaveEvery; /* for non-video streams only */
1040 } AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
1044 #define DEFINE_AVIGUID(name, l, w1, w2) \
1045 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
1047 DEFINE_AVIGUID(IID_IAVIFile, 0x00020020, 0, 0);
1048 DEFINE_AVIGUID(IID_IAVIStream, 0x00020021, 0, 0);
1049 DEFINE_AVIGUID(IID_IAVIStreaming, 0x00020022, 0, 0);
1050 DEFINE_AVIGUID(IID_IGetFrame, 0x00020023, 0, 0);
1051 DEFINE_AVIGUID(IID_IAVIEditStream, 0x00020024, 0, 0);
1053 DEFINE_AVIGUID(CLSID_AVIFile, 0x00020000, 0, 0);
1055 /*****************************************************************************
1056 * IAVIStream interface
1058 #define ICOM_INTERFACE IAVIStream
1059 #define IAVIStream_METHODS \
1060 ICOM_METHOD2(HRESULT,Create, LPARAM,lParam1, LPARAM,lParam2) \
1061 ICOM_METHOD2(HRESULT,Info, AVISTREAMINFOW*,psi, LONG,lSize) \
1062 ICOM_METHOD2(LONG, FindSample, LONG,lPos, LONG,lFlags) \
1063 ICOM_METHOD3(HRESULT,ReadFormat, LONG,lPos, LPVOID,lpFormat, LONG*,lpcbFormat) \
1064 ICOM_METHOD3(HRESULT,SetFormat, LONG,lPos, LPVOID,lpFormat, LONG,cbFormat) \
1065 ICOM_METHOD6(HRESULT,Read, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, LONG*,plBytes, LONG*,plSamples) \
1066 ICOM_METHOD7(HRESULT,Write, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, DWORD,dwFlags, LONG*,plSampWritten, LONG*,plBytesWritten) \
1067 ICOM_METHOD2(HRESULT,Delete, LONG,lStart, LONG,lSamples) \
1068 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
1069 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
1070 ICOM_METHOD2(HRESULT,SetInfo, AVISTREAMINFOW*,plInfo, LONG,cbInfo)
1071 #define IAVIStream_IMETHODS \
1072 IUnknown_IMETHODS \
1073 IAVIStream_METHODS
1074 ICOM_DEFINE(IAVIStream, IUnknown)
1075 #undef ICOM_INTERFACE
1077 /*** IUnknown methods ***/
1078 #define IAVIStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1079 #define IAVIStream_AddRef(p) ICOM_CALL (AddRef,p)
1080 #define IAVIStream_Release(p) ICOM_CALL (Release,p)
1081 /*** IAVIStream methods ***/
1082 #define IAVIStream_Create(p,a,b) ICOM_CALL2(Create,p,a,b)
1083 #define IAVIStream_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
1084 #define IAVIStream_FindSample(p,a,b) ICOM_CALL2(FindSample,p,a,b)
1085 #define IAVIStream_ReadFormat(p,a,b,c) ICOM_CALL3(ReadFormat,p,a,b,c)
1086 #define IAVIStream_SetFormat(p,a,b,c) ICOM_CALL3(SetFormat,p,a,b,c)
1087 #define IAVIStream_Read(p,a,b,c,d,e,f) ICOM_CALL6(Read,p,a,b,c,d,e,f)
1088 #define IAVIStream_Write(p,a,b,c,d,e,f,g) ICOM_CALL7(Write,p,a,b,c,d,e,f,g)
1089 #define IAVIStream_Delete(p,a,b) ICOM_CALL2(Delete,p,a,b)
1090 #define IAVIStream_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
1091 #define IAVIStream_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
1092 #define IAVIStream_SetInfo(p,a,b) ICOM_CALL2(SetInfo,p,a,b)
1094 HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler);
1096 HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size);
1097 HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG size);
1098 #define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo)
1099 LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos);
1100 HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg);
1101 PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted);
1102 LONG WINAPI AVIStreamLength(PAVISTREAM iface);
1103 HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
1104 HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread);
1105 HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize);
1106 ULONG WINAPI AVIStreamRelease(PAVISTREAM iface);
1107 HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize);
1108 LONG WINAPI AVIStreamStart(PAVISTREAM iface);
1109 HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
1110 HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size);
1111 HRESULT WINAPI AVIStreamOpenFromFileA(PAVISTREAM *ppavi, LPCSTR szFile,
1112 DWORD fccType, LONG lParam,
1113 UINT mode, CLSID *pclsidHandler);
1114 HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile,
1115 DWORD fccType, LONG lParam,
1116 UINT mode, CLSID *pclsidHandler);
1117 #define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile)
1119 #define AVIStreamFormatSize(pavi, lPos, plSize) \
1120 AVIStreamReadFormat(pavi, lPos, NULL, plSize)
1122 /*****************************************************************************
1123 * IAVIFile interface
1125 /* In Win32 this interface uses UNICODE only */
1126 #define ICOM_INTERFACE IAVIFile
1127 #define IAVIFile_METHODS \
1128 ICOM_METHOD2(HRESULT,Info, AVIFILEINFOW*,pfi, LONG,lSize) \
1129 ICOM_METHOD3(HRESULT,GetStream, PAVISTREAM*,ppStream, DWORD,fccType, LONG,lParam) \
1130 ICOM_METHOD2(HRESULT,CreateStream, PAVISTREAM*,ppStream, AVISTREAMINFOW*,psi) \
1131 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
1132 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
1133 ICOM_METHOD (HRESULT,EndRecord) \
1134 ICOM_METHOD2(HRESULT,DeleteStream, DWORD,fccType, LONG,lParam)
1135 #define IAVIFile_IMETHODS \
1136 IUnknown_IMETHODS \
1137 IAVIFile_METHODS
1138 ICOM_DEFINE(IAVIFile,IUnknown)
1139 #undef ICOM_INTERFACE
1141 /*** IUnknown methods ***/
1142 #define IAVIFile_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1143 #define IAVIFile_AddRef(p) ICOM_CALL (AddRef,p)
1144 #define IAVIFile_Release(p) ICOM_CALL (Release,p)
1145 /*** IAVIFile methods ***/
1146 #define IAVIFile_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
1147 #define IAVIFile_GetStream(p,a,b,c) ICOM_CALL3(GetStream,p,a,b,c)
1148 #define IAVIFile_CreateStream(p,a,b) ICOM_CALL2(CreateStream,p,a,b)
1149 #define IAVIFile_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
1150 #define IAVIFile_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
1151 #define IAVIFile_EndRecord(p) ICOM_CALL (EndRecord,p)
1152 #define IAVIFile_DeleteStream(p,a,b) ICOM_CALL2(DeleteStream,p,a,b)
1154 HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOA* psi);
1155 HRESULT WINAPI AVIFileCreateStreamW(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOW* psi);
1156 #define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream)
1157 void WINAPI AVIFileExit(void);
1158 HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile,PAVISTREAM* avis,DWORD fccType,LONG lParam);
1159 HRESULT WINAPI AVIFileInfoA(PAVIFILE pfile,PAVIFILEINFOA pfi,LONG lSize);
1160 HRESULT WINAPI AVIFileInfoW(PAVIFILE pfile,PAVIFILEINFOW pfi,LONG lSize);
1161 #define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo)
1162 void WINAPI AVIFileInit(void);
1163 HRESULT WINAPI AVIFileOpenA(PAVIFILE* ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler);
1164 HRESULT WINAPI AVIFileOpenW(PAVIFILE* ppfile,LPCWSTR szFile,UINT uMode,LPCLSID lpHandler);
1165 #define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen)
1166 ULONG WINAPI AVIFileRelease(PAVIFILE iface);
1169 /*****************************************************************************
1170 * IGetFrame interface
1172 #define ICOM_INTERFACE IGetFrame
1173 #define IGetFrame_METHODS \
1174 ICOM_METHOD1(LPVOID, GetFrame, LONG,lPos) \
1175 ICOM_METHOD3(HRESULT,Begin, LONG,lStart, LONG,lEnd, LONG,lRate) \
1176 ICOM_METHOD (HRESULT,End) \
1177 ICOM_METHOD6(HRESULT,SetFormat, LPBITMAPINFOHEADER,lpbi, LPVOID,lpBits, INT,x, INT,y, INT,dx, INT,dy)
1178 #define IGetFrame_IMETHODS \
1179 IUnknown_IMETHODS \
1180 IGetFrame_METHODS
1181 ICOM_DEFINE(IGetFrame,IUnknown)
1182 #undef ICOM_INTERFACE
1184 /*** IUnknown methods ***/
1185 #define IGetFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1186 #define IGetFrame_AddRef(p) ICOM_CALL (AddRef,p)
1187 #define IGetFrame_Release(p) ICOM_CALL (Release,p)
1188 /*** IGetFrame methods ***/
1189 #define IGetFrame_GetFrame(p,a) ICOM_CALL1(GetFrame,p,a)
1190 #define IGetFrame_Begin(p,a,b,c) ICOM_CALL3(Begin,p,a,b,c)
1191 #define IGetFrame_End(p) ICOM_CALL (End,p)
1192 #define IGetFrame_SetFormat(p,a,b,c,d,e,f) ICOM_CALL6(SetFormat,p,a,b,c,d,e,f)
1194 #define AVIERR_OK 0
1195 #define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
1197 #define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
1198 #define AVIERR_BADFORMAT MAKE_AVIERR(102)
1199 #define AVIERR_MEMORY MAKE_AVIERR(103)
1200 #define AVIERR_INTERNAL MAKE_AVIERR(104)
1201 #define AVIERR_BADFLAGS MAKE_AVIERR(105)
1202 #define AVIERR_BADPARAM MAKE_AVIERR(106)
1203 #define AVIERR_BADSIZE MAKE_AVIERR(107)
1204 #define AVIERR_BADHANDLE MAKE_AVIERR(108)
1205 #define AVIERR_FILEREAD MAKE_AVIERR(109)
1206 #define AVIERR_FILEWRITE MAKE_AVIERR(110)
1207 #define AVIERR_FILEOPEN MAKE_AVIERR(111)
1208 #define AVIERR_COMPRESSOR MAKE_AVIERR(112)
1209 #define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
1210 #define AVIERR_READONLY MAKE_AVIERR(114)
1211 #define AVIERR_NODATA MAKE_AVIERR(115)
1212 #define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
1213 #define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
1214 #define AVIERR_USERABORT MAKE_AVIERR(198)
1215 #define AVIERR_ERROR MAKE_AVIERR(199)
1217 /********************************************
1218 * DrawDib declarations
1221 HDRAWDIB VFWAPI DrawDibOpen( void );
1222 UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground);
1224 BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst,
1225 LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags);
1227 BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst,
1228 LPBITMAPINFOHEADER lpbi, LPVOID lpBits,
1229 INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags);
1231 /* DrawDibDraw flags */
1233 #define DDF_UPDATE 0x0002
1234 #define DDF_SAME_HDC 0x0004
1235 #define DDF_SAME_DRAW 0x0008
1236 #define DDF_DONTDRAW 0x0010
1237 #define DDF_ANIMATE 0x0020
1238 #define DDF_BUFFER 0x0040
1239 #define DDF_JUSTDRAWIT 0x0080
1240 #define DDF_FULLSCREEN 0x0100
1241 #define DDF_BACKGROUNDPAL 0x0200
1242 #define DDF_NOTKEYFRAME 0x0400
1243 #define DDF_HURRYUP 0x0800
1244 #define DDF_HALFTONE 0x1000
1246 #define DDF_PREROLL DDF_DONTDRAW
1247 #define DDF_SAME_DIB DDF_SAME_DRAW
1248 #define DDF_SAME_SIZE DDF_SAME_DRAW
1250 BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal);
1251 HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd);
1252 BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe);
1253 LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags);
1255 BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate);
1256 BOOL VFWAPI DrawDibStop(HDRAWDIB hdd);
1257 #define DrawDibUpdate(hdd, hdc, x, y) \
1258 DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
1260 BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd);
1261 BOOL VFWAPI DrawDibClose(HDRAWDIB hdd);
1263 /* display profiling */
1264 #define PD_CAN_DRAW_DIB 0x0001
1265 #define PD_CAN_STRETCHDIB 0x0002
1266 #define PD_STRETCHDIB_1_1_OK 0x0004
1267 #define PD_STRETCHDIB_1_2_OK 0x0008
1268 #define PD_STRETCHDIB_1_N_OK 0x0010
1270 DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
1272 #ifdef __cplusplus
1274 #endif /* __cplusplus */
1276 #endif /* __WINE_VFW_H */