blob: b16074210c9dce3bf4bbadbe8d65e4f0f47e698b [file] [log] [blame]
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00001/*
2 * Copyright (C) the Wine project
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000019#ifndef __WINE_VFW_H
20#define __WINE_VFW_H
21
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +000022#include <mmsystem.h>
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000023#include <mmreg.h>
24#include <msacm.h>
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000025
26#define VFWAPI WINAPI
27#define VFWAPIV WINAPIV
28
Eric Pouech731e9f52000-07-26 18:07:04 +000029#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
Francois Gouget326e2ba2000-06-18 17:26:44 +000033typedef HANDLE HDRAWDIB;
34
Eric Pouech731e9f52000-07-26 18:07:04 +000035DWORD VFWAPI VideoForWindowsVersion(void);
36LONG VFWAPI InitVFW(void);
37LONG VFWAPI TermVFW(void);
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000038
Francois Gouget4e4f1d11999-03-17 15:16:01 +000039/*****************************************************************************
40 * Predeclare the interfaces
41 */
42typedef struct IAVIStream IAVIStream,*PAVISTREAM;
43typedef struct IAVIFile IAVIFile,*PAVIFILE;
44typedef struct IGetFrame IGetFrame,*PGETFRAME;
Michael Günnewig9f67cfe2003-06-23 18:10:06 +000045typedef struct IAVIEditStream IAVIEditStream, *PAVIEDITSTREAM;
Michael Günnewigc783c202003-07-02 00:38:57 +000046typedef struct IAVIStreaming IAVIStreaming;
Francois Gouget4e4f1d11999-03-17 15:16:01 +000047
Bradley Baetza1491de2000-07-08 12:50:26 +000048/* Installable Compressor Manager */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000049
Eric Pouech26146cd2001-02-14 21:49:22 +000050DECLARE_HANDLE(HIC);
Francois Gougeta537bec2000-06-11 20:07:08 +000051
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000052/* error return codes */
53#define ICERR_OK 0
54#define ICERR_DONTDRAW 1
55#define ICERR_NEWPALETTE 2
56#define ICERR_GOTOKEYFRAME 3
57#define ICERR_STOPDRAWING 4
58
59#define ICERR_UNSUPPORTED -1
60#define ICERR_BADFORMAT -2
61#define ICERR_MEMORY -3
62#define ICERR_INTERNAL -4
63#define ICERR_BADFLAGS -5
64#define ICERR_BADPARAM -6
65#define ICERR_BADSIZE -7
66#define ICERR_BADHANDLE -8
67#define ICERR_CANTUPDATE -9
68#define ICERR_ABORT -10
69#define ICERR_ERROR -100
70#define ICERR_BADBITDEPTH -200
71#define ICERR_BADIMAGESIZE -201
72
73#define ICERR_CUSTOM -400
74
75/* ICM Messages */
76#define ICM_USER (DRV_USER+0x0000)
77
78/* ICM driver message range */
79#define ICM_RESERVED_LOW (DRV_USER+0x1000)
80#define ICM_RESERVED_HIGH (DRV_USER+0x2000)
81#define ICM_RESERVED ICM_RESERVED_LOW
82
83#define ICM_GETSTATE (ICM_RESERVED+0)
84#define ICM_SETSTATE (ICM_RESERVED+1)
85#define ICM_GETINFO (ICM_RESERVED+2)
86
87#define ICM_CONFIGURE (ICM_RESERVED+10)
88#define ICM_ABOUT (ICM_RESERVED+11)
89/* */
90
91#define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30)
92#define ICM_GETQUALITY (ICM_RESERVED+31)
93#define ICM_SETQUALITY (ICM_RESERVED+32)
94
95#define ICM_SET (ICM_RESERVED+40)
96#define ICM_GET (ICM_RESERVED+41)
97
98/* 2 constant FOURCC codes */
99#define ICM_FRAMERATE mmioFOURCC('F','r','m','R')
100#define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R')
101
102#define ICM_COMPRESS_GET_FORMAT (ICM_USER+4)
103#define ICM_COMPRESS_GET_SIZE (ICM_USER+5)
104#define ICM_COMPRESS_QUERY (ICM_USER+6)
105#define ICM_COMPRESS_BEGIN (ICM_USER+7)
106#define ICM_COMPRESS (ICM_USER+8)
107#define ICM_COMPRESS_END (ICM_USER+9)
108
109#define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10)
110#define ICM_DECOMPRESS_QUERY (ICM_USER+11)
111#define ICM_DECOMPRESS_BEGIN (ICM_USER+12)
112#define ICM_DECOMPRESS (ICM_USER+13)
113#define ICM_DECOMPRESS_END (ICM_USER+14)
114#define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29)
115#define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30)
116
117#define ICM_DRAW_QUERY (ICM_USER+31)
118#define ICM_DRAW_BEGIN (ICM_USER+15)
119#define ICM_DRAW_GET_PALETTE (ICM_USER+16)
120#define ICM_DRAW_START (ICM_USER+18)
121#define ICM_DRAW_STOP (ICM_USER+19)
122#define ICM_DRAW_END (ICM_USER+21)
123#define ICM_DRAW_GETTIME (ICM_USER+32)
124#define ICM_DRAW (ICM_USER+33)
125#define ICM_DRAW_WINDOW (ICM_USER+34)
126#define ICM_DRAW_SETTIME (ICM_USER+35)
127#define ICM_DRAW_REALIZE (ICM_USER+36)
128#define ICM_DRAW_FLUSH (ICM_USER+37)
129#define ICM_DRAW_RENDERBUFFER (ICM_USER+38)
130
131#define ICM_DRAW_START_PLAY (ICM_USER+39)
132#define ICM_DRAW_STOP_PLAY (ICM_USER+40)
133
134#define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50)
135#define ICM_DRAW_CHANGEPALETTE (ICM_USER+51)
136
137#define ICM_GETBUFFERSWANTED (ICM_USER+41)
138
139#define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42)
140
141#define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60)
142#define ICM_DECOMPRESSEX_QUERY (ICM_USER+61)
143#define ICM_DECOMPRESSEX (ICM_USER+62)
144#define ICM_DECOMPRESSEX_END (ICM_USER+63)
145
146#define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70)
147#define ICM_SET_STATUS_PROC (ICM_USER+72)
148
149/* structs */
150
Bradley Baetza1491de2000-07-08 12:50:26 +0000151/* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway
152 * have not been changed. If a structure is later extended, you may need to create
153 * two versions of it.
154 */
155
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000156typedef struct {
157 DWORD dwSize; /* 00: size */
158 DWORD fccType; /* 04: type 'vidc' usually */
159 DWORD fccHandler; /* 08: */
160 DWORD dwVersion; /* 0c: version of compman opening you */
161 DWORD dwFlags; /* 10: LOWORD is type specific */
162 LRESULT dwError; /* 14: */
163 LPVOID pV1Reserved; /* 18: */
164 LPVOID pV2Reserved; /* 1c: */
165 DWORD dnDevNode; /* 20: */
166 /* 24: */
167} ICOPEN,*LPICOPEN;
168
Marcus Meissner32b32d81999-01-29 15:12:10 +0000169#define ICCOMPRESS_KEYFRAME 0x00000001L
170
171typedef struct {
172 DWORD dwFlags;
173 LPBITMAPINFOHEADER lpbiOutput;
174 LPVOID lpOutput;
175 LPBITMAPINFOHEADER lpbiInput;
176 LPVOID lpInput;
177 LPDWORD lpckid;
178 LPDWORD lpdwFlags;
179 LONG lFrameNum;
180 DWORD dwFrameSize;
181 DWORD dwQuality;
182 LPBITMAPINFOHEADER lpbiPrev;
183 LPVOID lpPrev;
184} ICCOMPRESS;
185
Alexandre Julliarda3960291999-02-26 11:11:13 +0000186DWORD VFWAPIV ICCompress(
187 HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
Marcus Meissner32b32d81999-01-29 15:12:10 +0000188 LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
189 LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
190 LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev
191);
192
Alexandre Julliarda3960291999-02-26 11:11:13 +0000193#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
Eric Pouech731e9f52000-07-26 18:07:04 +0000194 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000195 hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput), \
196 (DWORD)(LPVOID)(lpbiOutput) \
197 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000198
Alexandre Julliarda3960291999-02-26 11:11:13 +0000199#define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000200
Alexandre Julliarda3960291999-02-26 11:11:13 +0000201#define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
202 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000203 hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
204 (DWORD)(LPVOID)(lpbiOutput) \
205 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000206
Eric Pouech731e9f52000-07-26 18:07:04 +0000207#define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
Alexandre Julliarda3960291999-02-26 11:11:13 +0000208 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000209 hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \
210 (DWORD)(LPVOID)(lpbiOutput) \
211 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000212
Alexandre Julliarda3960291999-02-26 11:11:13 +0000213#define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
214 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000215 hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
216 (DWORD)(LPVOID)(lpbiOutput) \
217 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000218
Alexandre Julliarda3960291999-02-26 11:11:13 +0000219#define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000220
221/* ICCOMPRESSFRAMES.dwFlags */
222#define ICCOMPRESSFRAMES_PADDING 0x00000001
223typedef struct {
224 DWORD dwFlags;
225 LPBITMAPINFOHEADER lpbiOutput;
226 LPARAM lOutput;
227 LPBITMAPINFOHEADER lpbiInput;
228 LPARAM lInput;
229 LONG lStartFrame;
230 LONG lFrameCount;
231 LONG lQuality;
232 LONG lDataRate;
233 LONG lKeyRate;
234 DWORD dwRate;
235 DWORD dwScale;
236 DWORD dwOverheadPerFrame;
237 DWORD dwReserved2;
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000238 LONG (CALLBACK *GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len);
239 LONG (CALLBACK *PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000240} ICCOMPRESSFRAMES;
241
Eric Pouech731e9f52000-07-26 18:07:04 +0000242typedef struct {
243 DWORD dwFlags;
244 LPARAM lParam;
245 /* messages for Status callback */
246#define ICSTATUS_START 0
247#define ICSTATUS_STATUS 1
248#define ICSTATUS_END 2
249#define ICSTATUS_ERROR 3
250#define ICSTATUS_YIELD 4
251 /* FIXME: some X11 libs define Status as int... */
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000252 /* LONG (CALLBACK *zStatus)(LPARAM lParam, UINT message, LONG l); */
253 LONG (CALLBACK *zStatus)(LPARAM lParam, UINT message, LONG l);
Eric Pouech731e9f52000-07-26 18:07:04 +0000254} ICSETSTATUSPROC;
255
Marcus Meissner32b32d81999-01-29 15:12:10 +0000256/* Values for wMode of ICOpen() */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000257#define ICMODE_COMPRESS 1
258#define ICMODE_DECOMPRESS 2
259#define ICMODE_FASTDECOMPRESS 3
260#define ICMODE_QUERY 4
261#define ICMODE_FASTCOMPRESS 5
262#define ICMODE_DRAW 8
263
264/* quality flags */
265#define ICQUALITY_LOW 0
266#define ICQUALITY_HIGH 10000
267#define ICQUALITY_DEFAULT -1
268
269typedef struct {
270 DWORD dwSize; /* 00: */
271 DWORD fccType; /* 04:compressor type 'vidc' 'audc' */
272 DWORD fccHandler; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
273 DWORD dwFlags; /* 0c:flags LOWORD is type specific */
274 DWORD dwVersion; /* 10:version of the driver */
275 DWORD dwVersionICM; /* 14:version of the ICM used */
276 /*
277 * under Win32, the driver always returns UNICODE strings.
278 */
279 WCHAR szName[16]; /* 18:short name */
280 WCHAR szDescription[128]; /* 38:long name */
281 WCHAR szDriver[128]; /* 138:driver that contains compressor*/
282 /* 238: */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000283} ICINFO;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000284
Marcus Meissner32b32d81999-01-29 15:12:10 +0000285/* ICINFO.dwFlags */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000286#define VIDCF_QUALITY 0x0001 /* supports quality */
287#define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */
288#define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */
289#define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */
290#define VIDCF_DRAW 0x0010 /* supports drawing */
291#define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */
292#define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */
293#define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */
294
295#define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
296
297
298/* function shortcuts */
299/* ICM_ABOUT */
300#define ICMF_ABOUT_QUERY 0x00000001
301
Alexandre Julliarda3960291999-02-26 11:11:13 +0000302#define ICQueryAbout(hic) \
303 (ICSendMessage(hic,ICM_ABOUT,(DWORD)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000304
Alexandre Julliarda3960291999-02-26 11:11:13 +0000305#define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD)(UINT)(hwnd),0)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000306
307/* ICM_CONFIGURE */
308#define ICMF_CONFIGURE_QUERY 0x00000001
Alexandre Julliarda3960291999-02-26 11:11:13 +0000309#define ICQueryConfigure(hic) \
310 (ICSendMessage(hic,ICM_CONFIGURE,(DWORD)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000311
Alexandre Julliarda3960291999-02-26 11:11:13 +0000312#define ICConfigure(hic,hwnd) \
313 ICSendMessage(hic,ICM_CONFIGURE,(DWORD)(UINT)(hwnd),0)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000314
315/* Decompression stuff */
316#define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */
317#define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */
Eric Pouech731e9f52000-07-26 18:07:04 +0000318#define ICDECOMPRESS_PREROLL 0x20000000 /* this frame is before real start */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000319#define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */
320#define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */
321
322typedef struct {
323 DWORD dwFlags; /* flags (from AVI index...) */
324 LPBITMAPINFOHEADER lpbiInput; /* BITMAPINFO of compressed data */
325 LPVOID lpInput; /* compressed data */
326 LPBITMAPINFOHEADER lpbiOutput; /* DIB to decompress to */
327 LPVOID lpOutput;
328 DWORD ckid; /* ckid from AVI file */
329} ICDECOMPRESS;
330
331typedef struct {
332 DWORD dwFlags;
333 LPBITMAPINFOHEADER lpbiSrc;
334 LPVOID lpSrc;
335 LPBITMAPINFOHEADER lpbiDst;
336 LPVOID lpDst;
337
338 /* changed for ICM_DECOMPRESSEX */
Eric Pouech731e9f52000-07-26 18:07:04 +0000339 INT xDst; /* destination rectangle */
340 INT yDst;
341 INT dxDst;
342 INT dyDst;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000343
Eric Pouech731e9f52000-07-26 18:07:04 +0000344 INT xSrc; /* source rectangle */
345 INT ySrc;
346 INT dxSrc;
347 INT dySrc;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000348} ICDECOMPRESSEX;
349
Bradley Baetza1491de2000-07-08 12:50:26 +0000350DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000351
Alexandre Julliarda3960291999-02-26 11:11:13 +0000352#define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
353 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000354 hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
355 (DWORD)(LPVOID)(lpbiOutput) \
356 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000357
Alexandre Julliarda3960291999-02-26 11:11:13 +0000358#define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
359 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000360 hic,ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
361 (DWORD) (LPVOID)(lpbiOutput) \
362 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000363
Alexandre Julliarda3960291999-02-26 11:11:13 +0000364#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
365 ((LONG)ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000366 hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), \
367 (DWORD)(LPVOID)(lpbiOutput) \
368 ))
Marcus Meissner32b32d81999-01-29 15:12:10 +0000369
Alexandre Julliarda3960291999-02-26 11:11:13 +0000370#define ICDecompressGetFormatSize(hic, lpbi) \
371 ICDecompressGetFormat(hic, lpbi, NULL)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000372
Alexandre Julliarda3960291999-02-26 11:11:13 +0000373#define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
374 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000375 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), \
376 (DWORD)(LPVOID)(lpbiOutput) \
377 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000378
Alexandre Julliarda3960291999-02-26 11:11:13 +0000379#define ICDecompressSetPalette(hic,lpbiPalette) \
380 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000381 hic,ICM_DECOMPRESS_SET_PALETTE, \
382 (DWORD)(LPVOID)(lpbiPalette),0 \
383 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000384
Alexandre Julliarda3960291999-02-26 11:11:13 +0000385#define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000386
Eric Pouech731e9f52000-07-26 18:07:04 +0000387LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
Eric Pouech731e9f52000-07-26 18:07:04 +0000388
Vincent Béron9a624912002-05-31 23:06:46 +0000389inline static LRESULT VFWAPI ICDecompressEx(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000390 LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc,
391 int xSrc, int ySrc, int dxSrc, int dySrc,
392 LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst,
393 int xDst, int yDst, int dxDst, int dyDst)
394{
395 ICDECOMPRESSEX ic;
396
397 ic.dwFlags = dwFlags;
398 ic.lpbiSrc = lpbiSrc;
399 ic.lpSrc = lpSrc;
400 ic.xSrc = xSrc;
401 ic.ySrc = ySrc;
402 ic.dxSrc = dxSrc;
403 ic.dySrc = dySrc;
404 ic.lpbiDst = lpbiDst;
405 ic.lpDst = lpDst;
406 ic.xDst = xDst;
407 ic.yDst = yDst;
408 ic.dxDst = dxDst;
409 ic.dyDst = dyDst;
410 return ICSendMessage(hic, ICM_DECOMPRESSEX, (DWORD)&ic, sizeof(ic));
411}
412
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000413inline static LRESULT VFWAPI ICDecompressExBegin(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000414 LPBITMAPINFOHEADER lpbiSrc,
415 LPVOID lpSrc,
416 int xSrc, int ySrc, int dxSrc, int dySrc,
417 LPBITMAPINFOHEADER lpbiDst,
418 LPVOID lpDst,
419 int xDst,
420 int yDst,
421 int dxDst,
422 int dyDst)
423{
424 ICDECOMPRESSEX ic;
425
426 ic.dwFlags = dwFlags;
427 ic.lpbiSrc = lpbiSrc;
428 ic.lpSrc = lpSrc;
429 ic.xSrc = xSrc;
430 ic.ySrc = ySrc;
431 ic.dxSrc = dxSrc;
432 ic.dySrc = dySrc;
433 ic.lpbiDst = lpbiDst;
434 ic.lpDst = lpDst;
435 ic.xDst = xDst;
436 ic.yDst = yDst;
437 ic.dxDst = dxDst;
438 ic.dyDst = dyDst;
439 return ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, (DWORD)&ic, sizeof(ic));
440}
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000441inline static LRESULT VFWAPI ICDecompressExQuery(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000442 LPBITMAPINFOHEADER lpbiSrc,
443 LPVOID lpSrc,
444 int xSrc, int ySrc, int dxSrc, int dySrc,
445 LPBITMAPINFOHEADER lpbiDst,
446 LPVOID lpDst,
447 int xDst,
448 int yDst,
449 int dxDst,
450 int dyDst)
451{
452 ICDECOMPRESSEX ic;
453
454 ic.dwFlags = dwFlags;
455 ic.lpbiSrc = lpbiSrc;
456 ic.lpSrc = lpSrc;
457 ic.xSrc = xSrc;
458 ic.ySrc = ySrc;
459 ic.dxSrc = dxSrc;
460 ic.dySrc = dySrc;
461 ic.lpbiDst = lpbiDst;
462 ic.lpDst = lpDst;
463 ic.xDst = xDst;
464 ic.yDst = yDst;
465 ic.dxDst = dxDst;
466 ic.dyDst = dyDst;
467 return ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, (DWORD)&ic, sizeof(ic));
468}
469
470#define ICDecompressExEnd(hic) \
471 ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000472
Marcus Meissner73458b01998-12-26 12:54:29 +0000473#define ICDRAW_QUERY 0x00000001L /* test for support */
474#define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
475#define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
Eric Pouech731e9f52000-07-26 18:07:04 +0000476#define ICDRAW_ANIMATE 0x00000008L /* expect palette animation */
477#define ICDRAW_CONTINUE 0x00000010L /* draw is a continuation of previous draw */
478#define ICDRAW_MEMORYDC 0x00000020L /* DC is offscreen, by the way */
479#define ICDRAW_UPDATING 0x00000040L /* We're updating, as opposed to playing */
480#define ICDRAW_RENDER 0x00000080L /* used to render data not draw it */
481#define ICDRAW_BUFFER 0x00000100L /* buffer data offscreen, we will need to update it */
482
483#define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \
484 ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS)
485
486#define ICDrawOpen(fccType, fccHandler, lpbiIn) \
487 ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW)
488
Vincent Béron9a624912002-05-31 23:06:46 +0000489HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
Eric Pouech731e9f52000-07-26 18:07:04 +0000490 LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality,
491 LONG* plSize);
492
493HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
494 LPVOID lpBits, LPBITMAPINFO lpbiOut);
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000495
Alexandre Julliarda3960291999-02-26 11:11:13 +0000496BOOL VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
Eric Pouech731e9f52000-07-26 18:07:04 +0000497BOOL VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags);
498BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000499LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb);
500HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
Marcus Meissner960c7251999-03-13 18:09:16 +0000501HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler);
502
Eric Pouech731e9f52000-07-26 18:07:04 +0000503LRESULT VFWAPI ICClose(HIC hic);
504HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
Eric Pouech731e9f52000-07-26 18:07:04 +0000505HIC VFWAPI ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy);
506
507/* Values for wFlags of ICInstall() */
508#define ICINSTALL_UNICODE 0x8000
509#define ICINSTALL_FUNCTION 0x0001
510#define ICINSTALL_DRIVER 0x0002
511#define ICINSTALL_HDRV 0x0004
512#define ICINSTALL_DRIVERW 0x8002
513
514#define ICGetState(hic, pv, cb) \
515 ICSendMessage(hic, ICM_GETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
516#define ICSetState(hic, pv, cb) \
517 ICSendMessage(hic, ICM_SETSTATE, (DWORD)(LPVOID)(pv), (DWORD)(cb))
518#define ICGetStateSize(hic) \
519 ICGetState(hic, NULL, 0)
520
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000521inline static DWORD ICGetDefaultQuality(HIC hic)
Eric Pouech731e9f52000-07-26 18:07:04 +0000522{
523 DWORD dwICValue;
524 ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD));
525 return dwICValue;
526}
527
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000528inline static DWORD ICGetDefaultKeyFrameRate(HIC hic)
Eric Pouech731e9f52000-07-26 18:07:04 +0000529{
530 DWORD dwICValue;
531 ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD)(LPVOID)&dwICValue, sizeof(DWORD));
532 return dwICValue;
533}
534
535#define ICDrawWindow(hic, prc) \
536 ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD)(LPVOID)(prc), sizeof(RECT))
Bradley Baetza1491de2000-07-08 12:50:26 +0000537
538/* As passed to ICM_DRAW_SUGGESTFORMAT */
539typedef struct {
540 DWORD dwFlags;
541 LPBITMAPINFOHEADER lpbiIn;
542 LPBITMAPINFOHEADER lpbiSuggest;
543 INT dxSrc;
544 INT dySrc;
545 INT dxDst;
546 INT dyDst;
547 HIC hicDecompressor;
548} ICDRAWSUGGEST;
549
550typedef struct {
Eric Pouech731e9f52000-07-26 18:07:04 +0000551 DWORD dwFlags;
552 int iStart;
553 int iLen;
554 LPPALETTEENTRY lppe;
555} ICPALETTE;
556
Alexandre Julliarda3960291999-02-26 11:11:13 +0000557DWORD VFWAPIV ICDrawBegin(
558 HIC hic,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000559 DWORD dwFlags,/* flags */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000560 HPALETTE hpal, /* palette to draw with */
561 HWND hwnd, /* window to draw to */
562 HDC hdc, /* HDC to draw to */
563 INT xDst, /* destination rectangle */
564 INT yDst,
565 INT dxDst,
566 INT dyDst,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000567 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000568 INT xSrc, /* source rectangle */
569 INT ySrc,
570 INT dxSrc,
571 INT dySrc,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000572 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
Marcus Meissner32b32d81999-01-29 15:12:10 +0000573 DWORD dwScale
574);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000575
Bradley Baetza1491de2000-07-08 12:50:26 +0000576/* as passed to ICM_DRAW_BEGIN */
Marcus Meissner960c7251999-03-13 18:09:16 +0000577typedef struct {
578 DWORD dwFlags;
579 HPALETTE hpal;
580 HWND hwnd;
581 HDC hdc;
582 INT xDst;
583 INT yDst;
584 INT dxDst;
585 INT dyDst;
586 LPBITMAPINFOHEADER lpbi;
587 INT xSrc;
588 INT ySrc;
589 INT dxSrc;
590 INT dySrc;
591 DWORD dwRate;
592 DWORD dwScale;
593} ICDRAWBEGIN;
594
Patrik Stridvall0f8bc5b1999-04-22 16:27:50 +0000595#define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */
596#define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */
597#define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */
598#define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */
599#define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */
Marcus Meissner960c7251999-03-13 18:09:16 +0000600
601typedef struct {
602 DWORD dwFlags;
603 LPVOID lpFormat;
604 LPVOID lpData;
605 DWORD cbData;
606 LONG lTime;
607} ICDRAW;
608
609DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime);
610
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000611inline static LRESULT VFWAPI ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn,
Eric Pouech731e9f52000-07-26 18:07:04 +0000612 LPBITMAPINFOHEADER lpbiOut,
Vincent Béron9a624912002-05-31 23:06:46 +0000613 int dxSrc, int dySrc,
Eric Pouech731e9f52000-07-26 18:07:04 +0000614 int dxDst, int dyDst,
615 HIC hicDecomp)
616{
617 ICDRAWSUGGEST ic;
618
619 ic.lpbiIn = lpbiIn;
620 ic.lpbiSuggest = lpbiOut;
621 ic.dxSrc = dxSrc;
622 ic.dySrc = dySrc;
623 ic.dxDst = dxDst;
624 ic.dyDst = dyDst;
625 ic.hicDecompressor = hicDecomp;
626 return ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, (DWORD)&ic, sizeof(ic));
627}
628
629#define ICDrawQuery(hic, lpbiInput) \
630 ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD)(LPVOID)(lpbiInput), 0L)
631
632#define ICDrawChangePalette(hic, lpbiInput) \
633 ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD)(LPVOID)(lpbiInput), 0L)
634
635#define ICGetBuffersWanted(hic, lpdwBuffers) \
636 ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD)(LPVOID)(lpdwBuffers), 0)
637
638#define ICDrawEnd(hic) \
639 ICSendMessage(hic, ICM_DRAW_END, 0, 0)
640
641#define ICDrawStart(hic) \
642 ICSendMessage(hic, ICM_DRAW_START, 0, 0)
643
644#define ICDrawStartPlay(hic, lFrom, lTo) \
645 ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD)(lFrom), (DWORD)(lTo))
646
647#define ICDrawStop(hic) \
648 ICSendMessage(hic, ICM_DRAW_STOP, 0, 0)
649
650#define ICDrawStopPlay(hic) \
651 ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0)
652
653#define ICDrawGetTime(hic, lplTime) \
654 ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD)(LPVOID)(lplTime), 0)
655
656#define ICDrawSetTime(hic, lTime) \
657 ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD)lTime, 0)
658
659#define ICDrawRealize(hic, hdc, fBackground) \
660 ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD)(UINT)(HDC)(hdc), (DWORD)(BOOL)(fBackground))
661
662#define ICDrawFlush(hic) \
663 ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0)
664
665#define ICDrawRenderBuffer(hic) \
666 ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0)
667
Marcus Meissnerf86f24d2000-08-07 02:34:16 +0000668inline static LRESULT VFWAPI ICSetStatusProc(HIC hic, DWORD dwFlags, LRESULT lParam,
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000669 LONG (CALLBACK *fpfnStatus)(LPARAM, UINT, LONG))
Eric Pouech731e9f52000-07-26 18:07:04 +0000670{
671 ICSETSTATUSPROC ic;
672
673 ic.dwFlags = dwFlags;
674 ic.lParam = lParam;
675 /* FIXME: see comment in ICSETSTATUSPROC definition */
676 ic.zStatus = fpfnStatus;
677
678 return ICSendMessage(hic, ICM_SET_STATUS_PROC, (DWORD)&ic, sizeof(ic));
679}
680
681typedef struct {
682 LONG cbSize;
683 DWORD dwFlags;
684 HIC hic;
685 DWORD fccType;
686 DWORD fccHandler;
687 LPBITMAPINFO lpbiIn;
688 LPBITMAPINFO lpbiOut;
689 LPVOID lpBitsOut;
690 LPVOID lpBitsPrev;
691 LONG lFrame;
692 LONG lKey;
693 LONG lDataRate;
694 LONG lQ;
695 LONG lKeyCount;
696 LPVOID lpState;
697 LONG cbState;
698} COMPVARS, *PCOMPVARS;
699
700#define ICMF_COMPVARS_VALID 0x00000001
701
702BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData,
703 PCOMPVARS pc, LPSTR lpszTitle);
704
705#define ICMF_CHOOSE_KEYFRAME 0x0001
706#define ICMF_CHOOSE_DATARATE 0x0002
707#define ICMF_CHOOSE_PREVIEW 0x0004
708#define ICMF_CHOOSE_ALLCOMPRESSORS 0x0008
709
710BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn);
711void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc);
712
713LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits,
714 BOOL *pfKey, LONG *plSize);
715void VFWAPI ICCompressorFree(PCOMPVARS pc);
716
Marcus Meissner32b32d81999-01-29 15:12:10 +0000717/********************* AVIFILE function declarations *************************/
Eric Pouech26146cd2001-02-14 21:49:22 +0000718
719#ifndef mmioFOURCC
720#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
721 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
722 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
723#endif
724
725#ifndef aviTWOCC
726#define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
727#endif
728
729typedef WORD TWOCC;
730
731#define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
732#define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
733
Eric Pouech731e9f52000-07-26 18:07:04 +0000734#define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
735#define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
736#define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
737#define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
738#define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
739#define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
740#define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
741#define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
742
743#define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
744#define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
745
746#define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
Marcus Meissner32b32d81999-01-29 15:12:10 +0000747
Michael Günnewig9f67cfe2003-06-23 18:10:06 +0000748#define streamtypeANY 0UL
Marcus Meissner676a5131999-02-05 09:41:55 +0000749#define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
750#define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
751#define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
752#define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
753
754/* Basic chunk types */
755#define cktypeDIBbits aviTWOCC('d', 'b')
756#define cktypeDIBcompressed aviTWOCC('d', 'c')
757#define cktypePALchange aviTWOCC('p', 'c')
758#define cktypeWAVEbytes aviTWOCC('w', 'b')
759
760/* Chunk id to use for extra chunks for padding. */
761#define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
762
Eric Pouech26146cd2001-02-14 21:49:22 +0000763#define FromHex(n) (((n) >= 'A') ? ((n) + 10 - 'A') : ((n) - '0'))
764#define StreamFromFOURCC(fcc) ((WORD)((FromHex(LOBYTE(LOWORD(fcc))) << 4) + \
765 (FromHex(HIBYTE(LOWORD(fcc))))))
766#define TWOCCFromFOURCC(fcc) HIWORD(fcc)
767#define ToHex(n) ((BYTE)(((n) > 9) ? ((n) - 10 + 'A') : ((n) + '0')))
768#define MAKEAVICKID(tcc, stream) \
769 MAKELONG((ToHex((stream) & 0x0f) << 8) | \
770 (ToHex(((stream) & 0xf0) >> 4)), tcc)
771
Marcus Meissner32b32d81999-01-29 15:12:10 +0000772/* AVIFileHdr.dwFlags */
773#define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
774#define AVIF_MUSTUSEINDEX 0x00000020
775#define AVIF_ISINTERLEAVED 0x00000100
776#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames*/
777#define AVIF_WASCAPTUREFILE 0x00010000
778#define AVIF_COPYRIGHTED 0x00020000
779
780#define AVI_HEADERSIZE 2048
781
Michael Günnewigb26206d2002-10-18 00:25:19 +0000782typedef BOOL (CALLBACK *AVISAVECALLBACK)(INT);
783
Marcus Meissner676a5131999-02-05 09:41:55 +0000784typedef struct _MainAVIHeader
785{
786 DWORD dwMicroSecPerFrame;
787 DWORD dwMaxBytesPerSec;
788 DWORD dwPaddingGranularity;
789 DWORD dwFlags;
790 DWORD dwTotalFrames;
791 DWORD dwInitialFrames;
792 DWORD dwStreams;
793 DWORD dwSuggestedBufferSize;
794 DWORD dwWidth;
795 DWORD dwHeight;
796 DWORD dwReserved[4];
797} MainAVIHeader;
798
Marcus Meissner32b32d81999-01-29 15:12:10 +0000799/* AVIStreamHeader.dwFlags */
800#define AVISF_DISABLED 0x00000001
801#define AVISF_VIDEO_PALCHANGES 0x00010000
802
803typedef struct {
804 FOURCC fccType;
805 FOURCC fccHandler;
806 DWORD dwFlags; /* AVISF_* */
807 WORD wPriority;
808 WORD wLanguage;
809 DWORD dwInitialFrames;
Vincent Béron9a624912002-05-31 23:06:46 +0000810 DWORD dwScale;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000811 DWORD dwRate; /* dwRate / dwScale == samples/second */
812 DWORD dwStart;
813 DWORD dwLength; /* In units above... */
814 DWORD dwSuggestedBufferSize;
815 DWORD dwQuality;
816 DWORD dwSampleSize;
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000817 struct { SHORT left, top, right, bottom; } rcFrame; /* word.word - word.word in file */
Marcus Meissner32b32d81999-01-29 15:12:10 +0000818} AVIStreamHeader;
819
820/* AVIINDEXENTRY.dwFlags */
821#define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */
Eric Pouech731e9f52000-07-26 18:07:04 +0000822#define AVIIF_TWOCC 0x00000002
Marcus Meissner32b32d81999-01-29 15:12:10 +0000823#define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
824
825#define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */
826#define AVIIF_COMPUSE 0x0FFF0000
827
828typedef struct _AVIINDEXENTRY {
829 DWORD ckid;
830 DWORD dwFlags;
831 DWORD dwChunkOffset;
832 DWORD dwChunkLength;
833} AVIINDEXENTRY;
834
835typedef struct _AVIPALCHANGE {
836 BYTE bFirstEntry;
837 BYTE bNumEntries;
838 WORD wFlags; /* pad */
839 PALETTEENTRY peNew[1];
840} AVIPALCHANGE;
841
842#define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
843
844#define AVIGETFRAMEF_BESTDISPLAYFMT 1
845
Alexandre Julliarda3960291999-02-26 11:11:13 +0000846typedef struct _AVISTREAMINFOA {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000847 DWORD fccType;
848 DWORD fccHandler;
849 DWORD dwFlags; /* AVIIF_* */
850 DWORD dwCaps;
851 WORD wPriority;
852 WORD wLanguage;
853 DWORD dwScale;
854 DWORD dwRate; /* dwRate / dwScale == samples/second */
855 DWORD dwStart;
856 DWORD dwLength; /* In units above... */
857 DWORD dwInitialFrames;
858 DWORD dwSuggestedBufferSize;
859 DWORD dwQuality;
860 DWORD dwSampleSize;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000861 RECT rcFrame;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000862 DWORD dwEditCount;
863 DWORD dwFormatChangeCount;
864 CHAR szName[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000865} AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000866
Alexandre Julliarda3960291999-02-26 11:11:13 +0000867typedef struct _AVISTREAMINFOW {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000868 DWORD fccType;
869 DWORD fccHandler;
870 DWORD dwFlags;
871 DWORD dwCaps;
872 WORD wPriority;
873 WORD wLanguage;
874 DWORD dwScale;
875 DWORD dwRate; /* dwRate / dwScale == samples/second */
876 DWORD dwStart;
877 DWORD dwLength; /* In units above... */
878 DWORD dwInitialFrames;
879 DWORD dwSuggestedBufferSize;
880 DWORD dwQuality;
881 DWORD dwSampleSize;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000882 RECT rcFrame;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000883 DWORD dwEditCount;
884 DWORD dwFormatChangeCount;
885 WCHAR szName[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000886} AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
Marcus Meissner676a5131999-02-05 09:41:55 +0000887DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
888DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
889DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000890
891#define AVISTREAMINFO_DISABLED 0x00000001
892#define AVISTREAMINFO_FORMATCHANGES 0x00010000
893
894/* AVIFILEINFO.dwFlags */
895#define AVIFILEINFO_HASINDEX 0x00000010
896#define AVIFILEINFO_MUSTUSEINDEX 0x00000020
897#define AVIFILEINFO_ISINTERLEAVED 0x00000100
Michael Günnewigb26206d2002-10-18 00:25:19 +0000898#define AVIFILEINFO_TRUSTCKTYPE 0x00000800
Marcus Meissner32b32d81999-01-29 15:12:10 +0000899#define AVIFILEINFO_WASCAPTUREFILE 0x00010000
900#define AVIFILEINFO_COPYRIGHTED 0x00020000
901
902/* AVIFILEINFO.dwCaps */
903#define AVIFILECAPS_CANREAD 0x00000001
904#define AVIFILECAPS_CANWRITE 0x00000002
905#define AVIFILECAPS_ALLKEYFRAMES 0x00000010
906#define AVIFILECAPS_NOCOMPRESSION 0x00000020
907
Alexandre Julliarda3960291999-02-26 11:11:13 +0000908typedef struct _AVIFILEINFOW {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000909 DWORD dwMaxBytesPerSec;
910 DWORD dwFlags;
911 DWORD dwCaps;
912 DWORD dwStreams;
913 DWORD dwSuggestedBufferSize;
914 DWORD dwWidth;
915 DWORD dwHeight;
Vincent Béron9a624912002-05-31 23:06:46 +0000916 DWORD dwScale;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000917 DWORD dwRate;
918 DWORD dwLength;
919 DWORD dwEditCount;
920 WCHAR szFileType[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000921} AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
922typedef struct _AVIFILEINFOA {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000923 DWORD dwMaxBytesPerSec;
924 DWORD dwFlags;
925 DWORD dwCaps;
926 DWORD dwStreams;
927 DWORD dwSuggestedBufferSize;
928 DWORD dwWidth;
929 DWORD dwHeight;
Vincent Béron9a624912002-05-31 23:06:46 +0000930 DWORD dwScale;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000931 DWORD dwRate;
932 DWORD dwLength;
933 DWORD dwEditCount;
Marcus Meissner676a5131999-02-05 09:41:55 +0000934 CHAR szFileType[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000935} AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
Marcus Meissner676a5131999-02-05 09:41:55 +0000936DECL_WINELIB_TYPE_AW(AVIFILEINFO)
937DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
938DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000939
940/* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
941#define AVICOMPRESSF_INTERLEAVE 0x00000001
942#define AVICOMPRESSF_DATARATE 0x00000002
943#define AVICOMPRESSF_KEYFRAMES 0x00000004
944#define AVICOMPRESSF_VALID 0x00000008
945
946typedef struct {
947 DWORD fccType; /* stream type, for consistency */
948 DWORD fccHandler; /* compressor */
949 DWORD dwKeyFrameEvery; /* keyframe rate */
950 DWORD dwQuality; /* compress quality 0-10,000 */
951 DWORD dwBytesPerSecond; /* bytes per second */
952 DWORD dwFlags; /* flags... see below */
953 LPVOID lpFormat; /* save format */
954 DWORD cbFormat;
955 LPVOID lpParms; /* compressor options */
956 DWORD cbParms;
957 DWORD dwInterleaveEvery; /* for non-video streams only */
958} AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
959
Michael Günnewigb26206d2002-10-18 00:25:19 +0000960#define FIND_DIR 0x0000000FL /* direction mask */
961#define FIND_NEXT 0x00000001L /* search forward */
962#define FIND_PREV 0x00000004L /* search backward */
963#define FIND_FROM_START 0x00000008L /* start at the logical beginning */
964
965#define FIND_TYPE 0x000000F0L /* type mask */
966#define FIND_KEY 0x00000010L /* find a key frame */
967#define FIND_ANY 0x00000020L /* find any (non-empty) sample */
968#define FIND_FORMAT 0x00000040L /* find a formatchange */
969
970#define FIND_RET 0x0000F000L /* return mask */
971#define FIND_POS 0x00000000L /* return logical position */
972#define FIND_LENGTH 0x00001000L /* return logical size */
973#define FIND_OFFSET 0x00002000L /* return physical position */
974#define FIND_SIZE 0x00003000L /* return physical size */
975#define FIND_INDEX 0x00004000L /* return physical index position */
976
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +0000977#include <ole2.h>
Marcus Meissner32b32d81999-01-29 15:12:10 +0000978
979#define DEFINE_AVIGUID(name, l, w1, w2) \
980 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
981
982DEFINE_AVIGUID(IID_IAVIFile, 0x00020020, 0, 0);
983DEFINE_AVIGUID(IID_IAVIStream, 0x00020021, 0, 0);
984DEFINE_AVIGUID(IID_IAVIStreaming, 0x00020022, 0, 0);
985DEFINE_AVIGUID(IID_IGetFrame, 0x00020023, 0, 0);
986DEFINE_AVIGUID(IID_IAVIEditStream, 0x00020024, 0, 0);
987
988DEFINE_AVIGUID(CLSID_AVIFile, 0x00020000, 0, 0);
989
Francois Gouget4e4f1d11999-03-17 15:16:01 +0000990/*****************************************************************************
991 * IAVIStream interface
992 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000993#define INTERFACE IAVIStream
Alexandre Julliardaae3cb62003-04-11 00:31:02 +0000994#define IAVIStream_METHODS \
995 IUnknown_METHODS \
Alexandre Julliardf00c46f2003-04-10 00:19:24 +0000996 STDMETHOD(Create)(THIS_ LPARAM lParam1, LPARAM lParam2) PURE; \
997 STDMETHOD(Info)(THIS_ AVISTREAMINFOW *psi, LONG lSize) PURE; \
998 STDMETHOD_(LONG,FindSample)(THIS_ LONG lPos, LONG lFlags) PURE; \
999 STDMETHOD(ReadFormat)(THIS_ LONG lPos, LPVOID lpFormat, LONG *lpcbFormat) PURE; \
1000 STDMETHOD(SetFormat)(THIS_ LONG lPos, LPVOID lpFormat, LONG cbFormat) PURE; \
1001 STDMETHOD(Read)(THIS_ LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples) PURE; \
1002 STDMETHOD(Write)(THIS_ LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten) PURE; \
1003 STDMETHOD(Delete)(THIS_ LONG lStart, LONG lSamples) PURE; \
1004 STDMETHOD(ReadData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG *lpcbBuffer) PURE; \
1005 STDMETHOD(WriteData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG cbBuffer) PURE; \
1006 STDMETHOD(SetInfo)(THIS_ AVISTREAMINFOW *plInfo, LONG cbInfo) PURE;
Marcus Meissner960c7251999-03-13 18:09:16 +00001007ICOM_DEFINE(IAVIStream, IUnknown)
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001008#undef INTERFACE
Marcus Meissner32b32d81999-01-29 15:12:10 +00001009
Alexandre Julliard55379112003-04-10 21:13:58 +00001010#ifdef COBJMACROS
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001011/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001012#define IAVIStream_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1013#define IAVIStream_AddRef(p) (p)->lpVtbl->AddRef(p)
1014#define IAVIStream_Release(p) (p)->lpVtbl->Release(p)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001015/*** IAVIStream methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001016#define IAVIStream_Create(p,a,b) (p)->lpVtbl->Create(p,a,b)
1017#define IAVIStream_Info(p,a,b) (p)->lpVtbl->Info(p,a,b)
1018#define IAVIStream_FindSample(p,a,b) (p)->lpVtbl->FindSample(p,a,b)
1019#define IAVIStream_ReadFormat(p,a,b,c) (p)->lpVtbl->ReadFormat(p,a,b,c)
1020#define IAVIStream_SetFormat(p,a,b,c) (p)->lpVtbl->SetFormat(p,a,b,c)
1021#define IAVIStream_Read(p,a,b,c,d,e,f) (p)->lpVtbl->Read(p,a,b,c,d,e,f)
1022#define IAVIStream_Write(p,a,b,c,d,e,f,g) (p)->lpVtbl->Write(p,a,b,c,d,e,f,g)
1023#define IAVIStream_Delete(p,a,b) (p)->lpVtbl->Delete(p,a,b)
1024#define IAVIStream_ReadData(p,a,b,c) (p)->lpVtbl->ReadData(p,a,b,c)
1025#define IAVIStream_WriteData(p,a,b,c) (p)->lpVtbl->WriteData(p,a,b,c)
1026#define IAVIStream_SetInfo(p,a,b) (p)->lpVtbl->SetInfo(p,a,b)
1027#endif
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001028
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001029ULONG WINAPI AVIStreamAddRef(PAVISTREAM iface);
1030ULONG WINAPI AVIStreamRelease(PAVISTREAM iface);
Hidenori Takeshimac814a6c2001-06-07 22:28:19 +00001031HRESULT WINAPI AVIStreamCreate(PAVISTREAM*,LONG,LONG,CLSID*);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001032HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size);
1033HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG size);
1034#define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo)
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001035HRESULT WINAPI AVIStreamFindSample(PAVISTREAM pstream, LONG pos, DWORD flags);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001036HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001037HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001038HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001039HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001040HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001041HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001042
1043PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted);
1044LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos);
1045HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg);
1046
1047HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler);
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001048HRESULT WINAPI AVIMakeFileFromStreams(PAVIFILE *ppfile, int nStreams, PAVISTREAM *ppStreams);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001049
Eric Pouech731e9f52000-07-26 18:07:04 +00001050HRESULT WINAPI AVIStreamOpenFromFileA(PAVISTREAM *ppavi, LPCSTR szFile,
1051 DWORD fccType, LONG lParam,
1052 UINT mode, CLSID *pclsidHandler);
1053HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile,
1054 DWORD fccType, LONG lParam,
1055 UINT mode, CLSID *pclsidHandler);
1056#define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001057
Michael Günnewigb26206d2002-10-18 00:25:19 +00001058HRESULT WINAPI AVIBuildFilterA(LPSTR szFilter, LONG cbFilter, BOOL fSaving);
1059HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving);
1060#define AVIBuildFilter WINELIB_NAME_AW(AVIBuildFilter)
1061
1062BOOL WINAPI AVISaveOptions(HWND hWnd,UINT uFlags,INT nStream,
1063 PAVISTREAM *ppavi,LPAVICOMPRESSOPTIONS *ppOptions);
1064HRESULT WINAPI AVISaveOptionsFree(INT nStreams,LPAVICOMPRESSOPTIONS*ppOptions);
1065
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001066HRESULT WINAPI AVISaveVA(LPCSTR szFile, CLSID *pclsidHandler,
1067 AVISAVECALLBACK lpfnCallback, int nStream,
1068 PAVISTREAM *ppavi, LPAVICOMPRESSOPTIONS *plpOptions);
1069HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
1070 AVISAVECALLBACK lpfnCallback, int nStream,
1071 PAVISTREAM *ppavi, LPAVICOMPRESSOPTIONS *plpOptions);
1072#define AVISaveV WINELIB_NAME_AW(AVISaveV)
1073
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001074LONG WINAPI AVIStreamStart(PAVISTREAM iface);
1075LONG WINAPI AVIStreamLength(PAVISTREAM iface);
1076LONG WINAPI AVIStreamSampleToTime(PAVISTREAM pstream, LONG lSample);
1077LONG WINAPI AVIStreamTimeToSample(PAVISTREAM pstream, LONG lTime);
1078
Michael Günnewigf6bcf232002-10-21 23:39:20 +00001079#define AVIFileClose(pavi) \
1080 AVIFileRelease(pavi)
1081#define AVIStreamClose(pavi) \
1082 AVIStreamRelease(pavi);
Michael Günnewigb26206d2002-10-18 00:25:19 +00001083#define AVIStreamEnd(pavi) \
1084 (AVIStreamStart(pavi) + AVIStreamLength(pavi))
1085#define AVIStreamEndTime(pavi) \
1086 AVIStreamSampleToTime(pavi, AVIStreamEnd(pavi))
Eric Pouech731e9f52000-07-26 18:07:04 +00001087#define AVIStreamFormatSize(pavi, lPos, plSize) \
Vincent Béron9a624912002-05-31 23:06:46 +00001088 AVIStreamReadFormat(pavi, lPos, NULL, plSize)
Michael Günnewigb26206d2002-10-18 00:25:19 +00001089#define AVIStreamLengthTime(pavi) \
1090 AVIStreamSampleToTime(pavi, AVIStreamLength(pavi))
1091#define AVIStreamSampleSize(pavi,pos,psize) \
1092 AVIStreamRead(pavi,pos,1,NULL,0,psize,NULL)
1093#define AVIStreamSampleToSample(pavi1, pavi2, samp2) \
1094 AVIStreamTimeToSample(pavi1, AVIStreamSampleToTime(pavi2, samp2))
1095#define AVIStreamStartTime(pavi) \
1096 AVIStreamSampleToTime(pavi, AVIStreamStart(pavi))
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001097
Michael Günnewigc783c202003-07-02 00:38:57 +00001098#define AVIStreamNextSample(pavi, pos) \
1099 AVIStreamFindSample(pavi, pos + 1, FIND_NEXT | FIND_ANY)
1100#define AVIStreamPrevSample(pavi, pos) \
1101 AVIStreamFindSample(pavi, pos - 1, FIND_PREV | FIND_ANY)
1102#define AVIStreamNearestSample(pavi, pos) \
1103 AVIStreamFindSample(pavi, pos, FIND_PREV | FIND_ANY)
1104#define AVStreamNextKeyFrame(pavi,pos) \
1105 AVIStreamFindSample(pavi, pos + 1, FIND_NEXT | FIND_KEY)
1106#define AVStreamPrevKeyFrame(pavi,pos) \
1107 AVIStreamFindSample(pavi, pos - 1, FIND_NEXT | FIND_KEY)
1108#define AVIStreamNearestKeyFrame(pavi,pos) \
1109 AVIStreamFindSample(pavi, pos, FIND_PREV | FIND_KEY)
1110#define AVIStreamIsKeyFrame(pavi, pos) \
1111 (AVIStreamNearestKeyFrame(pavi, pos) == pos)
1112
1113/*****************************************************************************
1114 * IAVIStreaming interface
1115 */
1116#define INTERFACE IAVIStreaming
1117#define IAVIStreaming_METHODS \
1118 IUnknown_METHODS \
1119 STDMETHOD(Begin)(IAVIStreaming*iface,LONG lStart,LONG lEnd,LONG lRate) PURE; \
1120 STDMETHOD(End)(IAVIStreaming*iface) PURE;
Michael Günnewig1b5c4132003-09-02 00:54:30 +00001121ICOM_DEFINE(IAVIStreaming, IUnknown)
Michael Günnewigc783c202003-07-02 00:38:57 +00001122#undef INTERFACE
1123
1124#ifdef COBJMACROS
1125/*** IUnknown methods ***/
1126#define IAVIStreaming_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1127#define IAVIStreaming_AddRef(p) (p)->lpVtbl->AddRef(p)
1128#define IAVIStreaming_Release(p) (p)->lpVtbl->Release(p)
1129/*** IAVIStreaming methods ***/
1130#define IAVIStreaming_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
1131#define IAVIStreaming_End(p) (p)->lpVtbl->End(p)
1132#endif
1133
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001134/*****************************************************************************
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001135 * IAVIEditStream interface
1136 */
1137#define INTERFACE IAVIEditStream
1138#define IAVIEditStream_METHODS \
1139 IUnknown_METHODS \
1140 STDMETHOD(Cut)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE; \
1141 STDMETHOD(Copy)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE; \
1142 STDMETHOD(Paste)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM pSource,LONG lStart,LONG lEnd) PURE; \
1143 STDMETHOD(Clone)(IAVIEditStream*iface,PAVISTREAM*ppResult) PURE; \
1144 STDMETHOD(SetInfo)(IAVIEditStream*iface,LPAVISTREAMINFOW asi, LONG size) PURE;
1145ICOM_DEFINE(IAVIEditStream,IUnknown)
1146#undef INTERFACE
1147
1148#ifdef COBJMACROS
1149/*** IUnknown methods ***/
1150#define IAVIEditStream_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1151#define IAVIEditStream_AddRef(p) (p)->lpVtbl->AddRef(p)
1152#define IAVIEditStream_Release(p) (p)->lpVtbl->Release(p)
1153/*** IAVIEditStream methods ***/
1154#define IAVIEditStream_Cut(p,a,b,c) (p)->lpVtbl->Cut(p,a,b,c)
1155#define IAVIEditStream_Copy(p,a,b,c) (p)->lpVtbl->Copy(p,a,b,c)
1156#define IAVIEditStream_Paste(p,a,b,c,d,e) (p)->lpVtbl->Paste(p,a,b,c,d,e)
1157#define IAVIEditStream_Clone(p,a) (p)->lpVtbl->Clone(p,a)
1158#define IAVIEditStream_SetInfo(p,a,b) (p)->lpVtbl->SetInfo(p,a,b)
1159#endif
1160
1161HRESULT WINAPI CreateEditableStream(PAVISTREAM *ppEditable,PAVISTREAM pSource);
1162HRESULT WINAPI EditStreamClone(PAVISTREAM pStream, PAVISTREAM *ppResult);
1163HRESULT WINAPI EditStreamCopy(PAVISTREAM pStream, LONG *plStart,
1164 LONG *plLength, PAVISTREAM *ppResult);
1165HRESULT WINAPI EditStreamCut(PAVISTREAM pStream, LONG *plStart,
1166 LONG *plLength, PAVISTREAM *ppResult);
1167HRESULT WINAPI EditStreamPaste(PAVISTREAM pDest, LONG *plStart, LONG *plLength,
1168 PAVISTREAM pSource, LONG lStart, LONG lEnd);
1169
1170HRESULT WINAPI EditStreamSetInfoA(PAVISTREAM pstream, LPAVISTREAMINFOA asi,
1171 LONG size);
1172HRESULT WINAPI EditStreamSetInfoW(PAVISTREAM pstream, LPAVISTREAMINFOW asi,
1173 LONG size);
1174#define EditStreamSetInfo WINELIB_NAME_AW(EditStreamSetInfo)
1175
1176HRESULT WINAPI EditStreamSetNameA(PAVISTREAM pstream, LPCSTR szName);
1177HRESULT WINAPI EditStreamSetNameW(PAVISTREAM pstream, LPCWSTR szName);
1178#define EditStreamSetName WINELIB_NAME_AW(EditStreamSetName)
1179
1180/*****************************************************************************
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001181 * IAVIFile interface
1182 */
1183/* In Win32 this interface uses UNICODE only */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001184#define INTERFACE IAVIFile
Alexandre Julliardaae3cb62003-04-11 00:31:02 +00001185#define IAVIFile_METHODS \
1186 IUnknown_METHODS \
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001187 STDMETHOD(Info)(THIS_ AVIFILEINFOW *pfi, LONG lSize) PURE; \
1188 STDMETHOD(GetStream)(THIS_ PAVISTREAM *ppStream, DWORD fccType, LONG lParam) PURE; \
1189 STDMETHOD(CreateStream)(THIS_ PAVISTREAM *ppStream, AVISTREAMINFOW *psi) PURE; \
1190 STDMETHOD(WriteData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG cbBuffer) PURE; \
1191 STDMETHOD(ReadData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG *lpcbBuffer) PURE; \
1192 STDMETHOD(EndRecord)(THIS) PURE; \
1193 STDMETHOD(DeleteStream)(THIS_ DWORD fccType, LONG lParam) PURE;
Marcus Meissner960c7251999-03-13 18:09:16 +00001194ICOM_DEFINE(IAVIFile,IUnknown)
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001195#undef INTERFACE
Marcus Meissner32b32d81999-01-29 15:12:10 +00001196
Alexandre Julliard55379112003-04-10 21:13:58 +00001197#ifdef COBJMACROS
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001198/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001199#define IAVIFile_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1200#define IAVIFile_AddRef(p) (p)->lpVtbl->AddRef(p)
1201#define IAVIFile_Release(p) (p)->lpVtbl->Release(p)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001202/*** IAVIFile methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001203#define IAVIFile_Info(p,a,b) (p)->lpVtbl->Info(p,a,b)
1204#define IAVIFile_GetStream(p,a,b,c) (p)->lpVtbl->GetStream(p,a,b,c)
1205#define IAVIFile_CreateStream(p,a,b) (p)->lpVtbl->CreateStream(p,a,b)
1206#define IAVIFile_WriteData(p,a,b,c) (p)->lpVtbl->WriteData(p,a,b,c)
1207#define IAVIFile_ReadData(p,a,b,c) (p)->lpVtbl->ReadData(p,a,b,c)
1208#define IAVIFile_EndRecord(p) (p)->lpVtbl->EndRecord(p)
1209#define IAVIFile_DeleteStream(p,a,b) (p)->lpVtbl->DeleteStream(p,a,b)
1210#endif
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001211
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001212void WINAPI AVIFileInit(void);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001213void WINAPI AVIFileExit(void);
1214
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001215HRESULT WINAPI AVIFileOpenA(PAVIFILE* ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler);
1216HRESULT WINAPI AVIFileOpenW(PAVIFILE* ppfile,LPCWSTR szFile,UINT uMode,LPCLSID lpHandler);
1217#define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001218
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001219ULONG WINAPI AVIFileAddRef(PAVIFILE pfile);
1220ULONG WINAPI AVIFileRelease(PAVIFILE pfile);
1221HRESULT WINAPI AVIFileInfoA(PAVIFILE pfile,PAVIFILEINFOA pfi,LONG lSize);
1222HRESULT WINAPI AVIFileInfoW(PAVIFILE pfile,PAVIFILEINFOW pfi,LONG lSize);
1223#define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo)
1224HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile,PAVISTREAM* avis,DWORD fccType,LONG lParam);
1225HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOA* psi);
1226HRESULT WINAPI AVIFileCreateStreamW(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOW* psi);
1227#define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream)
1228HRESULT WINAPI AVIFileWriteData(PAVIFILE pfile,DWORD fcc,LPVOID lp,LONG size);
1229HRESULT WINAPI AVIFileReadData(PAVIFILE pfile,DWORD fcc,LPVOID lp,LPLONG size);
1230HRESULT WINAPI AVIFileEndRecord(PAVIFILE pfile);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001231
1232/*****************************************************************************
1233 * IGetFrame interface
1234 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001235#define INTERFACE IGetFrame
Alexandre Julliardaae3cb62003-04-11 00:31:02 +00001236#define IGetFrame_METHODS \
1237 IUnknown_METHODS \
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001238 STDMETHOD_(LPVOID,GetFrame)(THIS_ LONG lPos) PURE; \
1239 STDMETHOD(Begin)(THIS_ LONG lStart, LONG lEnd, LONG lRate) PURE; \
1240 STDMETHOD(End)(THIS) PURE; \
1241 STDMETHOD(SetFormat)(THIS_ LPBITMAPINFOHEADER lpbi, LPVOID lpBits, INT x, INT y, INT dx, INT dy) PURE;
Marcus Meissner960c7251999-03-13 18:09:16 +00001242ICOM_DEFINE(IGetFrame,IUnknown)
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001243#undef INTERFACE
Marcus Meissner676a5131999-02-05 09:41:55 +00001244
Alexandre Julliard55379112003-04-10 21:13:58 +00001245#ifdef COBJMACROS
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001246/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001247#define IGetFrame_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1248#define IGetFrame_AddRef(p) (p)->lpVtbl->AddRef(p)
1249#define IGetFrame_Release(p) (p)->lpVtbl->Release(p)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001250/*** IGetFrame methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001251#define IGetFrame_GetFrame(p,a) (p)->lpVtbl->GetFrame(p,a)
1252#define IGetFrame_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
1253#define IGetFrame_End(p) (p)->lpVtbl->End(p)
1254#define IGetFrame_SetFormat(p,a,b,c,d,e,f) (p)->lpVtbl->SetFormat(p,a,b,c,d,e,f)
1255#endif
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001256
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001257HRESULT WINAPI AVIClearClipboard(void);
1258HRESULT WINAPI AVIGetFromClipboard(PAVIFILE *ppfile);
1259HRESULT WINAPI AVIPutFileOnClipboard(PAVIFILE pfile);
1260
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001261#ifdef OFN_READONLY
1262BOOL WINAPI GetOpenFileNamePreviewA(LPOPENFILENAMEA lpofn);
1263BOOL WINAPI GetOpenFileNamePreviewW(LPOPENFILENAMEW lpofn);
1264#define GetOpenFileNamePreview WINELIB_NAME_AW(GetOpenFileNamePreview)
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001265BOOL WINAPI GetSaveFileNamePreviewA(LPOPENFILENAMEA lpofn);
1266BOOL WINAPI GetSaveFileNamePreviewW(LPOPENFILENAMEW lpofn);
1267#define GetSaveFileNamePreview WINELIB_NAME_AW(GetSaveFileNamePreview)
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001268#endif
1269
Marcus Meissner32b32d81999-01-29 15:12:10 +00001270#define AVIERR_OK 0
1271#define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
1272
1273#define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
1274#define AVIERR_BADFORMAT MAKE_AVIERR(102)
1275#define AVIERR_MEMORY MAKE_AVIERR(103)
1276#define AVIERR_INTERNAL MAKE_AVIERR(104)
1277#define AVIERR_BADFLAGS MAKE_AVIERR(105)
1278#define AVIERR_BADPARAM MAKE_AVIERR(106)
1279#define AVIERR_BADSIZE MAKE_AVIERR(107)
1280#define AVIERR_BADHANDLE MAKE_AVIERR(108)
1281#define AVIERR_FILEREAD MAKE_AVIERR(109)
1282#define AVIERR_FILEWRITE MAKE_AVIERR(110)
1283#define AVIERR_FILEOPEN MAKE_AVIERR(111)
1284#define AVIERR_COMPRESSOR MAKE_AVIERR(112)
1285#define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
1286#define AVIERR_READONLY MAKE_AVIERR(114)
1287#define AVIERR_NODATA MAKE_AVIERR(115)
1288#define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
1289#define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
1290#define AVIERR_USERABORT MAKE_AVIERR(198)
1291#define AVIERR_ERROR MAKE_AVIERR(199)
1292
Dmitry Timoshkovcd61ce82004-01-01 00:12:13 +00001293BOOL VFWAPIV MCIWndRegisterClass(void);
Dmitry Timoshkov06464992003-12-15 20:17:11 +00001294
1295HWND VFWAPIV MCIWndCreateA(HWND, HINSTANCE, DWORD, LPCSTR);
1296HWND VFWAPIV MCIWndCreateW(HWND, HINSTANCE, DWORD, LPCWSTR);
Eric Pouech26146cd2001-02-14 21:49:22 +00001297#define MCIWndCreate WINELIB_NAME_AW(MCIWndCreate)
1298
1299#define MCIWNDOPENF_NEW 0x0001
1300
1301#define MCIWNDF_NOAUTOSIZEWINDOW 0x0001
1302#define MCIWNDF_NOPLAYBAR 0x0002
1303#define MCIWNDF_NOAUTOSIZEMOVIE 0x0004
1304#define MCIWNDF_NOMENU 0x0008
1305#define MCIWNDF_SHOWNAME 0x0010
1306#define MCIWNDF_SHOWPOS 0x0020
1307#define MCIWNDF_SHOWMODE 0x0040
1308#define MCIWNDF_SHOWALL 0x0070
1309
1310#define MCIWNDF_NOTIFYMODE 0x0100
1311#define MCIWNDF_NOTIFYPOS 0x0200
1312#define MCIWNDF_NOTIFYSIZE 0x0400
1313#define MCIWNDF_NOTIFYERROR 0x1000
1314#define MCIWNDF_NOTIFYALL 0x1F00
1315
1316#define MCIWNDF_NOTIFYANSI 0x0080
1317
1318#define MCIWNDF_NOTIFYMEDIAA 0x0880
1319#define MCIWNDF_NOTIFYMEDIAW 0x0800
1320#define MCIWNDF_NOTIFYMEDIA WINELIB_NAME_AW(MCIWNDF_NOTIFYMEDIA)
1321
1322#define MCIWNDF_RECORD 0x2000
1323#define MCIWNDF_NOERRORDLG 0x4000
1324#define MCIWNDF_NOOPEN 0x8000
1325
1326#ifdef __cplusplus
1327#define MCIWndSM ::SendMessage
1328#else
1329#define MCIWndSM SendMessage
1330#endif
1331
1332#define MCIWndCanPlay(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_PLAY,0,0)
1333#define MCIWndCanRecord(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_RECORD,0,0)
1334#define MCIWndCanSave(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_SAVE,0,0)
1335#define MCIWndCanWindow(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_WINDOW,0,0)
1336#define MCIWndCanEject(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_EJECT,0,0)
1337#define MCIWndCanConfig(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_CONFIG,0,0)
1338#define MCIWndPaletteKick(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_PALETTEKICK,0,0)
1339
1340#define MCIWndSave(hWnd,szFile) (LONG)MCIWndSM(hWnd,MCI_SAVE,0,(LPARAM)(LPVOID)(szFile))
1341#define MCIWndSaveDialog(hWnd) MCIWndSave(hWnd,-1)
1342
1343#define MCIWndNew(hWnd,lp) (LONG)MCIWndSM(hWnd,MCIWNDM_NEW,0,(LPARAM)(LPVOID)(lp))
1344
1345#define MCIWndRecord(hWnd) (LONG)MCIWndSM(hWnd,MCI_RECORD,0,0)
1346#define MCIWndOpen(hWnd,sz,f) (LONG)MCIWndSM(hWnd,MCIWNDM_OPEN,(WPARAM)(UINT)(f),(LPARAM)(LPVOID)(sz))
1347#define MCIWndOpenDialog(hWnd) MCIWndOpen(hWnd,-1,0)
1348#define MCIWndClose(hWnd) (LONG)MCIWndSM(hWnd,MCI_CLOSE,0,0)
1349#define MCIWndPlay(hWnd) (LONG)MCIWndSM(hWnd,MCI_PLAY,0,0)
1350#define MCIWndStop(hWnd) (LONG)MCIWndSM(hWnd,MCI_STOP,0,0)
1351#define MCIWndPause(hWnd) (LONG)MCIWndSM(hWnd,MCI_PAUSE,0,0)
1352#define MCIWndResume(hWnd) (LONG)MCIWndSM(hWnd,MCI_RESUME,0,0)
1353#define MCIWndSeek(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCI_SEEK,0,(LPARAM)(LONG)(lPos))
1354#define MCIWndEject(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_EJECT,0,0)
1355
1356#define MCIWndHome(hWnd) MCIWndSeek(hWnd,MCIWND_START)
1357#define MCIWndEnd(hWnd) MCIWndSeek(hWnd,MCIWND_END)
1358
1359#define MCIWndGetSource(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_GET_SOURCE,0,(LPARAM)(LPRECT)(prc))
1360#define MCIWndPutSource(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_PUT_SOURCE,0,(LPARAM)(LPRECT)(prc))
1361
1362#define MCIWndGetDest(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_GET_DEST,0,(LPARAM)(LPRECT)(prc))
1363#define MCIWndPutDest(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_PUT_DEST,0,(LPARAM)(LPRECT)(prc))
1364
1365#define MCIWndPlayReverse(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYREVERSE,0,0)
1366#define MCIWndPlayFrom(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYFROM,0,(LPARAM)(LONG)(lPos))
1367#define MCIWndPlayTo(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYTO, 0,(LPARAM)(LONG)(lPos))
1368#define MCIWndPlayFromTo(hWnd,lStart,lEnd) (MCIWndSeek(hWnd,lStart),MCIWndPlayTo(hWnd,lEnd))
1369
1370#define MCIWndGetDeviceID(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETDEVICEID,0,0)
1371#define MCIWndGetAlias(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETALIAS,0,0)
1372#define MCIWndGetMode(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETMODE,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1373#define MCIWndGetPosition(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETPOSITION,0,0)
1374#define MCIWndGetPositionString(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETPOSITION,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1375#define MCIWndGetStart(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETSTART,0,0)
1376#define MCIWndGetLength(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETLENGTH,0,0)
1377#define MCIWndGetEnd(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETEND,0,0)
1378
1379#define MCIWndStep(hWnd,n) (LONG)MCIWndSM(hWnd,MCI_STEP,0,(LPARAM)(long)(n))
1380
1381#define MCIWndDestroy(hWnd) (VOID)MCIWndSM(hWnd,WM_CLOSE,0,0)
1382#define MCIWndSetZoom(hWnd,iZoom) (VOID)MCIWndSM(hWnd,MCIWNDM_SETZOOM,0,(LPARAM)(UINT)(iZoom))
1383#define MCIWndGetZoom(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETZOOM,0,0)
1384#define MCIWndSetVolume(hWnd,iVol) (LONG)MCIWndSM(hWnd,MCIWNDM_SETVOLUME,0,(LPARAM)(UINT)(iVol))
1385#define MCIWndGetVolume(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETVOLUME,0,0)
1386#define MCIWndSetSpeed(hWnd,iSpeed) (LONG)MCIWndSM(hWnd,MCIWNDM_SETSPEED,0,(LPARAM)(UINT)(iSpeed))
1387#define MCIWndGetSpeed(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETSPEED,0,0)
1388#define MCIWndSetTimeFormat(hWnd,lp) (LONG)MCIWndSM(hWnd,MCIWNDM_SETTIMEFORMAT,0,(LPARAM)(LPTSTR)(lp))
1389#define MCIWndGetTimeFormat(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETTIMEFORMAT,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1390#define MCIWndValidateMedia(hWnd) (VOID)MCIWndSM(hWnd,MCIWNDM_VALIDATEMEDIA,0,0)
1391
1392#define MCIWndSetRepeat(hWnd,f) (void)MCIWndSM(hWnd,MCIWNDM_SETREPEAT,0,(LPARAM)(BOOL)(f))
1393#define MCIWndGetRepeat(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_GETREPEAT,0,0)
1394
1395#define MCIWndUseFrames(hWnd) MCIWndSetTimeFormat(hWnd,TEXT("frames"))
1396#define MCIWndUseTime(hWnd) MCIWndSetTimeFormat(hWnd,TEXT("ms"))
1397
1398#define MCIWndSetActiveTimer(hWnd,active) \
1399 (VOID)MCIWndSM(hWnd,MCIWNDM_SETACTIVETIMER, \
1400 (WPARAM)(UINT)(active),0L)
1401#define MCIWndSetInactiveTimer(hWnd,inactive) \
1402 (VOID)MCIWndSM(hWnd,MCIWNDM_SETINACTIVETIMER, \
1403 (WPARAM)(UINT)(inactive),0L)
1404#define MCIWndSetTimers(hWnd,active,inactive) \
1405 (VOID)MCIWndSM(hWnd,MCIWNDM_SETTIMERS,(WPARAM)(UINT)(active),\
1406 (LPARAM)(UINT)(inactive))
1407#define MCIWndGetActiveTimer(hWnd) \
1408 (UINT)MCIWndSM(hWnd,MCIWNDM_GETACTIVETIMER,0,0L);
1409#define MCIWndGetInactiveTimer(hWnd) \
1410 (UINT)MCIWndSM(hWnd,MCIWNDM_GETINACTIVETIMER,0,0L);
1411
1412#define MCIWndRealize(hWnd,fBkgnd) (LONG)MCIWndSM(hWnd,MCIWNDM_REALIZE,(WPARAM)(BOOL)(fBkgnd),0)
1413
1414#define MCIWndSendString(hWnd,sz) (LONG)MCIWndSM(hWnd,MCIWNDM_SENDSTRING,0,(LPARAM)(LPTSTR)(sz))
1415#define MCIWndReturnString(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_RETURNSTRING,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1416#define MCIWndGetError(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETERROR,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1417
1418#define MCIWndGetPalette(hWnd) (HPALETTE)MCIWndSM(hWnd,MCIWNDM_GETPALETTE,0,0)
1419#define MCIWndSetPalette(hWnd,hpal) (LONG)MCIWndSM(hWnd,MCIWNDM_SETPALETTE,(WPARAM)(HPALETTE)(hpal),0)
1420
1421#define MCIWndGetFileName(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETFILENAME,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1422#define MCIWndGetDevice(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETDEVICE,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1423
1424#define MCIWndGetStyles(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETSTYLES,0,0L)
1425#define MCIWndChangeStyles(hWnd,mask,value) (LONG)MCIWndSM(hWnd,MCIWNDM_CHANGESTYLES,(WPARAM)(UINT)(mask),(LPARAM)(LONG)(value))
1426
1427#define MCIWndOpenInterface(hWnd,pUnk) (LONG)MCIWndSM(hWnd,MCIWNDM_OPENINTERFACE,0,(LPARAM)(LPUNKNOWN)(pUnk))
1428
1429#define MCIWndSetOwner(hWnd,hWndP) (LONG)MCIWndSM(hWnd,MCIWNDM_SETOWNER,(WPARAM)(hWndP),0)
1430
1431#define MCIWNDM_GETDEVICEID (WM_USER + 100)
1432#define MCIWNDM_GETSTART (WM_USER + 103)
1433#define MCIWNDM_GETLENGTH (WM_USER + 104)
1434#define MCIWNDM_GETEND (WM_USER + 105)
1435#define MCIWNDM_EJECT (WM_USER + 107)
1436#define MCIWNDM_SETZOOM (WM_USER + 108)
1437#define MCIWNDM_GETZOOM (WM_USER + 109)
1438#define MCIWNDM_SETVOLUME (WM_USER + 110)
1439#define MCIWNDM_GETVOLUME (WM_USER + 111)
1440#define MCIWNDM_SETSPEED (WM_USER + 112)
1441#define MCIWNDM_GETSPEED (WM_USER + 113)
1442#define MCIWNDM_SETREPEAT (WM_USER + 114)
1443#define MCIWNDM_GETREPEAT (WM_USER + 115)
1444#define MCIWNDM_REALIZE (WM_USER + 118)
1445#define MCIWNDM_VALIDATEMEDIA (WM_USER + 121)
1446#define MCIWNDM_PLAYFROM (WM_USER + 122)
1447#define MCIWNDM_PLAYTO (WM_USER + 123)
1448#define MCIWNDM_GETPALETTE (WM_USER + 126)
1449#define MCIWNDM_SETPALETTE (WM_USER + 127)
1450#define MCIWNDM_SETTIMERS (WM_USER + 129)
1451#define MCIWNDM_SETACTIVETIMER (WM_USER + 130)
1452#define MCIWNDM_SETINACTIVETIMER (WM_USER + 131)
1453#define MCIWNDM_GETACTIVETIMER (WM_USER + 132)
1454#define MCIWNDM_GETINACTIVETIMER (WM_USER + 133)
1455#define MCIWNDM_CHANGESTYLES (WM_USER + 135)
1456#define MCIWNDM_GETSTYLES (WM_USER + 136)
1457#define MCIWNDM_GETALIAS (WM_USER + 137)
1458#define MCIWNDM_PLAYREVERSE (WM_USER + 139)
1459#define MCIWNDM_GET_SOURCE (WM_USER + 140)
1460#define MCIWNDM_PUT_SOURCE (WM_USER + 141)
1461#define MCIWNDM_GET_DEST (WM_USER + 142)
1462#define MCIWNDM_PUT_DEST (WM_USER + 143)
1463#define MCIWNDM_CAN_PLAY (WM_USER + 144)
1464#define MCIWNDM_CAN_WINDOW (WM_USER + 145)
1465#define MCIWNDM_CAN_RECORD (WM_USER + 146)
1466#define MCIWNDM_CAN_SAVE (WM_USER + 147)
1467#define MCIWNDM_CAN_EJECT (WM_USER + 148)
1468#define MCIWNDM_CAN_CONFIG (WM_USER + 149)
1469#define MCIWNDM_PALETTEKICK (WM_USER + 150)
1470#define MCIWNDM_OPENINTERFACE (WM_USER + 151)
1471#define MCIWNDM_SETOWNER (WM_USER + 152)
1472
1473#define MCIWNDM_SENDSTRINGA (WM_USER + 101)
1474#define MCIWNDM_GETPOSITIONA (WM_USER + 102)
1475#define MCIWNDM_GETMODEA (WM_USER + 106)
1476#define MCIWNDM_SETTIMEFORMATA (WM_USER + 119)
1477#define MCIWNDM_GETTIMEFORMATA (WM_USER + 120)
1478#define MCIWNDM_GETFILENAMEA (WM_USER + 124)
1479#define MCIWNDM_GETDEVICEA (WM_USER + 125)
1480#define MCIWNDM_GETERRORA (WM_USER + 128)
1481#define MCIWNDM_NEWA (WM_USER + 134)
1482#define MCIWNDM_RETURNSTRINGA (WM_USER + 138)
1483#define MCIWNDM_OPENA (WM_USER + 153)
1484
1485#define MCIWNDM_SENDSTRINGW (WM_USER + 201)
1486#define MCIWNDM_GETPOSITIONW (WM_USER + 202)
1487#define MCIWNDM_GETMODEW (WM_USER + 206)
1488#define MCIWNDM_SETTIMEFORMATW (WM_USER + 219)
1489#define MCIWNDM_GETTIMEFORMATW (WM_USER + 220)
1490#define MCIWNDM_GETFILENAMEW (WM_USER + 224)
1491#define MCIWNDM_GETDEVICEW (WM_USER + 225)
1492#define MCIWNDM_GETERRORW (WM_USER + 228)
1493#define MCIWNDM_NEWW (WM_USER + 234)
1494#define MCIWNDM_RETURNSTRINGW (WM_USER + 238)
1495#define MCIWNDM_OPENW (WM_USER + 252)
1496
1497#define MCIWNDM_SENDSTRING WINELIB_NAME_AW(MCIWNDM_SENDSTRING)
1498#define MCIWNDM_GETPOSITION WINELIB_NAME_AW(MCIWNDM_GETPOSITION)
1499#define MCIWNDM_GETMODE WINELIB_NAME_AW(MCIWNDM_GETMODE)
1500#define MCIWNDM_SETTIMEFORMAT WINELIB_NAME_AW(MCIWNDM_SETTIMEFORMAT)
1501#define MCIWNDM_GETTIMEFORMAT WINELIB_NAME_AW(MCIWNDM_GETTIMEFORMAT)
1502#define MCIWNDM_GETFILENAME WINELIB_NAME_AW(MCIWNDM_GETFILENAME)
1503#define MCIWNDM_GETDEVICE WINELIB_NAME_AW(MCIWNDM_GETDEVICE)
1504#define MCIWNDM_GETERROR WINELIB_NAME_AW(MCIWNDM_GETERROR)
1505#define MCIWNDM_NEW WINELIB_NAME_AW(MCIWNDM_NEW)
1506#define MCIWNDM_RETURNSTRING WINELIB_NAME_AW(MCIWNDM_RETURNSTRING)
1507#define MCIWNDM_OPEN WINELIB_NAME_AW(MCIWNDM_OPEN)
1508
1509#define MCIWNDM_NOTIFYMODE (WM_USER + 200)
1510#define MCIWNDM_NOTIFYPOS (WM_USER + 201)
1511#define MCIWNDM_NOTIFYSIZE (WM_USER + 202)
1512#define MCIWNDM_NOTIFYMEDIA (WM_USER + 203)
1513#define MCIWNDM_NOTIFYERROR (WM_USER + 205)
1514
1515#define MCIWND_START -1
1516#define MCIWND_END -2
1517
Bradley Baetza1491de2000-07-08 12:50:26 +00001518/********************************************
1519 * DrawDib declarations
1520 */
1521
1522HDRAWDIB VFWAPI DrawDibOpen( void );
1523UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground);
1524
Eric Pouech731e9f52000-07-26 18:07:04 +00001525BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst,
1526 LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags);
Bradley Baetza1491de2000-07-08 12:50:26 +00001527
Eric Pouech731e9f52000-07-26 18:07:04 +00001528BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst,
Vincent Béron9a624912002-05-31 23:06:46 +00001529 LPBITMAPINFOHEADER lpbi, LPVOID lpBits,
Eric Pouech731e9f52000-07-26 18:07:04 +00001530 INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags);
Bradley Baetza1491de2000-07-08 12:50:26 +00001531
1532/* DrawDibDraw flags */
1533
Eric Pouech731e9f52000-07-26 18:07:04 +00001534#define DDF_UPDATE 0x0002
Bradley Baetza1491de2000-07-08 12:50:26 +00001535#define DDF_SAME_HDC 0x0004
1536#define DDF_SAME_DRAW 0x0008
1537#define DDF_DONTDRAW 0x0010
Eric Pouech731e9f52000-07-26 18:07:04 +00001538#define DDF_ANIMATE 0x0020
1539#define DDF_BUFFER 0x0040
Bradley Baetza1491de2000-07-08 12:50:26 +00001540#define DDF_JUSTDRAWIT 0x0080
1541#define DDF_FULLSCREEN 0x0100
1542#define DDF_BACKGROUNDPAL 0x0200
1543#define DDF_NOTKEYFRAME 0x0400
Eric Pouech731e9f52000-07-26 18:07:04 +00001544#define DDF_HURRYUP 0x0800
Bradley Baetza1491de2000-07-08 12:50:26 +00001545#define DDF_HALFTONE 0x1000
1546
Eric Pouech731e9f52000-07-26 18:07:04 +00001547#define DDF_PREROLL DDF_DONTDRAW
1548#define DDF_SAME_DIB DDF_SAME_DRAW
1549#define DDF_SAME_SIZE DDF_SAME_DRAW
1550
Bradley Baetza1491de2000-07-08 12:50:26 +00001551BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal);
1552HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd);
Eric Pouech731e9f52000-07-26 18:07:04 +00001553BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe);
1554LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags);
1555
1556BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate);
1557BOOL VFWAPI DrawDibStop(HDRAWDIB hdd);
1558#define DrawDibUpdate(hdd, hdc, x, y) \
1559 DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
Bradley Baetza1491de2000-07-08 12:50:26 +00001560
1561BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd);
1562BOOL VFWAPI DrawDibClose(HDRAWDIB hdd);
Marcus Meissner676a5131999-02-05 09:41:55 +00001563
Eric Pouech731e9f52000-07-26 18:07:04 +00001564/* display profiling */
1565#define PD_CAN_DRAW_DIB 0x0001
1566#define PD_CAN_STRETCHDIB 0x0002
1567#define PD_STRETCHDIB_1_1_OK 0x0004
1568#define PD_STRETCHDIB_1_2_OK 0x0008
1569#define PD_STRETCHDIB_1_N_OK 0x0010
1570
1571DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
1572
Alexandre Julliard2fdc4dc2003-11-26 04:11:56 +00001573HWND VFWAPI capCreateCaptureWindowA(LPCSTR,DWORD,INT,INT,INT,INT,HWND,INT);
1574HWND VFWAPI capCreateCaptureWindowW(LPCWSTR,DWORD,INT,INT,INT,INT,HWND,INT);
1575#define capCreateCaptureWindow WINELIB_NAME_AW(capCreateCaptureWindow)
1576BOOL VFWAPI capGetDriverDescriptionA(WORD,LPSTR,INT,LPSTR,INT);
1577BOOL VFWAPI capGetDriverDescriptionW(WORD,LPWSTR,INT,LPWSTR,INT);
1578#define capGetDriverDescription WINELIB_NAME_AW(capGetDriverDescription)
1579
Eric Pouech731e9f52000-07-26 18:07:04 +00001580#ifdef __cplusplus
1581}
1582#endif /* __cplusplus */
1583
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001584#endif /* __WINE_VFW_H */