2 * Copyright 1998 Marcus Meissner
13 #include "wine/winbase.h"
14 #include "wine/windef.h"
15 #include "wine/winuser.h"
17 #include "wine/winestring.h"
18 #include "wine/driver.h"
19 #include "wine/avifmt.h"
22 #define OpenDriverA DrvOpen
23 #define CloseDriver DrvClose
25 /***********************************************************************
26 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
27 * Returns the version in major.minor form.
28 * In Windows95 this returns 0x040003b6 (4.950)
30 long VFWAPI
VideoForWindowsVersion(void) {
31 return 0x040003B6; /* 4.950 */
34 /* system.ini: [drivers] */
36 /***********************************************************************
38 * Get information about an installable compressor. Return TRUE if there
43 long fccType
, /* [in] type of compressor ('vidc') */
44 long fccHandler
, /* [in] <n>th compressor */
45 ICINFO
*lpicinfo
/* [out] information about compressor */
47 /* does OpenDriver/CloseDriver */
48 lpicinfo
->dwSize
= sizeof(ICINFO
);
49 lpicinfo
->fccType
= fccType
;
50 lpicinfo
->dwFlags
= 0;
54 /***********************************************************************
56 * Opens an installable compressor. Return special handle.
59 //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
60 ICOpen(long filename
,long fccHandler
,unsigned int wMode
) {
65 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
66 * same layout as ICOPEN
68 icopen
.fccType
= 0x63646976; // "vidc" //fccType;
69 icopen
.fccHandler
= fccHandler
;
70 icopen
.dwSize
= sizeof(ICOPEN
);
71 icopen
.dwFlags
= wMode
;
72 icopen
.pV1Reserved
= (void*)filename
;
73 /* FIXME: do we need to fill out the rest too? */
74 hdrv
=OpenDriverA((long)&icopen
);
76 whic
= (WINE_HIC
*)malloc(sizeof(WINE_HIC
));
78 whic
->driverproc
= ((DRVR
*)hdrv
)->DriverProc
;
79 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
80 whic
->driverid
= ((DRVR
*)hdrv
)->dwDriverID
;
84 /***********************************************************************
85 * ICGetInfo [MSVFW.30]
88 ICGetInfo(HIC hic
,ICINFO
*picinfo
,long cb
) {
91 ret
= ICSendMessage(hic
,ICM_GETINFO
,(long)picinfo
,cb
);
96 /***********************************************************************
97 * ICCompress [MSVFW.23]
101 HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiOutput
,void* lpData
,
102 LPBITMAPINFOHEADER lpbiInput
,void* lpBits
,long* lpckid
,
103 long* lpdwFlags
,long lFrameNum
,long dwFrameSize
,long dwQuality
,
104 LPBITMAPINFOHEADER lpbiPrev
,void* lpPrev
108 iccmp
.dwFlags
= dwFlags
;
110 iccmp
.lpbiOutput
= lpbiOutput
;
111 iccmp
.lpOutput
= lpData
;
112 iccmp
.lpbiInput
= lpbiInput
;
113 iccmp
.lpInput
= lpBits
;
115 iccmp
.lpckid
= lpckid
;
116 iccmp
.lpdwFlags
= lpdwFlags
;
117 iccmp
.lFrameNum
= lFrameNum
;
118 iccmp
.dwFrameSize
= dwFrameSize
;
119 iccmp
.dwQuality
= dwQuality
;
120 iccmp
.lpbiPrev
= lpbiPrev
;
121 iccmp
.lpPrev
= lpPrev
;
122 return ICSendMessage(hic
,ICM_COMPRESS
,(long)&iccmp
,sizeof(iccmp
));
125 /***********************************************************************
126 * ICDecompress [MSVFW.26]
129 ICDecompress(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
132 icd
.dwFlags
= dwFlags
;
133 icd
.lpbiInput
= lpbiFormat
;
134 icd
.lpInput
= lpData
;
136 icd
.lpbiOutput
= lpbi
;
137 icd
.lpOutput
= lpBits
;
139 result
=ICSendMessage(hic
,ICM_DECOMPRESS
,(long)&icd
,sizeof(icd
));
143 /***********************************************************************
144 * ICDecompressEx [MSVFW.26]
147 ICDecompressEx(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
151 icd
.dwFlags
= dwFlags
;
153 icd
.lpbiSrc
= lpbiFormat
;
160 icd
.dxSrc
=lpbiFormat
->biWidth
;
161 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
164 icd
.dxDst
=lpbi
->biWidth
;
165 icd
.dyDst
=abs(lpbi
->biHeight
);
168 result
=ICSendMessage(hic
,ICM_DECOMPRESSEX
,(long)&icd
,sizeof(icd
));
173 ICUniversalEx(HIC hic
,int command
,LPBITMAPINFOHEADER lpbiFormat
,LPBITMAPINFOHEADER lpbi
) {
179 icd
.lpbiSrc
= lpbiFormat
;
186 icd
.dxSrc
=lpbiFormat
->biWidth
;
187 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
190 icd
.dxDst
=lpbi
->biWidth
;
191 icd
.dyDst
=abs(lpbi
->biHeight
);
194 result
=ICSendMessage(hic
,command
,(long)&icd
,sizeof(icd
));
199 /***********************************************************************
200 * ICSendMessage [MSVFW.40]
203 ICSendMessage(HIC hic
,unsigned int msg
,long lParam1
,long lParam2
) {
204 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
205 return SendDriverMessage(whic
->hdrv
, msg
, lParam1
,lParam2
);
209 /***********************************************************************
212 LRESULT VFWAPI
ICClose(HIC hic
) {
213 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
214 /* FIXME: correct? */
215 // CloseDriver(whic->hdrv,0,0);
216 DrvClose(whic
->hdrv
);
217 //#warning FIXME: DrvClose
222 int VFWAPI
ICDoSomething()