Removed suicide code when playback thread's father dies.
[wine.git] / include / vfw.h
blob747a547f9a764235b37be48f1eb194d6a6718ecc
1 #ifndef __WINE_VFW_H
2 #define __WINE_VFW_H
4 #include "windef.h"
5 #include "mmsystem.h"
6 #include "wingdi.h"
7 #include "wine/obj_base.h"
8 #include "unknwn.h"
10 #define VFWAPI WINAPI
11 #define VFWAPIV WINAPIV
13 DWORD VFWAPI VideoForWindowsVersion(void);
15 #ifndef mmioFOURCC
16 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
17 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
18 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
19 #endif
21 #ifndef aviTWOCC
22 #define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
23 #endif
25 #define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
26 #define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
28 /*****************************************************************************
29 * Predeclare the interfaces
31 typedef struct IAVIStream IAVIStream,*PAVISTREAM;
32 typedef struct IAVIFile IAVIFile,*PAVIFILE;
33 typedef struct IGetFrame IGetFrame,*PGETFRAME;
35 /* Installable Compressor M? */
37 /* HIC struct (same layout as Win95 one) */
38 typedef struct tagWINE_HIC {
39 DWORD magic; /* 00: 'Smag' */
40 HANDLE curthread; /* 04: */
41 DWORD type; /* 08: */
42 DWORD handler; /* 0C: */
43 HDRVR hdrv; /* 10: */
44 DWORD private; /* 14:(handled by SendDriverMessage)*/
45 FARPROC driverproc; /* 18:(handled by SendDriverMessage)*/
46 DWORD x1; /* 1c: name? */
47 WORD x2; /* 20: */
48 DWORD x3; /* 22: */
49 /* 26: */
50 } WINE_HIC;
52 /* error return codes */
53 #define ICERR_OK 0
54 #define ICERR_DONTDRAW 1
55 #define ICERR_NEWPALETTE 2
56 #define ICERR_GOTOKEYFRAME 3
57 #define ICERR_STOPDRAWING 4
59 #define ICERR_UNSUPPORTED -1
60 #define ICERR_BADFORMAT -2
61 #define ICERR_MEMORY -3
62 #define ICERR_INTERNAL -4
63 #define ICERR_BADFLAGS -5
64 #define ICERR_BADPARAM -6
65 #define ICERR_BADSIZE -7
66 #define ICERR_BADHANDLE -8
67 #define ICERR_CANTUPDATE -9
68 #define ICERR_ABORT -10
69 #define ICERR_ERROR -100
70 #define ICERR_BADBITDEPTH -200
71 #define ICERR_BADIMAGESIZE -201
73 #define ICERR_CUSTOM -400
75 /* ICM Messages */
76 #define ICM_USER (DRV_USER+0x0000)
78 /* ICM driver message range */
79 #define ICM_RESERVED_LOW (DRV_USER+0x1000)
80 #define ICM_RESERVED_HIGH (DRV_USER+0x2000)
81 #define ICM_RESERVED ICM_RESERVED_LOW
83 #define ICM_GETSTATE (ICM_RESERVED+0)
84 #define ICM_SETSTATE (ICM_RESERVED+1)
85 #define ICM_GETINFO (ICM_RESERVED+2)
87 #define ICM_CONFIGURE (ICM_RESERVED+10)
88 #define ICM_ABOUT (ICM_RESERVED+11)
89 /* */
91 #define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30)
92 #define ICM_GETQUALITY (ICM_RESERVED+31)
93 #define ICM_SETQUALITY (ICM_RESERVED+32)
95 #define ICM_SET (ICM_RESERVED+40)
96 #define ICM_GET (ICM_RESERVED+41)
98 /* 2 constant FOURCC codes */
99 #define ICM_FRAMERATE mmioFOURCC('F','r','m','R')
100 #define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R')
102 #define ICM_COMPRESS_GET_FORMAT (ICM_USER+4)
103 #define ICM_COMPRESS_GET_SIZE (ICM_USER+5)
104 #define ICM_COMPRESS_QUERY (ICM_USER+6)
105 #define ICM_COMPRESS_BEGIN (ICM_USER+7)
106 #define ICM_COMPRESS (ICM_USER+8)
107 #define ICM_COMPRESS_END (ICM_USER+9)
109 #define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10)
110 #define ICM_DECOMPRESS_QUERY (ICM_USER+11)
111 #define ICM_DECOMPRESS_BEGIN (ICM_USER+12)
112 #define ICM_DECOMPRESS (ICM_USER+13)
113 #define ICM_DECOMPRESS_END (ICM_USER+14)
114 #define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29)
115 #define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30)
117 #define ICM_DRAW_QUERY (ICM_USER+31)
118 #define ICM_DRAW_BEGIN (ICM_USER+15)
119 #define ICM_DRAW_GET_PALETTE (ICM_USER+16)
120 #define ICM_DRAW_START (ICM_USER+18)
121 #define ICM_DRAW_STOP (ICM_USER+19)
122 #define ICM_DRAW_END (ICM_USER+21)
123 #define ICM_DRAW_GETTIME (ICM_USER+32)
124 #define ICM_DRAW (ICM_USER+33)
125 #define ICM_DRAW_WINDOW (ICM_USER+34)
126 #define ICM_DRAW_SETTIME (ICM_USER+35)
127 #define ICM_DRAW_REALIZE (ICM_USER+36)
128 #define ICM_DRAW_FLUSH (ICM_USER+37)
129 #define ICM_DRAW_RENDERBUFFER (ICM_USER+38)
131 #define ICM_DRAW_START_PLAY (ICM_USER+39)
132 #define ICM_DRAW_STOP_PLAY (ICM_USER+40)
134 #define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50)
135 #define ICM_DRAW_CHANGEPALETTE (ICM_USER+51)
137 #define ICM_GETBUFFERSWANTED (ICM_USER+41)
139 #define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42)
141 #define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60)
142 #define ICM_DECOMPRESSEX_QUERY (ICM_USER+61)
143 #define ICM_DECOMPRESSEX (ICM_USER+62)
144 #define ICM_DECOMPRESSEX_END (ICM_USER+63)
146 #define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70)
147 #define ICM_SET_STATUS_PROC (ICM_USER+72)
149 /* structs */
151 typedef struct {
152 DWORD dwSize; /* 00: size */
153 DWORD fccType; /* 04: type 'vidc' usually */
154 DWORD fccHandler; /* 08: */
155 DWORD dwVersion; /* 0c: version of compman opening you */
156 DWORD dwFlags; /* 10: LOWORD is type specific */
157 LRESULT dwError; /* 14: */
158 LPVOID pV1Reserved; /* 18: */
159 LPVOID pV2Reserved; /* 1c: */
160 DWORD dnDevNode; /* 20: */
161 /* 24: */
162 } ICOPEN,*LPICOPEN;
164 #define ICCOMPRESS_KEYFRAME 0x00000001L
166 typedef struct {
167 DWORD dwFlags;
168 LPBITMAPINFOHEADER lpbiOutput;
169 LPVOID lpOutput;
170 LPBITMAPINFOHEADER lpbiInput;
171 LPVOID lpInput;
172 LPDWORD lpckid;
173 LPDWORD lpdwFlags;
174 LONG lFrameNum;
175 DWORD dwFrameSize;
176 DWORD dwQuality;
177 LPBITMAPINFOHEADER lpbiPrev;
178 LPVOID lpPrev;
179 } ICCOMPRESS;
181 DWORD VFWAPIV ICCompress(
182 HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
183 LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
184 LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
185 LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev
188 #define ICCompressGetFormat(hic, lpbiInput, lpbiOutput) \
189 ICSendMessage( \
190 hic,ICM_COMPRESS_GET_FORMAT,(DWORD)(LPVOID)(lpbiInput), \
191 (DWORD)(LPVOID)(lpbiOutput) \
194 #define ICCompressGetFormatSize(hic,lpbi) ICCompressGetFormat(hic,lpbi,NULL)
196 #define ICCompressBegin(hic, lpbiInput, lpbiOutput) \
197 ICSendMessage( \
198 hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
199 (DWORD)(LPVOID)(lpbiOutput) \
202 #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
203 ICSendMessage( \
204 hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \
205 (DWORD)(LPVOID)(lpbiOutput) \
208 #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
209 ICSendMessage( \
210 hic, ICM_COMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
211 (DWORD)(LPVOID)(lpbiOutput) \
215 #define ICCompressEnd(hic) ICSendMessage(hic, ICM_COMPRESS_END, 0, 0)
217 /* ICCOMPRESSFRAMES.dwFlags */
218 #define ICCOMPRESSFRAMES_PADDING 0x00000001
219 typedef struct {
220 DWORD dwFlags;
221 LPBITMAPINFOHEADER lpbiOutput;
222 LPARAM lOutput;
223 LPBITMAPINFOHEADER lpbiInput;
224 LPARAM lInput;
225 LONG lStartFrame;
226 LONG lFrameCount;
227 LONG lQuality;
228 LONG lDataRate;
229 LONG lKeyRate;
230 DWORD dwRate;
231 DWORD dwScale;
232 DWORD dwOverheadPerFrame;
233 DWORD dwReserved2;
234 LONG (CALLBACK *GetData)(LPARAM lInput,LONG lFrame,LPVOID lpBits,LONG len);
235 LONG (CALLBACK *PutData)(LPARAM lOutput,LONG lFrame,LPVOID lpBits,LONG len);
236 } ICCOMPRESSFRAMES;
238 /* Values for wMode of ICOpen() */
239 #define ICMODE_COMPRESS 1
240 #define ICMODE_DECOMPRESS 2
241 #define ICMODE_FASTDECOMPRESS 3
242 #define ICMODE_QUERY 4
243 #define ICMODE_FASTCOMPRESS 5
244 #define ICMODE_DRAW 8
246 /* quality flags */
247 #define ICQUALITY_LOW 0
248 #define ICQUALITY_HIGH 10000
249 #define ICQUALITY_DEFAULT -1
251 typedef struct {
252 DWORD dwSize; /* 00: */
253 DWORD fccType; /* 04:compressor type 'vidc' 'audc' */
254 DWORD fccHandler; /* 08:compressor sub-type 'rle ' 'jpeg' 'pcm '*/
255 DWORD dwFlags; /* 0c:flags LOWORD is type specific */
256 DWORD dwVersion; /* 10:version of the driver */
257 DWORD dwVersionICM; /* 14:version of the ICM used */
259 * under Win32, the driver always returns UNICODE strings.
261 WCHAR szName[16]; /* 18:short name */
262 WCHAR szDescription[128]; /* 38:long name */
263 WCHAR szDriver[128]; /* 138:driver that contains compressor*/
264 /* 238: */
265 } ICINFO;
267 /* ICINFO.dwFlags */
268 #define VIDCF_QUALITY 0x0001 /* supports quality */
269 #define VIDCF_CRUNCH 0x0002 /* supports crunching to a frame size */
270 #define VIDCF_TEMPORAL 0x0004 /* supports inter-frame compress */
271 #define VIDCF_COMPRESSFRAMES 0x0008 /* wants the compress all frames message */
272 #define VIDCF_DRAW 0x0010 /* supports drawing */
273 #define VIDCF_FASTTEMPORALC 0x0020 /* does not need prev frame on compress */
274 #define VIDCF_FASTTEMPORALD 0x0080 /* does not need prev frame on decompress */
275 #define VIDCF_QUALITYTIME 0x0040 /* supports temporal quality */
277 #define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
280 /* function shortcuts */
281 /* ICM_ABOUT */
282 #define ICMF_ABOUT_QUERY 0x00000001
284 #define ICQueryAbout(hic) \
285 (ICSendMessage(hic,ICM_ABOUT,(DWORD)-1,ICMF_ABOUT_QUERY)==ICERR_OK)
287 #define ICAbout(hic, hwnd) ICSendMessage(hic,ICM_ABOUT,(DWORD)(UINT)(hwnd),0)
289 /* ICM_CONFIGURE */
290 #define ICMF_CONFIGURE_QUERY 0x00000001
291 #define ICQueryConfigure(hic) \
292 (ICSendMessage(hic,ICM_CONFIGURE,(DWORD)-1,ICMF_CONFIGURE_QUERY)==ICERR_OK)
294 #define ICConfigure(hic,hwnd) \
295 ICSendMessage(hic,ICM_CONFIGURE,(DWORD)(UINT)(hwnd),0)
297 /* Decompression stuff */
298 #define ICDECOMPRESS_HURRYUP 0x80000000 /* don't draw just buffer (hurry up!) */
299 #define ICDECOMPRESS_UPDATE 0x40000000 /* don't draw just update screen */
300 #define ICDECOMPRESS_PREROL 0x20000000 /* this frame is before real start */
301 #define ICDECOMPRESS_NULLFRAME 0x10000000 /* repeat last frame */
302 #define ICDECOMPRESS_NOTKEYFRAME 0x08000000 /* this frame is not a key frame */
304 typedef struct {
305 DWORD dwFlags; /* flags (from AVI index...) */
306 LPBITMAPINFOHEADER lpbiInput; /* BITMAPINFO of compressed data */
307 LPVOID lpInput; /* compressed data */
308 LPBITMAPINFOHEADER lpbiOutput; /* DIB to decompress to */
309 LPVOID lpOutput;
310 DWORD ckid; /* ckid from AVI file */
311 } ICDECOMPRESS;
313 typedef struct {
314 DWORD dwFlags;
315 LPBITMAPINFOHEADER lpbiSrc;
316 LPVOID lpSrc;
317 LPBITMAPINFOHEADER lpbiDst;
318 LPVOID lpDst;
320 /* changed for ICM_DECOMPRESSEX */
321 INT xDst; /* destination rectangle */
322 INT yDst;
323 INT dxDst;
324 INT dyDst;
326 INT xSrc; /* source rectangle */
327 INT ySrc;
328 INT dxSrc;
329 INT dySrc;
330 } ICDECOMPRESSEX;
332 DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits);
335 #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
336 ICSendMessage( \
337 hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
338 (DWORD)(LPVOID)(lpbiOutput) \
341 #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
342 ICSendMessage( \
343 hic,ICM_DECOMPRESS_QUERY, (DWORD)(LPVOID)(lpbiInput), \
344 (DWORD) (LPVOID)(lpbiOutput) \
347 #define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput) \
348 ((LONG)ICSendMessage( \
349 hic,ICM_DECOMPRESS_GET_FORMAT, (DWORD)(LPVOID)(lpbiInput), \
350 (DWORD)(LPVOID)(lpbiOutput) \
353 #define ICDecompressGetFormatSize(hic, lpbi) \
354 ICDecompressGetFormat(hic, lpbi, NULL)
356 #define ICDecompressGetPalette(hic, lpbiInput, lpbiOutput) \
357 ICSendMessage( \
358 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), \
359 (DWORD)(LPVOID)(lpbiOutput) \
362 #define ICDecompressSetPalette(hic,lpbiPalette) \
363 ICSendMessage( \
364 hic,ICM_DECOMPRESS_SET_PALETTE, \
365 (DWORD)(LPVOID)(lpbiPalette),0 \
368 #define ICDecompressEnd(hic) ICSendMessage(hic, ICM_DECOMPRESS_END, 0, 0)
371 #define ICDRAW_QUERY 0x00000001L /* test for support */
372 #define ICDRAW_FULLSCREEN 0x00000002L /* draw to full screen */
373 #define ICDRAW_HDC 0x00000004L /* draw to a HDC/HWND */
375 BOOL VFWAPI ICInfo(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
376 LRESULT VFWAPI ICGetInfo(HIC hic,ICINFO *picinfo, DWORD cb);
377 HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode);
378 HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode, FARPROC lpfnHandler);
380 LRESULT VFWAPI ICClose(HIC hic);
381 LRESULT VFWAPI ICSendMessage(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
382 HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut, WORD wFlags);
384 DWORD VFWAPIV ICDrawBegin(
385 HIC hic,
386 DWORD dwFlags,/* flags */
387 HPALETTE hpal, /* palette to draw with */
388 HWND hwnd, /* window to draw to */
389 HDC hdc, /* HDC to draw to */
390 INT xDst, /* destination rectangle */
391 INT yDst,
392 INT dxDst,
393 INT dyDst,
394 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
395 INT xSrc, /* source rectangle */
396 INT ySrc,
397 INT dxSrc,
398 INT dySrc,
399 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
400 DWORD dwScale
403 /* as passed to ICM_DRAW_BEGIN (FIXME: correct only for Win32?) */
404 typedef struct {
405 DWORD dwFlags;
406 HPALETTE hpal;
407 HWND hwnd;
408 HDC hdc;
409 INT xDst;
410 INT yDst;
411 INT dxDst;
412 INT dyDst;
413 LPBITMAPINFOHEADER lpbi;
414 INT xSrc;
415 INT ySrc;
416 INT dxSrc;
417 INT dySrc;
418 DWORD dwRate;
419 DWORD dwScale;
420 } ICDRAWBEGIN;
422 #define ICDRAW_HURRYUP 0x80000000L /* don't draw just buffer (hurry up!) */
423 #define ICDRAW_UPDATE 0x40000000L /* don't draw just update screen */
424 #define ICDRAW_PREROLL 0x20000000L /* this frame is before real start */
425 #define ICDRAW_NULLFRAME 0x10000000L /* repeat last frame */
426 #define ICDRAW_NOTKEYFRAME 0x08000000L /* this frame is not a key frame */
428 typedef struct {
429 DWORD dwFlags;
430 LPVOID lpFormat;
431 LPVOID lpData;
432 DWORD cbData;
433 LONG lTime;
434 } ICDRAW;
436 DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,DWORD cbData,LONG lTime);
438 /********************* AVIFILE function declarations *************************/
440 #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
441 #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
442 #define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
443 #define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
445 /* Basic chunk types */
446 #define cktypeDIBbits aviTWOCC('d', 'b')
447 #define cktypeDIBcompressed aviTWOCC('d', 'c')
448 #define cktypePALchange aviTWOCC('p', 'c')
449 #define cktypeWAVEbytes aviTWOCC('w', 'b')
451 /* Chunk id to use for extra chunks for padding. */
452 #define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
454 /* AVIFileHdr.dwFlags */
455 #define AVIF_HASINDEX 0x00000010 /* Index at end of file? */
456 #define AVIF_MUSTUSEINDEX 0x00000020
457 #define AVIF_ISINTERLEAVED 0x00000100
458 #define AVIF_TRUSTCKTYPE 0x00000800 /* Use CKType to find key frames*/
459 #define AVIF_WASCAPTUREFILE 0x00010000
460 #define AVIF_COPYRIGHTED 0x00020000
462 #define AVI_HEADERSIZE 2048
464 typedef struct _MainAVIHeader
466 DWORD dwMicroSecPerFrame;
467 DWORD dwMaxBytesPerSec;
468 DWORD dwPaddingGranularity;
469 DWORD dwFlags;
470 DWORD dwTotalFrames;
471 DWORD dwInitialFrames;
472 DWORD dwStreams;
473 DWORD dwSuggestedBufferSize;
474 DWORD dwWidth;
475 DWORD dwHeight;
476 DWORD dwReserved[4];
477 } MainAVIHeader;
479 /* AVIStreamHeader.dwFlags */
480 #define AVISF_DISABLED 0x00000001
481 #define AVISF_VIDEO_PALCHANGES 0x00010000
483 typedef struct {
484 FOURCC fccType;
485 FOURCC fccHandler;
486 DWORD dwFlags; /* AVISF_* */
487 WORD wPriority;
488 WORD wLanguage;
489 DWORD dwInitialFrames;
490 DWORD dwScale;
491 DWORD dwRate; /* dwRate / dwScale == samples/second */
492 DWORD dwStart;
493 DWORD dwLength; /* In units above... */
494 DWORD dwSuggestedBufferSize;
495 DWORD dwQuality;
496 DWORD dwSampleSize;
497 RECT16 rcFrame; /* word.word - word.word in file */
498 } AVIStreamHeader;
500 /* AVIINDEXENTRY.dwFlags */
501 #define AVIIF_LIST 0x00000001 /* chunk is a 'LIST' */
502 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
504 #define AVIIF_NOTIME 0x00000100 /* this frame doesn't take any time */
505 #define AVIIF_COMPUSE 0x0FFF0000
507 typedef struct _AVIINDEXENTRY {
508 DWORD ckid;
509 DWORD dwFlags;
510 DWORD dwChunkOffset;
511 DWORD dwChunkLength;
512 } AVIINDEXENTRY;
514 typedef struct _AVIPALCHANGE {
515 BYTE bFirstEntry;
516 BYTE bNumEntries;
517 WORD wFlags; /* pad */
518 PALETTEENTRY peNew[1];
519 } AVIPALCHANGE;
521 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
523 #define AVIGETFRAMEF_BESTDISPLAYFMT 1
525 typedef struct _AVISTREAMINFOA {
526 DWORD fccType;
527 DWORD fccHandler;
528 DWORD dwFlags; /* AVIIF_* */
529 DWORD dwCaps;
530 WORD wPriority;
531 WORD wLanguage;
532 DWORD dwScale;
533 DWORD dwRate; /* dwRate / dwScale == samples/second */
534 DWORD dwStart;
535 DWORD dwLength; /* In units above... */
536 DWORD dwInitialFrames;
537 DWORD dwSuggestedBufferSize;
538 DWORD dwQuality;
539 DWORD dwSampleSize;
540 RECT rcFrame;
541 DWORD dwEditCount;
542 DWORD dwFormatChangeCount;
543 CHAR szName[64];
544 } AVISTREAMINFOA, * LPAVISTREAMINFOA, *PAVISTREAMINFOA;
546 typedef struct _AVISTREAMINFOW {
547 DWORD fccType;
548 DWORD fccHandler;
549 DWORD dwFlags;
550 DWORD dwCaps;
551 WORD wPriority;
552 WORD wLanguage;
553 DWORD dwScale;
554 DWORD dwRate; /* dwRate / dwScale == samples/second */
555 DWORD dwStart;
556 DWORD dwLength; /* In units above... */
557 DWORD dwInitialFrames;
558 DWORD dwSuggestedBufferSize;
559 DWORD dwQuality;
560 DWORD dwSampleSize;
561 RECT rcFrame;
562 DWORD dwEditCount;
563 DWORD dwFormatChangeCount;
564 WCHAR szName[64];
565 } AVISTREAMINFOW, * LPAVISTREAMINFOW, *PAVISTREAMINFOW;
566 DECL_WINELIB_TYPE_AW(AVISTREAMINFO)
567 DECL_WINELIB_TYPE_AW(LPAVISTREAMINFO)
568 DECL_WINELIB_TYPE_AW(PAVISTREAMINFO)
570 #define AVISTREAMINFO_DISABLED 0x00000001
571 #define AVISTREAMINFO_FORMATCHANGES 0x00010000
573 /* AVIFILEINFO.dwFlags */
574 #define AVIFILEINFO_HASINDEX 0x00000010
575 #define AVIFILEINFO_MUSTUSEINDEX 0x00000020
576 #define AVIFILEINFO_ISINTERLEAVED 0x00000100
577 #define AVIFILEINFO_WASCAPTUREFILE 0x00010000
578 #define AVIFILEINFO_COPYRIGHTED 0x00020000
580 /* AVIFILEINFO.dwCaps */
581 #define AVIFILECAPS_CANREAD 0x00000001
582 #define AVIFILECAPS_CANWRITE 0x00000002
583 #define AVIFILECAPS_ALLKEYFRAMES 0x00000010
584 #define AVIFILECAPS_NOCOMPRESSION 0x00000020
586 typedef struct _AVIFILEINFOW {
587 DWORD dwMaxBytesPerSec;
588 DWORD dwFlags;
589 DWORD dwCaps;
590 DWORD dwStreams;
591 DWORD dwSuggestedBufferSize;
592 DWORD dwWidth;
593 DWORD dwHeight;
594 DWORD dwScale;
595 DWORD dwRate;
596 DWORD dwLength;
597 DWORD dwEditCount;
598 WCHAR szFileType[64];
599 } AVIFILEINFOW, * LPAVIFILEINFOW, *PAVIFILEINFOW;
600 typedef struct _AVIFILEINFOA {
601 DWORD dwMaxBytesPerSec;
602 DWORD dwFlags;
603 DWORD dwCaps;
604 DWORD dwStreams;
605 DWORD dwSuggestedBufferSize;
606 DWORD dwWidth;
607 DWORD dwHeight;
608 DWORD dwScale;
609 DWORD dwRate;
610 DWORD dwLength;
611 DWORD dwEditCount;
612 CHAR szFileType[64];
613 } AVIFILEINFOA, * LPAVIFILEINFOA, *PAVIFILEINFOA;
614 DECL_WINELIB_TYPE_AW(AVIFILEINFO)
615 DECL_WINELIB_TYPE_AW(PAVIFILEINFO)
616 DECL_WINELIB_TYPE_AW(LPAVIFILEINFO)
618 /* AVICOMPRESSOPTIONS.dwFlags. determines presence of fields in below struct */
619 #define AVICOMPRESSF_INTERLEAVE 0x00000001
620 #define AVICOMPRESSF_DATARATE 0x00000002
621 #define AVICOMPRESSF_KEYFRAMES 0x00000004
622 #define AVICOMPRESSF_VALID 0x00000008
624 typedef struct {
625 DWORD fccType; /* stream type, for consistency */
626 DWORD fccHandler; /* compressor */
627 DWORD dwKeyFrameEvery; /* keyframe rate */
628 DWORD dwQuality; /* compress quality 0-10,000 */
629 DWORD dwBytesPerSecond; /* bytes per second */
630 DWORD dwFlags; /* flags... see below */
631 LPVOID lpFormat; /* save format */
632 DWORD cbFormat;
633 LPVOID lpParms; /* compressor options */
634 DWORD cbParms;
635 DWORD dwInterleaveEvery; /* for non-video streams only */
636 } AVICOMPRESSOPTIONS, *LPAVICOMPRESSOPTIONS,*PAVICOMPRESSOPTIONS;
640 #define DEFINE_AVIGUID(name, l, w1, w2) \
641 DEFINE_GUID(name, l, w1, w2, 0xC0,0,0,0,0,0,0,0x46)
643 DEFINE_AVIGUID(IID_IAVIFile, 0x00020020, 0, 0);
644 DEFINE_AVIGUID(IID_IAVIStream, 0x00020021, 0, 0);
645 DEFINE_AVIGUID(IID_IAVIStreaming, 0x00020022, 0, 0);
646 DEFINE_AVIGUID(IID_IGetFrame, 0x00020023, 0, 0);
647 DEFINE_AVIGUID(IID_IAVIEditStream, 0x00020024, 0, 0);
649 DEFINE_AVIGUID(CLSID_AVIFile, 0x00020000, 0, 0);
651 /*****************************************************************************
652 * IAVIStream interface
654 #define ICOM_INTERFACE IAVIStream
655 #define IAVIStream_METHODS \
656 ICOM_METHOD2(HRESULT,Create, LPARAM,lParam1, LPARAM,lParam2) \
657 ICOM_METHOD2(HRESULT,Info, AVISTREAMINFOW*,psi, LONG,lSize) \
658 ICOM_METHOD2(LONG, FindSample, LONG,lPos, LONG,lFlags) \
659 ICOM_METHOD3(HRESULT,ReadFormat, LONG,lPos, LPVOID,lpFormat, LONG*,lpcbFormat) \
660 ICOM_METHOD3(HRESULT,SetFormat, LONG,lPos, LPVOID,lpFormat, LONG,cbFormat) \
661 ICOM_METHOD6(HRESULT,Read, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, LONG*,plBytes, LONG*,plSamples) \
662 ICOM_METHOD7(HRESULT,Write, LONG,lStart, LONG,lSamples, LPVOID,lpBuffer, LONG,cbBuffer, DWORD,dwFlags, LONG*,plSampWritten, LONG*,plBytesWritten) \
663 ICOM_METHOD2(HRESULT,Delete, LONG,lStart, LONG,lSamples) \
664 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
665 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
666 ICOM_METHOD2(HRESULT,SetInfo, AVISTREAMINFOW*,plInfo, LONG,cbInfo)
667 #define IAVIStream_IMETHODS \
668 IUnknown_IMETHODS \
669 IAVIStream_METHODS
670 ICOM_DEFINE(IAVIStream, IUnknown)
671 #undef ICOM_INTERFACE
673 /*** IUnknown methods ***/
674 #define IAVIStream_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
675 #define IAVIStream_AddRef(p) ICOM_CALL (AddRef,p)
676 #define IAVIStream_Release(p) ICOM_CALL (Release,p)
677 /*** IAVIStream methods ***/
678 #define IAVIStream_Create(p,a,b) ICOM_CALL2(Create,p,a,b)
679 #define IAVIStream_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
680 #define IAVIStream_FindSample(p,a,b) ICOM_CALL2(FindSample,p,a,b)
681 #define IAVIStream_ReadFormat(p,a,b,c) ICOM_CALL3(ReadFormat,p,a,b,c)
682 #define IAVIStream_SetFormat(p,a,b,c) ICOM_CALL3(SetFormat,p,a,b,c)
683 #define IAVIStream_Read(p,a,b,c,d,e,f) ICOM_CALL6(Read,p,a,b,c,d,e,f)
684 #define IAVIStream_Write(p,a,b,c,d,e,f,g) ICOM_CALL7(Write,p,a,b,c,d,e,f,g)
685 #define IAVIStream_Delete(p,a,b) ICOM_CALL2(Delete,p,a,b)
686 #define IAVIStream_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
687 #define IAVIStream_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
688 #define IAVIStream_SetInfo(p,a,b) ICOM_CALL2(SetInfo,p,a,b)
690 HRESULT WINAPI AVIMakeCompressedStream(PAVISTREAM*ppsCompressed,PAVISTREAM ppsSource,AVICOMPRESSOPTIONS *lpOptions,CLSID*pclsidHandler);
692 HRESULT WINAPI AVIStreamInfoA(PAVISTREAM iface,AVISTREAMINFOA *asi,LONG size);
693 HRESULT WINAPI AVIStreamInfoW(PAVISTREAM iface,AVISTREAMINFOW *asi,LONG size);
694 #define AVIStreamInfo WINELIB_NAME_AW(AVIStreamInfo)
695 LPVOID WINAPI AVIStreamGetFrame(PGETFRAME pg,LONG pos);
696 HRESULT WINAPI AVIStreamGetFrameClose(PGETFRAME pg);
697 PGETFRAME WINAPI AVIStreamGetFrameOpen(PAVISTREAM pavi,LPBITMAPINFOHEADER lpbiWanted);
698 LONG WINAPI AVIStreamLength(PAVISTREAM iface);
699 HRESULT WINAPI AVIStreamRead(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,LONG *bytesread,LONG *samplesread);
700 HRESULT WINAPI AVIStreamReadData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG *lpread);
701 HRESULT WINAPI AVIStreamReadFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG *formatsize);
702 ULONG WINAPI AVIStreamRelease(PAVISTREAM iface);
703 HRESULT WINAPI AVIStreamSetFormat(PAVISTREAM iface,LONG pos,LPVOID format,LONG formatsize);
704 LONG WINAPI AVIStreamStart(PAVISTREAM iface);
705 HRESULT WINAPI AVIStreamWrite(PAVISTREAM iface,LONG start,LONG samples,LPVOID buffer,LONG buffersize,DWORD flags,LONG *sampwritten,LONG *byteswritten);
706 HRESULT WINAPI AVIStreamWriteData(PAVISTREAM iface,DWORD fcc,LPVOID lp,LONG size);
709 /*****************************************************************************
710 * IAVIFile interface
712 /* In Win32 this interface uses UNICODE only */
713 #define ICOM_INTERFACE IAVIFile
714 #define IAVIFile_METHODS \
715 ICOM_METHOD2(HRESULT,Info, AVIFILEINFOW*,pfi, LONG,lSize) \
716 ICOM_METHOD3(HRESULT,GetStream, PAVISTREAM*,ppStream, DWORD,fccType, LONG,lParam) \
717 ICOM_METHOD2(HRESULT,CreateStream, PAVISTREAM*,ppStream, AVISTREAMINFOW*,psi) \
718 ICOM_METHOD3(HRESULT,WriteData, DWORD,fcc, LPVOID,lpBuffer, LONG,cbBuffer) \
719 ICOM_METHOD3(HRESULT,ReadData, DWORD,fcc, LPVOID,lpBuffer, LONG*,lpcbBuffer) \
720 ICOM_METHOD (HRESULT,EndRecord) \
721 ICOM_METHOD2(HRESULT,DeleteStream, DWORD,fccType, LONG,lParam)
722 #define IAVIFile_IMETHODS \
723 IUnknown_IMETHODS \
724 IAVIFile_METHODS
725 ICOM_DEFINE(IAVIFile,IUnknown)
726 #undef ICOM_INTERFACE
728 /*** IUnknown methods ***/
729 #define IAVIFile_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
730 #define IAVIFile_AddRef(p) ICOM_CALL (AddRef,p)
731 #define IAVIFile_Release(p) ICOM_CALL (Release,p)
732 /*** IAVIFile methods ***/
733 #define IAVIFile_Info(p,a,b) ICOM_CALL2(Info,p,a,b)
734 #define IAVIFile_GetStream(p,a,b,c) ICOM_CALL3(GetStream,p,a,b,c)
735 #define IAVIFile_CreateStream(p,a,b) ICOM_CALL2(CreateStream,p,a,b)
736 #define IAVIFile_WriteData(p,a,b,c) ICOM_CALL3(WriteData,p,a,b,c)
737 #define IAVIFile_ReadData(p,a,b,c) ICOM_CALL3(ReadData,p,a,b,c)
738 #define IAVIFile_EndRecord(p) ICOM_CALL (EndRecord,p)
739 #define IAVIFile_DeleteStream(p,a,b) ICOM_CALL2(DeleteStream,p,a,b)
741 HRESULT WINAPI AVIFileCreateStreamA(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOA* psi);
742 HRESULT WINAPI AVIFileCreateStreamW(PAVIFILE pfile,PAVISTREAM* ppavi,AVISTREAMINFOW* psi);
743 #define AVIFileCreateStream WINELIB_NAME_AW(AVIFileCreateStream)
744 void WINAPI AVIFileExit(void);
745 HRESULT WINAPI AVIFileGetStream(PAVIFILE pfile,PAVISTREAM* avis,DWORD fccType,LONG lParam);
746 HRESULT WINAPI AVIFileInfoA(PAVIFILE pfile,PAVIFILEINFOA pfi,LONG lSize);
747 HRESULT WINAPI AVIFileInfoW(PAVIFILE pfile,PAVIFILEINFOW pfi,LONG lSize);
748 #define AVIFileInfo WINELIB_NAME_AW(AVIFileInfo)
749 void WINAPI AVIFileInit(void);
750 HRESULT WINAPI AVIFileOpenA(PAVIFILE* ppfile,LPCSTR szFile,UINT uMode,LPCLSID lpHandler);
751 HRESULT WINAPI AVIFileOpenW(PAVIFILE* ppfile,LPCWSTR szFile,UINT uMode,LPCLSID lpHandler);
752 #define AVIFileOpen WINELIB_NAME_AW(AVIFileOpen)
753 ULONG WINAPI AVIFileRelease(PAVIFILE iface);
756 /*****************************************************************************
757 * IGetFrame interface
759 #define ICOM_INTERFACE IGetFrame
760 #define IGetFrame_METHODS \
761 ICOM_METHOD1(LPVOID, GetFrame, LONG,lPos) \
762 ICOM_METHOD3(HRESULT,Begin, LONG,lStart, LONG,lEnd, LONG,lRate) \
763 ICOM_METHOD (HRESULT,End) \
764 ICOM_METHOD6(HRESULT,SetFormat, LPBITMAPINFOHEADER,lpbi, LPVOID,lpBits, INT,x, INT,y, INT,dx, INT,dy)
765 #define IGetFrame_IMETHODS \
766 IUnknown_IMETHODS \
767 IGetFrame_METHODS
768 ICOM_DEFINE(IGetFrame,IUnknown)
769 #undef ICOM_INTERFACE
771 /*** IUnknown methods ***/
772 #define IGetFrame_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
773 #define IGetFrame_AddRef(p) ICOM_CALL (AddRef,p)
774 #define IGetFrame_Release(p) ICOM_CALL (Release,p)
775 /*** IGetFrame methods ***/
776 #define IGetFrame_GetFrame(p,a) ICOM_CALL1(GetFrame,p,a)
777 #define IGetFrame_Begin(p,a,b,c) ICOM_CALL3(Begin,p,a,b,c)
778 #define IGetFrame_End(p) ICOM_CALL (End,p)
779 #define IGetFrame_SetFormat(p,a,b,c,d,e,f) ICOM_CALL6(SetFormat,p,a,b,c,d,e,f)
781 #define AVIERR_OK 0
782 #define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR,FACILITY_ITF,0x4000+error)
784 #define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
785 #define AVIERR_BADFORMAT MAKE_AVIERR(102)
786 #define AVIERR_MEMORY MAKE_AVIERR(103)
787 #define AVIERR_INTERNAL MAKE_AVIERR(104)
788 #define AVIERR_BADFLAGS MAKE_AVIERR(105)
789 #define AVIERR_BADPARAM MAKE_AVIERR(106)
790 #define AVIERR_BADSIZE MAKE_AVIERR(107)
791 #define AVIERR_BADHANDLE MAKE_AVIERR(108)
792 #define AVIERR_FILEREAD MAKE_AVIERR(109)
793 #define AVIERR_FILEWRITE MAKE_AVIERR(110)
794 #define AVIERR_FILEOPEN MAKE_AVIERR(111)
795 #define AVIERR_COMPRESSOR MAKE_AVIERR(112)
796 #define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
797 #define AVIERR_READONLY MAKE_AVIERR(114)
798 #define AVIERR_NODATA MAKE_AVIERR(115)
799 #define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
800 #define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
801 #define AVIERR_USERABORT MAKE_AVIERR(198)
802 #define AVIERR_ERROR MAKE_AVIERR(199)
805 #endif /* __WINE_VFW_H */