7 #include "wine/obj_base.h"
11 #define VFWAPIV WINAPIV
13 DWORD VFWAPI
VideoForWindowsVersion(void);
16 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
17 ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
18 ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
22 #define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
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: */
42 DWORD handler
; /* 0C: */
44 DWORD
private; /* 14:(handled by SendDriverMessage)*/
45 FARPROC driverproc
; /* 18:(handled by SendDriverMessage)*/
46 DWORD x1
; /* 1c: name? */
52 /* error return codes */
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
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)
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)
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: */
164 #define ICCOMPRESS_KEYFRAME 0x00000001L
168 LPBITMAPINFOHEADER lpbiOutput
;
170 LPBITMAPINFOHEADER lpbiInput
;
177 LPBITMAPINFOHEADER lpbiPrev
;
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) \
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) \
198 hic, ICM_COMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
199 (DWORD)(LPVOID)(lpbiOutput) \
202 #define ICCompressGetSize(hic, lpbiInput, lpbiOutput) \
204 hic, ICM_COMPRESS_GET_SIZE, (DWORD)(LPVOID)(lpbiInput), \
205 (DWORD)(LPVOID)(lpbiOutput) \
208 #define ICCompressQuery(hic, lpbiInput, lpbiOutput) \
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
221 LPBITMAPINFOHEADER lpbiOutput
;
223 LPBITMAPINFOHEADER lpbiInput
;
232 DWORD dwOverheadPerFrame
;
234 LONG (CALLBACK
*GetData
)(LPARAM lInput
,LONG lFrame
,LPVOID lpBits
,LONG len
);
235 LONG (CALLBACK
*PutData
)(LPARAM lOutput
,LONG lFrame
,LPVOID lpBits
,LONG len
);
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
247 #define ICQUALITY_LOW 0
248 #define ICQUALITY_HIGH 10000
249 #define ICQUALITY_DEFAULT -1
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*/
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 */
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)
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 */
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 */
310 DWORD ckid
; /* ckid from AVI file */
315 LPBITMAPINFOHEADER lpbiSrc
;
317 LPBITMAPINFOHEADER lpbiDst
;
320 /* changed for ICM_DECOMPRESSEX */
321 INT xDst
; /* destination rectangle */
326 INT xSrc
; /* source rectangle */
332 DWORD VFWAPIV
ICDecompress(HIC hic
,DWORD dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,LPVOID lpData
,LPBITMAPINFOHEADER lpbi
,LPVOID lpBits
);
335 #define ICDecompressBegin(hic, lpbiInput, lpbiOutput) \
337 hic, ICM_DECOMPRESS_BEGIN, (DWORD)(LPVOID)(lpbiInput), \
338 (DWORD)(LPVOID)(lpbiOutput) \
341 #define ICDecompressQuery(hic, lpbiInput, lpbiOutput) \
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) \
358 hic, ICM_DECOMPRESS_GET_PALETTE, (DWORD)(LPVOID)(lpbiInput), \
359 (DWORD)(LPVOID)(lpbiOutput) \
362 #define ICDecompressSetPalette(hic,lpbiPalette) \
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(
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 */
394 LPBITMAPINFOHEADER lpbi
, /* format of frame to draw */
395 INT xSrc
, /* source rectangle */
399 DWORD dwRate
, /* frames/second = (dwRate/dwScale) */
403 /* as passed to ICM_DRAW_BEGIN (FIXME: correct only for Win32?) */
413 LPBITMAPINFOHEADER lpbi
;
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 */
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
;
471 DWORD dwInitialFrames
;
473 DWORD dwSuggestedBufferSize
;
479 /* AVIStreamHeader.dwFlags */
480 #define AVISF_DISABLED 0x00000001
481 #define AVISF_VIDEO_PALCHANGES 0x00010000
486 DWORD dwFlags
; /* AVISF_* */
489 DWORD dwInitialFrames
;
491 DWORD dwRate
; /* dwRate / dwScale == samples/second */
493 DWORD dwLength
; /* In units above... */
494 DWORD dwSuggestedBufferSize
;
497 RECT16 rcFrame
; /* word.word - word.word in file */
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
{
514 typedef struct _AVIPALCHANGE
{
517 WORD wFlags
; /* pad */
518 PALETTEENTRY peNew
[1];
521 #define AVIIF_KEYFRAME 0x00000010 /* this frame is a key frame. */
523 #define AVIGETFRAMEF_BESTDISPLAYFMT 1
525 typedef struct _AVISTREAMINFOA
{
528 DWORD dwFlags
; /* AVIIF_* */
533 DWORD dwRate
; /* dwRate / dwScale == samples/second */
535 DWORD dwLength
; /* In units above... */
536 DWORD dwInitialFrames
;
537 DWORD dwSuggestedBufferSize
;
542 DWORD dwFormatChangeCount
;
544 } AVISTREAMINFOA
, * LPAVISTREAMINFOA
, *PAVISTREAMINFOA
;
546 typedef struct _AVISTREAMINFOW
{
554 DWORD dwRate
; /* dwRate / dwScale == samples/second */
556 DWORD dwLength
; /* In units above... */
557 DWORD dwInitialFrames
;
558 DWORD dwSuggestedBufferSize
;
563 DWORD dwFormatChangeCount
;
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
;
591 DWORD dwSuggestedBufferSize
;
598 WCHAR szFileType
[64];
599 } AVIFILEINFOW
, * LPAVIFILEINFOW
, *PAVIFILEINFOW
;
600 typedef struct _AVIFILEINFOA
{
601 DWORD dwMaxBytesPerSec
;
605 DWORD dwSuggestedBufferSize
;
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
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 */
633 LPVOID lpParms
; /* compressor options */
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 \
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 /*****************************************************************************
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 \
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 \
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)
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 */