4 #include "config.h" /* for inline */
12 #define VFWAPIV WINAPIV
16 #endif /* __cplusplus */
18 typedef HANDLE16 HDRAWDIB16
;
19 typedef HANDLE HDRAWDIB
;
21 HWND VFWAPIV
MCIWndCreateA(HWND hwndParent
, HINSTANCE hInstance
, DWORD dwStyle
, LPCSTR szFile
);
22 HWND VFWAPIV
MCIWndCreateW(HWND hwndParent
, HINSTANCE hInstance
, DWORD dwStyle
, LPCWSTR szFile
);
23 #define MCIWndCreate WINELIB_NAME_AW(MCIWndCreate)
24 DWORD VFWAPI
VideoForWindowsVersion(void);
25 LONG VFWAPI
InitVFW(void);
26 LONG VFWAPI
TermVFW(void);
29 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
30 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
31 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
35 #define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
38 #define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
39 #define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
41 /*****************************************************************************
42 * Predeclare the interfaces
44 typedef struct IAVIStream IAVIStream
,*PAVISTREAM
;
45 typedef struct IAVIFile IAVIFile
,*PAVIFILE
;
46 typedef struct IGetFrame IGetFrame
,*PGETFRAME
;
48 /* Installable Compressor Manager */
53 /* HIC struct (same layout as Win95 one) */
54 typedef struct tagWINE_HIC
{
55 DWORD magic
; /* 00: 'Smag' */
56 HANDLE curthread
; /* 04: */
58 DWORD handler
; /* 0C: */
60 DWORD
private; /* 14:(handled by SendDriverMessage)*/
61 FARPROC driverproc
; /* 18:(handled by SendDriverMessage)*/
62 DWORD x1
; /* 1c: name? */
69 /* error return codes */
71 #define ICERR_DONTDRAW 1
72 #define ICERR_NEWPALETTE 2
73 #define ICERR_GOTOKEYFRAME 3
74 #define ICERR_STOPDRAWING 4
76 #define ICERR_UNSUPPORTED -1
77 #define ICERR_BADFORMAT -2
78 #define ICERR_MEMORY -3
79 #define ICERR_INTERNAL -4
80 #define ICERR_BADFLAGS -5
81 #define ICERR_BADPARAM -6
82 #define ICERR_BADSIZE -7
83 #define ICERR_BADHANDLE -8
84 #define ICERR_CANTUPDATE -9
85 #define ICERR_ABORT -10
86 #define ICERR_ERROR -100
87 #define ICERR_BADBITDEPTH -200
88 #define ICERR_BADIMAGESIZE -201
90 #define ICERR_CUSTOM -400
93 #define ICM_USER (DRV_USER+0x0000)
95 /* ICM driver message range */
96 #define ICM_RESERVED_LOW (DRV_USER+0x1000)
97 #define ICM_RESERVED_HIGH (DRV_USER+0x2000)
98 #define ICM_RESERVED ICM_RESERVED_LOW
100 #define ICM_GETSTATE (ICM_RESERVED+0)
101 #define ICM_SETSTATE (ICM_RESERVED+1)
102 #define ICM_GETINFO (ICM_RESERVED+2)
104 #define ICM_CONFIGURE (ICM_RESERVED+10)
105 #define ICM_ABOUT (ICM_RESERVED+11)
108 #define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30)
109 #define ICM_GETQUALITY (ICM_RESERVED+31)
110 #define ICM_SETQUALITY (ICM_RESERVED+32)
112 #define ICM_SET (ICM_RESERVED+40)
113 #define ICM_GET (ICM_RESERVED+41)
115 /* 2 constant FOURCC codes */
116 #define ICM_FRAMERATE mmioFOURCC('F','r','m','R')
117 #define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R')
119 #define ICM_COMPRESS_GET_FORMAT (ICM_USER+4)
120 #define ICM_COMPRESS_GET_SIZE (ICM_USER+5)
121 #define ICM_COMPRESS_QUERY (ICM_USER+6)
122 #define ICM_COMPRESS_BEGIN (ICM_USER+7)
123 #define ICM_COMPRESS (ICM_USER+8)
124 #define ICM_COMPRESS_END (ICM_USER+9)
126 #define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10)
127 #define ICM_DECOMPRESS_QUERY (ICM_USER+11)
128 #define ICM_DECOMPRESS_BEGIN (ICM_USER+12)
129 #define ICM_DECOMPRESS (ICM_USER+13)
130 #define ICM_DECOMPRESS_END (ICM_USER+14)
131 #define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29)
132 #define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30)
134 #define ICM_DRAW_QUERY (ICM_USER+31)
135 #define ICM_DRAW_BEGIN (ICM_USER+15)
136 #define ICM_DRAW_GET_PALETTE (ICM_USER+16)
137 #define ICM_DRAW_START (ICM_USER+18)
138 #define ICM_DRAW_STOP (ICM_USER+19)
139 #define ICM_DRAW_END (ICM_USER+21)
140 #define ICM_DRAW_GETTIME (ICM_USER+32)
141 #define ICM_DRAW (ICM_USER+33)
142 #define ICM_DRAW_WINDOW (ICM_USER+34)
143 #define ICM_DRAW_SETTIME (ICM_USER+35)
144 #define ICM_DRAW_REALIZE (ICM_USER+36)
145 #define ICM_DRAW_FLUSH (ICM_USER+37)
146 #define ICM_DRAW_RENDERBUFFER (ICM_USER+38)
148 #define ICM_DRAW_START_PLAY (ICM_USER+39)
149 #define ICM_DRAW_STOP_PLAY (ICM_USER+40)
151 #define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50)
152 #define ICM_DRAW_CHANGEPALETTE (ICM_USER+51)
154 #define ICM_GETBUFFERSWANTED (ICM_USER+41)
156 #define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42)
158 #define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60)
159 #define ICM_DECOMPRESSEX_QUERY (ICM_USER+61)
160 #define ICM_DECOMPRESSEX (ICM_USER+62)
161 #define ICM_DECOMPRESSEX_END (ICM_USER+63)
163 #define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70)
164 #define ICM_SET_STATUS_PROC (ICM_USER+72)
168 /* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway
169 * have not been changed. If a structure is later extended, you may need to create
170 * two versions of it.
174 DWORD dwSize
; /* 00: size */
175 DWORD fccType
; /* 04: type 'vidc' usually */
176 DWORD fccHandler
; /* 08: */
177 DWORD dwVersion
; /* 0c: version of compman opening you */
178 DWORD dwFlags
; /* 10: LOWORD is type specific */
179 LRESULT dwError
; /* 14: */
180 LPVOID pV1Reserved
; /* 18: */
181 LPVOID pV2Reserved
; /* 1c: */
182 DWORD dnDevNode
; /* 20: */
186 #define ICCOMPRESS_KEYFRAME 0x00000001L
190 LPBITMAPINFOHEADER lpbiOutput
;
192 LPBITMAPINFOHEADER lpbiInput
;
199 LPBITMAPINFOHEADER lpbiPrev
;
203 DWORD VFWAPIV
ICCompress(
204 HIC hic
,DWORD dwFlags
,LPBITMAPINFOHEADER lpbiOutput
,LPVOID lpData
,
205 LPBITMAPINFOHEADER lpbiInput
,LPVOID lpBits
,LPDWORD lpckid
,
206 LPDWORD lpdwFlags
,LONG lFrameNum
,DWORD dwFrameSize
,DWORD dwQuality
,
207 LPBITMAPINFOHEADER lpbiPrev
,LPVOID lpPrev
210 #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
212 hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput), \
213 (DWORD)(LPVOID)(lpbiOutput) \
216 #define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
218 #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
220 hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
221 (DWORD)(LPVOID)(lpbiOutput) \
224 #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
226 hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \
227 (DWORD)(LPVOID)(lpbiOutput) \
230 #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
232 hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
233 (DWORD)(LPVOID)(lpbiOutput) \
236 #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
238 /* ICCOMPRESSFRAMES.dwFlags */
239 #define ICCOMPRESSFRAMES_PADDING 0x00000001
242 LPBITMAPINFOHEADER lpbiOutput
;
244 LPBITMAPINFOHEADER lpbiInput
;
253 DWORD dwOverheadPerFrame
;
255 LONG
CALLBACK (*GetData
)(LPARAM lInput
,LONG lFrame
,LPVOID lpBits
,LONG len
);
256 LONG
CALLBACK (*PutData
)(LPARAM lOutput
,LONG lFrame
,LPVOID lpBits
,LONG len
);
262 /* messages for Status callback */
263 #define ICSTATUS_START 0
264 #define ICSTATUS_STATUS 1
265 #define ICSTATUS_END 2
266 #define ICSTATUS_ERROR 3
267 #define ICSTATUS_YIELD 4
268 /* FIXME: some X11 libs define Status as int... */
269 /* LONG CALLBACK (*zStatus)(LPARAM lParam, UINT message, LONG l); */
270 LONG
CALLBACK (*zStatus
)(LPARAM lParam
, UINT message
, LONG l
);
273 /* Values for wMode of ICOpen() */
274 #define ICMODE_COMPRESS 1
275 #define ICMODE_DECOMPRESS 2
276 #define ICMODE_FASTDECOMPRESS 3
277 #define ICMODE_QUERY 4
278 #define ICMODE_FASTCOMPRESS 5
279 #define ICMODE_DRAW 8
282 #define ICQUALITY_LOW 0
283 #define ICQUALITY_HIGH 10000
284 #define ICQUALITY_DEFAULT -1
287 DWORD dwSize
; /* 00: */
288 DWORD fccType
; /* 04:compressor type 'vidc' 'audc' */
289 DWORD fccHandler
; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
290 DWORD dwFlags
; /* 0c:flags LOWORD is type specific */
291 DWORD dwVersion
; /* 10:version of the driver */
292 DWORD dwVersionICM
; /* 14:version of the ICM used */
294 * under Win32, the driver always returns UNICODE strings.
296 WCHAR szName
[16]; /* 18:short name */
297 WCHAR szDescription
[128]; /* 38:long name */
298 WCHAR szDriver
[128]; /* 138:driver that contains compressor*/
302 #include "pshpack1.h"
312 * under Win16, normal chars are used
315 CHAR szDescription
[128];
322 #define VIDCF_QUALITY 0x0001 /* supports quality */
323 #define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */
324 #define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */
325 #define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */
326 #define VIDCF_DRAW 0x0010 /* supports drawing */
327 #define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */
328 #define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */
329 #define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */
331 #define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
334 /* function shortcuts */
336 #define ICMF_ABOUT_QUERY 0x00000001
338 #define ICQueryAbout(hic) \
339 (ICSendMessage(hic,ICM_ABOUT,(DWORD)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
341 #define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD)(UINT)(hwnd),0)
344 #define ICMF_CONFIGURE_QUERY 0x00000001
345 #define ICQueryConfigure(hic) \
346 (ICSendMessage(hic,ICM_CONFIGURE,(DWORD)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
348 #define ICConfigure(hic,hwnd) \
349 ICSendMessage(hic,ICM_CONFIGURE,(DWORD)(UINT)(hwnd),0)
351 /* Decompression stuff */
352 #define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */
353 #define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */
354 #define ICDECOMPRESS_PREROLL 0x20000000 /* this frame is before real start */
355 #define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */
356 #define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */
359 DWORD dwFlags
; /* flags (from AVI index...) */
360 LPBITMAPINFOHEADER lpbiInput
; /* BITMAPINFO of compressed data */
361 LPVOID lpInput
; /* compressed data */
362 LPBITMAPINFOHEADER lpbiOutput
; /* DIB to decompress to */
364 DWORD ckid
; /* ckid from AVI file */
369 LPBITMAPINFOHEADER lpbiSrc
;
371 LPBITMAPINFOHEADER lpbiDst
;
374 /* changed for ICM_DECOMPRESSEX */
375 INT xDst
; /* destination rectangle */
380 INT xSrc
; /* source rectangle */
386 #include "pshpack1.h"
390 LPBITMAPINFOHEADER lpbiSrc
;
392 LPBITMAPINFOHEADER lpbiDst
;
395 INT16 xDst
; /* destination rectangle */
400 INT16 xSrc
; /* source rectangle */
408 DWORD VFWAPIV
ICDecompress(HIC hic
,DWORD dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,LPVOID lpData
,LPBITMAPINFOHEADER lpbi
,LPVOID lpBits
);
410 #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
412 hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
413 (DWORD)(LPVOID)(lpbiOutput) \
416 #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
418 hic,ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
419 (DWORD) (LPVOID)(lpbiOutput) \
422 #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
423 ((LONG)ICSendMessage( \
424 hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), \
425 (DWORD)(LPVOID)(lpbiOutput) \
428 #define ICDecompressGetFormatSize(hic, lpbi) \
429 ICDecompressGetFormat(hic, lpbi, NULL)
431 #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
433 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), \
434 (DWORD)(LPVOID)(lpbiOutput) \
437 #define ICDecompressSetPalette(hic,lpbiPalette) \
439 hic,ICM_DECOMPRESS_SET_PALETTE, \
440 (DWORD)(LPVOID)(lpbiPalette),0 \
443 #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
445 LRESULT VFWAPI
ICSendMessage(HIC hic
, UINT msg
, DWORD dw1
, DWORD dw2
);
446 LRESULT VFWAPI
ICSendMessage16(HIC16 hic
, UINT16 msg
, DWORD dw1
, DWORD dw2
);
448 inline static LRESULT VFWAPI
ICDecompressEx(HIC hic
, DWORD dwFlags
,
449 LPBITMAPINFOHEADER lpbiSrc
, LPVOID lpSrc
,
450 int xSrc
, int ySrc
, int dxSrc
, int dySrc
,
451 LPBITMAPINFOHEADER lpbiDst
, LPVOID lpDst
,
452 int xDst
, int yDst
, int dxDst
, int dyDst
)
456 ic
.dwFlags
= dwFlags
;
457 ic
.lpbiSrc
= lpbiSrc
;
463 ic
.lpbiDst
= lpbiDst
;
469 return ICSendMessage(hic
, ICM_DECOMPRESSEX
, (DWORD
)&ic
, sizeof(ic
));
472 inline static LRESULT VFWAPI
ICDecompressExBegin(HIC hic
, DWORD dwFlags
,
473 LPBITMAPINFOHEADER lpbiSrc
,
475 int xSrc
, int ySrc
, int dxSrc
, int dySrc
,
476 LPBITMAPINFOHEADER lpbiDst
,
485 ic
.dwFlags
= dwFlags
;
486 ic
.lpbiSrc
= lpbiSrc
;
492 ic
.lpbiDst
= lpbiDst
;
498 return ICSendMessage(hic
, ICM_DECOMPRESSEX_BEGIN
, (DWORD
)&ic
, sizeof(ic
));
500 inline static LRESULT VFWAPI
ICDecompressExQuery(HIC hic
, DWORD dwFlags
,
501 LPBITMAPINFOHEADER lpbiSrc
,
503 int xSrc
, int ySrc
, int dxSrc
, int dySrc
,
504 LPBITMAPINFOHEADER lpbiDst
,
513 ic
.dwFlags
= dwFlags
;
514 ic
.lpbiSrc
= lpbiSrc
;
520 ic
.lpbiDst
= lpbiDst
;
526 return ICSendMessage(hic
, ICM_DECOMPRESSEX_QUERY
, (DWORD
)&ic
, sizeof(ic
));
529 #define ICDecompressExEnd(hic) \
530 ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
532 #define ICDRAW_QUERY 0x00000001L /* test for support */
533 #define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
534 #define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
535 #define ICDRAW_ANIMATE 0x00000008L /* expect palette animation */
536 #define ICDRAW_CONTINUE 0x00000010L /* draw is a continuation of previous draw */
537 #define ICDRAW_MEMORYDC 0x00000020L /* DC is offscreen, by the way */
538 #define ICDRAW_UPDATING 0x00000040L /* We're updating, as opposed to playing */
539 #define ICDRAW_RENDER 0x00000080L /* used to render data not draw it */
540 #define ICDRAW_BUFFER 0x00000100L /* buffer data offscreen, we will need to update it */
542 #define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \
543 ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS)
545 #define ICDrawOpen(fccType, fccHandler, lpbiIn) \
546 ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW)
548 HANDLE VFWAPI
ICImageCompress(HIC hic
, UINT uiFlags
, LPBITMAPINFO lpbiIn
,
549 LPVOID lpBits
, LPBITMAPINFO lpbiOut
, LONG lQuality
,
552 HANDLE VFWAPI
ICImageDecompress(HIC hic
, UINT uiFlags
, LPBITMAPINFO lpbiIn
,
553 LPVOID lpBits
, LPBITMAPINFO lpbiOut
);
555 BOOL VFWAPI
ICInfo(DWORD fccType
, DWORD fccHandler
, ICINFO
* lpicinfo
);
556 BOOL VFWAPI
ICInstall(DWORD fccType
, DWORD fccHandler
, LPARAM lParam
, LPSTR szDesc
, UINT wFlags
);
557 BOOL VFWAPI
ICRemove(DWORD fccType
, DWORD fccHandler
, UINT wFlags
);
558 LRESULT VFWAPI
ICGetInfo(HIC hic
,ICINFO
*picinfo
, DWORD cb
);
559 HIC VFWAPI
ICOpen(DWORD fccType
, DWORD fccHandler
, UINT wMode
);
560 HIC16 VFWAPI
ICOpen16(DWORD fccType
, DWORD fccHangler
, UINT16 wMode
);
561 HIC VFWAPI
ICOpenFunction(DWORD fccType
, DWORD fccHandler
, UINT wMode
, FARPROC lpfnHandler
);
563 LRESULT VFWAPI
ICClose(HIC hic
);
564 HIC VFWAPI
ICLocate(DWORD fccType
, DWORD fccHandler
, LPBITMAPINFOHEADER lpbiIn
, LPBITMAPINFOHEADER lpbiOut
, WORD wFlags
);
565 HIC16 VFWAPI
ICLocate16(DWORD fccType
, DWORD fccHandler
, LPBITMAPINFOHEADER lpbiIn
, LPBITMAPINFOHEADER lpbiOut
, WORD wFlags
);
566 HIC VFWAPI
ICGetDisplayFormat(HIC hic
, LPBITMAPINFOHEADER lpbiIn
, LPBITMAPINFOHEADER lpbiOut
, int BitDepth
, int dx
, int dy
);
568 /* Values for wFlags of ICInstall() */
569 #define ICINSTALL_UNICODE 0x8000
570 #define ICINSTALL_FUNCTION 0x0001
571 #define ICINSTALL_DRIVER 0x0002
572 #define ICINSTALL_HDRV 0x0004
573 #define ICINSTALL_DRIVERW 0x8002
575 #define ICGetState(hic, pv, cb) \
576 ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
577 #define ICSetState(hic, pv, cb) \
578 ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
579 #define ICGetStateSize(hic) \
580 ICGetState(hic, NULL, 0)
582 inline static DWORD
ICGetDefaultQuality(HIC hic
)
585 ICSendMessage(hic
, ICM_GETDEFAULTQUALITY
, (DWORD
)(LPVOID
)&dwICValue
, sizeof(DWORD
));
589 inline static DWORD
ICGetDefaultKeyFrameRate(HIC hic
)
592 ICSendMessage(hic
, ICM_GETDEFAULTKEYFRAMERATE
, (DWORD
)(LPVOID
)&dwICValue
, sizeof(DWORD
));
596 #define ICDrawWindow(hic, prc) \
597 ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT))
599 /* As passed to ICM_DRAW_SUGGESTFORMAT */
602 LPBITMAPINFOHEADER lpbiIn
;
603 LPBITMAPINFOHEADER lpbiSuggest
;
613 LPBITMAPINFOHEADER lpbiIn
;
614 LPBITMAPINFOHEADER lpbiSuggest
;
619 HIC16 hicDecompressor
;
629 DWORD VFWAPIV
ICDrawBegin(
631 DWORD dwFlags
,/* flags */
632 HPALETTE hpal
, /* palette to draw with */
633 HWND hwnd
, /* window to draw to */
634 HDC hdc
, /* HDC to draw to */
635 INT xDst
, /* destination rectangle */
639 LPBITMAPINFOHEADER lpbi
, /* format of frame to draw */
640 INT xSrc
, /* source rectangle */
644 DWORD dwRate
, /* frames/second = (dwRate/dwScale) */
648 DWORD VFWAPIV
ICDrawBegin16(
650 DWORD dwFlags
,/* flags */
651 HPALETTE16 hpal
, /* palette to draw with */
652 HWND16 hwnd
, /* window to draw to */
653 HDC16 hdc
, /* HDC to draw to */
654 INT16 xDst
, /* destination rectangle */
658 LPBITMAPINFOHEADER lpbi
, /* format of frame to draw */
659 INT16 xSrc
, /* source rectangle */
663 DWORD dwRate
, /* frames/second = (dwRate/dwScale) */
667 /* as passed to ICM_DRAW_BEGIN */
677 LPBITMAPINFOHEADER lpbi
;
686 #include "pshpack1.h"
697 LPBITMAPINFOHEADER lpbi
;
708 #define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */
709 #define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */
710 #define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */
711 #define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */
712 #define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */
722 DWORD VFWAPIV
ICDraw(HIC hic
,DWORD dwFlags
,LPVOID lpFormat
,LPVOID lpData
,DWORD cbData
,LONG lTime
);
724 inline static LRESULT VFWAPI
ICDrawSuggestFormat(HIC hic
, LPBITMAPINFOHEADER lpbiIn
,
725 LPBITMAPINFOHEADER lpbiOut
,
726 int dxSrc
, int dySrc
,
727 int dxDst
, int dyDst
,
733 ic
.lpbiSuggest
= lpbiOut
;
738 ic
.hicDecompressor
= hicDecomp
;
739 return ICSendMessage(hic
, ICM_DRAW_SUGGESTFORMAT
, (DWORD
)&ic
, sizeof(ic
));
742 #define ICDrawQuery(hic, lpbiInput) \
743 ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L)
745 #define ICDrawChangePalette(hic, lpbiInput) \
746 ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L)
748 #define ICGetBuffersWanted(hic, lpdwBuffers) \
749 ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0)
751 #define ICDrawEnd(hic) \
752 ICSendMessage(hic, ICM_DRAW_END, 0, 0)
754 #define ICDrawStart(hic) \
755 ICSendMessage(hic, ICM_DRAW_START, 0, 0)
757 #define ICDrawStartPlay(hic, lFrom, lTo) \
758 ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo))
760 #define ICDrawStop(hic) \
761 ICSendMessage(hic, ICM_DRAW_STOP, 0, 0)
763 #define ICDrawStopPlay(hic) \
764 ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0)
766 #define ICDrawGetTime(hic, lplTime) \
767 ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0)
769 #define ICDrawSetTime(hic, lTime) \
770 ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0)
772 #define ICDrawRealize(hic, hdc, fBackground) \
773 ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground))
775 #define ICDrawFlush(hic) \
776 ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0)
778 #define ICDrawRenderBuffer(hic) \
779 ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0)
781 inline static LRESULT VFWAPI
ICSetStatusProc(HIC hic
, DWORD dwFlags
, LRESULT lParam
,
782 LONG (CALLBACK
*fpfnStatus
)(LPARAM
, UINT
, LONG
))
786 ic
.dwFlags
= dwFlags
;
788 /* FIXME: see comment in ICSETSTATUSPROC definition */
789 ic
.zStatus
= fpfnStatus
;
791 return ICSendMessage(hic
, ICM_SET_STATUS_PROC
, (DWORD
)&ic
, sizeof(ic
));
801 LPBITMAPINFO lpbiOut
;
811 } COMPVARS
, *PCOMPVARS
;
813 #define ICMF_COMPVARS_VALID 0x00000001
815 BOOL VFWAPI
ICCompressorChoose(HWND hwnd
, UINT uiFlags
, LPVOID pvIn
, LPVOID lpData
,
816 PCOMPVARS pc
, LPSTR lpszTitle
);
818 #define ICMF_CHOOSE_KEYFRAME 0x0001
819 #define ICMF_CHOOSE_DATARATE 0x0002
820 #define ICMF_CHOOSE_PREVIEW 0x0004
821 #define ICMF_CHOOSE_ALLCOMPRESSORS 0x0008
823 BOOL VFWAPI
ICSeqCompressFrameStart(PCOMPVARS pc
, LPBITMAPINFO lpbiIn
);
824 void VFWAPI
ICSeqCompressFrameEnd(PCOMPVARS pc
);
826 LPVOID VFWAPI
ICSeqCompressFrame(PCOMPVARS pc
, UINT uiFlags
, LPVOID lpBits
,
827 BOOL
*pfKey
, LONG
*plSize
);
828 void VFWAPI
ICCompressorFree(PCOMPVARS pc
);
830 /********************* AVIFILE function declarations *************************/
831 #define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
832 #define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
833 #define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
834 #define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
835 #define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
836 #define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
837 #define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
838 #define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
840 #define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
841 #define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
843 #define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
845 #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
846 #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
847 #define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
848 #define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
850 /* Basic chunk types */
851 #define cktypeDIBbits aviTWOCC('d', 'b')
852 #define cktypeDIBcompressed aviTWOCC('d', 'c')
853 #define cktypePALchange aviTWOCC('p', 'c')
854 #define cktypeWAVEbytes aviTWOCC('w', 'b')
856 /* Chunk id to use for extra chunks for padding. */
857 #define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
859 /* AVIFileHdr.dwFlags */
860 #define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
861 #define AVIF_MUSTUSEINDEX 0x00000020
862 #define AVIF_ISINTERLEAVED 0x00000100
863 #define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames*/
864 #define AVIF_WASCAPTUREFILE 0x00010000
865 #define AVIF_COPYRIGHTED 0x00020000
867 #define AVI_HEADERSIZE 2048
869 typedef struct _MainAVIHeader
871 DWORD dwMicroSecPerFrame
;
872 DWORD dwMaxBytesPerSec
;
873 DWORD dwPaddingGranularity
;
876 DWORD dwInitialFrames
;
878 DWORD dwSuggestedBufferSize
;
884 /* AVIStreamHeader.dwFlags */
885 #define AVISF_DISABLED 0x00000001
886 #define AVISF_VIDEO_PALCHANGES 0x00010000
891 DWORD dwFlags
; /* AVISF_* */
894 DWORD dwInitialFrames
;
896 DWORD dwRate
; /* dwRate / dwScale == samples/second */
898 DWORD dwLength
; /* In units above... */
899 DWORD dwSuggestedBufferSize
;
902 RECT16 rcFrame
; /* word.word - word.word in file */
905 /* AVIINDEXENTRY.dwFlags */
906 #define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */
907 #define AVIIF_TWOCC 0x00000002
908 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
910 #define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */
911 #define AVIIF_COMPUSE 0x0FFF0000
913 typedef struct _AVIINDEXENTRY
{
920 typedef struct _AVIPALCHANGE
{
923 WORD wFlags
; /* pad */
924 PALETTEENTRY peNew
[1];
927 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
929 #define AVIGETFRAMEF_BESTDISPLAYFMT 1
931 typedef struct _AVISTREAMINFOA
{
934 DWORD dwFlags
; /* AVIIF_* */
939 DWORD dwRate
; /* dwRate / dwScale == samples/second */
941 DWORD dwLength
; /* In units above... */
942 DWORD dwInitialFrames
;
943 DWORD dwSuggestedBufferSize
;
948 DWORD dwFormatChangeCount
;
950 } AVISTREAMINFOA
, * LPAVISTREAMINFOA
, *PAVISTREAMINFOA
;
952 typedef struct _AVISTREAMINFOW
{
960 DWORD dwRate
; /* dwRate / dwScale == samples/second */
962 DWORD dwLength
; /* In units above... */
963 DWORD dwInitialFrames
;
964 DWORD dwSuggestedBufferSize
;
969 DWORD dwFormatChangeCount
;
971 } AVISTREAMINFOW
, * LPAVISTREAMINFOW
, *PAVISTREAMINFOW
;
972 DECL_WINELIB_TYPE_AW(AVISTREAMINFO
)
973 DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO
)
974 DECL_WINELIB_TYPE_AW(PAVISTREAMINFO
)
976 #define AVISTREAMINFO_DISABLED 0x00000001
977 #define AVISTREAMINFO_FORMATCHANGES 0x00010000
979 /* AVIFILEINFO.dwFlags */
980 #define AVIFILEINFO_HASINDEX 0x00000010
981 #define AVIFILEINFO_MUSTUSEINDEX 0x00000020
982 #define AVIFILEINFO_ISINTERLEAVED 0x00000100
983 #define AVIFILEINFO_WASCAPTUREFILE 0x00010000
984 #define AVIFILEINFO_COPYRIGHTED 0x00020000
986 /* AVIFILEINFO.dwCaps */
987 #define AVIFILECAPS_CANREAD 0x00000001
988 #define AVIFILECAPS_CANWRITE 0x00000002
989 #define AVIFILECAPS_ALLKEYFRAMES 0x00000010
990 #define AVIFILECAPS_NOCOMPRESSION 0x00000020
992 typedef struct _AVIFILEINFOW
{
993 DWORD dwMaxBytesPerSec
;
997 DWORD dwSuggestedBufferSize
;
1004 WCHAR szFileType
[64];
1005 } AVIFILEINFOW
, * LPAVIFILEINFOW
, *PAVIFILEINFOW
;
1006 typedef struct _AVIFILEINFOA
{
1007 DWORD dwMaxBytesPerSec
;
1011 DWORD dwSuggestedBufferSize
;
1018 CHAR szFileType
[64];
1019 } AVIFILEINFOA
, * LPAVIFILEINFOA
, *PAVIFILEINFOA
;
1020 DECL_WINELIB_TYPE_AW(AVIFILEINFO
)
1021 DECL_WINELIB_TYPE_AW(PAVIFILEINFO
)
1022 DECL_WINELIB_TYPE_AW(LPAVIFILEINFO
)
1024 /* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
1025 #define AVICOMPRESSF_INTERLEAVE 0x00000001
1026 #define AVICOMPRESSF_DATARATE 0x00000002
1027 #define AVICOMPRESSF_KEYFRAMES 0x00000004
1028 #define AVICOMPRESSF_VALID 0x00000008
1031 DWORD fccType
; /* stream type, for consistency */
1032 DWORD fccHandler
; /* compressor */
1033 DWORD dwKeyFrameEvery
; /* keyframe rate */
1034 DWORD dwQuality
; /* compress quality 0-10,000 */
1035 DWORD dwBytesPerSecond
; /* bytes per second */
1036 DWORD dwFlags
; /* flags... see below */
1037 LPVOID lpFormat
; /* save format */
1039 LPVOID lpParms
; /* compressor options */
1041 DWORD dwInterleaveEvery
; /* for non-video streams only */
1042 } AVICOMPRESSOPTIONS
, *LPAVICOMPRESSOPTIONS
,*PAVICOMPRESSOPTIONS
;
1046 #define DEFINE_AVIGUID(name, l, w1, w2) \
1047 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
1049 DEFINE_AVIGUID(IID_IAVIFile
, 0x00020020, 0, 0);
1050 DEFINE_AVIGUID(IID_IAVIStream
, 0x00020021, 0, 0);
1051 DEFINE_AVIGUID(IID_IAVIStreaming
, 0x00020022, 0, 0);
1052 DEFINE_AVIGUID(IID_IGetFrame
, 0x00020023, 0, 0);
1053 DEFINE_AVIGUID(IID_IAVIEditStream
, 0x00020024, 0, 0);
1055 DEFINE_AVIGUID(CLSID_AVIFile
, 0x00020000, 0, 0);
1057 /*****************************************************************************
1058 * IAVIStream interface
1060 #define ICOM_INTERFACE IAVIStream
1061 #define IAVIStream_METHODS \
1062 ICOM_METHOD2(HRESULT,Create, LPARAM,lParam1, LPARAM,lParam2) \
1063 ICOM_METHOD2(HRESULT,Info, AVISTREAMINFOW*,psi, LONG,lSize) \
1064 ICOM_METHOD2(LONG, FindSample, LONG,lPos, LONG,lFlags) \
1065 ICOM_METHOD3(HRESULT,ReadFormat, LONG,lPos, LPVOID,lpFormat, LONG*,lpcbFormat) \
1066 ICOM_METHOD3(HRESULT,SetFormat, LONG,lPos, LPVOID,lpFormat, LONG,cbFormat) \
1067 ICOM_METHOD6(HRESULT,Read, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, LONG*,plBytes, LONG*,plSamples) \
1068 ICOM_METHOD7(HRESULT,Write, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, DWORD,dwFlags, LONG*,plSampWritten, LONG*,plBytesWritten) \
1069 ICOM_METHOD2(HRESULT,Delete, LONG,lStart, LONG,lSamples) \
1070 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
1071 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
1072 ICOM_METHOD2(HRESULT,SetInfo, AVISTREAMINFOW*,plInfo, LONG,cbInfo)
1073 #define IAVIStream_IMETHODS \
1076 ICOM_DEFINE(IAVIStream
, IUnknown
)
1077 #undef ICOM_INTERFACE
1079 /*** IUnknown methods ***/
1080 #define IAVIStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1081 #define IAVIStream_AddRef(p) ICOM_CALL (AddRef,p)
1082 #define IAVIStream_Release(p) ICOM_CALL (Release,p)
1083 /*** IAVIStream methods ***/
1084 #define IAVIStream_Create(p,a,b) ICOM_CALL2(Create,p,a,b)
1085 #define IAVIStream_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
1086 #define IAVIStream_FindSample(p,a,b) ICOM_CALL2(FindSample,p,a,b)
1087 #define IAVIStream_ReadFormat(p,a,b,c) ICOM_CALL3(ReadFormat,p,a,b,c)
1088 #define IAVIStream_SetFormat(p,a,b,c) ICOM_CALL3(SetFormat,p,a,b,c)
1089 #define IAVIStream_Read(p,a,b,c,d,e,f) ICOM_CALL6(Read,p,a,b,c,d,e,f)
1090 #define IAVIStream_Write(p,a,b,c,d,e,f,g) ICOM_CALL7(Write,p,a,b,c,d,e,f,g)
1091 #define IAVIStream_Delete(p,a,b) ICOM_CALL2(Delete,p,a,b)
1092 #define IAVIStream_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
1093 #define IAVIStream_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
1094 #define IAVIStream_SetInfo(p,a,b) ICOM_CALL2(SetInfo,p,a,b)
1096 HRESULT WINAPI
AVIMakeCompressedStream(PAVISTREAM
*ppsCompressed
,PAVISTREAM ppsSource
,AVICOMPRESSOPTIONS
*lpOptions
,CLSID
*pclsidHandler
);
1098 HRESULT WINAPI
AVIStreamInfoA(PAVISTREAM iface
,AVISTREAMINFOA
*asi
,LONG size
);
1099 HRESULT WINAPI
AVIStreamInfoW(PAVISTREAM iface
,AVISTREAMINFOW
*asi
,LONG size
);
1100 #define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo)
1101 LPVOID WINAPI
AVIStreamGetFrame(PGETFRAME pg
,LONG pos
);
1102 HRESULT WINAPI
AVIStreamGetFrameClose(PGETFRAME pg
);
1103 PGETFRAME WINAPI
AVIStreamGetFrameOpen(PAVISTREAM pavi
,LPBITMAPINFOHEADER lpbiWanted
);
1104 LONG WINAPI
AVIStreamLength(PAVISTREAM iface
);
1105 HRESULT WINAPI
AVIStreamRead(PAVISTREAM iface
,LONG start
,LONG samples
,LPVOID buffer
,LONG buffersize
,LONG
*bytesread
,LONG
*samplesread
);
1106 HRESULT WINAPI
AVIStreamReadData(PAVISTREAM iface
,DWORD fcc
,LPVOID lp
,LONG
*lpread
);
1107 HRESULT WINAPI
AVIStreamReadFormat(PAVISTREAM iface
,LONG pos
,LPVOID format
,LONG
*formatsize
);
1108 ULONG WINAPI
AVIStreamRelease(PAVISTREAM iface
);
1109 HRESULT WINAPI
AVIStreamSetFormat(PAVISTREAM iface
,LONG pos
,LPVOID format
,LONG formatsize
);
1110 LONG WINAPI
AVIStreamStart(PAVISTREAM iface
);
1111 HRESULT WINAPI
AVIStreamWrite(PAVISTREAM iface
,LONG start
,LONG samples
,LPVOID buffer
,LONG buffersize
,DWORD flags
,LONG
*sampwritten
,LONG
*byteswritten
);
1112 HRESULT WINAPI
AVIStreamWriteData(PAVISTREAM iface
,DWORD fcc
,LPVOID lp
,LONG size
);
1113 HRESULT WINAPI
AVIStreamOpenFromFileA(PAVISTREAM
*ppavi
, LPCSTR szFile
,
1114 DWORD fccType
, LONG lParam
,
1115 UINT mode
, CLSID
*pclsidHandler
);
1116 HRESULT WINAPI
AVIStreamOpenFromFileW(PAVISTREAM
*ppavi
, LPCWSTR szFile
,
1117 DWORD fccType
, LONG lParam
,
1118 UINT mode
, CLSID
*pclsidHandler
);
1119 #define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile)
1121 #define AVIStreamFormatSize(pavi, lPos, plSize) \
1122 AVIStreamReadFormat(pavi, lPos, NULL, plSize)
1124 /*****************************************************************************
1125 * IAVIFile interface
1127 /* In Win32 this interface uses UNICODE only */
1128 #define ICOM_INTERFACE IAVIFile
1129 #define IAVIFile_METHODS \
1130 ICOM_METHOD2(HRESULT,Info, AVIFILEINFOW*,pfi, LONG,lSize) \
1131 ICOM_METHOD3(HRESULT,GetStream, PAVISTREAM*,ppStream, DWORD,fccType, LONG,lParam) \
1132 ICOM_METHOD2(HRESULT,CreateStream, PAVISTREAM*,ppStream, AVISTREAMINFOW*,psi) \
1133 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
1134 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
1135 ICOM_METHOD (HRESULT,EndRecord) \
1136 ICOM_METHOD2(HRESULT,DeleteStream, DWORD,fccType, LONG,lParam)
1137 #define IAVIFile_IMETHODS \
1140 ICOM_DEFINE(IAVIFile
,IUnknown
)
1141 #undef ICOM_INTERFACE
1143 /*** IUnknown methods ***/
1144 #define IAVIFile_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1145 #define IAVIFile_AddRef(p) ICOM_CALL (AddRef,p)
1146 #define IAVIFile_Release(p) ICOM_CALL (Release,p)
1147 /*** IAVIFile methods ***/
1148 #define IAVIFile_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
1149 #define IAVIFile_GetStream(p,a,b,c) ICOM_CALL3(GetStream,p,a,b,c)
1150 #define IAVIFile_CreateStream(p,a,b) ICOM_CALL2(CreateStream,p,a,b)
1151 #define IAVIFile_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
1152 #define IAVIFile_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
1153 #define IAVIFile_EndRecord(p) ICOM_CALL (EndRecord,p)
1154 #define IAVIFile_DeleteStream(p,a,b) ICOM_CALL2(DeleteStream,p,a,b)
1156 HRESULT WINAPI
AVIFileCreateStreamA(PAVIFILE pfile
,PAVISTREAM
* ppavi
,AVISTREAMINFOA
* psi
);
1157 HRESULT WINAPI
AVIFileCreateStreamW(PAVIFILE pfile
,PAVISTREAM
* ppavi
,AVISTREAMINFOW
* psi
);
1158 #define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream)
1159 void WINAPI
AVIFileExit(void);
1160 HRESULT WINAPI
AVIFileGetStream(PAVIFILE pfile
,PAVISTREAM
* avis
,DWORD fccType
,LONG lParam
);
1161 HRESULT WINAPI
AVIFileInfoA(PAVIFILE pfile
,PAVIFILEINFOA pfi
,LONG lSize
);
1162 HRESULT WINAPI
AVIFileInfoW(PAVIFILE pfile
,PAVIFILEINFOW pfi
,LONG lSize
);
1163 #define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo)
1164 void WINAPI
AVIFileInit(void);
1165 HRESULT WINAPI
AVIFileOpenA(PAVIFILE
* ppfile
,LPCSTR szFile
,UINT uMode
,LPCLSID lpHandler
);
1166 HRESULT WINAPI
AVIFileOpenW(PAVIFILE
* ppfile
,LPCWSTR szFile
,UINT uMode
,LPCLSID lpHandler
);
1167 #define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen)
1168 ULONG WINAPI
AVIFileRelease(PAVIFILE iface
);
1171 /*****************************************************************************
1172 * IGetFrame interface
1174 #define ICOM_INTERFACE IGetFrame
1175 #define IGetFrame_METHODS \
1176 ICOM_METHOD1(LPVOID, GetFrame, LONG,lPos) \
1177 ICOM_METHOD3(HRESULT,Begin, LONG,lStart, LONG,lEnd, LONG,lRate) \
1178 ICOM_METHOD (HRESULT,End) \
1179 ICOM_METHOD6(HRESULT,SetFormat, LPBITMAPINFOHEADER,lpbi, LPVOID,lpBits, INT,x, INT,y, INT,dx, INT,dy)
1180 #define IGetFrame_IMETHODS \
1183 ICOM_DEFINE(IGetFrame
,IUnknown
)
1184 #undef ICOM_INTERFACE
1186 /*** IUnknown methods ***/
1187 #define IGetFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1188 #define IGetFrame_AddRef(p) ICOM_CALL (AddRef,p)
1189 #define IGetFrame_Release(p) ICOM_CALL (Release,p)
1190 /*** IGetFrame methods ***/
1191 #define IGetFrame_GetFrame(p,a) ICOM_CALL1(GetFrame,p,a)
1192 #define IGetFrame_Begin(p,a,b,c) ICOM_CALL3(Begin,p,a,b,c)
1193 #define IGetFrame_End(p) ICOM_CALL (End,p)
1194 #define IGetFrame_SetFormat(p,a,b,c,d,e,f) ICOM_CALL6(SetFormat,p,a,b,c,d,e,f)
1197 #define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
1199 #define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
1200 #define AVIERR_BADFORMAT MAKE_AVIERR(102)
1201 #define AVIERR_MEMORY MAKE_AVIERR(103)
1202 #define AVIERR_INTERNAL MAKE_AVIERR(104)
1203 #define AVIERR_BADFLAGS MAKE_AVIERR(105)
1204 #define AVIERR_BADPARAM MAKE_AVIERR(106)
1205 #define AVIERR_BADSIZE MAKE_AVIERR(107)
1206 #define AVIERR_BADHANDLE MAKE_AVIERR(108)
1207 #define AVIERR_FILEREAD MAKE_AVIERR(109)
1208 #define AVIERR_FILEWRITE MAKE_AVIERR(110)
1209 #define AVIERR_FILEOPEN MAKE_AVIERR(111)
1210 #define AVIERR_COMPRESSOR MAKE_AVIERR(112)
1211 #define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
1212 #define AVIERR_READONLY MAKE_AVIERR(114)
1213 #define AVIERR_NODATA MAKE_AVIERR(115)
1214 #define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
1215 #define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
1216 #define AVIERR_USERABORT MAKE_AVIERR(198)
1217 #define AVIERR_ERROR MAKE_AVIERR(199)
1219 /********************************************
1220 * DrawDib declarations
1223 HDRAWDIB VFWAPI
DrawDibOpen( void );
1224 UINT VFWAPI
DrawDibRealize(HDRAWDIB hdd
, HDC hdc
, BOOL fBackground
);
1226 BOOL VFWAPI
DrawDibBegin(HDRAWDIB hdd
, HDC hdc
, INT dxDst
, INT dyDst
,
1227 LPBITMAPINFOHEADER lpbi
, INT dxSrc
, INT dySrc
, UINT wFlags
);
1229 BOOL VFWAPI
DrawDibDraw(HDRAWDIB hdd
, HDC hdc
, INT xDst
, INT yDst
, INT dxDst
, INT dyDst
,
1230 LPBITMAPINFOHEADER lpbi
, LPVOID lpBits
,
1231 INT xSrc
, INT ySrc
, INT dxSrc
, INT dySrc
, UINT wFlags
);
1233 /* DrawDibDraw flags */
1235 #define DDF_UPDATE 0x0002
1236 #define DDF_SAME_HDC 0x0004
1237 #define DDF_SAME_DRAW 0x0008
1238 #define DDF_DONTDRAW 0x0010
1239 #define DDF_ANIMATE 0x0020
1240 #define DDF_BUFFER 0x0040
1241 #define DDF_JUSTDRAWIT 0x0080
1242 #define DDF_FULLSCREEN 0x0100
1243 #define DDF_BACKGROUNDPAL 0x0200
1244 #define DDF_NOTKEYFRAME 0x0400
1245 #define DDF_HURRYUP 0x0800
1246 #define DDF_HALFTONE 0x1000
1248 #define DDF_PREROLL DDF_DONTDRAW
1249 #define DDF_SAME_DIB DDF_SAME_DRAW
1250 #define DDF_SAME_SIZE DDF_SAME_DRAW
1252 BOOL VFWAPI
DrawDibSetPalette(HDRAWDIB hdd
, HPALETTE hpal
);
1253 HPALETTE VFWAPI
DrawDibGetPalette(HDRAWDIB hdd
);
1254 BOOL VFWAPI
DrawDibChangePalette(HDRAWDIB hdd
, int iStart
, int iLen
, LPPALETTEENTRY lppe
);
1255 LPVOID VFWAPI
DrawDibGetBuffer(HDRAWDIB hdd
, LPBITMAPINFOHEADER lpbi
, DWORD dwSize
, DWORD dwFlags
);
1257 BOOL VFWAPI
DrawDibStart(HDRAWDIB hdd
, DWORD rate
);
1258 BOOL VFWAPI
DrawDibStop(HDRAWDIB hdd
);
1259 #define DrawDibUpdate(hdd, hdc, x, y) \
1260 DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
1262 BOOL VFWAPI
DrawDibEnd(HDRAWDIB hdd
);
1263 BOOL VFWAPI
DrawDibClose(HDRAWDIB hdd
);
1265 /* display profiling */
1266 #define PD_CAN_DRAW_DIB 0x0001
1267 #define PD_CAN_STRETCHDIB 0x0002
1268 #define PD_STRETCHDIB_1_1_OK 0x0004
1269 #define PD_STRETCHDIB_1_2_OK 0x0008
1270 #define PD_STRETCHDIB_1_N_OK 0x0010
1272 DWORD VFWAPI
DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi
);
1276 #endif /* __cplusplus */
1278 #endif /* __WINE_VFW_H */