blob: b136b43a43dabe4cff8fdd9f7522fdb36f63c3a5 [file] [log] [blame]
Alexandre Julliardd30dfd21998-09-27 18:28:36 +00001#ifndef __WINE_VFW_H
2#define __WINE_VFW_H
3
Jim Aston2e1cafa1999-03-14 16:35:05 +00004#include "windef.h"
Marcus Meissner61afa331999-02-22 10:16:00 +00005#include "mmsystem.h"
Marcus Meissner317af321999-02-17 13:51:06 +00006#include "wingdi.h"
Alexandre Julliardd30dfd21998-09-27 18:28:36 +00007
8#define VFWAPI WINAPI
9#define VFWAPIV WINAPIV
10
Eric Pouech731e9f52000-07-26 18:07:04 +000011#ifdef __cplusplus
12extern "C" {
13#endif /* __cplusplus */
14
Francois Gouget326e2ba2000-06-18 17:26:44 +000015typedef HANDLE HDRAWDIB;
16
Eric Pouech731e9f52000-07-26 18:07:04 +000017DWORD VFWAPI VideoForWindowsVersion(void);
18LONG VFWAPI InitVFW(void);
19LONG VFWAPI TermVFW(void);
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000020
Francois Gouget4e4f1d11999-03-17 15:16:01 +000021/*****************************************************************************
22 * Predeclare the interfaces
23 */
24typedef struct IAVIStream IAVIStream,*PAVISTREAM;
25typedef struct IAVIFile IAVIFile,*PAVIFILE;
26typedef struct IGetFrame IGetFrame,*PGETFRAME;
27
Bradley Baetza1491de2000-07-08 12:50:26 +000028/* Installable Compressor Manager */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000029
Eric Pouech26146cd2001-02-14 21:49:22 +000030DECLARE_HANDLE(HIC);
Francois Gougeta537bec2000-06-11 20:07:08 +000031
32#ifdef __WINE__
Marcus Meissner960c7251999-03-13 18:09:16 +000033/* HIC struct (same layout as Win95 one) */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000034typedef struct tagWINE_HIC {
35 DWORD magic; /* 00: 'Smag' */
Eric Pouech731e9f52000-07-26 18:07:04 +000036 HANDLE curthread; /* 04: */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000037 DWORD type; /* 08: */
38 DWORD handler; /* 0C: */
Alexandre Julliarda3960291999-02-26 11:11:13 +000039 HDRVR hdrv; /* 10: */
Marcus Meissner960c7251999-03-13 18:09:16 +000040 DWORD private; /* 14:(handled by SendDriverMessage)*/
Eric Pouech731e9f52000-07-26 18:07:04 +000041 FARPROC driverproc; /* 18:(handled by SendDriverMessage)*/
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000042 DWORD x1; /* 1c: name? */
43 WORD x2; /* 20: */
44 DWORD x3; /* 22: */
45 /* 26: */
46} WINE_HIC;
Francois Gougeta537bec2000-06-11 20:07:08 +000047#endif
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000048
49/* error return codes */
50#define ICERR_OK 0
51#define ICERR_DONTDRAW 1
52#define ICERR_NEWPALETTE 2
53#define ICERR_GOTOKEYFRAME 3
54#define ICERR_STOPDRAWING 4
55
56#define ICERR_UNSUPPORTED -1
57#define ICERR_BADFORMAT -2
58#define ICERR_MEMORY -3
59#define ICERR_INTERNAL -4
60#define ICERR_BADFLAGS -5
61#define ICERR_BADPARAM -6
62#define ICERR_BADSIZE -7
63#define ICERR_BADHANDLE -8
64#define ICERR_CANTUPDATE -9
65#define ICERR_ABORT -10
66#define ICERR_ERROR -100
67#define ICERR_BADBITDEPTH -200
68#define ICERR_BADIMAGESIZE -201
69
70#define ICERR_CUSTOM -400
71
72/* ICM Messages */
73#define ICM_USER (DRV_USER+0x0000)
74
75/* ICM driver message range */
76#define ICM_RESERVED_LOW (DRV_USER+0x1000)
77#define ICM_RESERVED_HIGH (DRV_USER+0x2000)
78#define ICM_RESERVED ICM_RESERVED_LOW
79
80#define ICM_GETSTATE (ICM_RESERVED+0)
81#define ICM_SETSTATE (ICM_RESERVED+1)
82#define ICM_GETINFO (ICM_RESERVED+2)
83
84#define ICM_CONFIGURE (ICM_RESERVED+10)
85#define ICM_ABOUT (ICM_RESERVED+11)
86/* */
87
88#define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30)
89#define ICM_GETQUALITY (ICM_RESERVED+31)
90#define ICM_SETQUALITY (ICM_RESERVED+32)
91
92#define ICM_SET (ICM_RESERVED+40)
93#define ICM_GET (ICM_RESERVED+41)
94
95/* 2 constant FOURCC codes */
96#define ICM_FRAMERATE mmioFOURCC('F','r','m','R')
97#define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R')
98
99#define ICM_COMPRESS_GET_FORMAT (ICM_USER+4)
100#define ICM_COMPRESS_GET_SIZE (ICM_USER+5)
101#define ICM_COMPRESS_QUERY (ICM_USER+6)
102#define ICM_COMPRESS_BEGIN (ICM_USER+7)
103#define ICM_COMPRESS (ICM_USER+8)
104#define ICM_COMPRESS_END (ICM_USER+9)
105
106#define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10)
107#define ICM_DECOMPRESS_QUERY (ICM_USER+11)
108#define ICM_DECOMPRESS_BEGIN (ICM_USER+12)
109#define ICM_DECOMPRESS (ICM_USER+13)
110#define ICM_DECOMPRESS_END (ICM_USER+14)
111#define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29)
112#define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30)
113
114#define ICM_DRAW_QUERY (ICM_USER+31)
115#define ICM_DRAW_BEGIN (ICM_USER+15)
116#define ICM_DRAW_GET_PALETTE (ICM_USER+16)
117#define ICM_DRAW_START (ICM_USER+18)
118#define ICM_DRAW_STOP (ICM_USER+19)
119#define ICM_DRAW_END (ICM_USER+21)
120#define ICM_DRAW_GETTIME (ICM_USER+32)
121#define ICM_DRAW (ICM_USER+33)
122#define ICM_DRAW_WINDOW (ICM_USER+34)
123#define ICM_DRAW_SETTIME (ICM_USER+35)
124#define ICM_DRAW_REALIZE (ICM_USER+36)
125#define ICM_DRAW_FLUSH (ICM_USER+37)
126#define ICM_DRAW_RENDERBUFFER (ICM_USER+38)
127
128#define ICM_DRAW_START_PLAY (ICM_USER+39)
129#define ICM_DRAW_STOP_PLAY (ICM_USER+40)
130
131#define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50)
132#define ICM_DRAW_CHANGEPALETTE (ICM_USER+51)
133
134#define ICM_GETBUFFERSWANTED (ICM_USER+41)
135
136#define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42)
137
138#define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60)
139#define ICM_DECOMPRESSEX_QUERY (ICM_USER+61)
140#define ICM_DECOMPRESSEX (ICM_USER+62)
141#define ICM_DECOMPRESSEX_END (ICM_USER+63)
142
143#define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70)
144#define ICM_SET_STATUS_PROC (ICM_USER+72)
145
146/* structs */
147
Bradley Baetza1491de2000-07-08 12:50:26 +0000148/* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway
149 * have not been changed. If a structure is later extended, you may need to create
150 * two versions of it.
151 */
152
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000153typedef struct {
154 DWORD dwSize; /* 00: size */
155 DWORD fccType; /* 04: type 'vidc' usually */
156 DWORD fccHandler; /* 08: */
157 DWORD dwVersion; /* 0c: version of compman opening you */
158 DWORD dwFlags; /* 10: LOWORD is type specific */
159 LRESULT dwError; /* 14: */
160 LPVOID pV1Reserved; /* 18: */
161 LPVOID pV2Reserved; /* 1c: */
162 DWORD dnDevNode; /* 20: */
163 /* 24: */
164} ICOPEN,*LPICOPEN;
165
Marcus Meissner32b32d81999-01-29 15:12:10 +0000166#define ICCOMPRESS_KEYFRAME 0x00000001L
167
168typedef struct {
169 DWORD dwFlags;
170 LPBITMAPINFOHEADER lpbiOutput;
171 LPVOID lpOutput;
172 LPBITMAPINFOHEADER lpbiInput;
173 LPVOID lpInput;
174 LPDWORD lpckid;
175 LPDWORD lpdwFlags;
176 LONG lFrameNum;
177 DWORD dwFrameSize;
178 DWORD dwQuality;
179 LPBITMAPINFOHEADER lpbiPrev;
180 LPVOID lpPrev;
181} ICCOMPRESS;
182
Alexandre Julliarda3960291999-02-26 11:11:13 +0000183DWORD VFWAPIV ICCompress(
184 HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
Marcus Meissner32b32d81999-01-29 15:12:10 +0000185 LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
186 LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
187 LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev
188);
189
Alexandre Julliarda3960291999-02-26 11:11:13 +0000190#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
Eric Pouech731e9f52000-07-26 18:07:04 +0000191 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000192 hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput), \
193 (DWORD)(LPVOID)(lpbiOutput) \
194 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000195
Alexandre Julliarda3960291999-02-26 11:11:13 +0000196#define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000197
Alexandre Julliarda3960291999-02-26 11:11:13 +0000198#define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
199 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000200 hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
201 (DWORD)(LPVOID)(lpbiOutput) \
202 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000203
Eric Pouech731e9f52000-07-26 18:07:04 +0000204#define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
Alexandre Julliarda3960291999-02-26 11:11:13 +0000205 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000206 hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \
207 (DWORD)(LPVOID)(lpbiOutput) \
208 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000209
Alexandre Julliarda3960291999-02-26 11:11:13 +0000210#define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
211 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000212 hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
213 (DWORD)(LPVOID)(lpbiOutput) \
214 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000215
Alexandre Julliarda3960291999-02-26 11:11:13 +0000216#define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000217
218/* ICCOMPRESSFRAMES.dwFlags */
219#define ICCOMPRESSFRAMES_PADDING 0x00000001
220typedef struct {
221 DWORD dwFlags;
222 LPBITMAPINFOHEADER lpbiOutput;
223 LPARAM lOutput;
224 LPBITMAPINFOHEADER lpbiInput;
225 LPARAM lInput;
226 LONG lStartFrame;
227 LONG lFrameCount;
228 LONG lQuality;
229 LONG lDataRate;
230 LONG lKeyRate;
231 DWORD dwRate;
232 DWORD dwScale;
233 DWORD dwOverheadPerFrame;
234 DWORD dwReserved2;
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000235 LONG (CALLBACK *GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len);
236 LONG (CALLBACK *PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000237} ICCOMPRESSFRAMES;
238
Eric Pouech731e9f52000-07-26 18:07:04 +0000239typedef struct {
240 DWORD dwFlags;
241 LPARAM lParam;
242 /* messages for Status callback */
243#define ICSTATUS_START 0
244#define ICSTATUS_STATUS 1
245#define ICSTATUS_END 2
246#define ICSTATUS_ERROR 3
247#define ICSTATUS_YIELD 4
248 /* FIXME: some X11 libs define Status as int... */
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000249 /* LONG (CALLBACK *zStatus)(LPARAM lParam, UINT message, LONG l); */
250 LONG (CALLBACK *zStatus)(LPARAM lParam, UINT message, LONG l);
Eric Pouech731e9f52000-07-26 18:07:04 +0000251} ICSETSTATUSPROC;
252
Marcus Meissner32b32d81999-01-29 15:12:10 +0000253/* Values for wMode of ICOpen() */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000254#define ICMODE_COMPRESS 1
255#define ICMODE_DECOMPRESS 2
256#define ICMODE_FASTDECOMPRESS 3
257#define ICMODE_QUERY 4
258#define ICMODE_FASTCOMPRESS 5
259#define ICMODE_DRAW 8
260
261/* quality flags */
262#define ICQUALITY_LOW 0
263#define ICQUALITY_HIGH 10000
264#define ICQUALITY_DEFAULT -1
265
266typedef struct {
267 DWORD dwSize; /* 00: */
268 DWORD fccType; /* 04:compressor type 'vidc' 'audc' */
269 DWORD fccHandler; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
270 DWORD dwFlags; /* 0c:flags LOWORD is type specific */
271 DWORD dwVersion; /* 10:version of the driver */
272 DWORD dwVersionICM; /* 14:version of the ICM used */
273 /*
274 * under Win32, the driver always returns UNICODE strings.
275 */
276 WCHAR szName[16]; /* 18:short name */
277 WCHAR szDescription[128]; /* 38:long name */
278 WCHAR szDriver[128]; /* 138:driver that contains compressor*/
279 /* 238: */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000280} ICINFO;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000281
Marcus Meissner32b32d81999-01-29 15:12:10 +0000282/* ICINFO.dwFlags */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000283#define VIDCF_QUALITY 0x0001 /* supports quality */
284#define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */
285#define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */
286#define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */
287#define VIDCF_DRAW 0x0010 /* supports drawing */
288#define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */
289#define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */
290#define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */
291
292#define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
293
294
295/* function shortcuts */
296/* ICM_ABOUT */
297#define ICMF_ABOUT_QUERY 0x00000001
298
Alexandre Julliarda3960291999-02-26 11:11:13 +0000299#define ICQueryAbout(hic) \
300 (ICSendMessage(hic,ICM_ABOUT,(DWORD)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000301
Alexandre Julliarda3960291999-02-26 11:11:13 +0000302#define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD)(UINT)(hwnd),0)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000303
304/* ICM_CONFIGURE */
305#define ICMF_CONFIGURE_QUERY 0x00000001
Alexandre Julliarda3960291999-02-26 11:11:13 +0000306#define ICQueryConfigure(hic) \
307 (ICSendMessage(hic,ICM_CONFIGURE,(DWORD)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000308
Alexandre Julliarda3960291999-02-26 11:11:13 +0000309#define ICConfigure(hic,hwnd) \
310 ICSendMessage(hic,ICM_CONFIGURE,(DWORD)(UINT)(hwnd),0)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000311
312/* Decompression stuff */
313#define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */
314#define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */
Eric Pouech731e9f52000-07-26 18:07:04 +0000315#define ICDECOMPRESS_PREROLL 0x20000000 /* this frame is before real start */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000316#define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */
317#define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */
318
319typedef struct {
320 DWORD dwFlags; /* flags (from AVI index...) */
321 LPBITMAPINFOHEADER lpbiInput; /* BITMAPINFO of compressed data */
322 LPVOID lpInput; /* compressed data */
323 LPBITMAPINFOHEADER lpbiOutput; /* DIB to decompress to */
324 LPVOID lpOutput;
325 DWORD ckid; /* ckid from AVI file */
326} ICDECOMPRESS;
327
328typedef struct {
329 DWORD dwFlags;
330 LPBITMAPINFOHEADER lpbiSrc;
331 LPVOID lpSrc;
332 LPBITMAPINFOHEADER lpbiDst;
333 LPVOID lpDst;
334
335 /* changed for ICM_DECOMPRESSEX */
Eric Pouech731e9f52000-07-26 18:07:04 +0000336 INT xDst; /* destination rectangle */
337 INT yDst;
338 INT dxDst;
339 INT dyDst;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000340
Eric Pouech731e9f52000-07-26 18:07:04 +0000341 INT xSrc; /* source rectangle */
342 INT ySrc;
343 INT dxSrc;
344 INT dySrc;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000345} ICDECOMPRESSEX;
346
Bradley Baetza1491de2000-07-08 12:50:26 +0000347DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000348
Alexandre Julliarda3960291999-02-26 11:11:13 +0000349#define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
350 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000351 hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
352 (DWORD)(LPVOID)(lpbiOutput) \
353 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000354
Alexandre Julliarda3960291999-02-26 11:11:13 +0000355#define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
356 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000357 hic,ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
358 (DWORD) (LPVOID)(lpbiOutput) \
359 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000360
Alexandre Julliarda3960291999-02-26 11:11:13 +0000361#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
362 ((LONG)ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000363 hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), \
364 (DWORD)(LPVOID)(lpbiOutput) \
365 ))
Marcus Meissner32b32d81999-01-29 15:12:10 +0000366
Alexandre Julliarda3960291999-02-26 11:11:13 +0000367#define ICDecompressGetFormatSize(hic, lpbi) \
368 ICDecompressGetFormat(hic, lpbi, NULL)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000369
Alexandre Julliarda3960291999-02-26 11:11:13 +0000370#define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
371 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000372 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), \
373 (DWORD)(LPVOID)(lpbiOutput) \
374 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000375
Alexandre Julliarda3960291999-02-26 11:11:13 +0000376#define ICDecompressSetPalette(hic,lpbiPalette) \
377 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000378 hic,ICM_DECOMPRESS_SET_PALETTE, \
379 (DWORD)(LPVOID)(lpbiPalette),0 \
380 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000381
Alexandre Julliarda3960291999-02-26 11:11:13 +0000382#define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000383
Eric Pouech731e9f52000-07-26 18:07:04 +0000384LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
Eric Pouech731e9f52000-07-26 18:07:04 +0000385
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000386inline static LRESULT VFWAPI ICDecompressEx(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000387 LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc,
388 int xSrc, int ySrc, int dxSrc, int dySrc,
389 LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst,
390 int xDst, int yDst, int dxDst, int dyDst)
391{
392 ICDECOMPRESSEX ic;
393
394 ic.dwFlags = dwFlags;
395 ic.lpbiSrc = lpbiSrc;
396 ic.lpSrc = lpSrc;
397 ic.xSrc = xSrc;
398 ic.ySrc = ySrc;
399 ic.dxSrc = dxSrc;
400 ic.dySrc = dySrc;
401 ic.lpbiDst = lpbiDst;
402 ic.lpDst = lpDst;
403 ic.xDst = xDst;
404 ic.yDst = yDst;
405 ic.dxDst = dxDst;
406 ic.dyDst = dyDst;
407 return ICSendMessage(hic, ICM_DECOMPRESSEX, (DWORD)&ic, sizeof(ic));
408}
409
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000410inline static LRESULT VFWAPI ICDecompressExBegin(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000411 LPBITMAPINFOHEADER lpbiSrc,
412 LPVOID lpSrc,
413 int xSrc, int ySrc, int dxSrc, int dySrc,
414 LPBITMAPINFOHEADER lpbiDst,
415 LPVOID lpDst,
416 int xDst,
417 int yDst,
418 int dxDst,
419 int dyDst)
420{
421 ICDECOMPRESSEX ic;
422
423 ic.dwFlags = dwFlags;
424 ic.lpbiSrc = lpbiSrc;
425 ic.lpSrc = lpSrc;
426 ic.xSrc = xSrc;
427 ic.ySrc = ySrc;
428 ic.dxSrc = dxSrc;
429 ic.dySrc = dySrc;
430 ic.lpbiDst = lpbiDst;
431 ic.lpDst = lpDst;
432 ic.xDst = xDst;
433 ic.yDst = yDst;
434 ic.dxDst = dxDst;
435 ic.dyDst = dyDst;
436 return ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, (DWORD)&ic, sizeof(ic));
437}
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000438inline static LRESULT VFWAPI ICDecompressExQuery(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000439 LPBITMAPINFOHEADER lpbiSrc,
440 LPVOID lpSrc,
441 int xSrc, int ySrc, int dxSrc, int dySrc,
442 LPBITMAPINFOHEADER lpbiDst,
443 LPVOID lpDst,
444 int xDst,
445 int yDst,
446 int dxDst,
447 int dyDst)
448{
449 ICDECOMPRESSEX ic;
450
451 ic.dwFlags = dwFlags;
452 ic.lpbiSrc = lpbiSrc;
453 ic.lpSrc = lpSrc;
454 ic.xSrc = xSrc;
455 ic.ySrc = ySrc;
456 ic.dxSrc = dxSrc;
457 ic.dySrc = dySrc;
458 ic.lpbiDst = lpbiDst;
459 ic.lpDst = lpDst;
460 ic.xDst = xDst;
461 ic.yDst = yDst;
462 ic.dxDst = dxDst;
463 ic.dyDst = dyDst;
464 return ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, (DWORD)&ic, sizeof(ic));
465}
466
467#define ICDecompressExEnd(hic) \
468 ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000469
Marcus Meissner73458b01998-12-26 12:54:29 +0000470#define ICDRAW_QUERY 0x00000001L /* test for support */
471#define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
472#define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
Eric Pouech731e9f52000-07-26 18:07:04 +0000473#define ICDRAW_ANIMATE 0x00000008L /* expect palette animation */
474#define ICDRAW_CONTINUE 0x00000010L /* draw is a continuation of previous draw */
475#define ICDRAW_MEMORYDC 0x00000020L /* DC is offscreen, by the way */
476#define ICDRAW_UPDATING 0x00000040L /* We're updating, as opposed to playing */
477#define ICDRAW_RENDER 0x00000080L /* used to render data not draw it */
478#define ICDRAW_BUFFER 0x00000100L /* buffer data offscreen, we will need to update it */
479
480#define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \
481 ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS)
482
483#define ICDrawOpen(fccType, fccHandler, lpbiIn) \
484 ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW)
485
486HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
487 LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality,
488 LONG* plSize);
489
490HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
491 LPVOID lpBits, LPBITMAPINFO lpbiOut);
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000492
Alexandre Julliarda3960291999-02-26 11:11:13 +0000493BOOL VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
Eric Pouech731e9f52000-07-26 18:07:04 +0000494BOOL VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags);
495BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000496LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb);
497HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
Marcus Meissner960c7251999-03-13 18:09:16 +0000498HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler);
499
Eric Pouech731e9f52000-07-26 18:07:04 +0000500LRESULT VFWAPI ICClose(HIC hic);
501HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
Eric Pouech731e9f52000-07-26 18:07:04 +0000502HIC VFWAPI ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy);
503
504/* Values for wFlags of ICInstall() */
505#define ICINSTALL_UNICODE 0x8000
506#define ICINSTALL_FUNCTION 0x0001
507#define ICINSTALL_DRIVER 0x0002
508#define ICINSTALL_HDRV 0x0004
509#define ICINSTALL_DRIVERW 0x8002
510
511#define ICGetState(hic, pv, cb) \
512 ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
513#define ICSetState(hic, pv, cb) \
514 ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
515#define ICGetStateSize(hic) \
516 ICGetState(hic, NULL, 0)
517
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000518inline static DWORD ICGetDefaultQuality(HIC hic)
Eric Pouech731e9f52000-07-26 18:07:04 +0000519{
520 DWORD dwICValue;
521 ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD));
522 return dwICValue;
523}
524
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000525inline static DWORD ICGetDefaultKeyFrameRate(HIC hic)
Eric Pouech731e9f52000-07-26 18:07:04 +0000526{
527 DWORD dwICValue;
528 ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD));
529 return dwICValue;
530}
531
532#define ICDrawWindow(hic, prc) \
533 ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT))
Bradley Baetza1491de2000-07-08 12:50:26 +0000534
535/* As passed to ICM_DRAW_SUGGESTFORMAT */
536typedef struct {
537 DWORD dwFlags;
538 LPBITMAPINFOHEADER lpbiIn;
539 LPBITMAPINFOHEADER lpbiSuggest;
540 INT dxSrc;
541 INT dySrc;
542 INT dxDst;
543 INT dyDst;
544 HIC hicDecompressor;
545} ICDRAWSUGGEST;
546
547typedef struct {
Eric Pouech731e9f52000-07-26 18:07:04 +0000548 DWORD dwFlags;
549 int iStart;
550 int iLen;
551 LPPALETTEENTRY lppe;
552} ICPALETTE;
553
Alexandre Julliarda3960291999-02-26 11:11:13 +0000554DWORD VFWAPIV ICDrawBegin(
555 HIC hic,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000556 DWORD dwFlags,/* flags */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000557 HPALETTE hpal, /* palette to draw with */
558 HWND hwnd, /* window to draw to */
559 HDC hdc, /* HDC to draw to */
560 INT xDst, /* destination rectangle */
561 INT yDst,
562 INT dxDst,
563 INT dyDst,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000564 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000565 INT xSrc, /* source rectangle */
566 INT ySrc,
567 INT dxSrc,
568 INT dySrc,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000569 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
Marcus Meissner32b32d81999-01-29 15:12:10 +0000570 DWORD dwScale
571);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000572
Bradley Baetza1491de2000-07-08 12:50:26 +0000573/* as passed to ICM_DRAW_BEGIN */
Marcus Meissner960c7251999-03-13 18:09:16 +0000574typedef struct {
575 DWORD dwFlags;
576 HPALETTE hpal;
577 HWND hwnd;
578 HDC hdc;
579 INT xDst;
580 INT yDst;
581 INT dxDst;
582 INT dyDst;
583 LPBITMAPINFOHEADER lpbi;
584 INT xSrc;
585 INT ySrc;
586 INT dxSrc;
587 INT dySrc;
588 DWORD dwRate;
589 DWORD dwScale;
590} ICDRAWBEGIN;
591
Patrik Stridvall0f8bc5b1999-04-22 16:27:50 +0000592#define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */
593#define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */
594#define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */
595#define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */
596#define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */
Marcus Meissner960c7251999-03-13 18:09:16 +0000597
598typedef struct {
599 DWORD dwFlags;
600 LPVOID lpFormat;
601 LPVOID lpData;
602 DWORD cbData;
603 LONG lTime;
604} ICDRAW;
605
606DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime);
607
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000608inline static LRESULT VFWAPI ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn,
Eric Pouech731e9f52000-07-26 18:07:04 +0000609 LPBITMAPINFOHEADER lpbiOut,
610 int dxSrc, int dySrc,
611 int dxDst, int dyDst,
612 HIC hicDecomp)
613{
614 ICDRAWSUGGEST ic;
615
616 ic.lpbiIn = lpbiIn;
617 ic.lpbiSuggest = lpbiOut;
618 ic.dxSrc = dxSrc;
619 ic.dySrc = dySrc;
620 ic.dxDst = dxDst;
621 ic.dyDst = dyDst;
622 ic.hicDecompressor = hicDecomp;
623 return ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, (DWORD)&ic, sizeof(ic));
624}
625
626#define ICDrawQuery(hic, lpbiInput) \
627 ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L)
628
629#define ICDrawChangePalette(hic, lpbiInput) \
630 ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L)
631
632#define ICGetBuffersWanted(hic, lpdwBuffers) \
633 ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0)
634
635#define ICDrawEnd(hic) \
636 ICSendMessage(hic, ICM_DRAW_END, 0, 0)
637
638#define ICDrawStart(hic) \
639 ICSendMessage(hic, ICM_DRAW_START, 0, 0)
640
641#define ICDrawStartPlay(hic, lFrom, lTo) \
642 ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo))
643
644#define ICDrawStop(hic) \
645 ICSendMessage(hic, ICM_DRAW_STOP, 0, 0)
646
647#define ICDrawStopPlay(hic) \
648 ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0)
649
650#define ICDrawGetTime(hic, lplTime) \
651 ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0)
652
653#define ICDrawSetTime(hic, lTime) \
654 ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0)
655
656#define ICDrawRealize(hic, hdc, fBackground) \
657 ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground))
658
659#define ICDrawFlush(hic) \
660 ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0)
661
662#define ICDrawRenderBuffer(hic) \
663 ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0)
664
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000665inline static LRESULT VFWAPI ICSetStatusProc(HIC hic, DWORD dwFlags, LRESULT lParam,
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000666 LONG (CALLBACK *fpfnStatus)(LPARAM, UINT, LONG))
Eric Pouech731e9f52000-07-26 18:07:04 +0000667{
668 ICSETSTATUSPROC ic;
669
670 ic.dwFlags = dwFlags;
671 ic.lParam = lParam;
672 /* FIXME: see comment in ICSETSTATUSPROC definition */
673 ic.zStatus = fpfnStatus;
674
675 return ICSendMessage(hic, ICM_SET_STATUS_PROC, (DWORD)&ic, sizeof(ic));
676}
677
678typedef struct {
679 LONG cbSize;
680 DWORD dwFlags;
681 HIC hic;
682 DWORD fccType;
683 DWORD fccHandler;
684 LPBITMAPINFO lpbiIn;
685 LPBITMAPINFO lpbiOut;
686 LPVOID lpBitsOut;
687 LPVOID lpBitsPrev;
688 LONG lFrame;
689 LONG lKey;
690 LONG lDataRate;
691 LONG lQ;
692 LONG lKeyCount;
693 LPVOID lpState;
694 LONG cbState;
695} COMPVARS, *PCOMPVARS;
696
697#define ICMF_COMPVARS_VALID 0x00000001
698
699BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData,
700 PCOMPVARS pc, LPSTR lpszTitle);
701
702#define ICMF_CHOOSE_KEYFRAME 0x0001
703#define ICMF_CHOOSE_DATARATE 0x0002
704#define ICMF_CHOOSE_PREVIEW 0x0004
705#define ICMF_CHOOSE_ALLCOMPRESSORS 0x0008
706
707BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn);
708void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc);
709
710LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits,
711 BOOL *pfKey, LONG *plSize);
712void VFWAPI ICCompressorFree(PCOMPVARS pc);
713
Marcus Meissner32b32d81999-01-29 15:12:10 +0000714/********************* AVIFILE function declarations *************************/
Eric Pouech26146cd2001-02-14 21:49:22 +0000715
716#ifndef mmioFOURCC
717#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
718 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
719 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
720#endif
721
722#ifndef aviTWOCC
723#define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
724#endif
725
726typedef WORD TWOCC;
727
728#define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
729#define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
730
Eric Pouech731e9f52000-07-26 18:07:04 +0000731#define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
732#define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
733#define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
734#define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
735#define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
736#define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
737#define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
738#define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
739
740#define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
741#define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
742
743#define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
Marcus Meissner32b32d81999-01-29 15:12:10 +0000744
Marcus Meissner676a5131999-02-05 09:41:55 +0000745#define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
746#define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
747#define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
748#define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
749
750/* Basic chunk types */
751#define cktypeDIBbits aviTWOCC('d', 'b')
752#define cktypeDIBcompressed aviTWOCC('d', 'c')
753#define cktypePALchange aviTWOCC('p', 'c')
754#define cktypeWAVEbytes aviTWOCC('w', 'b')
755
756/* Chunk id to use for extra chunks for padding. */
757#define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
758
Eric Pouech26146cd2001-02-14 21:49:22 +0000759#define FromHex(n) (((n) >= 'A') ? ((n) + 10 - 'A') : ((n) - '0'))
760#define StreamFromFOURCC(fcc) ((WORD)((FromHex(LOBYTE(LOWORD(fcc))) << 4) + \
761 (FromHex(HIBYTE(LOWORD(fcc))))))
762#define TWOCCFromFOURCC(fcc) HIWORD(fcc)
763#define ToHex(n) ((BYTE)(((n) > 9) ? ((n) - 10 + 'A') : ((n) + '0')))
764#define MAKEAVICKID(tcc, stream) \
765 MAKELONG((ToHex((stream) & 0x0f) << 8) | \
766 (ToHex(((stream) & 0xf0) >> 4)), tcc)
767
Marcus Meissner32b32d81999-01-29 15:12:10 +0000768/* AVIFileHdr.dwFlags */
769#define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
770#define AVIF_MUSTUSEINDEX 0x00000020
771#define AVIF_ISINTERLEAVED 0x00000100
772#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames*/
773#define AVIF_WASCAPTUREFILE 0x00010000
774#define AVIF_COPYRIGHTED 0x00020000
775
776#define AVI_HEADERSIZE 2048
777
Marcus Meissner676a5131999-02-05 09:41:55 +0000778typedef struct _MainAVIHeader
779{
780 DWORD dwMicroSecPerFrame;
781 DWORD dwMaxBytesPerSec;
782 DWORD dwPaddingGranularity;
783 DWORD dwFlags;
784 DWORD dwTotalFrames;
785 DWORD dwInitialFrames;
786 DWORD dwStreams;
787 DWORD dwSuggestedBufferSize;
788 DWORD dwWidth;
789 DWORD dwHeight;
790 DWORD dwReserved[4];
791} MainAVIHeader;
792
Marcus Meissner32b32d81999-01-29 15:12:10 +0000793/* AVIStreamHeader.dwFlags */
794#define AVISF_DISABLED 0x00000001
795#define AVISF_VIDEO_PALCHANGES 0x00010000
796
797typedef struct {
798 FOURCC fccType;
799 FOURCC fccHandler;
800 DWORD dwFlags; /* AVISF_* */
801 WORD wPriority;
802 WORD wLanguage;
803 DWORD dwInitialFrames;
804 DWORD dwScale;
805 DWORD dwRate; /* dwRate / dwScale == samples/second */
806 DWORD dwStart;
807 DWORD dwLength; /* In units above... */
808 DWORD dwSuggestedBufferSize;
809 DWORD dwQuality;
810 DWORD dwSampleSize;
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000811 struct { SHORT left, top, right, bottom; } rcFrame; /* word.word - word.word in file */
Marcus Meissner32b32d81999-01-29 15:12:10 +0000812} AVIStreamHeader;
813
814/* AVIINDEXENTRY.dwFlags */
815#define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */
Eric Pouech731e9f52000-07-26 18:07:04 +0000816#define AVIIF_TWOCC 0x00000002
Marcus Meissner32b32d81999-01-29 15:12:10 +0000817#define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
818
819#define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */
820#define AVIIF_COMPUSE 0x0FFF0000
821
822typedef struct _AVIINDEXENTRY {
823 DWORD ckid;
824 DWORD dwFlags;
825 DWORD dwChunkOffset;
826 DWORD dwChunkLength;
827} AVIINDEXENTRY;
828
829typedef struct _AVIPALCHANGE {
830 BYTE bFirstEntry;
831 BYTE bNumEntries;
832 WORD wFlags; /* pad */
833 PALETTEENTRY peNew[1];
834} AVIPALCHANGE;
835
836#define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
837
838#define AVIGETFRAMEF_BESTDISPLAYFMT 1
839
Alexandre Julliarda3960291999-02-26 11:11:13 +0000840typedef struct _AVISTREAMINFOA {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000841 DWORD fccType;
842 DWORD fccHandler;
843 DWORD dwFlags; /* AVIIF_* */
844 DWORD dwCaps;
845 WORD wPriority;
846 WORD wLanguage;
847 DWORD dwScale;
848 DWORD dwRate; /* dwRate / dwScale == samples/second */
849 DWORD dwStart;
850 DWORD dwLength; /* In units above... */
851 DWORD dwInitialFrames;
852 DWORD dwSuggestedBufferSize;
853 DWORD dwQuality;
854 DWORD dwSampleSize;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000855 RECT rcFrame;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000856 DWORD dwEditCount;
857 DWORD dwFormatChangeCount;
858 CHAR szName[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000859} AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000860
Alexandre Julliarda3960291999-02-26 11:11:13 +0000861typedef struct _AVISTREAMINFOW {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000862 DWORD fccType;
863 DWORD fccHandler;
864 DWORD dwFlags;
865 DWORD dwCaps;
866 WORD wPriority;
867 WORD wLanguage;
868 DWORD dwScale;
869 DWORD dwRate; /* dwRate / dwScale == samples/second */
870 DWORD dwStart;
871 DWORD dwLength; /* In units above... */
872 DWORD dwInitialFrames;
873 DWORD dwSuggestedBufferSize;
874 DWORD dwQuality;
875 DWORD dwSampleSize;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000876 RECT rcFrame;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000877 DWORD dwEditCount;
878 DWORD dwFormatChangeCount;
879 WCHAR szName[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000880} AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
Marcus Meissner676a5131999-02-05 09:41:55 +0000881DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
882DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
883DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000884
885#define AVISTREAMINFO_DISABLED 0x00000001
886#define AVISTREAMINFO_FORMATCHANGES 0x00010000
887
888/* AVIFILEINFO.dwFlags */
889#define AVIFILEINFO_HASINDEX 0x00000010
890#define AVIFILEINFO_MUSTUSEINDEX 0x00000020
891#define AVIFILEINFO_ISINTERLEAVED 0x00000100
892#define AVIFILEINFO_WASCAPTUREFILE 0x00010000
893#define AVIFILEINFO_COPYRIGHTED 0x00020000
894
895/* AVIFILEINFO.dwCaps */
896#define AVIFILECAPS_CANREAD 0x00000001
897#define AVIFILECAPS_CANWRITE 0x00000002
898#define AVIFILECAPS_ALLKEYFRAMES 0x00000010
899#define AVIFILECAPS_NOCOMPRESSION 0x00000020
900
Alexandre Julliarda3960291999-02-26 11:11:13 +0000901typedef struct _AVIFILEINFOW {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000902 DWORD dwMaxBytesPerSec;
903 DWORD dwFlags;
904 DWORD dwCaps;
905 DWORD dwStreams;
906 DWORD dwSuggestedBufferSize;
907 DWORD dwWidth;
908 DWORD dwHeight;
909 DWORD dwScale;
910 DWORD dwRate;
911 DWORD dwLength;
912 DWORD dwEditCount;
913 WCHAR szFileType[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000914} AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
915typedef struct _AVIFILEINFOA {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000916 DWORD dwMaxBytesPerSec;
917 DWORD dwFlags;
918 DWORD dwCaps;
919 DWORD dwStreams;
920 DWORD dwSuggestedBufferSize;
921 DWORD dwWidth;
922 DWORD dwHeight;
923 DWORD dwScale;
924 DWORD dwRate;
925 DWORD dwLength;
926 DWORD dwEditCount;
Marcus Meissner676a5131999-02-05 09:41:55 +0000927 CHAR szFileType[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000928} AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
Marcus Meissner676a5131999-02-05 09:41:55 +0000929DECL_WINELIB_TYPE_AW(AVIFILEINFO)
930DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
931DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000932
933/* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
934#define AVICOMPRESSF_INTERLEAVE 0x00000001
935#define AVICOMPRESSF_DATARATE 0x00000002
936#define AVICOMPRESSF_KEYFRAMES 0x00000004
937#define AVICOMPRESSF_VALID 0x00000008
938
939typedef struct {
940 DWORD fccType; /* stream type, for consistency */
941 DWORD fccHandler; /* compressor */
942 DWORD dwKeyFrameEvery; /* keyframe rate */
943 DWORD dwQuality; /* compress quality 0-10,000 */
944 DWORD dwBytesPerSecond; /* bytes per second */
945 DWORD dwFlags; /* flags... see below */
946 LPVOID lpFormat; /* save format */
947 DWORD cbFormat;
948 LPVOID lpParms; /* compressor options */
949 DWORD cbParms;
950 DWORD dwInterleaveEvery; /* for non-video streams only */
951} AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
952
Eric Pouech26146cd2001-02-14 21:49:22 +0000953#include "ole2.h"
Marcus Meissner32b32d81999-01-29 15:12:10 +0000954
955#define DEFINE_AVIGUID(name, l, w1, w2) \
956 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
957
958DEFINE_AVIGUID(IID_IAVIFile, 0x00020020, 0, 0);
959DEFINE_AVIGUID(IID_IAVIStream, 0x00020021, 0, 0);
960DEFINE_AVIGUID(IID_IAVIStreaming, 0x00020022, 0, 0);
961DEFINE_AVIGUID(IID_IGetFrame, 0x00020023, 0, 0);
962DEFINE_AVIGUID(IID_IAVIEditStream, 0x00020024, 0, 0);
963
964DEFINE_AVIGUID(CLSID_AVIFile, 0x00020000, 0, 0);
965
Francois Gouget4e4f1d11999-03-17 15:16:01 +0000966/*****************************************************************************
967 * IAVIStream interface
968 */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000969#define ICOM_INTERFACE IAVIStream
Marcus Meissner960c7251999-03-13 18:09:16 +0000970#define IAVIStream_METHODS \
Francois Gouget4e4f1d11999-03-17 15:16:01 +0000971 ICOM_METHOD2(HRESULT,Create, LPARAM,lParam1, LPARAM,lParam2) \
972 ICOM_METHOD2(HRESULT,Info, AVISTREAMINFOW*,psi, LONG,lSize) \
973 ICOM_METHOD2(LONG, FindSample, LONG,lPos, LONG,lFlags) \
974 ICOM_METHOD3(HRESULT,ReadFormat, LONG,lPos, LPVOID,lpFormat, LONG*,lpcbFormat) \
975 ICOM_METHOD3(HRESULT,SetFormat, LONG,lPos, LPVOID,lpFormat, LONG,cbFormat) \
976 ICOM_METHOD6(HRESULT,Read, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, LONG*,plBytes, LONG*,plSamples) \
977 ICOM_METHOD7(HRESULT,Write, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, DWORD,dwFlags, LONG*,plSampWritten, LONG*,plBytesWritten) \
978 ICOM_METHOD2(HRESULT,Delete, LONG,lStart, LONG,lSamples) \
979 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
980 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
981 ICOM_METHOD2(HRESULT,SetInfo, AVISTREAMINFOW*,plInfo, LONG,cbInfo)
Marcus Meissner960c7251999-03-13 18:09:16 +0000982#define IAVIStream_IMETHODS \
983 IUnknown_IMETHODS \
984 IAVIStream_METHODS
985ICOM_DEFINE(IAVIStream, IUnknown)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000986#undef ICOM_INTERFACE
987
Francois Gouget4e4f1d11999-03-17 15:16:01 +0000988/*** IUnknown methods ***/
989#define IAVIStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
990#define IAVIStream_AddRef(p) ICOM_CALL (AddRef,p)
991#define IAVIStream_Release(p) ICOM_CALL (Release,p)
992/*** IAVIStream methods ***/
993#define IAVIStream_Create(p,a,b) ICOM_CALL2(Create,p,a,b)
994#define IAVIStream_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
995#define IAVIStream_FindSample(p,a,b) ICOM_CALL2(FindSample,p,a,b)
996#define IAVIStream_ReadFormat(p,a,b,c) ICOM_CALL3(ReadFormat,p,a,b,c)
997#define IAVIStream_SetFormat(p,a,b,c) ICOM_CALL3(SetFormat,p,a,b,c)
998#define IAVIStream_Read(p,a,b,c,d,e,f) ICOM_CALL6(Read,p,a,b,c,d,e,f)
999#define IAVIStream_Write(p,a,b,c,d,e,f,g) ICOM_CALL7(Write,p,a,b,c,d,e,f,g)
1000#define IAVIStream_Delete(p,a,b) ICOM_CALL2(Delete,p,a,b)
1001#define IAVIStream_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
1002#define IAVIStream_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
1003#define IAVIStream_SetInfo(p,a,b) ICOM_CALL2(SetInfo,p,a,b)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001004
1005HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler);
1006
Hidenori Takeshimac814a6c2001-06-07 22:28:19 +00001007HRESULT WINAPI AVIStreamCreate(PAVISTREAM*,LONG,LONG,CLSID*);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001008HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size);
1009HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG size);
1010#define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo)
1011LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos);
1012HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg);
1013PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted);
1014LONG WINAPI AVIStreamLength(PAVISTREAM iface);
1015HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
1016HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread);
1017HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize);
1018ULONG WINAPI AVIStreamRelease(PAVISTREAM iface);
1019HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize);
1020LONG WINAPI AVIStreamStart(PAVISTREAM iface);
1021HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
1022HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size);
Eric Pouech731e9f52000-07-26 18:07:04 +00001023HRESULT WINAPI AVIStreamOpenFromFileA(PAVISTREAM *ppavi, LPCSTR szFile,
1024 DWORD fccType, LONG lParam,
1025 UINT mode, CLSID *pclsidHandler);
1026HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile,
1027 DWORD fccType, LONG lParam,
1028 UINT mode, CLSID *pclsidHandler);
1029#define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001030
Eric Pouech731e9f52000-07-26 18:07:04 +00001031#define AVIStreamFormatSize(pavi, lPos, plSize) \
1032 AVIStreamReadFormat(pavi, lPos, NULL, plSize)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001033
1034/*****************************************************************************
1035 * IAVIFile interface
1036 */
1037/* In Win32 this interface uses UNICODE only */
Alexandre Julliarda3960291999-02-26 11:11:13 +00001038#define ICOM_INTERFACE IAVIFile
Marcus Meissner960c7251999-03-13 18:09:16 +00001039#define IAVIFile_METHODS \
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001040 ICOM_METHOD2(HRESULT,Info, AVIFILEINFOW*,pfi, LONG,lSize) \
1041 ICOM_METHOD3(HRESULT,GetStream, PAVISTREAM*,ppStream, DWORD,fccType, LONG,lParam) \
1042 ICOM_METHOD2(HRESULT,CreateStream, PAVISTREAM*,ppStream, AVISTREAMINFOW*,psi) \
1043 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
1044 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
Marcus Meissner960c7251999-03-13 18:09:16 +00001045 ICOM_METHOD (HRESULT,EndRecord) \
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001046 ICOM_METHOD2(HRESULT,DeleteStream, DWORD,fccType, LONG,lParam)
Marcus Meissner960c7251999-03-13 18:09:16 +00001047#define IAVIFile_IMETHODS \
1048 IUnknown_IMETHODS \
1049 IAVIFile_METHODS
1050ICOM_DEFINE(IAVIFile,IUnknown)
Marcus Meissner32b32d81999-01-29 15:12:10 +00001051#undef ICOM_INTERFACE
1052
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001053/*** IUnknown methods ***/
1054#define IAVIFile_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1055#define IAVIFile_AddRef(p) ICOM_CALL (AddRef,p)
1056#define IAVIFile_Release(p) ICOM_CALL (Release,p)
1057/*** IAVIFile methods ***/
1058#define IAVIFile_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
1059#define IAVIFile_GetStream(p,a,b,c) ICOM_CALL3(GetStream,p,a,b,c)
1060#define IAVIFile_CreateStream(p,a,b) ICOM_CALL2(CreateStream,p,a,b)
1061#define IAVIFile_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
1062#define IAVIFile_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
1063#define IAVIFile_EndRecord(p) ICOM_CALL (EndRecord,p)
1064#define IAVIFile_DeleteStream(p,a,b) ICOM_CALL2(DeleteStream,p,a,b)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001065
1066HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOA* psi);
1067HRESULT WINAPI AVIFileCreateStreamW(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOW* psi);
1068#define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream)
1069void WINAPI AVIFileExit(void);
1070HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile,PAVISTREAM* avis,DWORD fccType,LONG lParam);
1071HRESULT WINAPI AVIFileInfoA(PAVIFILE pfile,PAVIFILEINFOA pfi,LONG lSize);
1072HRESULT WINAPI AVIFileInfoW(PAVIFILE pfile,PAVIFILEINFOW pfi,LONG lSize);
1073#define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo)
1074void WINAPI AVIFileInit(void);
1075HRESULT WINAPI AVIFileOpenA(PAVIFILE* ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler);
1076HRESULT WINAPI AVIFileOpenW(PAVIFILE* ppfile,LPCWSTR szFile,UINT uMode,LPCLSID lpHandler);
1077#define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen)
1078ULONG WINAPI AVIFileRelease(PAVIFILE iface);
1079
1080
1081/*****************************************************************************
1082 * IGetFrame interface
1083 */
Marcus Meissner960c7251999-03-13 18:09:16 +00001084#define ICOM_INTERFACE IGetFrame
1085#define IGetFrame_METHODS \
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001086 ICOM_METHOD1(LPVOID, GetFrame, LONG,lPos) \
1087 ICOM_METHOD3(HRESULT,Begin, LONG,lStart, LONG,lEnd, LONG,lRate) \
Marcus Meissner960c7251999-03-13 18:09:16 +00001088 ICOM_METHOD (HRESULT,End) \
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001089 ICOM_METHOD6(HRESULT,SetFormat, LPBITMAPINFOHEADER,lpbi, LPVOID,lpBits, INT,x, INT,y, INT,dx, INT,dy)
Marcus Meissner960c7251999-03-13 18:09:16 +00001090#define IGetFrame_IMETHODS \
1091 IUnknown_IMETHODS \
1092 IGetFrame_METHODS
1093ICOM_DEFINE(IGetFrame,IUnknown)
Marcus Meissner676a5131999-02-05 09:41:55 +00001094#undef ICOM_INTERFACE
1095
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001096/*** IUnknown methods ***/
1097#define IGetFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
1098#define IGetFrame_AddRef(p) ICOM_CALL (AddRef,p)
1099#define IGetFrame_Release(p) ICOM_CALL (Release,p)
1100/*** IGetFrame methods ***/
1101#define IGetFrame_GetFrame(p,a) ICOM_CALL1(GetFrame,p,a)
1102#define IGetFrame_Begin(p,a,b,c) ICOM_CALL3(Begin,p,a,b,c)
1103#define IGetFrame_End(p) ICOM_CALL (End,p)
1104#define IGetFrame_SetFormat(p,a,b,c,d,e,f) ICOM_CALL6(SetFormat,p,a,b,c,d,e,f)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001105
Marcus Meissner32b32d81999-01-29 15:12:10 +00001106#define AVIERR_OK 0
1107#define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
1108
1109#define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
1110#define AVIERR_BADFORMAT MAKE_AVIERR(102)
1111#define AVIERR_MEMORY MAKE_AVIERR(103)
1112#define AVIERR_INTERNAL MAKE_AVIERR(104)
1113#define AVIERR_BADFLAGS MAKE_AVIERR(105)
1114#define AVIERR_BADPARAM MAKE_AVIERR(106)
1115#define AVIERR_BADSIZE MAKE_AVIERR(107)
1116#define AVIERR_BADHANDLE MAKE_AVIERR(108)
1117#define AVIERR_FILEREAD MAKE_AVIERR(109)
1118#define AVIERR_FILEWRITE MAKE_AVIERR(110)
1119#define AVIERR_FILEOPEN MAKE_AVIERR(111)
1120#define AVIERR_COMPRESSOR MAKE_AVIERR(112)
1121#define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
1122#define AVIERR_READONLY MAKE_AVIERR(114)
1123#define AVIERR_NODATA MAKE_AVIERR(115)
1124#define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
1125#define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
1126#define AVIERR_USERABORT MAKE_AVIERR(198)
1127#define AVIERR_ERROR MAKE_AVIERR(199)
1128
Eric Pouech26146cd2001-02-14 21:49:22 +00001129HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCSTR szFile);
1130HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCWSTR szFile);
1131#define MCIWndCreate WINELIB_NAME_AW(MCIWndCreate)
1132
1133#define MCIWNDOPENF_NEW 0x0001
1134
1135#define MCIWNDF_NOAUTOSIZEWINDOW 0x0001
1136#define MCIWNDF_NOPLAYBAR 0x0002
1137#define MCIWNDF_NOAUTOSIZEMOVIE 0x0004
1138#define MCIWNDF_NOMENU 0x0008
1139#define MCIWNDF_SHOWNAME 0x0010
1140#define MCIWNDF_SHOWPOS 0x0020
1141#define MCIWNDF_SHOWMODE 0x0040
1142#define MCIWNDF_SHOWALL 0x0070
1143
1144#define MCIWNDF_NOTIFYMODE 0x0100
1145#define MCIWNDF_NOTIFYPOS 0x0200
1146#define MCIWNDF_NOTIFYSIZE 0x0400
1147#define MCIWNDF_NOTIFYERROR 0x1000
1148#define MCIWNDF_NOTIFYALL 0x1F00
1149
1150#define MCIWNDF_NOTIFYANSI 0x0080
1151
1152#define MCIWNDF_NOTIFYMEDIAA 0x0880
1153#define MCIWNDF_NOTIFYMEDIAW 0x0800
1154#define MCIWNDF_NOTIFYMEDIA WINELIB_NAME_AW(MCIWNDF_NOTIFYMEDIA)
1155
1156#define MCIWNDF_RECORD 0x2000
1157#define MCIWNDF_NOERRORDLG 0x4000
1158#define MCIWNDF_NOOPEN 0x8000
1159
1160#ifdef __cplusplus
1161#define MCIWndSM ::SendMessage
1162#else
1163#define MCIWndSM SendMessage
1164#endif
1165
1166#define MCIWndCanPlay(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_PLAY,0,0)
1167#define MCIWndCanRecord(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_RECORD,0,0)
1168#define MCIWndCanSave(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_SAVE,0,0)
1169#define MCIWndCanWindow(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_WINDOW,0,0)
1170#define MCIWndCanEject(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_EJECT,0,0)
1171#define MCIWndCanConfig(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_CONFIG,0,0)
1172#define MCIWndPaletteKick(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_PALETTEKICK,0,0)
1173
1174#define MCIWndSave(hWnd,szFile) (LONG)MCIWndSM(hWnd,MCI_SAVE,0,(LPARAM)(LPVOID)(szFile))
1175#define MCIWndSaveDialog(hWnd) MCIWndSave(hWnd,-1)
1176
1177#define MCIWndNew(hWnd,lp) (LONG)MCIWndSM(hWnd,MCIWNDM_NEW,0,(LPARAM)(LPVOID)(lp))
1178
1179#define MCIWndRecord(hWnd) (LONG)MCIWndSM(hWnd,MCI_RECORD,0,0)
1180#define MCIWndOpen(hWnd,sz,f) (LONG)MCIWndSM(hWnd,MCIWNDM_OPEN,(WPARAM)(UINT)(f),(LPARAM)(LPVOID)(sz))
1181#define MCIWndOpenDialog(hWnd) MCIWndOpen(hWnd,-1,0)
1182#define MCIWndClose(hWnd) (LONG)MCIWndSM(hWnd,MCI_CLOSE,0,0)
1183#define MCIWndPlay(hWnd) (LONG)MCIWndSM(hWnd,MCI_PLAY,0,0)
1184#define MCIWndStop(hWnd) (LONG)MCIWndSM(hWnd,MCI_STOP,0,0)
1185#define MCIWndPause(hWnd) (LONG)MCIWndSM(hWnd,MCI_PAUSE,0,0)
1186#define MCIWndResume(hWnd) (LONG)MCIWndSM(hWnd,MCI_RESUME,0,0)
1187#define MCIWndSeek(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCI_SEEK,0,(LPARAM)(LONG)(lPos))
1188#define MCIWndEject(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_EJECT,0,0)
1189
1190#define MCIWndHome(hWnd) MCIWndSeek(hWnd,MCIWND_START)
1191#define MCIWndEnd(hWnd) MCIWndSeek(hWnd,MCIWND_END)
1192
1193#define MCIWndGetSource(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_GET_SOURCE,0,(LPARAM)(LPRECT)(prc))
1194#define MCIWndPutSource(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_PUT_SOURCE,0,(LPARAM)(LPRECT)(prc))
1195
1196#define MCIWndGetDest(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_GET_DEST,0,(LPARAM)(LPRECT)(prc))
1197#define MCIWndPutDest(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_PUT_DEST,0,(LPARAM)(LPRECT)(prc))
1198
1199#define MCIWndPlayReverse(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYREVERSE,0,0)
1200#define MCIWndPlayFrom(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYFROM,0,(LPARAM)(LONG)(lPos))
1201#define MCIWndPlayTo(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYTO, 0,(LPARAM)(LONG)(lPos))
1202#define MCIWndPlayFromTo(hWnd,lStart,lEnd) (MCIWndSeek(hWnd,lStart),MCIWndPlayTo(hWnd,lEnd))
1203
1204#define MCIWndGetDeviceID(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETDEVICEID,0,0)
1205#define MCIWndGetAlias(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETALIAS,0,0)
1206#define MCIWndGetMode(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETMODE,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1207#define MCIWndGetPosition(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETPOSITION,0,0)
1208#define MCIWndGetPositionString(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETPOSITION,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1209#define MCIWndGetStart(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETSTART,0,0)
1210#define MCIWndGetLength(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETLENGTH,0,0)
1211#define MCIWndGetEnd(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETEND,0,0)
1212
1213#define MCIWndStep(hWnd,n) (LONG)MCIWndSM(hWnd,MCI_STEP,0,(LPARAM)(long)(n))
1214
1215#define MCIWndDestroy(hWnd) (VOID)MCIWndSM(hWnd,WM_CLOSE,0,0)
1216#define MCIWndSetZoom(hWnd,iZoom) (VOID)MCIWndSM(hWnd,MCIWNDM_SETZOOM,0,(LPARAM)(UINT)(iZoom))
1217#define MCIWndGetZoom(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETZOOM,0,0)
1218#define MCIWndSetVolume(hWnd,iVol) (LONG)MCIWndSM(hWnd,MCIWNDM_SETVOLUME,0,(LPARAM)(UINT)(iVol))
1219#define MCIWndGetVolume(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETVOLUME,0,0)
1220#define MCIWndSetSpeed(hWnd,iSpeed) (LONG)MCIWndSM(hWnd,MCIWNDM_SETSPEED,0,(LPARAM)(UINT)(iSpeed))
1221#define MCIWndGetSpeed(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETSPEED,0,0)
1222#define MCIWndSetTimeFormat(hWnd,lp) (LONG)MCIWndSM(hWnd,MCIWNDM_SETTIMEFORMAT,0,(LPARAM)(LPTSTR)(lp))
1223#define MCIWndGetTimeFormat(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETTIMEFORMAT,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1224#define MCIWndValidateMedia(hWnd) (VOID)MCIWndSM(hWnd,MCIWNDM_VALIDATEMEDIA,0,0)
1225
1226#define MCIWndSetRepeat(hWnd,f) (void)MCIWndSM(hWnd,MCIWNDM_SETREPEAT,0,(LPARAM)(BOOL)(f))
1227#define MCIWndGetRepeat(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_GETREPEAT,0,0)
1228
1229#define MCIWndUseFrames(hWnd) MCIWndSetTimeFormat(hWnd,TEXT("frames"))
1230#define MCIWndUseTime(hWnd) MCIWndSetTimeFormat(hWnd,TEXT("ms"))
1231
1232#define MCIWndSetActiveTimer(hWnd,active) \
1233 (VOID)MCIWndSM(hWnd,MCIWNDM_SETACTIVETIMER, \
1234 (WPARAM)(UINT)(active),0L)
1235#define MCIWndSetInactiveTimer(hWnd,inactive) \
1236 (VOID)MCIWndSM(hWnd,MCIWNDM_SETINACTIVETIMER, \
1237 (WPARAM)(UINT)(inactive),0L)
1238#define MCIWndSetTimers(hWnd,active,inactive) \
1239 (VOID)MCIWndSM(hWnd,MCIWNDM_SETTIMERS,(WPARAM)(UINT)(active),\
1240 (LPARAM)(UINT)(inactive))
1241#define MCIWndGetActiveTimer(hWnd) \
1242 (UINT)MCIWndSM(hWnd,MCIWNDM_GETACTIVETIMER,0,0L);
1243#define MCIWndGetInactiveTimer(hWnd) \
1244 (UINT)MCIWndSM(hWnd,MCIWNDM_GETINACTIVETIMER,0,0L);
1245
1246#define MCIWndRealize(hWnd,fBkgnd) (LONG)MCIWndSM(hWnd,MCIWNDM_REALIZE,(WPARAM)(BOOL)(fBkgnd),0)
1247
1248#define MCIWndSendString(hWnd,sz) (LONG)MCIWndSM(hWnd,MCIWNDM_SENDSTRING,0,(LPARAM)(LPTSTR)(sz))
1249#define MCIWndReturnString(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_RETURNSTRING,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1250#define MCIWndGetError(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETERROR,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1251
1252#define MCIWndGetPalette(hWnd) (HPALETTE)MCIWndSM(hWnd,MCIWNDM_GETPALETTE,0,0)
1253#define MCIWndSetPalette(hWnd,hpal) (LONG)MCIWndSM(hWnd,MCIWNDM_SETPALETTE,(WPARAM)(HPALETTE)(hpal),0)
1254
1255#define MCIWndGetFileName(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETFILENAME,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1256#define MCIWndGetDevice(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETDEVICE,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1257
1258#define MCIWndGetStyles(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETSTYLES,0,0L)
1259#define MCIWndChangeStyles(hWnd,mask,value) (LONG)MCIWndSM(hWnd,MCIWNDM_CHANGESTYLES,(WPARAM)(UINT)(mask),(LPARAM)(LONG)(value))
1260
1261#define MCIWndOpenInterface(hWnd,pUnk) (LONG)MCIWndSM(hWnd,MCIWNDM_OPENINTERFACE,0,(LPARAM)(LPUNKNOWN)(pUnk))
1262
1263#define MCIWndSetOwner(hWnd,hWndP) (LONG)MCIWndSM(hWnd,MCIWNDM_SETOWNER,(WPARAM)(hWndP),0)
1264
1265#define MCIWNDM_GETDEVICEID (WM_USER + 100)
1266#define MCIWNDM_GETSTART (WM_USER + 103)
1267#define MCIWNDM_GETLENGTH (WM_USER + 104)
1268#define MCIWNDM_GETEND (WM_USER + 105)
1269#define MCIWNDM_EJECT (WM_USER + 107)
1270#define MCIWNDM_SETZOOM (WM_USER + 108)
1271#define MCIWNDM_GETZOOM (WM_USER + 109)
1272#define MCIWNDM_SETVOLUME (WM_USER + 110)
1273#define MCIWNDM_GETVOLUME (WM_USER + 111)
1274#define MCIWNDM_SETSPEED (WM_USER + 112)
1275#define MCIWNDM_GETSPEED (WM_USER + 113)
1276#define MCIWNDM_SETREPEAT (WM_USER + 114)
1277#define MCIWNDM_GETREPEAT (WM_USER + 115)
1278#define MCIWNDM_REALIZE (WM_USER + 118)
1279#define MCIWNDM_VALIDATEMEDIA (WM_USER + 121)
1280#define MCIWNDM_PLAYFROM (WM_USER + 122)
1281#define MCIWNDM_PLAYTO (WM_USER + 123)
1282#define MCIWNDM_GETPALETTE (WM_USER + 126)
1283#define MCIWNDM_SETPALETTE (WM_USER + 127)
1284#define MCIWNDM_SETTIMERS (WM_USER + 129)
1285#define MCIWNDM_SETACTIVETIMER (WM_USER + 130)
1286#define MCIWNDM_SETINACTIVETIMER (WM_USER + 131)
1287#define MCIWNDM_GETACTIVETIMER (WM_USER + 132)
1288#define MCIWNDM_GETINACTIVETIMER (WM_USER + 133)
1289#define MCIWNDM_CHANGESTYLES (WM_USER + 135)
1290#define MCIWNDM_GETSTYLES (WM_USER + 136)
1291#define MCIWNDM_GETALIAS (WM_USER + 137)
1292#define MCIWNDM_PLAYREVERSE (WM_USER + 139)
1293#define MCIWNDM_GET_SOURCE (WM_USER + 140)
1294#define MCIWNDM_PUT_SOURCE (WM_USER + 141)
1295#define MCIWNDM_GET_DEST (WM_USER + 142)
1296#define MCIWNDM_PUT_DEST (WM_USER + 143)
1297#define MCIWNDM_CAN_PLAY (WM_USER + 144)
1298#define MCIWNDM_CAN_WINDOW (WM_USER + 145)
1299#define MCIWNDM_CAN_RECORD (WM_USER + 146)
1300#define MCIWNDM_CAN_SAVE (WM_USER + 147)
1301#define MCIWNDM_CAN_EJECT (WM_USER + 148)
1302#define MCIWNDM_CAN_CONFIG (WM_USER + 149)
1303#define MCIWNDM_PALETTEKICK (WM_USER + 150)
1304#define MCIWNDM_OPENINTERFACE (WM_USER + 151)
1305#define MCIWNDM_SETOWNER (WM_USER + 152)
1306
1307#define MCIWNDM_SENDSTRINGA (WM_USER + 101)
1308#define MCIWNDM_GETPOSITIONA (WM_USER + 102)
1309#define MCIWNDM_GETMODEA (WM_USER + 106)
1310#define MCIWNDM_SETTIMEFORMATA (WM_USER + 119)
1311#define MCIWNDM_GETTIMEFORMATA (WM_USER + 120)
1312#define MCIWNDM_GETFILENAMEA (WM_USER + 124)
1313#define MCIWNDM_GETDEVICEA (WM_USER + 125)
1314#define MCIWNDM_GETERRORA (WM_USER + 128)
1315#define MCIWNDM_NEWA (WM_USER + 134)
1316#define MCIWNDM_RETURNSTRINGA (WM_USER + 138)
1317#define MCIWNDM_OPENA (WM_USER + 153)
1318
1319#define MCIWNDM_SENDSTRINGW (WM_USER + 201)
1320#define MCIWNDM_GETPOSITIONW (WM_USER + 202)
1321#define MCIWNDM_GETMODEW (WM_USER + 206)
1322#define MCIWNDM_SETTIMEFORMATW (WM_USER + 219)
1323#define MCIWNDM_GETTIMEFORMATW (WM_USER + 220)
1324#define MCIWNDM_GETFILENAMEW (WM_USER + 224)
1325#define MCIWNDM_GETDEVICEW (WM_USER + 225)
1326#define MCIWNDM_GETERRORW (WM_USER + 228)
1327#define MCIWNDM_NEWW (WM_USER + 234)
1328#define MCIWNDM_RETURNSTRINGW (WM_USER + 238)
1329#define MCIWNDM_OPENW (WM_USER + 252)
1330
1331#define MCIWNDM_SENDSTRING WINELIB_NAME_AW(MCIWNDM_SENDSTRING)
1332#define MCIWNDM_GETPOSITION WINELIB_NAME_AW(MCIWNDM_GETPOSITION)
1333#define MCIWNDM_GETMODE WINELIB_NAME_AW(MCIWNDM_GETMODE)
1334#define MCIWNDM_SETTIMEFORMAT WINELIB_NAME_AW(MCIWNDM_SETTIMEFORMAT)
1335#define MCIWNDM_GETTIMEFORMAT WINELIB_NAME_AW(MCIWNDM_GETTIMEFORMAT)
1336#define MCIWNDM_GETFILENAME WINELIB_NAME_AW(MCIWNDM_GETFILENAME)
1337#define MCIWNDM_GETDEVICE WINELIB_NAME_AW(MCIWNDM_GETDEVICE)
1338#define MCIWNDM_GETERROR WINELIB_NAME_AW(MCIWNDM_GETERROR)
1339#define MCIWNDM_NEW WINELIB_NAME_AW(MCIWNDM_NEW)
1340#define MCIWNDM_RETURNSTRING WINELIB_NAME_AW(MCIWNDM_RETURNSTRING)
1341#define MCIWNDM_OPEN WINELIB_NAME_AW(MCIWNDM_OPEN)
1342
1343#define MCIWNDM_NOTIFYMODE (WM_USER + 200)
1344#define MCIWNDM_NOTIFYPOS (WM_USER + 201)
1345#define MCIWNDM_NOTIFYSIZE (WM_USER + 202)
1346#define MCIWNDM_NOTIFYMEDIA (WM_USER + 203)
1347#define MCIWNDM_NOTIFYERROR (WM_USER + 205)
1348
1349#define MCIWND_START -1
1350#define MCIWND_END -2
1351
Bradley Baetza1491de2000-07-08 12:50:26 +00001352/********************************************
1353 * DrawDib declarations
1354 */
1355
1356HDRAWDIB VFWAPI DrawDibOpen( void );
1357UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground);
1358
Eric Pouech731e9f52000-07-26 18:07:04 +00001359BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst,
1360 LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags);
Bradley Baetza1491de2000-07-08 12:50:26 +00001361
Eric Pouech731e9f52000-07-26 18:07:04 +00001362BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst,
1363 LPBITMAPINFOHEADER lpbi, LPVOID lpBits,
1364 INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags);
Bradley Baetza1491de2000-07-08 12:50:26 +00001365
1366/* DrawDibDraw flags */
1367
Eric Pouech731e9f52000-07-26 18:07:04 +00001368#define DDF_UPDATE 0x0002
Bradley Baetza1491de2000-07-08 12:50:26 +00001369#define DDF_SAME_HDC 0x0004
1370#define DDF_SAME_DRAW 0x0008
1371#define DDF_DONTDRAW 0x0010
Eric Pouech731e9f52000-07-26 18:07:04 +00001372#define DDF_ANIMATE 0x0020
1373#define DDF_BUFFER 0x0040
Bradley Baetza1491de2000-07-08 12:50:26 +00001374#define DDF_JUSTDRAWIT 0x0080
1375#define DDF_FULLSCREEN 0x0100
1376#define DDF_BACKGROUNDPAL 0x0200
1377#define DDF_NOTKEYFRAME 0x0400
Eric Pouech731e9f52000-07-26 18:07:04 +00001378#define DDF_HURRYUP 0x0800
Bradley Baetza1491de2000-07-08 12:50:26 +00001379#define DDF_HALFTONE 0x1000
1380
Eric Pouech731e9f52000-07-26 18:07:04 +00001381#define DDF_PREROLL DDF_DONTDRAW
1382#define DDF_SAME_DIB DDF_SAME_DRAW
1383#define DDF_SAME_SIZE DDF_SAME_DRAW
1384
Bradley Baetza1491de2000-07-08 12:50:26 +00001385BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal);
1386HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd);
Eric Pouech731e9f52000-07-26 18:07:04 +00001387BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe);
1388LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags);
1389
1390BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate);
1391BOOL VFWAPI DrawDibStop(HDRAWDIB hdd);
1392#define DrawDibUpdate(hdd, hdc, x, y) \
1393 DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
Bradley Baetza1491de2000-07-08 12:50:26 +00001394
1395BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd);
1396BOOL VFWAPI DrawDibClose(HDRAWDIB hdd);
Marcus Meissner676a5131999-02-05 09:41:55 +00001397
Eric Pouech731e9f52000-07-26 18:07:04 +00001398/* display profiling */
1399#define PD_CAN_DRAW_DIB 0x0001
1400#define PD_CAN_STRETCHDIB 0x0002
1401#define PD_STRETCHDIB_1_1_OK 0x0004
1402#define PD_STRETCHDIB_1_2_OK 0x0008
1403#define PD_STRETCHDIB_1_N_OK 0x0010
1404
1405DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
1406
1407#ifdef __cplusplus
1408}
1409#endif /* __cplusplus */
1410
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001411#endif /* __WINE_VFW_H */