blob: c0689fbd995dced24c5b7a23887cf081ae33b02e [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
Jonathan Ernst360a3f92006-05-18 14:49:52 +020016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000017 */
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
Francois Gouget4e4f1d11999-03-17 15:16:01 +000035/*****************************************************************************
36 * Predeclare the interfaces
37 */
Alexandre Julliardb8d30752005-07-26 18:32:53 +000038typedef struct IAVIStream *PAVISTREAM;
39typedef struct IAVIFile *PAVIFILE;
40typedef struct IGetFrame *PGETFRAME;
41typedef struct IAVIEditStream *PAVIEDITSTREAM;
Francois Gouget4e4f1d11999-03-17 15:16:01 +000042
Bradley Baetza1491de2000-07-08 12:50:26 +000043/* Installable Compressor Manager */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000044
Dmitry Timoshkov19021aa2005-11-28 17:31:48 +010045#define ICVERSION 0x0104
46
Eric Pouech26146cd2001-02-14 21:49:22 +000047DECLARE_HANDLE(HIC);
Francois Gougeta537bec2000-06-11 20:07:08 +000048
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000049/* 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
Dmitry Timoshkov2a93c2f2006-01-23 11:24:08 +0100146#ifndef comptypeDIB
147#define comptypeDIB mmioFOURCC('D','I','B',' ')
148#endif
149
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000150/* structs */
151
Bradley Baetza1491de2000-07-08 12:50:26 +0000152/* NOTE: Only the 16 bit structs are packed. Structs that are packed anyway
153 * have not been changed. If a structure is later extended, you may need to create
154 * two versions of it.
155 */
156
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000157typedef struct {
158 DWORD dwSize; /* 00: size */
159 DWORD fccType; /* 04: type 'vidc' usually */
160 DWORD fccHandler; /* 08: */
161 DWORD dwVersion; /* 0c: version of compman opening you */
162 DWORD dwFlags; /* 10: LOWORD is type specific */
163 LRESULT dwError; /* 14: */
164 LPVOID pV1Reserved; /* 18: */
165 LPVOID pV2Reserved; /* 1c: */
166 DWORD dnDevNode; /* 20: */
167 /* 24: */
168} ICOPEN,*LPICOPEN;
169
Marcus Meissner32b32d81999-01-29 15:12:10 +0000170#define ICCOMPRESS_KEYFRAME 0x00000001L
171
172typedef struct {
173 DWORD dwFlags;
174 LPBITMAPINFOHEADER lpbiOutput;
175 LPVOID lpOutput;
176 LPBITMAPINFOHEADER lpbiInput;
177 LPVOID lpInput;
178 LPDWORD lpckid;
179 LPDWORD lpdwFlags;
180 LONG lFrameNum;
181 DWORD dwFrameSize;
182 DWORD dwQuality;
183 LPBITMAPINFOHEADER lpbiPrev;
184 LPVOID lpPrev;
185} ICCOMPRESS;
186
Alexandre Julliarda3960291999-02-26 11:11:13 +0000187DWORD VFWAPIV ICCompress(
188 HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
Marcus Meissner32b32d81999-01-29 15:12:10 +0000189 LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
190 LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
191 LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev
192);
193
Alexandre Julliarda3960291999-02-26 11:11:13 +0000194#define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
Eric Pouech731e9f52000-07-26 18:07:04 +0000195 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000196 hic,ICM_COMPRESS_GET_FORMAT,(DWORD_PTR)(LPVOID)(lpbiInput), \
197 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000198 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000199
Alexandre Julliarda3960291999-02-26 11:11:13 +0000200#define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000201
Alexandre Julliarda3960291999-02-26 11:11:13 +0000202#define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
203 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000204 hic, ICM_COMPRESS_BEGIN, (DWORD_PTR)(LPVOID)(lpbiInput), \
205 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000206 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000207
Eric Pouech731e9f52000-07-26 18:07:04 +0000208#define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
Alexandre Julliarda3960291999-02-26 11:11:13 +0000209 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000210 hic, ICM_COMPRESS_GET_SIZE, (DWORD_PTR)(LPVOID)(lpbiInput), \
211 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000212 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000213
Alexandre Julliarda3960291999-02-26 11:11:13 +0000214#define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
215 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000216 hic, ICM_COMPRESS_QUERY, (DWORD_PTR)(LPVOID)(lpbiInput), \
217 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000218 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000219
Alexandre Julliarda3960291999-02-26 11:11:13 +0000220#define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000221
222/* ICCOMPRESSFRAMES.dwFlags */
223#define ICCOMPRESSFRAMES_PADDING 0x00000001
224typedef struct {
225 DWORD dwFlags;
226 LPBITMAPINFOHEADER lpbiOutput;
227 LPARAM lOutput;
228 LPBITMAPINFOHEADER lpbiInput;
229 LPARAM lInput;
230 LONG lStartFrame;
231 LONG lFrameCount;
232 LONG lQuality;
233 LONG lDataRate;
234 LONG lKeyRate;
235 DWORD dwRate;
236 DWORD dwScale;
237 DWORD dwOverheadPerFrame;
238 DWORD dwReserved2;
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000239 LONG (CALLBACK *GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len);
240 LONG (CALLBACK *PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000241} ICCOMPRESSFRAMES;
242
Eric Pouech731e9f52000-07-26 18:07:04 +0000243typedef struct {
244 DWORD dwFlags;
245 LPARAM lParam;
246 /* messages for Status callback */
247#define ICSTATUS_START 0
248#define ICSTATUS_STATUS 1
249#define ICSTATUS_END 2
250#define ICSTATUS_ERROR 3
251#define ICSTATUS_YIELD 4
252 /* FIXME: some X11 libs define Status as int... */
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000253 /* LONG (CALLBACK *zStatus)(LPARAM lParam, UINT message, LONG l); */
254 LONG (CALLBACK *zStatus)(LPARAM lParam, UINT message, LONG l);
Eric Pouech731e9f52000-07-26 18:07:04 +0000255} ICSETSTATUSPROC;
256
Marcus Meissner32b32d81999-01-29 15:12:10 +0000257/* Values for wMode of ICOpen() */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000258#define ICMODE_COMPRESS 1
259#define ICMODE_DECOMPRESS 2
260#define ICMODE_FASTDECOMPRESS 3
261#define ICMODE_QUERY 4
262#define ICMODE_FASTCOMPRESS 5
263#define ICMODE_DRAW 8
264
265/* quality flags */
266#define ICQUALITY_LOW 0
267#define ICQUALITY_HIGH 10000
268#define ICQUALITY_DEFAULT -1
269
270typedef struct {
271 DWORD dwSize; /* 00: */
272 DWORD fccType; /* 04:compressor type 'vidc' 'audc' */
273 DWORD fccHandler; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
274 DWORD dwFlags; /* 0c:flags LOWORD is type specific */
275 DWORD dwVersion; /* 10:version of the driver */
276 DWORD dwVersionICM; /* 14:version of the ICM used */
277 /*
278 * under Win32, the driver always returns UNICODE strings.
279 */
280 WCHAR szName[16]; /* 18:short name */
281 WCHAR szDescription[128]; /* 38:long name */
282 WCHAR szDriver[128]; /* 138:driver that contains compressor*/
283 /* 238: */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000284} ICINFO;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000285
Marcus Meissner32b32d81999-01-29 15:12:10 +0000286/* ICINFO.dwFlags */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000287#define VIDCF_QUALITY 0x0001 /* supports quality */
288#define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */
289#define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */
290#define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */
291#define VIDCF_DRAW 0x0010 /* supports drawing */
292#define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */
293#define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */
294#define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */
295
296#define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
297
298
299/* function shortcuts */
300/* ICM_ABOUT */
301#define ICMF_ABOUT_QUERY 0x00000001
302
Alexandre Julliarda3960291999-02-26 11:11:13 +0000303#define ICQueryAbout(hic) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000304 (ICSendMessage(hic,ICM_ABOUT,(DWORD_PTR)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000305
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000306#define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD_PTR)(UINT_PTR)(hwnd),0)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000307
308/* ICM_CONFIGURE */
309#define ICMF_CONFIGURE_QUERY 0x00000001
Alexandre Julliarda3960291999-02-26 11:11:13 +0000310#define ICQueryConfigure(hic) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000311 (ICSendMessage(hic,ICM_CONFIGURE,(DWORD_PTR)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000312
Alexandre Julliarda3960291999-02-26 11:11:13 +0000313#define ICConfigure(hic,hwnd) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000314 ICSendMessage(hic,ICM_CONFIGURE,(DWORD_PTR)(UINT_PTR)(hwnd),0)
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000315
316/* Decompression stuff */
317#define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */
318#define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */
Eric Pouech731e9f52000-07-26 18:07:04 +0000319#define ICDECOMPRESS_PREROLL 0x20000000 /* this frame is before real start */
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000320#define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */
321#define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */
322
323typedef struct {
324 DWORD dwFlags; /* flags (from AVI index...) */
325 LPBITMAPINFOHEADER lpbiInput; /* BITMAPINFO of compressed data */
326 LPVOID lpInput; /* compressed data */
327 LPBITMAPINFOHEADER lpbiOutput; /* DIB to decompress to */
328 LPVOID lpOutput;
329 DWORD ckid; /* ckid from AVI file */
330} ICDECOMPRESS;
331
332typedef struct {
333 DWORD dwFlags;
334 LPBITMAPINFOHEADER lpbiSrc;
335 LPVOID lpSrc;
336 LPBITMAPINFOHEADER lpbiDst;
337 LPVOID lpDst;
338
339 /* changed for ICM_DECOMPRESSEX */
Eric Pouech731e9f52000-07-26 18:07:04 +0000340 INT xDst; /* destination rectangle */
341 INT yDst;
342 INT dxDst;
343 INT dyDst;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000344
Eric Pouech731e9f52000-07-26 18:07:04 +0000345 INT xSrc; /* source rectangle */
346 INT ySrc;
347 INT dxSrc;
348 INT dySrc;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000349} ICDECOMPRESSEX;
350
Bradley Baetza1491de2000-07-08 12:50:26 +0000351DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000352
Alexandre Julliarda3960291999-02-26 11:11:13 +0000353#define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
354 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000355 hic, ICM_DECOMPRESS_BEGIN, (DWORD_PTR)(LPVOID)(lpbiInput), \
356 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000357 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000358
Alexandre Julliarda3960291999-02-26 11:11:13 +0000359#define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
360 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000361 hic,ICM_DECOMPRESS_QUERY, (DWORD_PTR)(LPVOID)(lpbiInput), \
362 (DWORD_PTR) (LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000363 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000364
Alexandre Julliarda3960291999-02-26 11:11:13 +0000365#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
366 ((LONG)ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000367 hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD_PTR)(LPVOID)(lpbiInput), \
368 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000369 ))
Marcus Meissner32b32d81999-01-29 15:12:10 +0000370
Alexandre Julliarda3960291999-02-26 11:11:13 +0000371#define ICDecompressGetFormatSize(hic, lpbi) \
372 ICDecompressGetFormat(hic, lpbi, NULL)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000373
Alexandre Julliarda3960291999-02-26 11:11:13 +0000374#define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
375 ICSendMessage( \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000376 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD_PTR)(LPVOID)(lpbiInput), \
377 (DWORD_PTR)(LPVOID)(lpbiOutput) \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000378 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000379
Alexandre Julliarda3960291999-02-26 11:11:13 +0000380#define ICDecompressSetPalette(hic,lpbiPalette) \
381 ICSendMessage( \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000382 hic,ICM_DECOMPRESS_SET_PALETTE, \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000383 (DWORD_PTR)(LPVOID)(lpbiPalette),0 \
Marcus Meissner32b32d81999-01-29 15:12:10 +0000384 )
Marcus Meissner32b32d81999-01-29 15:12:10 +0000385
Alexandre Julliarda3960291999-02-26 11:11:13 +0000386#define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000387
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000388LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD_PTR dw1, DWORD_PTR dw2);
Eric Pouech731e9f52000-07-26 18:07:04 +0000389
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000390static inline LRESULT VFWAPI ICDecompressEx(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000391 LPBITMAPINFOHEADER lpbiSrc, LPVOID lpSrc,
392 int xSrc, int ySrc, int dxSrc, int dySrc,
393 LPBITMAPINFOHEADER lpbiDst, LPVOID lpDst,
394 int xDst, int yDst, int dxDst, int dyDst)
395{
396 ICDECOMPRESSEX ic;
397
398 ic.dwFlags = dwFlags;
399 ic.lpbiSrc = lpbiSrc;
400 ic.lpSrc = lpSrc;
401 ic.xSrc = xSrc;
402 ic.ySrc = ySrc;
403 ic.dxSrc = dxSrc;
404 ic.dySrc = dySrc;
405 ic.lpbiDst = lpbiDst;
406 ic.lpDst = lpDst;
407 ic.xDst = xDst;
408 ic.yDst = yDst;
409 ic.dxDst = dxDst;
410 ic.dyDst = dyDst;
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000411 return ICSendMessage(hic, ICM_DECOMPRESSEX, (DWORD_PTR)&ic, sizeof(ic));
Eric Pouech731e9f52000-07-26 18:07:04 +0000412}
413
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000414static inline LRESULT VFWAPI ICDecompressExBegin(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000415 LPBITMAPINFOHEADER lpbiSrc,
416 LPVOID lpSrc,
417 int xSrc, int ySrc, int dxSrc, int dySrc,
418 LPBITMAPINFOHEADER lpbiDst,
419 LPVOID lpDst,
420 int xDst,
421 int yDst,
422 int dxDst,
423 int dyDst)
424{
425 ICDECOMPRESSEX ic;
426
427 ic.dwFlags = dwFlags;
428 ic.lpbiSrc = lpbiSrc;
429 ic.lpSrc = lpSrc;
430 ic.xSrc = xSrc;
431 ic.ySrc = ySrc;
432 ic.dxSrc = dxSrc;
433 ic.dySrc = dySrc;
434 ic.lpbiDst = lpbiDst;
435 ic.lpDst = lpDst;
436 ic.xDst = xDst;
437 ic.yDst = yDst;
438 ic.dxDst = dxDst;
439 ic.dyDst = dyDst;
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000440 return ICSendMessage(hic, ICM_DECOMPRESSEX_BEGIN, (DWORD_PTR)&ic, sizeof(ic));
Eric Pouech731e9f52000-07-26 18:07:04 +0000441}
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000442static inline LRESULT VFWAPI ICDecompressExQuery(HIC hic, DWORD dwFlags,
Eric Pouech731e9f52000-07-26 18:07:04 +0000443 LPBITMAPINFOHEADER lpbiSrc,
444 LPVOID lpSrc,
445 int xSrc, int ySrc, int dxSrc, int dySrc,
446 LPBITMAPINFOHEADER lpbiDst,
447 LPVOID lpDst,
448 int xDst,
449 int yDst,
450 int dxDst,
451 int dyDst)
452{
453 ICDECOMPRESSEX ic;
454
455 ic.dwFlags = dwFlags;
456 ic.lpbiSrc = lpbiSrc;
457 ic.lpSrc = lpSrc;
458 ic.xSrc = xSrc;
459 ic.ySrc = ySrc;
460 ic.dxSrc = dxSrc;
461 ic.dySrc = dySrc;
462 ic.lpbiDst = lpbiDst;
463 ic.lpDst = lpDst;
464 ic.xDst = xDst;
465 ic.yDst = yDst;
466 ic.dxDst = dxDst;
467 ic.dyDst = dyDst;
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000468 return ICSendMessage(hic, ICM_DECOMPRESSEX_QUERY, (DWORD_PTR)&ic, sizeof(ic));
Eric Pouech731e9f52000-07-26 18:07:04 +0000469}
470
471#define ICDecompressExEnd(hic) \
472 ICSendMessage(hic, ICM_DECOMPRESSEX_END, 0, 0)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000473
Marcus Meissner73458b01998-12-26 12:54:29 +0000474#define ICDRAW_QUERY 0x00000001L /* test for support */
475#define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
476#define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
Eric Pouech731e9f52000-07-26 18:07:04 +0000477#define ICDRAW_ANIMATE 0x00000008L /* expect palette animation */
478#define ICDRAW_CONTINUE 0x00000010L /* draw is a continuation of previous draw */
479#define ICDRAW_MEMORYDC 0x00000020L /* DC is offscreen, by the way */
480#define ICDRAW_UPDATING 0x00000040L /* We're updating, as opposed to playing */
481#define ICDRAW_RENDER 0x00000080L /* used to render data not draw it */
482#define ICDRAW_BUFFER 0x00000100L /* buffer data offscreen, we will need to update it */
483
484#define ICDecompressOpen(fccType, fccHandler, lpbiIn, lpbiOut) \
485 ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, ICMODE_DECOMPRESS)
486
487#define ICDrawOpen(fccType, fccHandler, lpbiIn) \
488 ICLocate(fccType, fccHandler, lpbiIn, NULL, ICMODE_DRAW)
489
Vincent Béron9a624912002-05-31 23:06:46 +0000490HANDLE VFWAPI ICImageCompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
Eric Pouech731e9f52000-07-26 18:07:04 +0000491 LPVOID lpBits, LPBITMAPINFO lpbiOut, LONG lQuality,
492 LONG* plSize);
493
494HANDLE VFWAPI ICImageDecompress(HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn,
495 LPVOID lpBits, LPBITMAPINFO lpbiOut);
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000496
Alexandre Julliarda3960291999-02-26 11:11:13 +0000497BOOL VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
Eric Pouech731e9f52000-07-26 18:07:04 +0000498BOOL VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags);
499BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000500LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb);
501HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
Alexandre Julliard0e67f652009-10-06 12:30:49 +0200502#ifdef WINE_STRICT_PROTOTYPES
503HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, DRIVERPROC lpfnHandler);
504#else
Marcus Meissner960c7251999-03-13 18:09:16 +0000505HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler);
Alexandre Julliard0e67f652009-10-06 12:30:49 +0200506#endif
Marcus Meissner960c7251999-03-13 18:09:16 +0000507
Eric Pouech731e9f52000-07-26 18:07:04 +0000508LRESULT VFWAPI ICClose(HIC hic);
509HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
Eric Pouech731e9f52000-07-26 18:07:04 +0000510HIC VFWAPI ICGetDisplayFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, int BitDepth, int dx, int dy);
511
512/* Values for wFlags of ICInstall() */
513#define ICINSTALL_UNICODE 0x8000
514#define ICINSTALL_FUNCTION 0x0001
515#define ICINSTALL_DRIVER 0x0002
516#define ICINSTALL_HDRV 0x0004
517#define ICINSTALL_DRIVERW 0x8002
518
519#define ICGetState(hic, pv, cb) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000520 ICSendMessage(hic, ICM_GETSTATE, (DWORD_PTR)(LPVOID)(pv), (DWORD_PTR)(cb))
Eric Pouech731e9f52000-07-26 18:07:04 +0000521#define ICSetState(hic, pv, cb) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000522 ICSendMessage(hic, ICM_SETSTATE, (DWORD_PTR)(LPVOID)(pv), (DWORD_PTR)(cb))
Eric Pouech731e9f52000-07-26 18:07:04 +0000523#define ICGetStateSize(hic) \
524 ICGetState(hic, NULL, 0)
525
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000526static inline DWORD ICGetDefaultQuality(HIC hic)
Eric Pouech731e9f52000-07-26 18:07:04 +0000527{
528 DWORD dwICValue;
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000529 ICSendMessage(hic, ICM_GETDEFAULTQUALITY, (DWORD_PTR)(LPVOID)&dwICValue, sizeof(DWORD));
Eric Pouech731e9f52000-07-26 18:07:04 +0000530 return dwICValue;
531}
532
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000533static inline DWORD ICGetDefaultKeyFrameRate(HIC hic)
Eric Pouech731e9f52000-07-26 18:07:04 +0000534{
535 DWORD dwICValue;
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000536 ICSendMessage(hic, ICM_GETDEFAULTKEYFRAMERATE, (DWORD_PTR)(LPVOID)&dwICValue, sizeof(DWORD));
Eric Pouech731e9f52000-07-26 18:07:04 +0000537 return dwICValue;
538}
539
540#define ICDrawWindow(hic, prc) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000541 ICSendMessage(hic, ICM_DRAW_WINDOW, (DWORD_PTR)(LPVOID)(prc), sizeof(RECT))
Bradley Baetza1491de2000-07-08 12:50:26 +0000542
543/* As passed to ICM_DRAW_SUGGESTFORMAT */
544typedef struct {
545 DWORD dwFlags;
546 LPBITMAPINFOHEADER lpbiIn;
547 LPBITMAPINFOHEADER lpbiSuggest;
548 INT dxSrc;
549 INT dySrc;
550 INT dxDst;
551 INT dyDst;
552 HIC hicDecompressor;
553} ICDRAWSUGGEST;
554
555typedef struct {
Eric Pouech731e9f52000-07-26 18:07:04 +0000556 DWORD dwFlags;
557 int iStart;
558 int iLen;
559 LPPALETTEENTRY lppe;
560} ICPALETTE;
561
Alexandre Julliarda3960291999-02-26 11:11:13 +0000562DWORD VFWAPIV ICDrawBegin(
563 HIC hic,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000564 DWORD dwFlags,/* flags */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000565 HPALETTE hpal, /* palette to draw with */
566 HWND hwnd, /* window to draw to */
567 HDC hdc, /* HDC to draw to */
568 INT xDst, /* destination rectangle */
569 INT yDst,
570 INT dxDst,
571 INT dyDst,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000572 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
Alexandre Julliarda3960291999-02-26 11:11:13 +0000573 INT xSrc, /* source rectangle */
574 INT ySrc,
575 INT dxSrc,
576 INT dySrc,
Alexandre Julliardd30dfd21998-09-27 18:28:36 +0000577 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
Marcus Meissner32b32d81999-01-29 15:12:10 +0000578 DWORD dwScale
579);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000580
Bradley Baetza1491de2000-07-08 12:50:26 +0000581/* as passed to ICM_DRAW_BEGIN */
Marcus Meissner960c7251999-03-13 18:09:16 +0000582typedef struct {
583 DWORD dwFlags;
584 HPALETTE hpal;
585 HWND hwnd;
586 HDC hdc;
587 INT xDst;
588 INT yDst;
589 INT dxDst;
590 INT dyDst;
591 LPBITMAPINFOHEADER lpbi;
592 INT xSrc;
593 INT ySrc;
594 INT dxSrc;
595 INT dySrc;
596 DWORD dwRate;
597 DWORD dwScale;
598} ICDRAWBEGIN;
599
Patrik Stridvall0f8bc5b1999-04-22 16:27:50 +0000600#define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */
601#define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */
602#define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */
603#define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */
604#define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */
Marcus Meissner960c7251999-03-13 18:09:16 +0000605
606typedef struct {
607 DWORD dwFlags;
608 LPVOID lpFormat;
609 LPVOID lpData;
610 DWORD cbData;
611 LONG lTime;
612} ICDRAW;
613
614DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime);
615
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000616static inline LRESULT VFWAPI ICDrawSuggestFormat(HIC hic, LPBITMAPINFOHEADER lpbiIn,
Eric Pouech731e9f52000-07-26 18:07:04 +0000617 LPBITMAPINFOHEADER lpbiOut,
Vincent Béron9a624912002-05-31 23:06:46 +0000618 int dxSrc, int dySrc,
Eric Pouech731e9f52000-07-26 18:07:04 +0000619 int dxDst, int dyDst,
620 HIC hicDecomp)
621{
622 ICDRAWSUGGEST ic;
623
624 ic.lpbiIn = lpbiIn;
625 ic.lpbiSuggest = lpbiOut;
626 ic.dxSrc = dxSrc;
627 ic.dySrc = dySrc;
628 ic.dxDst = dxDst;
629 ic.dyDst = dyDst;
630 ic.hicDecompressor = hicDecomp;
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000631 return ICSendMessage(hic, ICM_DRAW_SUGGESTFORMAT, (DWORD_PTR)&ic, sizeof(ic));
Eric Pouech731e9f52000-07-26 18:07:04 +0000632}
633
634#define ICDrawQuery(hic, lpbiInput) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000635 ICSendMessage(hic, ICM_DRAW_QUERY, (DWORD_PTR)(LPVOID)(lpbiInput), 0L)
Eric Pouech731e9f52000-07-26 18:07:04 +0000636
637#define ICDrawChangePalette(hic, lpbiInput) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000638 ICSendMessage(hic, ICM_DRAW_CHANGEPALETTE, (DWORD_PTR)(LPVOID)(lpbiInput), 0L)
Eric Pouech731e9f52000-07-26 18:07:04 +0000639
640#define ICGetBuffersWanted(hic, lpdwBuffers) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000641 ICSendMessage(hic, ICM_GETBUFFERSWANTED, (DWORD_PTR)(LPVOID)(lpdwBuffers), 0)
Eric Pouech731e9f52000-07-26 18:07:04 +0000642
643#define ICDrawEnd(hic) \
644 ICSendMessage(hic, ICM_DRAW_END, 0, 0)
645
646#define ICDrawStart(hic) \
647 ICSendMessage(hic, ICM_DRAW_START, 0, 0)
648
649#define ICDrawStartPlay(hic, lFrom, lTo) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000650 ICSendMessage(hic, ICM_DRAW_START_PLAY, (DWORD_PTR)(lFrom), (DWORD_PTR)(lTo))
Eric Pouech731e9f52000-07-26 18:07:04 +0000651
652#define ICDrawStop(hic) \
653 ICSendMessage(hic, ICM_DRAW_STOP, 0, 0)
654
655#define ICDrawStopPlay(hic) \
656 ICSendMessage(hic, ICM_DRAW_STOP_PLAY, 0, 0)
657
658#define ICDrawGetTime(hic, lplTime) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000659 ICSendMessage(hic, ICM_DRAW_GETTIME, (DWORD_PTR)(LPVOID)(lplTime), 0)
Eric Pouech731e9f52000-07-26 18:07:04 +0000660
661#define ICDrawSetTime(hic, lTime) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000662 ICSendMessage(hic, ICM_DRAW_SETTIME, (DWORD_PTR)lTime, 0)
Eric Pouech731e9f52000-07-26 18:07:04 +0000663
664#define ICDrawRealize(hic, hdc, fBackground) \
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000665 ICSendMessage(hic, ICM_DRAW_REALIZE, (DWORD_PTR)(UINT_PTR)(HDC)(hdc), (DWORD_PTR)(BOOL)(fBackground))
Eric Pouech731e9f52000-07-26 18:07:04 +0000666
667#define ICDrawFlush(hic) \
668 ICSendMessage(hic, ICM_DRAW_FLUSH, 0, 0)
669
670#define ICDrawRenderBuffer(hic) \
671 ICSendMessage(hic, ICM_DRAW_RENDERBUFFER, 0, 0)
672
Andrew Talbot7c6ef462007-03-23 15:12:17 +0000673static inline LRESULT VFWAPI ICSetStatusProc(HIC hic, DWORD dwFlags, LRESULT lParam,
Patrik Stridvallf94462f2002-01-31 23:22:07 +0000674 LONG (CALLBACK *fpfnStatus)(LPARAM, UINT, LONG))
Eric Pouech731e9f52000-07-26 18:07:04 +0000675{
676 ICSETSTATUSPROC ic;
677
678 ic.dwFlags = dwFlags;
679 ic.lParam = lParam;
680 /* FIXME: see comment in ICSETSTATUSPROC definition */
681 ic.zStatus = fpfnStatus;
682
Kevin Koltzau6bb46e32005-08-22 09:19:16 +0000683 return ICSendMessage(hic, ICM_SET_STATUS_PROC, (DWORD_PTR)&ic, sizeof(ic));
Eric Pouech731e9f52000-07-26 18:07:04 +0000684}
685
686typedef struct {
687 LONG cbSize;
688 DWORD dwFlags;
689 HIC hic;
690 DWORD fccType;
691 DWORD fccHandler;
692 LPBITMAPINFO lpbiIn;
693 LPBITMAPINFO lpbiOut;
694 LPVOID lpBitsOut;
695 LPVOID lpBitsPrev;
696 LONG lFrame;
697 LONG lKey;
698 LONG lDataRate;
699 LONG lQ;
700 LONG lKeyCount;
701 LPVOID lpState;
702 LONG cbState;
703} COMPVARS, *PCOMPVARS;
704
705#define ICMF_COMPVARS_VALID 0x00000001
706
707BOOL VFWAPI ICCompressorChoose(HWND hwnd, UINT uiFlags, LPVOID pvIn, LPVOID lpData,
708 PCOMPVARS pc, LPSTR lpszTitle);
709
710#define ICMF_CHOOSE_KEYFRAME 0x0001
711#define ICMF_CHOOSE_DATARATE 0x0002
712#define ICMF_CHOOSE_PREVIEW 0x0004
713#define ICMF_CHOOSE_ALLCOMPRESSORS 0x0008
714
715BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn);
716void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc);
717
718LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits,
719 BOOL *pfKey, LONG *plSize);
720void VFWAPI ICCompressorFree(PCOMPVARS pc);
721
Marcus Meissner32b32d81999-01-29 15:12:10 +0000722/********************* AVIFILE function declarations *************************/
Eric Pouech26146cd2001-02-14 21:49:22 +0000723
724#ifndef mmioFOURCC
725#define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
726 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
727 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
728#endif
729
730#ifndef aviTWOCC
731#define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
732#endif
733
734typedef WORD TWOCC;
735
736#define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
737#define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
738
Eric Pouech731e9f52000-07-26 18:07:04 +0000739#define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
740#define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
741#define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
742#define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
743#define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
744#define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
745#define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
746#define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
747
748#define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
749#define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
750
751#define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
Marcus Meissner32b32d81999-01-29 15:12:10 +0000752
Michael Günnewig9f67cfe2003-06-23 18:10:06 +0000753#define streamtypeANY 0UL
Marcus Meissner676a5131999-02-05 09:41:55 +0000754#define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
755#define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
756#define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
757#define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
758
759/* Basic chunk types */
760#define cktypeDIBbits aviTWOCC('d', 'b')
761#define cktypeDIBcompressed aviTWOCC('d', 'c')
762#define cktypePALchange aviTWOCC('p', 'c')
763#define cktypeWAVEbytes aviTWOCC('w', 'b')
764
765/* Chunk id to use for extra chunks for padding. */
766#define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
767
Eric Pouech26146cd2001-02-14 21:49:22 +0000768#define FromHex(n) (((n) >= 'A') ? ((n) + 10 - 'A') : ((n) - '0'))
769#define StreamFromFOURCC(fcc) ((WORD)((FromHex(LOBYTE(LOWORD(fcc))) << 4) + \
770 (FromHex(HIBYTE(LOWORD(fcc))))))
771#define TWOCCFromFOURCC(fcc) HIWORD(fcc)
772#define ToHex(n) ((BYTE)(((n) > 9) ? ((n) - 10 + 'A') : ((n) + '0')))
773#define MAKEAVICKID(tcc, stream) \
774 MAKELONG((ToHex((stream) & 0x0f) << 8) | \
775 (ToHex(((stream) & 0xf0) >> 4)), tcc)
776
Marcus Meissner32b32d81999-01-29 15:12:10 +0000777/* AVIFileHdr.dwFlags */
778#define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
779#define AVIF_MUSTUSEINDEX 0x00000020
780#define AVIF_ISINTERLEAVED 0x00000100
781#define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames*/
782#define AVIF_WASCAPTUREFILE 0x00010000
783#define AVIF_COPYRIGHTED 0x00020000
784
785#define AVI_HEADERSIZE 2048
786
Michael Günnewigb26206d2002-10-18 00:25:19 +0000787typedef BOOL (CALLBACK *AVISAVECALLBACK)(INT);
788
Marcus Meissner676a5131999-02-05 09:41:55 +0000789typedef struct _MainAVIHeader
790{
791 DWORD dwMicroSecPerFrame;
792 DWORD dwMaxBytesPerSec;
793 DWORD dwPaddingGranularity;
794 DWORD dwFlags;
795 DWORD dwTotalFrames;
796 DWORD dwInitialFrames;
797 DWORD dwStreams;
798 DWORD dwSuggestedBufferSize;
799 DWORD dwWidth;
800 DWORD dwHeight;
801 DWORD dwReserved[4];
802} MainAVIHeader;
803
Marcus Meissner32b32d81999-01-29 15:12:10 +0000804/* AVIStreamHeader.dwFlags */
805#define AVISF_DISABLED 0x00000001
806#define AVISF_VIDEO_PALCHANGES 0x00010000
807
808typedef struct {
809 FOURCC fccType;
810 FOURCC fccHandler;
811 DWORD dwFlags; /* AVISF_* */
812 WORD wPriority;
813 WORD wLanguage;
814 DWORD dwInitialFrames;
Vincent Béron9a624912002-05-31 23:06:46 +0000815 DWORD dwScale;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000816 DWORD dwRate; /* dwRate / dwScale == samples/second */
817 DWORD dwStart;
818 DWORD dwLength; /* In units above... */
819 DWORD dwSuggestedBufferSize;
820 DWORD dwQuality;
821 DWORD dwSampleSize;
Alexandre Julliard83f52d12000-09-26 22:20:14 +0000822 struct { SHORT left, top, right, bottom; } rcFrame; /* word.word - word.word in file */
Marcus Meissner32b32d81999-01-29 15:12:10 +0000823} AVIStreamHeader;
824
825/* AVIINDEXENTRY.dwFlags */
826#define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */
Eric Pouech731e9f52000-07-26 18:07:04 +0000827#define AVIIF_TWOCC 0x00000002
Marcus Meissner32b32d81999-01-29 15:12:10 +0000828#define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
Maarten Lankhorst9cc32202008-04-30 15:00:34 -0700829#define AVIIF_FIRSTPART 0x00000020
830#define AVIIF_LASTPART 0x00000040
831#define AVIIF_MIDPART (AVIIF_LASTPART|AVIIF_FIRSTPART)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000832#define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */
833#define AVIIF_COMPUSE 0x0FFF0000
834
835typedef struct _AVIINDEXENTRY {
836 DWORD ckid;
837 DWORD dwFlags;
838 DWORD dwChunkOffset;
839 DWORD dwChunkLength;
840} AVIINDEXENTRY;
841
842typedef struct _AVIPALCHANGE {
843 BYTE bFirstEntry;
844 BYTE bNumEntries;
845 WORD wFlags; /* pad */
846 PALETTEENTRY peNew[1];
847} AVIPALCHANGE;
848
849#define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
850
851#define AVIGETFRAMEF_BESTDISPLAYFMT 1
852
Alexandre Julliarda3960291999-02-26 11:11:13 +0000853typedef struct _AVISTREAMINFOA {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000854 DWORD fccType;
855 DWORD fccHandler;
856 DWORD dwFlags; /* AVIIF_* */
857 DWORD dwCaps;
858 WORD wPriority;
859 WORD wLanguage;
860 DWORD dwScale;
861 DWORD dwRate; /* dwRate / dwScale == samples/second */
862 DWORD dwStart;
863 DWORD dwLength; /* In units above... */
864 DWORD dwInitialFrames;
865 DWORD dwSuggestedBufferSize;
866 DWORD dwQuality;
867 DWORD dwSampleSize;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000868 RECT rcFrame;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000869 DWORD dwEditCount;
870 DWORD dwFormatChangeCount;
871 CHAR szName[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000872} AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000873
Alexandre Julliarda3960291999-02-26 11:11:13 +0000874typedef struct _AVISTREAMINFOW {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000875 DWORD fccType;
876 DWORD fccHandler;
877 DWORD dwFlags;
878 DWORD dwCaps;
879 WORD wPriority;
880 WORD wLanguage;
881 DWORD dwScale;
882 DWORD dwRate; /* dwRate / dwScale == samples/second */
883 DWORD dwStart;
884 DWORD dwLength; /* In units above... */
885 DWORD dwInitialFrames;
886 DWORD dwSuggestedBufferSize;
887 DWORD dwQuality;
888 DWORD dwSampleSize;
Alexandre Julliarda3960291999-02-26 11:11:13 +0000889 RECT rcFrame;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000890 DWORD dwEditCount;
891 DWORD dwFormatChangeCount;
892 WCHAR szName[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000893} AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
Marcus Meissner676a5131999-02-05 09:41:55 +0000894DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
895DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
896DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000897
898#define AVISTREAMINFO_DISABLED 0x00000001
899#define AVISTREAMINFO_FORMATCHANGES 0x00010000
900
901/* AVIFILEINFO.dwFlags */
902#define AVIFILEINFO_HASINDEX 0x00000010
903#define AVIFILEINFO_MUSTUSEINDEX 0x00000020
904#define AVIFILEINFO_ISINTERLEAVED 0x00000100
Michael Günnewigb26206d2002-10-18 00:25:19 +0000905#define AVIFILEINFO_TRUSTCKTYPE 0x00000800
Marcus Meissner32b32d81999-01-29 15:12:10 +0000906#define AVIFILEINFO_WASCAPTUREFILE 0x00010000
907#define AVIFILEINFO_COPYRIGHTED 0x00020000
908
909/* AVIFILEINFO.dwCaps */
910#define AVIFILECAPS_CANREAD 0x00000001
911#define AVIFILECAPS_CANWRITE 0x00000002
912#define AVIFILECAPS_ALLKEYFRAMES 0x00000010
913#define AVIFILECAPS_NOCOMPRESSION 0x00000020
914
Alexandre Julliarda3960291999-02-26 11:11:13 +0000915typedef struct _AVIFILEINFOW {
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;
Vincent Béron9a624912002-05-31 23:06:46 +0000923 DWORD dwScale;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000924 DWORD dwRate;
925 DWORD dwLength;
926 DWORD dwEditCount;
927 WCHAR szFileType[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000928} AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
929typedef struct _AVIFILEINFOA {
Marcus Meissner32b32d81999-01-29 15:12:10 +0000930 DWORD dwMaxBytesPerSec;
931 DWORD dwFlags;
932 DWORD dwCaps;
933 DWORD dwStreams;
934 DWORD dwSuggestedBufferSize;
935 DWORD dwWidth;
936 DWORD dwHeight;
Vincent Béron9a624912002-05-31 23:06:46 +0000937 DWORD dwScale;
Marcus Meissner32b32d81999-01-29 15:12:10 +0000938 DWORD dwRate;
939 DWORD dwLength;
940 DWORD dwEditCount;
Marcus Meissner676a5131999-02-05 09:41:55 +0000941 CHAR szFileType[64];
Alexandre Julliarda3960291999-02-26 11:11:13 +0000942} AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
Marcus Meissner676a5131999-02-05 09:41:55 +0000943DECL_WINELIB_TYPE_AW(AVIFILEINFO)
944DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
945DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
Marcus Meissner32b32d81999-01-29 15:12:10 +0000946
947/* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
948#define AVICOMPRESSF_INTERLEAVE 0x00000001
949#define AVICOMPRESSF_DATARATE 0x00000002
950#define AVICOMPRESSF_KEYFRAMES 0x00000004
951#define AVICOMPRESSF_VALID 0x00000008
952
953typedef struct {
954 DWORD fccType; /* stream type, for consistency */
955 DWORD fccHandler; /* compressor */
956 DWORD dwKeyFrameEvery; /* keyframe rate */
957 DWORD dwQuality; /* compress quality 0-10,000 */
958 DWORD dwBytesPerSecond; /* bytes per second */
959 DWORD dwFlags; /* flags... see below */
960 LPVOID lpFormat; /* save format */
961 DWORD cbFormat;
962 LPVOID lpParms; /* compressor options */
963 DWORD cbParms;
964 DWORD dwInterleaveEvery; /* for non-video streams only */
965} AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
966
Michael Günnewigb26206d2002-10-18 00:25:19 +0000967#define FIND_DIR 0x0000000FL /* direction mask */
968#define FIND_NEXT 0x00000001L /* search forward */
969#define FIND_PREV 0x00000004L /* search backward */
970#define FIND_FROM_START 0x00000008L /* start at the logical beginning */
971
972#define FIND_TYPE 0x000000F0L /* type mask */
973#define FIND_KEY 0x00000010L /* find a key frame */
974#define FIND_ANY 0x00000020L /* find any (non-empty) sample */
975#define FIND_FORMAT 0x00000040L /* find a formatchange */
976
977#define FIND_RET 0x0000F000L /* return mask */
978#define FIND_POS 0x00000000L /* return logical position */
979#define FIND_LENGTH 0x00001000L /* return logical size */
980#define FIND_OFFSET 0x00002000L /* return physical position */
981#define FIND_SIZE 0x00003000L /* return physical size */
982#define FIND_INDEX 0x00004000L /* return physical index position */
983
Dimitrie O. Paun53f9c212003-08-28 21:43:34 +0000984#include <ole2.h>
Marcus Meissner32b32d81999-01-29 15:12:10 +0000985
986#define DEFINE_AVIGUID(name, l, w1, w2) \
987 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
988
989DEFINE_AVIGUID(IID_IAVIFile, 0x00020020, 0, 0);
990DEFINE_AVIGUID(IID_IAVIStream, 0x00020021, 0, 0);
991DEFINE_AVIGUID(IID_IAVIStreaming, 0x00020022, 0, 0);
992DEFINE_AVIGUID(IID_IGetFrame, 0x00020023, 0, 0);
993DEFINE_AVIGUID(IID_IAVIEditStream, 0x00020024, 0, 0);
994
Alexandre Julliarde7f5fad2005-01-03 20:43:13 +0000995DEFINE_AVIGUID(CLSID_AVISimpleUnMarshal,0x00020009, 0, 0);
Marcus Meissner32b32d81999-01-29 15:12:10 +0000996DEFINE_AVIGUID(CLSID_AVIFile, 0x00020000, 0, 0);
997
Francois Gouget4e4f1d11999-03-17 15:16:01 +0000998/*****************************************************************************
999 * IAVIStream interface
1000 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001001#define INTERFACE IAVIStream
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001002DECLARE_INTERFACE_(IAVIStream,IUnknown)
1003{
1004 /*** IUnknown methods ***/
1005 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1006 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1007 STDMETHOD_(ULONG,Release)(THIS) PURE;
1008 /*** IAVIStream methods ***/
1009 STDMETHOD(Create)(THIS_ LPARAM lParam1, LPARAM lParam2) PURE;
1010 STDMETHOD(Info)(THIS_ AVISTREAMINFOW *psi, LONG lSize) PURE;
1011 STDMETHOD_(LONG,FindSample)(THIS_ LONG lPos, LONG lFlags) PURE;
1012 STDMETHOD(ReadFormat)(THIS_ LONG lPos, LPVOID lpFormat, LONG *lpcbFormat) PURE;
1013 STDMETHOD(SetFormat)(THIS_ LONG lPos, LPVOID lpFormat, LONG cbFormat) PURE;
1014 STDMETHOD(Read)(THIS_ LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples) PURE;
1015 STDMETHOD(Write)(THIS_ LONG lStart, LONG lSamples, LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten) PURE;
1016 STDMETHOD(Delete)(THIS_ LONG lStart, LONG lSamples) PURE;
1017 STDMETHOD(ReadData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG *lpcbBuffer) PURE;
1018 STDMETHOD(WriteData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG cbBuffer) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001019 STDMETHOD(SetInfo)(THIS_ AVISTREAMINFOW *plInfo, LONG cbInfo) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001020};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001021#undef INTERFACE
Marcus Meissner32b32d81999-01-29 15:12:10 +00001022
Francois Gouget52ecbf72004-10-04 19:35:40 +00001023#if !defined(__cplusplus) || defined(CINTERFACE)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001024/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001025#define IAVIStream_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1026#define IAVIStream_AddRef(p) (p)->lpVtbl->AddRef(p)
1027#define IAVIStream_Release(p) (p)->lpVtbl->Release(p)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001028/*** IAVIStream methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001029#define IAVIStream_Create(p,a,b) (p)->lpVtbl->Create(p,a,b)
1030#define IAVIStream_Info(p,a,b) (p)->lpVtbl->Info(p,a,b)
1031#define IAVIStream_FindSample(p,a,b) (p)->lpVtbl->FindSample(p,a,b)
1032#define IAVIStream_ReadFormat(p,a,b,c) (p)->lpVtbl->ReadFormat(p,a,b,c)
1033#define IAVIStream_SetFormat(p,a,b,c) (p)->lpVtbl->SetFormat(p,a,b,c)
1034#define IAVIStream_Read(p,a,b,c,d,e,f) (p)->lpVtbl->Read(p,a,b,c,d,e,f)
1035#define IAVIStream_Write(p,a,b,c,d,e,f,g) (p)->lpVtbl->Write(p,a,b,c,d,e,f,g)
1036#define IAVIStream_Delete(p,a,b) (p)->lpVtbl->Delete(p,a,b)
1037#define IAVIStream_ReadData(p,a,b,c) (p)->lpVtbl->ReadData(p,a,b,c)
1038#define IAVIStream_WriteData(p,a,b,c) (p)->lpVtbl->WriteData(p,a,b,c)
1039#define IAVIStream_SetInfo(p,a,b) (p)->lpVtbl->SetInfo(p,a,b)
1040#endif
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001041
Francois Gouget160cd202005-09-26 09:52:43 +00001042#define AVISTREAMREAD_CONVENIENT (-1L)
1043
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001044ULONG WINAPI AVIStreamAddRef(PAVISTREAM iface);
1045ULONG WINAPI AVIStreamRelease(PAVISTREAM iface);
Hidenori Takeshimac814a6c2001-06-07 22:28:19 +00001046HRESULT WINAPI AVIStreamCreate(PAVISTREAM*,LONG,LONG,CLSID*);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001047HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size);
1048HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG size);
1049#define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo)
Bang Jun-youngaaa19082007-10-15 17:48:20 +09001050LONG WINAPI AVIStreamFindSample(PAVISTREAM pstream, LONG pos, LONG flags);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001051HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001052HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001053HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001054HRESULT 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 +00001055HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001056HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001057
1058PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted);
1059LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos);
1060HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg);
1061
1062HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler);
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001063HRESULT WINAPI AVIMakeFileFromStreams(PAVIFILE *ppfile, int nStreams, PAVISTREAM *ppStreams);
Hans Leidekkerf4f4dff2004-12-27 16:58:18 +00001064HRESULT WINAPI AVIMakeStreamFromClipboard(UINT cfFormat, HANDLE hGlobal, PAVISTREAM * ppstream);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001065
Eric Pouech731e9f52000-07-26 18:07:04 +00001066HRESULT WINAPI AVIStreamOpenFromFileA(PAVISTREAM *ppavi, LPCSTR szFile,
1067 DWORD fccType, LONG lParam,
1068 UINT mode, CLSID *pclsidHandler);
1069HRESULT WINAPI AVIStreamOpenFromFileW(PAVISTREAM *ppavi, LPCWSTR szFile,
1070 DWORD fccType, LONG lParam,
1071 UINT mode, CLSID *pclsidHandler);
1072#define AVIStreamOpenFromFile WINELIB_NAME_AW(AVIStreamOpenFromFile)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001073
Vincent Béron1e365f72005-03-21 10:32:45 +00001074LONG WINAPI AVIStreamBeginStreaming(PAVISTREAM pavi, LONG lStart, LONG lEnd, LONG lRate);
1075LONG WINAPI AVIStreamEndStreaming(PAVISTREAM pavi);
1076
Michael Günnewigb26206d2002-10-18 00:25:19 +00001077HRESULT WINAPI AVIBuildFilterA(LPSTR szFilter, LONG cbFilter, BOOL fSaving);
1078HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving);
1079#define AVIBuildFilter WINELIB_NAME_AW(AVIBuildFilter)
1080
1081BOOL WINAPI AVISaveOptions(HWND hWnd,UINT uFlags,INT nStream,
1082 PAVISTREAM *ppavi,LPAVICOMPRESSOPTIONS *ppOptions);
1083HRESULT WINAPI AVISaveOptionsFree(INT nStreams,LPAVICOMPRESSOPTIONS*ppOptions);
1084
Vincent Béron1e365f72005-03-21 10:32:45 +00001085HRESULT CDECL AVISaveA(LPCSTR szFile, CLSID *pclsidHandler,
Hans Leidekkerf4f4dff2004-12-27 16:58:18 +00001086 AVISAVECALLBACK lpfnCallback, int nStreams,
1087 PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions, ...);
Vincent Béron1e365f72005-03-21 10:32:45 +00001088HRESULT CDECL AVISaveW(LPCWSTR szFile, CLSID *pclsidHandler,
Hans Leidekkerf4f4dff2004-12-27 16:58:18 +00001089 AVISAVECALLBACK lpfnCallback, int nStreams,
1090 PAVISTREAM pavi, LPAVICOMPRESSOPTIONS lpOptions, ...);
1091#define AVISave WINELIB_NAME_AW(AVISave)
1092
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001093HRESULT WINAPI AVISaveVA(LPCSTR szFile, CLSID *pclsidHandler,
1094 AVISAVECALLBACK lpfnCallback, int nStream,
1095 PAVISTREAM *ppavi, LPAVICOMPRESSOPTIONS *plpOptions);
1096HRESULT WINAPI AVISaveVW(LPCWSTR szFile, CLSID *pclsidHandler,
1097 AVISAVECALLBACK lpfnCallback, int nStream,
1098 PAVISTREAM *ppavi, LPAVICOMPRESSOPTIONS *plpOptions);
1099#define AVISaveV WINELIB_NAME_AW(AVISaveV)
1100
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001101LONG WINAPI AVIStreamStart(PAVISTREAM iface);
1102LONG WINAPI AVIStreamLength(PAVISTREAM iface);
1103LONG WINAPI AVIStreamSampleToTime(PAVISTREAM pstream, LONG lSample);
1104LONG WINAPI AVIStreamTimeToSample(PAVISTREAM pstream, LONG lTime);
1105
Michael Günnewigf6bcf232002-10-21 23:39:20 +00001106#define AVIFileClose(pavi) \
1107 AVIFileRelease(pavi)
1108#define AVIStreamClose(pavi) \
1109 AVIStreamRelease(pavi);
Michael Günnewigb26206d2002-10-18 00:25:19 +00001110#define AVIStreamEnd(pavi) \
1111 (AVIStreamStart(pavi) + AVIStreamLength(pavi))
1112#define AVIStreamEndTime(pavi) \
1113 AVIStreamSampleToTime(pavi, AVIStreamEnd(pavi))
Eric Pouech731e9f52000-07-26 18:07:04 +00001114#define AVIStreamFormatSize(pavi, lPos, plSize) \
Vincent Béron9a624912002-05-31 23:06:46 +00001115 AVIStreamReadFormat(pavi, lPos, NULL, plSize)
Michael Günnewigb26206d2002-10-18 00:25:19 +00001116#define AVIStreamLengthTime(pavi) \
1117 AVIStreamSampleToTime(pavi, AVIStreamLength(pavi))
1118#define AVIStreamSampleSize(pavi,pos,psize) \
1119 AVIStreamRead(pavi,pos,1,NULL,0,psize,NULL)
1120#define AVIStreamSampleToSample(pavi1, pavi2, samp2) \
1121 AVIStreamTimeToSample(pavi1, AVIStreamSampleToTime(pavi2, samp2))
1122#define AVIStreamStartTime(pavi) \
1123 AVIStreamSampleToTime(pavi, AVIStreamStart(pavi))
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001124
Michael Günnewigc783c202003-07-02 00:38:57 +00001125#define AVIStreamNextSample(pavi, pos) \
1126 AVIStreamFindSample(pavi, pos + 1, FIND_NEXT | FIND_ANY)
1127#define AVIStreamPrevSample(pavi, pos) \
1128 AVIStreamFindSample(pavi, pos - 1, FIND_PREV | FIND_ANY)
1129#define AVIStreamNearestSample(pavi, pos) \
1130 AVIStreamFindSample(pavi, pos, FIND_PREV | FIND_ANY)
1131#define AVStreamNextKeyFrame(pavi,pos) \
1132 AVIStreamFindSample(pavi, pos + 1, FIND_NEXT | FIND_KEY)
1133#define AVStreamPrevKeyFrame(pavi,pos) \
1134 AVIStreamFindSample(pavi, pos - 1, FIND_NEXT | FIND_KEY)
1135#define AVIStreamNearestKeyFrame(pavi,pos) \
1136 AVIStreamFindSample(pavi, pos, FIND_PREV | FIND_KEY)
1137#define AVIStreamIsKeyFrame(pavi, pos) \
1138 (AVIStreamNearestKeyFrame(pavi, pos) == pos)
1139
1140/*****************************************************************************
1141 * IAVIStreaming interface
1142 */
1143#define INTERFACE IAVIStreaming
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001144DECLARE_INTERFACE_(IAVIStreaming,IUnknown)
1145{
1146 /*** IUnknown methods ***/
1147 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1148 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1149 STDMETHOD_(ULONG,Release)(THIS) PURE;
1150 /*** IAVIStreaming methods ***/
1151 STDMETHOD(Begin)(IAVIStreaming*iface,LONG lStart,LONG lEnd,LONG lRate) PURE;
Michael Günnewigc783c202003-07-02 00:38:57 +00001152 STDMETHOD(End)(IAVIStreaming*iface) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001153};
Michael Günnewigc783c202003-07-02 00:38:57 +00001154#undef INTERFACE
1155
Francois Gouget52ecbf72004-10-04 19:35:40 +00001156#if !defined(__cplusplus) || defined(CINTERFACE)
Michael Günnewigc783c202003-07-02 00:38:57 +00001157/*** IUnknown methods ***/
1158#define IAVIStreaming_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1159#define IAVIStreaming_AddRef(p) (p)->lpVtbl->AddRef(p)
1160#define IAVIStreaming_Release(p) (p)->lpVtbl->Release(p)
1161/*** IAVIStreaming methods ***/
1162#define IAVIStreaming_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
1163#define IAVIStreaming_End(p) (p)->lpVtbl->End(p)
1164#endif
1165
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001166/*****************************************************************************
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001167 * IAVIEditStream interface
1168 */
1169#define INTERFACE IAVIEditStream
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001170DECLARE_INTERFACE_(IAVIEditStream,IUnknown)
1171{
1172 /*** IUnknown methods ***/
1173 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1174 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1175 STDMETHOD_(ULONG,Release)(THIS) PURE;
1176 /*** IAVIEditStream methods ***/
1177 STDMETHOD(Cut)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE;
1178 STDMETHOD(Copy)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE;
1179 STDMETHOD(Paste)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM pSource,LONG lStart,LONG lEnd) PURE;
1180 STDMETHOD(Clone)(IAVIEditStream*iface,PAVISTREAM*ppResult) PURE;
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001181 STDMETHOD(SetInfo)(IAVIEditStream*iface,LPAVISTREAMINFOW asi, LONG size) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001182};
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001183#undef INTERFACE
1184
Francois Gouget52ecbf72004-10-04 19:35:40 +00001185#if !defined(__cplusplus) || defined(CINTERFACE)
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001186/*** IUnknown methods ***/
1187#define IAVIEditStream_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1188#define IAVIEditStream_AddRef(p) (p)->lpVtbl->AddRef(p)
1189#define IAVIEditStream_Release(p) (p)->lpVtbl->Release(p)
1190/*** IAVIEditStream methods ***/
1191#define IAVIEditStream_Cut(p,a,b,c) (p)->lpVtbl->Cut(p,a,b,c)
1192#define IAVIEditStream_Copy(p,a,b,c) (p)->lpVtbl->Copy(p,a,b,c)
1193#define IAVIEditStream_Paste(p,a,b,c,d,e) (p)->lpVtbl->Paste(p,a,b,c,d,e)
1194#define IAVIEditStream_Clone(p,a) (p)->lpVtbl->Clone(p,a)
1195#define IAVIEditStream_SetInfo(p,a,b) (p)->lpVtbl->SetInfo(p,a,b)
1196#endif
1197
1198HRESULT WINAPI CreateEditableStream(PAVISTREAM *ppEditable,PAVISTREAM pSource);
1199HRESULT WINAPI EditStreamClone(PAVISTREAM pStream, PAVISTREAM *ppResult);
1200HRESULT WINAPI EditStreamCopy(PAVISTREAM pStream, LONG *plStart,
1201 LONG *plLength, PAVISTREAM *ppResult);
1202HRESULT WINAPI EditStreamCut(PAVISTREAM pStream, LONG *plStart,
1203 LONG *plLength, PAVISTREAM *ppResult);
1204HRESULT WINAPI EditStreamPaste(PAVISTREAM pDest, LONG *plStart, LONG *plLength,
1205 PAVISTREAM pSource, LONG lStart, LONG lEnd);
1206
1207HRESULT WINAPI EditStreamSetInfoA(PAVISTREAM pstream, LPAVISTREAMINFOA asi,
1208 LONG size);
1209HRESULT WINAPI EditStreamSetInfoW(PAVISTREAM pstream, LPAVISTREAMINFOW asi,
1210 LONG size);
1211#define EditStreamSetInfo WINELIB_NAME_AW(EditStreamSetInfo)
1212
1213HRESULT WINAPI EditStreamSetNameA(PAVISTREAM pstream, LPCSTR szName);
1214HRESULT WINAPI EditStreamSetNameW(PAVISTREAM pstream, LPCWSTR szName);
1215#define EditStreamSetName WINELIB_NAME_AW(EditStreamSetName)
1216
1217/*****************************************************************************
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001218 * IAVIFile interface
1219 */
1220/* In Win32 this interface uses UNICODE only */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001221#define INTERFACE IAVIFile
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001222DECLARE_INTERFACE_(IAVIFile,IUnknown)
1223{
1224 /*** IUnknown methods ***/
1225 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1226 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1227 STDMETHOD_(ULONG,Release)(THIS) PURE;
1228 /*** IAVIFile methods ***/
1229 STDMETHOD(Info)(THIS_ AVIFILEINFOW *pfi, LONG lSize) PURE;
1230 STDMETHOD(GetStream)(THIS_ PAVISTREAM *ppStream, DWORD fccType, LONG lParam) PURE;
1231 STDMETHOD(CreateStream)(THIS_ PAVISTREAM *ppStream, AVISTREAMINFOW *psi) PURE;
1232 STDMETHOD(WriteData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG cbBuffer) PURE;
1233 STDMETHOD(ReadData)(THIS_ DWORD fcc, LPVOID lpBuffer, LONG *lpcbBuffer) PURE;
1234 STDMETHOD(EndRecord)(THIS) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001235 STDMETHOD(DeleteStream)(THIS_ DWORD fccType, LONG lParam) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001236};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001237#undef INTERFACE
Marcus Meissner32b32d81999-01-29 15:12:10 +00001238
Francois Gouget52ecbf72004-10-04 19:35:40 +00001239#if !defined(__cplusplus) || defined(CINTERFACE)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001240/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001241#define IAVIFile_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1242#define IAVIFile_AddRef(p) (p)->lpVtbl->AddRef(p)
1243#define IAVIFile_Release(p) (p)->lpVtbl->Release(p)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001244/*** IAVIFile methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001245#define IAVIFile_Info(p,a,b) (p)->lpVtbl->Info(p,a,b)
1246#define IAVIFile_GetStream(p,a,b,c) (p)->lpVtbl->GetStream(p,a,b,c)
1247#define IAVIFile_CreateStream(p,a,b) (p)->lpVtbl->CreateStream(p,a,b)
1248#define IAVIFile_WriteData(p,a,b,c) (p)->lpVtbl->WriteData(p,a,b,c)
1249#define IAVIFile_ReadData(p,a,b,c) (p)->lpVtbl->ReadData(p,a,b,c)
1250#define IAVIFile_EndRecord(p) (p)->lpVtbl->EndRecord(p)
1251#define IAVIFile_DeleteStream(p,a,b) (p)->lpVtbl->DeleteStream(p,a,b)
1252#endif
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001253
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001254void WINAPI AVIFileInit(void);
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001255void WINAPI AVIFileExit(void);
1256
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001257HRESULT WINAPI AVIFileOpenA(PAVIFILE* ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler);
1258HRESULT WINAPI AVIFileOpenW(PAVIFILE* ppfile,LPCWSTR szFile,UINT uMode,LPCLSID lpHandler);
1259#define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001260
Michael Günnewiga26a2ca2002-10-10 23:31:13 +00001261ULONG WINAPI AVIFileAddRef(PAVIFILE pfile);
1262ULONG WINAPI AVIFileRelease(PAVIFILE pfile);
1263HRESULT WINAPI AVIFileInfoA(PAVIFILE pfile,PAVIFILEINFOA pfi,LONG lSize);
1264HRESULT WINAPI AVIFileInfoW(PAVIFILE pfile,PAVIFILEINFOW pfi,LONG lSize);
1265#define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo)
1266HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile,PAVISTREAM* avis,DWORD fccType,LONG lParam);
1267HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOA* psi);
1268HRESULT WINAPI AVIFileCreateStreamW(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOW* psi);
1269#define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream)
1270HRESULT WINAPI AVIFileWriteData(PAVIFILE pfile,DWORD fcc,LPVOID lp,LONG size);
1271HRESULT WINAPI AVIFileReadData(PAVIFILE pfile,DWORD fcc,LPVOID lp,LPLONG size);
1272HRESULT WINAPI AVIFileEndRecord(PAVIFILE pfile);
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001273
1274/*****************************************************************************
1275 * IGetFrame interface
1276 */
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001277#define INTERFACE IGetFrame
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001278DECLARE_INTERFACE_(IGetFrame,IUnknown)
1279{
1280 /*** IUnknown methods ***/
1281 STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
1282 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
1283 STDMETHOD_(ULONG,Release)(THIS) PURE;
1284 /*** IGetFrame methods ***/
1285 STDMETHOD_(LPVOID,GetFrame)(THIS_ LONG lPos) PURE;
1286 STDMETHOD(Begin)(THIS_ LONG lStart, LONG lEnd, LONG lRate) PURE;
1287 STDMETHOD(End)(THIS) PURE;
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001288 STDMETHOD(SetFormat)(THIS_ LPBITMAPINFOHEADER lpbi, LPVOID lpBits, INT x, INT y, INT dx, INT dy) PURE;
Alexandre Julliard5d0160e2004-10-05 04:38:15 +00001289};
Alexandre Julliardf00c46f2003-04-10 00:19:24 +00001290#undef INTERFACE
Marcus Meissner676a5131999-02-05 09:41:55 +00001291
Francois Gouget52ecbf72004-10-04 19:35:40 +00001292#if !defined(__cplusplus) || defined(CINTERFACE)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001293/*** IUnknown methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001294#define IGetFrame_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
1295#define IGetFrame_AddRef(p) (p)->lpVtbl->AddRef(p)
1296#define IGetFrame_Release(p) (p)->lpVtbl->Release(p)
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001297/*** IGetFrame methods ***/
Alexandre Julliard55379112003-04-10 21:13:58 +00001298#define IGetFrame_GetFrame(p,a) (p)->lpVtbl->GetFrame(p,a)
1299#define IGetFrame_Begin(p,a,b,c) (p)->lpVtbl->Begin(p,a,b,c)
1300#define IGetFrame_End(p) (p)->lpVtbl->End(p)
1301#define IGetFrame_SetFormat(p,a,b,c,d,e,f) (p)->lpVtbl->SetFormat(p,a,b,c,d,e,f)
1302#endif
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001303
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001304HRESULT WINAPI AVIClearClipboard(void);
1305HRESULT WINAPI AVIGetFromClipboard(PAVIFILE *ppfile);
1306HRESULT WINAPI AVIPutFileOnClipboard(PAVIFILE pfile);
1307
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001308#ifdef OFN_READONLY
1309BOOL WINAPI GetOpenFileNamePreviewA(LPOPENFILENAMEA lpofn);
1310BOOL WINAPI GetOpenFileNamePreviewW(LPOPENFILENAMEW lpofn);
1311#define GetOpenFileNamePreview WINELIB_NAME_AW(GetOpenFileNamePreview)
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001312BOOL WINAPI GetSaveFileNamePreviewA(LPOPENFILENAMEA lpofn);
1313BOOL WINAPI GetSaveFileNamePreviewW(LPOPENFILENAMEW lpofn);
1314#define GetSaveFileNamePreview WINELIB_NAME_AW(GetSaveFileNamePreview)
Michael Günnewig9f67cfe2003-06-23 18:10:06 +00001315#endif
1316
Marcus Meissner32b32d81999-01-29 15:12:10 +00001317#define AVIERR_OK 0
1318#define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
1319
1320#define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
1321#define AVIERR_BADFORMAT MAKE_AVIERR(102)
1322#define AVIERR_MEMORY MAKE_AVIERR(103)
1323#define AVIERR_INTERNAL MAKE_AVIERR(104)
1324#define AVIERR_BADFLAGS MAKE_AVIERR(105)
1325#define AVIERR_BADPARAM MAKE_AVIERR(106)
1326#define AVIERR_BADSIZE MAKE_AVIERR(107)
1327#define AVIERR_BADHANDLE MAKE_AVIERR(108)
1328#define AVIERR_FILEREAD MAKE_AVIERR(109)
1329#define AVIERR_FILEWRITE MAKE_AVIERR(110)
1330#define AVIERR_FILEOPEN MAKE_AVIERR(111)
1331#define AVIERR_COMPRESSOR MAKE_AVIERR(112)
1332#define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
1333#define AVIERR_READONLY MAKE_AVIERR(114)
1334#define AVIERR_NODATA MAKE_AVIERR(115)
1335#define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
1336#define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
1337#define AVIERR_USERABORT MAKE_AVIERR(198)
1338#define AVIERR_ERROR MAKE_AVIERR(199)
1339
Dmitry Timoshkovcd61ce82004-01-01 00:12:13 +00001340BOOL VFWAPIV MCIWndRegisterClass(void);
Dmitry Timoshkov06464992003-12-15 20:17:11 +00001341
1342HWND VFWAPIV MCIWndCreateA(HWND, HINSTANCE, DWORD, LPCSTR);
1343HWND VFWAPIV MCIWndCreateW(HWND, HINSTANCE, DWORD, LPCWSTR);
Eric Pouech26146cd2001-02-14 21:49:22 +00001344#define MCIWndCreate WINELIB_NAME_AW(MCIWndCreate)
1345
1346#define MCIWNDOPENF_NEW 0x0001
1347
1348#define MCIWNDF_NOAUTOSIZEWINDOW 0x0001
1349#define MCIWNDF_NOPLAYBAR 0x0002
1350#define MCIWNDF_NOAUTOSIZEMOVIE 0x0004
1351#define MCIWNDF_NOMENU 0x0008
1352#define MCIWNDF_SHOWNAME 0x0010
1353#define MCIWNDF_SHOWPOS 0x0020
1354#define MCIWNDF_SHOWMODE 0x0040
1355#define MCIWNDF_SHOWALL 0x0070
1356
1357#define MCIWNDF_NOTIFYMODE 0x0100
1358#define MCIWNDF_NOTIFYPOS 0x0200
1359#define MCIWNDF_NOTIFYSIZE 0x0400
1360#define MCIWNDF_NOTIFYERROR 0x1000
1361#define MCIWNDF_NOTIFYALL 0x1F00
1362
1363#define MCIWNDF_NOTIFYANSI 0x0080
1364
1365#define MCIWNDF_NOTIFYMEDIAA 0x0880
1366#define MCIWNDF_NOTIFYMEDIAW 0x0800
1367#define MCIWNDF_NOTIFYMEDIA WINELIB_NAME_AW(MCIWNDF_NOTIFYMEDIA)
1368
1369#define MCIWNDF_RECORD 0x2000
1370#define MCIWNDF_NOERRORDLG 0x4000
1371#define MCIWNDF_NOOPEN 0x8000
1372
1373#ifdef __cplusplus
1374#define MCIWndSM ::SendMessage
1375#else
1376#define MCIWndSM SendMessage
1377#endif
1378
1379#define MCIWndCanPlay(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_PLAY,0,0)
1380#define MCIWndCanRecord(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_RECORD,0,0)
1381#define MCIWndCanSave(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_SAVE,0,0)
1382#define MCIWndCanWindow(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_WINDOW,0,0)
1383#define MCIWndCanEject(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_EJECT,0,0)
1384#define MCIWndCanConfig(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_CAN_CONFIG,0,0)
1385#define MCIWndPaletteKick(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_PALETTEKICK,0,0)
1386
1387#define MCIWndSave(hWnd,szFile) (LONG)MCIWndSM(hWnd,MCI_SAVE,0,(LPARAM)(LPVOID)(szFile))
1388#define MCIWndSaveDialog(hWnd) MCIWndSave(hWnd,-1)
1389
1390#define MCIWndNew(hWnd,lp) (LONG)MCIWndSM(hWnd,MCIWNDM_NEW,0,(LPARAM)(LPVOID)(lp))
1391
1392#define MCIWndRecord(hWnd) (LONG)MCIWndSM(hWnd,MCI_RECORD,0,0)
1393#define MCIWndOpen(hWnd,sz,f) (LONG)MCIWndSM(hWnd,MCIWNDM_OPEN,(WPARAM)(UINT)(f),(LPARAM)(LPVOID)(sz))
1394#define MCIWndOpenDialog(hWnd) MCIWndOpen(hWnd,-1,0)
1395#define MCIWndClose(hWnd) (LONG)MCIWndSM(hWnd,MCI_CLOSE,0,0)
1396#define MCIWndPlay(hWnd) (LONG)MCIWndSM(hWnd,MCI_PLAY,0,0)
1397#define MCIWndStop(hWnd) (LONG)MCIWndSM(hWnd,MCI_STOP,0,0)
1398#define MCIWndPause(hWnd) (LONG)MCIWndSM(hWnd,MCI_PAUSE,0,0)
1399#define MCIWndResume(hWnd) (LONG)MCIWndSM(hWnd,MCI_RESUME,0,0)
1400#define MCIWndSeek(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCI_SEEK,0,(LPARAM)(LONG)(lPos))
1401#define MCIWndEject(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_EJECT,0,0)
1402
1403#define MCIWndHome(hWnd) MCIWndSeek(hWnd,MCIWND_START)
1404#define MCIWndEnd(hWnd) MCIWndSeek(hWnd,MCIWND_END)
1405
1406#define MCIWndGetSource(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_GET_SOURCE,0,(LPARAM)(LPRECT)(prc))
1407#define MCIWndPutSource(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_PUT_SOURCE,0,(LPARAM)(LPRECT)(prc))
1408
1409#define MCIWndGetDest(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_GET_DEST,0,(LPARAM)(LPRECT)(prc))
1410#define MCIWndPutDest(hWnd,prc) (LONG)MCIWndSM(hWnd,MCIWNDM_PUT_DEST,0,(LPARAM)(LPRECT)(prc))
1411
1412#define MCIWndPlayReverse(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYREVERSE,0,0)
1413#define MCIWndPlayFrom(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYFROM,0,(LPARAM)(LONG)(lPos))
1414#define MCIWndPlayTo(hWnd,lPos) (LONG)MCIWndSM(hWnd,MCIWNDM_PLAYTO, 0,(LPARAM)(LONG)(lPos))
1415#define MCIWndPlayFromTo(hWnd,lStart,lEnd) (MCIWndSeek(hWnd,lStart),MCIWndPlayTo(hWnd,lEnd))
1416
1417#define MCIWndGetDeviceID(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETDEVICEID,0,0)
1418#define MCIWndGetAlias(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETALIAS,0,0)
1419#define MCIWndGetMode(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETMODE,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1420#define MCIWndGetPosition(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETPOSITION,0,0)
1421#define MCIWndGetPositionString(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETPOSITION,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1422#define MCIWndGetStart(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETSTART,0,0)
1423#define MCIWndGetLength(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETLENGTH,0,0)
1424#define MCIWndGetEnd(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETEND,0,0)
1425
Michael Stefaniuc79f49802009-01-11 00:17:14 +01001426#define MCIWndStep(hWnd,n) (LONG)MCIWndSM(hWnd,MCI_STEP,0,(LPARAM)(LONG)(n))
Eric Pouech26146cd2001-02-14 21:49:22 +00001427
1428#define MCIWndDestroy(hWnd) (VOID)MCIWndSM(hWnd,WM_CLOSE,0,0)
1429#define MCIWndSetZoom(hWnd,iZoom) (VOID)MCIWndSM(hWnd,MCIWNDM_SETZOOM,0,(LPARAM)(UINT)(iZoom))
1430#define MCIWndGetZoom(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETZOOM,0,0)
1431#define MCIWndSetVolume(hWnd,iVol) (LONG)MCIWndSM(hWnd,MCIWNDM_SETVOLUME,0,(LPARAM)(UINT)(iVol))
1432#define MCIWndGetVolume(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETVOLUME,0,0)
1433#define MCIWndSetSpeed(hWnd,iSpeed) (LONG)MCIWndSM(hWnd,MCIWNDM_SETSPEED,0,(LPARAM)(UINT)(iSpeed))
1434#define MCIWndGetSpeed(hWnd) (LONG)MCIWndSM(hWnd,MCIWNDM_GETSPEED,0,0)
1435#define MCIWndSetTimeFormat(hWnd,lp) (LONG)MCIWndSM(hWnd,MCIWNDM_SETTIMEFORMAT,0,(LPARAM)(LPTSTR)(lp))
1436#define MCIWndGetTimeFormat(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETTIMEFORMAT,(WPARAM)(UINT)(len),(LPARAM)(LPTSTR)(lp))
1437#define MCIWndValidateMedia(hWnd) (VOID)MCIWndSM(hWnd,MCIWNDM_VALIDATEMEDIA,0,0)
1438
1439#define MCIWndSetRepeat(hWnd,f) (void)MCIWndSM(hWnd,MCIWNDM_SETREPEAT,0,(LPARAM)(BOOL)(f))
1440#define MCIWndGetRepeat(hWnd) (BOOL)MCIWndSM(hWnd,MCIWNDM_GETREPEAT,0,0)
1441
1442#define MCIWndUseFrames(hWnd) MCIWndSetTimeFormat(hWnd,TEXT("frames"))
1443#define MCIWndUseTime(hWnd) MCIWndSetTimeFormat(hWnd,TEXT("ms"))
1444
1445#define MCIWndSetActiveTimer(hWnd,active) \
1446 (VOID)MCIWndSM(hWnd,MCIWNDM_SETACTIVETIMER, \
1447 (WPARAM)(UINT)(active),0L)
1448#define MCIWndSetInactiveTimer(hWnd,inactive) \
1449 (VOID)MCIWndSM(hWnd,MCIWNDM_SETINACTIVETIMER, \
1450 (WPARAM)(UINT)(inactive),0L)
1451#define MCIWndSetTimers(hWnd,active,inactive) \
1452 (VOID)MCIWndSM(hWnd,MCIWNDM_SETTIMERS,(WPARAM)(UINT)(active),\
1453 (LPARAM)(UINT)(inactive))
1454#define MCIWndGetActiveTimer(hWnd) \
1455 (UINT)MCIWndSM(hWnd,MCIWNDM_GETACTIVETIMER,0,0L);
1456#define MCIWndGetInactiveTimer(hWnd) \
1457 (UINT)MCIWndSM(hWnd,MCIWNDM_GETINACTIVETIMER,0,0L);
1458
1459#define MCIWndRealize(hWnd,fBkgnd) (LONG)MCIWndSM(hWnd,MCIWNDM_REALIZE,(WPARAM)(BOOL)(fBkgnd),0)
1460
1461#define MCIWndSendString(hWnd,sz) (LONG)MCIWndSM(hWnd,MCIWNDM_SENDSTRING,0,(LPARAM)(LPTSTR)(sz))
1462#define MCIWndReturnString(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_RETURNSTRING,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1463#define MCIWndGetError(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETERROR,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1464
1465#define MCIWndGetPalette(hWnd) (HPALETTE)MCIWndSM(hWnd,MCIWNDM_GETPALETTE,0,0)
1466#define MCIWndSetPalette(hWnd,hpal) (LONG)MCIWndSM(hWnd,MCIWNDM_SETPALETTE,(WPARAM)(HPALETTE)(hpal),0)
1467
1468#define MCIWndGetFileName(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETFILENAME,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1469#define MCIWndGetDevice(hWnd,lp,len) (LONG)MCIWndSM(hWnd,MCIWNDM_GETDEVICE,(WPARAM)(UINT)(len),(LPARAM)(LPVOID)(lp))
1470
1471#define MCIWndGetStyles(hWnd) (UINT)MCIWndSM(hWnd,MCIWNDM_GETSTYLES,0,0L)
1472#define MCIWndChangeStyles(hWnd,mask,value) (LONG)MCIWndSM(hWnd,MCIWNDM_CHANGESTYLES,(WPARAM)(UINT)(mask),(LPARAM)(LONG)(value))
1473
1474#define MCIWndOpenInterface(hWnd,pUnk) (LONG)MCIWndSM(hWnd,MCIWNDM_OPENINTERFACE,0,(LPARAM)(LPUNKNOWN)(pUnk))
1475
1476#define MCIWndSetOwner(hWnd,hWndP) (LONG)MCIWndSM(hWnd,MCIWNDM_SETOWNER,(WPARAM)(hWndP),0)
1477
1478#define MCIWNDM_GETDEVICEID (WM_USER + 100)
1479#define MCIWNDM_GETSTART (WM_USER + 103)
1480#define MCIWNDM_GETLENGTH (WM_USER + 104)
1481#define MCIWNDM_GETEND (WM_USER + 105)
1482#define MCIWNDM_EJECT (WM_USER + 107)
1483#define MCIWNDM_SETZOOM (WM_USER + 108)
1484#define MCIWNDM_GETZOOM (WM_USER + 109)
1485#define MCIWNDM_SETVOLUME (WM_USER + 110)
1486#define MCIWNDM_GETVOLUME (WM_USER + 111)
1487#define MCIWNDM_SETSPEED (WM_USER + 112)
1488#define MCIWNDM_GETSPEED (WM_USER + 113)
1489#define MCIWNDM_SETREPEAT (WM_USER + 114)
1490#define MCIWNDM_GETREPEAT (WM_USER + 115)
1491#define MCIWNDM_REALIZE (WM_USER + 118)
1492#define MCIWNDM_VALIDATEMEDIA (WM_USER + 121)
1493#define MCIWNDM_PLAYFROM (WM_USER + 122)
1494#define MCIWNDM_PLAYTO (WM_USER + 123)
1495#define MCIWNDM_GETPALETTE (WM_USER + 126)
1496#define MCIWNDM_SETPALETTE (WM_USER + 127)
1497#define MCIWNDM_SETTIMERS (WM_USER + 129)
1498#define MCIWNDM_SETACTIVETIMER (WM_USER + 130)
1499#define MCIWNDM_SETINACTIVETIMER (WM_USER + 131)
1500#define MCIWNDM_GETACTIVETIMER (WM_USER + 132)
1501#define MCIWNDM_GETINACTIVETIMER (WM_USER + 133)
1502#define MCIWNDM_CHANGESTYLES (WM_USER + 135)
1503#define MCIWNDM_GETSTYLES (WM_USER + 136)
1504#define MCIWNDM_GETALIAS (WM_USER + 137)
1505#define MCIWNDM_PLAYREVERSE (WM_USER + 139)
1506#define MCIWNDM_GET_SOURCE (WM_USER + 140)
1507#define MCIWNDM_PUT_SOURCE (WM_USER + 141)
1508#define MCIWNDM_GET_DEST (WM_USER + 142)
1509#define MCIWNDM_PUT_DEST (WM_USER + 143)
1510#define MCIWNDM_CAN_PLAY (WM_USER + 144)
1511#define MCIWNDM_CAN_WINDOW (WM_USER + 145)
1512#define MCIWNDM_CAN_RECORD (WM_USER + 146)
1513#define MCIWNDM_CAN_SAVE (WM_USER + 147)
1514#define MCIWNDM_CAN_EJECT (WM_USER + 148)
1515#define MCIWNDM_CAN_CONFIG (WM_USER + 149)
1516#define MCIWNDM_PALETTEKICK (WM_USER + 150)
1517#define MCIWNDM_OPENINTERFACE (WM_USER + 151)
1518#define MCIWNDM_SETOWNER (WM_USER + 152)
1519
1520#define MCIWNDM_SENDSTRINGA (WM_USER + 101)
1521#define MCIWNDM_GETPOSITIONA (WM_USER + 102)
1522#define MCIWNDM_GETMODEA (WM_USER + 106)
1523#define MCIWNDM_SETTIMEFORMATA (WM_USER + 119)
1524#define MCIWNDM_GETTIMEFORMATA (WM_USER + 120)
1525#define MCIWNDM_GETFILENAMEA (WM_USER + 124)
1526#define MCIWNDM_GETDEVICEA (WM_USER + 125)
1527#define MCIWNDM_GETERRORA (WM_USER + 128)
1528#define MCIWNDM_NEWA (WM_USER + 134)
1529#define MCIWNDM_RETURNSTRINGA (WM_USER + 138)
1530#define MCIWNDM_OPENA (WM_USER + 153)
1531
1532#define MCIWNDM_SENDSTRINGW (WM_USER + 201)
1533#define MCIWNDM_GETPOSITIONW (WM_USER + 202)
1534#define MCIWNDM_GETMODEW (WM_USER + 206)
1535#define MCIWNDM_SETTIMEFORMATW (WM_USER + 219)
1536#define MCIWNDM_GETTIMEFORMATW (WM_USER + 220)
1537#define MCIWNDM_GETFILENAMEW (WM_USER + 224)
1538#define MCIWNDM_GETDEVICEW (WM_USER + 225)
1539#define MCIWNDM_GETERRORW (WM_USER + 228)
1540#define MCIWNDM_NEWW (WM_USER + 234)
1541#define MCIWNDM_RETURNSTRINGW (WM_USER + 238)
1542#define MCIWNDM_OPENW (WM_USER + 252)
1543
1544#define MCIWNDM_SENDSTRING WINELIB_NAME_AW(MCIWNDM_SENDSTRING)
1545#define MCIWNDM_GETPOSITION WINELIB_NAME_AW(MCIWNDM_GETPOSITION)
1546#define MCIWNDM_GETMODE WINELIB_NAME_AW(MCIWNDM_GETMODE)
1547#define MCIWNDM_SETTIMEFORMAT WINELIB_NAME_AW(MCIWNDM_SETTIMEFORMAT)
1548#define MCIWNDM_GETTIMEFORMAT WINELIB_NAME_AW(MCIWNDM_GETTIMEFORMAT)
1549#define MCIWNDM_GETFILENAME WINELIB_NAME_AW(MCIWNDM_GETFILENAME)
1550#define MCIWNDM_GETDEVICE WINELIB_NAME_AW(MCIWNDM_GETDEVICE)
1551#define MCIWNDM_GETERROR WINELIB_NAME_AW(MCIWNDM_GETERROR)
1552#define MCIWNDM_NEW WINELIB_NAME_AW(MCIWNDM_NEW)
1553#define MCIWNDM_RETURNSTRING WINELIB_NAME_AW(MCIWNDM_RETURNSTRING)
1554#define MCIWNDM_OPEN WINELIB_NAME_AW(MCIWNDM_OPEN)
1555
1556#define MCIWNDM_NOTIFYMODE (WM_USER + 200)
1557#define MCIWNDM_NOTIFYPOS (WM_USER + 201)
1558#define MCIWNDM_NOTIFYSIZE (WM_USER + 202)
1559#define MCIWNDM_NOTIFYMEDIA (WM_USER + 203)
1560#define MCIWNDM_NOTIFYERROR (WM_USER + 205)
1561
1562#define MCIWND_START -1
1563#define MCIWND_END -2
1564
Bradley Baetza1491de2000-07-08 12:50:26 +00001565/********************************************
1566 * DrawDib declarations
1567 */
1568
Hans Leidekkerfd5425e2005-01-17 15:33:43 +00001569typedef struct
1570{
1571 LONG timeCount;
1572 LONG timeDraw;
1573 LONG timeDecompress;
1574 LONG timeDither;
1575 LONG timeStretch;
1576 LONG timeBlt;
1577 LONG timeSetDIBits;
1578} DRAWDIBTIME, *LPDRAWDIBTIME;
1579
Bradley Baetza1491de2000-07-08 12:50:26 +00001580HDRAWDIB VFWAPI DrawDibOpen( void );
1581UINT VFWAPI DrawDibRealize(HDRAWDIB hdd, HDC hdc, BOOL fBackground);
1582
Eric Pouech731e9f52000-07-26 18:07:04 +00001583BOOL VFWAPI DrawDibBegin(HDRAWDIB hdd, HDC hdc, INT dxDst, INT dyDst,
1584 LPBITMAPINFOHEADER lpbi, INT dxSrc, INT dySrc, UINT wFlags);
Bradley Baetza1491de2000-07-08 12:50:26 +00001585
Eric Pouech731e9f52000-07-26 18:07:04 +00001586BOOL VFWAPI DrawDibDraw(HDRAWDIB hdd, HDC hdc, INT xDst, INT yDst, INT dxDst, INT dyDst,
Vincent Béron9a624912002-05-31 23:06:46 +00001587 LPBITMAPINFOHEADER lpbi, LPVOID lpBits,
Eric Pouech731e9f52000-07-26 18:07:04 +00001588 INT xSrc, INT ySrc, INT dxSrc, INT dySrc, UINT wFlags);
Bradley Baetza1491de2000-07-08 12:50:26 +00001589
1590/* DrawDibDraw flags */
1591
Eric Pouech731e9f52000-07-26 18:07:04 +00001592#define DDF_UPDATE 0x0002
Bradley Baetza1491de2000-07-08 12:50:26 +00001593#define DDF_SAME_HDC 0x0004
1594#define DDF_SAME_DRAW 0x0008
1595#define DDF_DONTDRAW 0x0010
Eric Pouech731e9f52000-07-26 18:07:04 +00001596#define DDF_ANIMATE 0x0020
1597#define DDF_BUFFER 0x0040
Bradley Baetza1491de2000-07-08 12:50:26 +00001598#define DDF_JUSTDRAWIT 0x0080
1599#define DDF_FULLSCREEN 0x0100
1600#define DDF_BACKGROUNDPAL 0x0200
1601#define DDF_NOTKEYFRAME 0x0400
Eric Pouech731e9f52000-07-26 18:07:04 +00001602#define DDF_HURRYUP 0x0800
Bradley Baetza1491de2000-07-08 12:50:26 +00001603#define DDF_HALFTONE 0x1000
1604
Eric Pouech731e9f52000-07-26 18:07:04 +00001605#define DDF_PREROLL DDF_DONTDRAW
1606#define DDF_SAME_DIB DDF_SAME_DRAW
1607#define DDF_SAME_SIZE DDF_SAME_DRAW
1608
Bradley Baetza1491de2000-07-08 12:50:26 +00001609BOOL VFWAPI DrawDibSetPalette(HDRAWDIB hdd, HPALETTE hpal);
1610HPALETTE VFWAPI DrawDibGetPalette(HDRAWDIB hdd);
Eric Pouech731e9f52000-07-26 18:07:04 +00001611BOOL VFWAPI DrawDibChangePalette(HDRAWDIB hdd, int iStart, int iLen, LPPALETTEENTRY lppe);
1612LPVOID VFWAPI DrawDibGetBuffer(HDRAWDIB hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags);
1613
1614BOOL VFWAPI DrawDibStart(HDRAWDIB hdd, DWORD rate);
1615BOOL VFWAPI DrawDibStop(HDRAWDIB hdd);
1616#define DrawDibUpdate(hdd, hdc, x, y) \
1617 DrawDibDraw(hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, 0, 0, DDF_UPDATE)
Bradley Baetza1491de2000-07-08 12:50:26 +00001618
1619BOOL VFWAPI DrawDibEnd(HDRAWDIB hdd);
1620BOOL VFWAPI DrawDibClose(HDRAWDIB hdd);
Hans Leidekkerfd5425e2005-01-17 15:33:43 +00001621BOOL VFWAPI DrawDibTime(HDRAWDIB hdd, LPDRAWDIBTIME lpddtime);
Marcus Meissner676a5131999-02-05 09:41:55 +00001622
Eric Pouech731e9f52000-07-26 18:07:04 +00001623/* display profiling */
1624#define PD_CAN_DRAW_DIB 0x0001
1625#define PD_CAN_STRETCHDIB 0x0002
1626#define PD_STRETCHDIB_1_1_OK 0x0004
1627#define PD_STRETCHDIB_1_2_OK 0x0008
1628#define PD_STRETCHDIB_1_N_OK 0x0010
1629
1630DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi);
1631
Rolf Kalbermatter12497162005-05-27 09:27:17 +00001632DECLARE_HANDLE(HVIDEO);
1633typedef HVIDEO *LPHVIDEO;
1634
1635DWORD VFWAPI VideoForWindowsVersion(void);
1636
1637LONG VFWAPI InitVFW(void);
1638LONG VFWAPI TermVFW(void);
1639
1640#define DV_ERR_OK (0)
1641#define DV_ERR_BASE (1)
1642#define DV_ERR_NONSPECIFIC (DV_ERR_BASE)
1643#define DV_ERR_BADFORMAT (DV_ERR_BASE + 1)
1644#define DV_ERR_STILLPLAYING (DV_ERR_BASE + 2)
1645#define DV_ERR_UNPREPARED (DV_ERR_BASE + 3)
1646#define DV_ERR_SYNC (DV_ERR_BASE + 4)
1647#define DV_ERR_TOOMANYCHANNELS (DV_ERR_BASE + 5)
1648#define DV_ERR_NOTDETECTED (DV_ERR_BASE + 6)
1649#define DV_ERR_BADINSTALL (DV_ERR_BASE + 7)
1650#define DV_ERR_CREATEPALETTE (DV_ERR_BASE + 8)
1651#define DV_ERR_SIZEFIELD (DV_ERR_BASE + 9)
1652#define DV_ERR_PARAM1 (DV_ERR_BASE + 10)
1653#define DV_ERR_PARAM2 (DV_ERR_BASE + 11)
1654#define DV_ERR_CONFIG1 (DV_ERR_BASE + 12)
1655#define DV_ERR_CONFIG2 (DV_ERR_BASE + 13)
1656#define DV_ERR_FLAGS (DV_ERR_BASE + 14)
1657#define DV_ERR_13 (DV_ERR_BASE + 15)
1658
1659#define DV_ERR_NOTSUPPORTED (DV_ERR_BASE + 16)
1660#define DV_ERR_NOMEM (DV_ERR_BASE + 17)
1661#define DV_ERR_ALLOCATED (DV_ERR_BASE + 18)
1662#define DV_ERR_BADDEVICEID (DV_ERR_BASE + 19)
1663#define DV_ERR_INVALHANDLE (DV_ERR_BASE + 20)
1664#define DV_ERR_BADERRNUM (DV_ERR_BASE + 21)
1665#define DV_ERR_NO_BUFFERS (DV_ERR_BASE + 22)
1666
1667#define DV_ERR_MEM_CONFLICT (DV_ERR_BASE + 23)
1668#define DV_ERR_IO_CONFLICT (DV_ERR_BASE + 24)
1669#define DV_ERR_DMA_CONFLICT (DV_ERR_BASE + 25)
1670#define DV_ERR_INT_CONFLICT (DV_ERR_BASE + 26)
1671#define DV_ERR_PROTECT_ONLY (DV_ERR_BASE + 27)
1672#define DV_ERR_LASTERROR (DV_ERR_BASE + 27)
1673
1674#define DV_ERR_USER_MSG (DV_ERR_BASE + 1000)
1675
1676#ifndef MM_DRVM_OPEN
1677#define MM_DRVM_OPEN 0x3D0
1678#define MM_DRVM_CLOSE 0x3D1
1679#define MM_DRVM_DATA 0x3D2
1680#define MM_DRVM_ERROR 0x3D3
1681
1682#define DV_VM_OPEN MM_DRVM_OPEN
1683#define DV_VM_CLOSE MM_DRVM_CLOSE
1684#define DV_VM_DATA MM_DRVM_DATA
1685#define DV_VM_ERROR MM_DRVM_ERROR
1686#endif
1687
1688typedef struct videohdr_tag {
1689 LPBYTE lpData;
1690 DWORD dwBufferLength;
1691 DWORD dwBytesUsed;
1692 DWORD dwTimeCaptured;
Michael Stefaniuc2caf7b82009-02-06 23:47:52 +01001693 DWORD_PTR dwUser;
Rolf Kalbermatter12497162005-05-27 09:27:17 +00001694 DWORD dwFlags;
Michael Stefaniuc2caf7b82009-02-06 23:47:52 +01001695 DWORD_PTR dwReserved[4];
Rolf Kalbermatter12497162005-05-27 09:27:17 +00001696} VIDEOHDR, *PVIDEOHDR, *LPVIDEOHDR;
1697
1698#define VHDR_DONE 0x00000001
1699#define VHDR_PREPARED 0x00000002
1700#define VHDR_INQUEUE 0x00000004
1701#define VHDR_KEYFRAME 0x00000008
1702
1703typedef struct channel_caps_tag {
1704 DWORD dwFlags;
1705 DWORD dwSrcRectXMod;
1706 DWORD dwSrcRectYMod;
1707 DWORD dwSrcRectWidthMod;
1708 DWORD dwSrcRectHeightMod;
1709 DWORD dwDstRectXMod;
1710 DWORD dwDstRectYMod;
1711 DWORD dwDstRectWidthMod;
1712 DWORD dwDstRectHeightMod;
1713} CHANNEL_CAPS, *PCHANNEL_CAPS, *LPCHANNEL_CAPS;
1714
1715#define VCAPS_OVERLAY 0x00000001
1716#define VCAPS_SRC_CAN_CLIP 0x00000002
1717#define VCAPS_DST_CAN_CLIP 0x00000004
1718#define VCAPS_CAN_SCALE 0x00000008
1719
1720#define VIDEO_EXTERNALIN 0x0001
1721#define VIDEO_EXTERNALOUT 0x0002
1722#define VIDEO_IN 0x0004
1723#define VIDEO_OUT 0x0008
1724
1725#define VIDEO_DLG_QUERY 0x0010
1726
1727#define VIDEO_CONFIGURE_QUERY 0x8000
1728
1729#define VIDEO_CONFIGURE_SET 0x1000
1730
1731#define VIDEO_CONFIGURE_GET 0x2000
1732#define VIDEO_CONFIGURE_QUERYSIZE 0x0001
1733
1734#define VIDEO_CONFIGURE_CURRENT 0x0010
1735#define VIDEO_CONFIGURE_NOMINAL 0x0020
1736#define VIDEO_CONFIGURE_MIN 0x0040
1737#define VIDEO_CONFIGURE_MAX 0x0080
1738
1739#define DVM_USER 0x4000
1740
1741#define DVM_CONFIGURE_START 0x1000
1742#define DVM_CONFIGURE_END 0x1FFF
1743
1744#define DVM_PALETTE (DVM_CONFIGURE_START + 1)
1745#define DVM_FORMAT (DVM_CONFIGURE_START + 2)
1746#define DVM_PALETTERGB555 (DVM_CONFIGURE_START + 3)
1747#define DVM_SRC_RECT (DVM_CONFIGURE_START + 4)
1748#define DVM_DST_RECT (DVM_CONFIGURE_START + 5)
1749
1750#define AVICapSM(hwnd,m,w,l) ((IsWindow(hwnd)) ? SendMessage(hwnd,m,w,l) : 0)
1751
1752#define WM_CAP_START WM_USER
1753
1754#define WM_CAP_UNICODE_START WM_USER+100
1755
1756#define WM_CAP_GET_CAPSTREAMPTR (WM_CAP_START + 1)
1757
1758#define WM_CAP_SET_CALLBACK_ERRORW (WM_CAP_UNICODE_START + 2)
1759#define WM_CAP_SET_CALLBACK_STATUSW (WM_CAP_UNICODE_START + 3)
1760#define WM_CAP_SET_CALLBACK_ERRORA (WM_CAP_START + 2)
1761#define WM_CAP_SET_CALLBACK_STATUSA (WM_CAP_START+ 3)
1762
1763#define WM_CAP_SET_CALLBACK_ERROR WINELIB_NAME_AW(WM_CAP_SET_CALLBACK_ERROR)
1764#define WM_CAP_SET_CALLBACK_STATUS WINELIB_NAME_AW(WM_CAP_SET_CALLBACK_STATUS)
1765
1766#define WM_CAP_SET_CALLBACK_YIELD (WM_CAP_START + 4)
1767#define WM_CAP_SET_CALLBACK_FRAME (WM_CAP_START + 5)
1768#define WM_CAP_SET_CALLBACK_VIDEOSTREAM (WM_CAP_START + 6)
1769#define WM_CAP_SET_CALLBACK_WAVESTREAM (WM_CAP_START + 7)
1770#define WM_CAP_GET_USER_DATA (WM_CAP_START + 8)
1771#define WM_CAP_SET_USER_DATA (WM_CAP_START + 9)
1772
1773#define WM_CAP_DRIVER_CONNECT (WM_CAP_START + 10)
1774#define WM_CAP_DRIVER_DISCONNECT (WM_CAP_START + 11)
1775
1776#define WM_CAP_DRIVER_GET_NAMEA (WM_CAP_START + 12)
1777#define WM_CAP_DRIVER_GET_VERSIONA (WM_CAP_START + 13)
1778#define WM_CAP_DRIVER_GET_NAMEW (WM_CAP_UNICODE_START + 12)
1779#define WM_CAP_DRIVER_GET_VERSIONW (WM_CAP_UNICODE_START + 13)
1780
1781#define WM_CAP_DRIVER_GET_NAME WINELIB_NAME_AW(WM_CAP_DRIVER_GET_NAME)
1782#define WM_CAP_DRIVER_GET_VERSION WINELIB_NAME_AW(WM_CAP_DRIVER_GET_VERSION)
1783
1784#define WM_CAP_DRIVER_GET_CAPS (WM_CAP_START + 14)
1785
1786#define WM_CAP_FILE_SET_CAPTURE_FILEA (WM_CAP_START + 20)
1787#define WM_CAP_FILE_GET_CAPTURE_FILEA (WM_CAP_START + 21)
1788#define WM_CAP_FILE_ALLOCATE (WM_CAP_START + 22)
1789#define WM_CAP_FILE_SAVEASA (WM_CAP_START + 23)
1790#define WM_CAP_FILE_SET_INFOCHUNK (WM_CAP_START + 24)
1791#define WM_CAP_FILE_SAVEDIBA (WM_CAP_START + 25)
1792#define WM_CAP_FILE_SET_CAPTURE_FILEW (WM_CAP_UNICODE_START + 20)
1793#define WM_CAP_FILE_GET_CAPTURE_FILEW (WM_CAP_UNICODE_START + 21)
1794#define WM_CAP_FILE_SAVEASW (WM_CAP_UNICODE_START + 23)
1795#define WM_CAP_FILE_SAVEDIBW (WM_CAP_UNICODE_START + 25)
1796
1797#define WM_CAP_FILE_SET_CAPTURE_FILE WINELIB_NAME_AW(WM_CAP_FILE_SET_CAPTURE_FILE)
1798#define WM_CAP_FILE_GET_CAPTURE_FILE WINELIB_NAME_AW(WM_CAP_FILE_GET_CAPTURE_FILE)
1799#define WM_CAP_FILE_SAVEAS WINELIB_NAME_AW(WM_CAP_FILE_SAVEAS)
1800#define WM_CAP_FILE_SAVEDIB WINELIB_NAME_AW(WM_CAP_FILE_SAVEDIB)
1801
1802#define WM_CAP_EDIT_COPY (WM_CAP_START + 30)
1803
1804#define WM_CAP_SET_AUDIOFORMAT (WM_CAP_START + 35)
1805#define WM_CAP_GET_AUDIOFORMAT (WM_CAP_START + 36)
1806
1807#define WM_CAP_DLG_VIDEOFORMAT (WM_CAP_START + 41)
1808#define WM_CAP_DLG_VIDEOSOURCE (WM_CAP_START + 42)
1809#define WM_CAP_DLG_VIDEODISPLAY (WM_CAP_START + 43)
1810#define WM_CAP_GET_VIDEOFORMAT (WM_CAP_START + 44)
1811#define WM_CAP_SET_VIDEOFORMAT (WM_CAP_START + 45)
1812#define WM_CAP_DLG_VIDEOCOMPRESSION (WM_CAP_START + 46)
1813
1814#define WM_CAP_SET_PREVIEW (WM_CAP_START + 50)
1815#define WM_CAP_SET_OVERLAY (WM_CAP_START + 51)
1816#define WM_CAP_SET_PREVIEWRATE (WM_CAP_START + 52)
1817#define WM_CAP_SET_SCALE (WM_CAP_START + 53)
1818#define WM_CAP_GET_STATUS (WM_CAP_START + 54)
1819#define WM_CAP_SET_SCROLL (WM_CAP_START + 55)
1820
1821#define WM_CAP_GRAB_FRAME (WM_CAP_START + 60)
1822#define WM_CAP_GRAB_FRAME_NOSTOP (WM_CAP_START + 61)
1823
1824#define WM_CAP_SEQUENCE (WM_CAP_START + 62)
1825#define WM_CAP_SEQUENCE_NOFILE (WM_CAP_START + 63)
1826#define WM_CAP_SET_SEQUENCE_SETUP (WM_CAP_START + 64)
1827#define WM_CAP_GET_SEQUENCE_SETUP (WM_CAP_START + 65)
1828
1829#define WM_CAP_SET_MCI_DEVICEA (WM_CAP_START + 66)
1830#define WM_CAP_GET_MCI_DEVICEA (WM_CAP_START + 67)
1831#define WM_CAP_SET_MCI_DEVICEW (WM_CAP_UNICODE_START + 66)
1832#define WM_CAP_GET_MCI_DEVICEW (WM_CAP_UNICODE_START + 67)
1833
1834#define WM_CAP_SET_MCI_DEVICE WINELIB_NAME_AW(WM_CAP_SET_MCI_DEVICE)
1835#define WM_CAP_GET_MCI_DEVICE WINELIB_NAME_AW(WM_CAP_GET_MCI_DEVICE)
1836
1837#define WM_CAP_STOP (WM_CAP_START + 68)
1838#define WM_CAP_ABORT (WM_CAP_START + 69)
1839
1840#define WM_CAP_SINGLE_FRAME_OPEN (WM_CAP_START + 70)
1841#define WM_CAP_SINGLE_FRAME_CLOSE (WM_CAP_START + 71)
1842#define WM_CAP_SINGLE_FRAME (WM_CAP_START + 72)
1843
1844#define WM_CAP_PAL_OPENA (WM_CAP_START + 80)
1845#define WM_CAP_PAL_SAVEA (WM_CAP_START + 81)
1846#define WM_CAP_PAL_OPENW (WM_CAP_UNICODE_START + 80)
1847#define WM_CAP_PAL_SAVEW (WM_CAP_UNICODE_START + 81)
1848
1849#define WM_CAP_PAL_OPEN WINELIB_NAME_AW(WM_CAP_PAL_OPEN)
1850#define WM_CAP_PAL_SAVE WINELIB_NAME_AW(WM_CAP_PAL_SAVE)
1851
1852#define WM_CAP_PAL_PASTE (WM_CAP_START + 82)
1853#define WM_CAP_PAL_AUTOCREATE (WM_CAP_START + 83)
1854#define WM_CAP_PAL_MANUALCREATE (WM_CAP_START + 84)
1855
1856#define WM_CAP_SET_CALLBACK_CAPCONTROL (WM_CAP_START + 85)
1857
1858#define WM_CAP_UNICODE_END WM_CAP_PAL_SAVEW
1859#define WM_CAP_END WM_CAP_UNICODE_END
1860
1861typedef struct tagCapDriverCaps {
1862 UINT wDeviceIndex;
1863 BOOL fHasOverlay;
1864 BOOL fHasDlgVideoSource;
1865 BOOL fHasDlgVideoFormat;
1866 BOOL fHasDlgVideoDisplay;
1867 BOOL fCaptureInitialized;
1868 BOOL fDriverSuppliesPalettes;
1869 HANDLE hVideoIn;
1870 HANDLE hVideoOut;
1871 HANDLE hVideoExtIn;
1872 HANDLE hVideoExtOut;
1873} CAPDRIVERCAPS, *PCAPDRIVERCAPS, *LPCAPDRIVERCAPS;
1874
1875typedef struct tagCapStatus {
1876 UINT uiImageWidth;
1877 UINT uiImageHeight;
1878 BOOL fLiveWindow;
1879 BOOL fOverlayWindow;
1880 BOOL fScale;
1881 POINT ptScroll;
1882 BOOL fUsingDefaultPalette;
1883 BOOL fAudioHardware;
1884 BOOL fCapFileExists;
1885 DWORD dwCurrentVideoFrame;
1886 DWORD dwCurrentVideoFramesDropped;
1887 DWORD dwCurrentWaveSamples;
1888 DWORD dwCurrentTimeElapsedMS;
1889 HPALETTE hPalCurrent;
1890 BOOL fCapturingNow;
1891 DWORD dwReturn;
1892 UINT wNumVideoAllocated;
1893 UINT wNumAudioAllocated;
1894} CAPSTATUS, *PCAPSTATUS, *LPCAPSTATUS;
1895
1896
1897typedef struct tagCaptureParms {
1898 DWORD dwRequestMicroSecPerFrame;
1899 BOOL fMakeUserHitOKToCapture;
1900 UINT wPercentDropForError;
1901 BOOL fYield;
1902 DWORD dwIndexSize;
1903 UINT wChunkGranularity;
1904 BOOL fUsingDOSMemory;
1905 UINT wNumVideoRequested;
1906 BOOL fCaptureAudio;
1907 UINT wNumAudioRequested;
1908 UINT vKeyAbort;
1909 BOOL fAbortLeftMouse;
1910 BOOL fAbortRightMouse;
1911 BOOL fLimitEnabled;
1912 UINT wTimeLimit;
1913 BOOL fMCIControl;
1914 BOOL fStepMCIDevice;
1915 DWORD dwMCIStartTime;
1916 DWORD dwMCIStopTime;
1917 BOOL fStepCaptureAt2x;
1918 UINT wStepCaptureAverageFrames;
1919 DWORD dwAudioBufferSize;
1920 BOOL fDisableWriteCache;
1921 UINT AVStreamMaster;
1922} CAPTUREPARMS, *PCAPTUREPARMS, *LPCAPTUREPARMS;
1923
1924typedef LRESULT (CALLBACK* CAPYIELDCALLBACK) (HWND hWnd);
1925typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKW) (HWND hWnd, int nID, LPCWSTR lpsz);
1926typedef LRESULT (CALLBACK* CAPERRORCALLBACKW) (HWND hWnd, int nID, LPCWSTR lpsz);
1927typedef LRESULT (CALLBACK* CAPSTATUSCALLBACKA) (HWND hWnd, int nID, LPCSTR lpsz);
1928typedef LRESULT (CALLBACK* CAPERRORCALLBACKA) (HWND hWnd, int nID, LPCSTR lpsz);
1929typedef LRESULT (CALLBACK* CAPVIDEOCALLBACK) (HWND hWnd, LPVIDEOHDR lpVHdr);
1930typedef LRESULT (CALLBACK* CAPWAVECALLBACK) (HWND hWnd, LPWAVEHDR lpWHdr);
1931typedef LRESULT (CALLBACK* CAPCONTROLCALLBACK)(HWND hWnd, int nState);
1932
Alexandre Julliard2fdc4dc2003-11-26 04:11:56 +00001933HWND VFWAPI capCreateCaptureWindowA(LPCSTR,DWORD,INT,INT,INT,INT,HWND,INT);
1934HWND VFWAPI capCreateCaptureWindowW(LPCWSTR,DWORD,INT,INT,INT,INT,HWND,INT);
1935#define capCreateCaptureWindow WINELIB_NAME_AW(capCreateCaptureWindow)
1936BOOL VFWAPI capGetDriverDescriptionA(WORD,LPSTR,INT,LPSTR,INT);
1937BOOL VFWAPI capGetDriverDescriptionW(WORD,LPWSTR,INT,LPWSTR,INT);
1938#define capGetDriverDescription WINELIB_NAME_AW(capGetDriverDescription)
1939
Eric Pouech731e9f52000-07-26 18:07:04 +00001940#ifdef __cplusplus
1941}
1942#endif /* __cplusplus */
1943
Francois Gouget4e4f1d11999-03-17 15:16:01 +00001944#endif /* __WINE_VFW_H */