2 * Copyright 1998 Marcus Meissner
4 * Modified for use with MPlayer, detailed changelog at
5 * http://svn.mplayerhq.hu/mplayer/trunk/
17 #include "wine/winbase.h"
18 #include "wine/windef.h"
19 #include "wine/winuser.h"
21 #include "wine/winestring.h"
22 #include "wine/driver.h"
23 #include "wine/avifmt.h"
26 #define OpenDriverA DrvOpen
27 #define CloseDriver DrvClose
29 /***********************************************************************
30 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
31 * Returns the version in major.minor form.
32 * In Windows95 this returns 0x040003b6 (4.950)
34 long VFWAPI
VideoForWindowsVersion(void) {
35 return 0x040003B6; /* 4.950 */
38 /* system.ini: [drivers] */
40 /***********************************************************************
42 * Get information about an installable compressor. Return TRUE if there
47 long fccType
, /* [in] type of compressor ('vidc') */
48 long fccHandler
, /* [in] <n>th compressor */
49 ICINFO
*lpicinfo
/* [out] information about compressor */
51 /* does OpenDriver/CloseDriver */
52 lpicinfo
->dwSize
= sizeof(ICINFO
);
53 lpicinfo
->fccType
= fccType
;
54 lpicinfo
->dwFlags
= 0;
58 /***********************************************************************
60 * Opens an installable compressor. Return special handle.
63 //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
64 ICOpen(long filename
,long fccHandler
,unsigned int wMode
) {
69 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
70 * same layout as ICOPEN
72 icopen
.fccType
= 0x63646976; // "vidc" //fccType;
73 icopen
.fccHandler
= fccHandler
;
74 icopen
.dwSize
= sizeof(ICOPEN
);
75 icopen
.dwFlags
= wMode
;
76 icopen
.pV1Reserved
= (void*)filename
;
77 /* FIXME: do we need to fill out the rest too? */
78 hdrv
=OpenDriverA((long)&icopen
);
80 whic
= malloc(sizeof(WINE_HIC
));
82 whic
->driverproc
= ((DRVR
*)hdrv
)->DriverProc
;
83 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
84 whic
->driverid
= ((DRVR
*)hdrv
)->dwDriverID
;
88 /***********************************************************************
89 * ICGetInfo [MSVFW.30]
92 ICGetInfo(HIC hic
,ICINFO
*picinfo
,long cb
) {
95 ret
= ICSendMessage(hic
,ICM_GETINFO
,(long)picinfo
,cb
);
100 /***********************************************************************
101 * ICCompress [MSVFW.23]
105 HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiOutput
,void* lpData
,
106 LPBITMAPINFOHEADER lpbiInput
,void* lpBits
,long* lpckid
,
107 long* lpdwFlags
,long lFrameNum
,long dwFrameSize
,long dwQuality
,
108 LPBITMAPINFOHEADER lpbiPrev
,void* lpPrev
112 iccmp
.dwFlags
= dwFlags
;
114 iccmp
.lpbiOutput
= lpbiOutput
;
115 iccmp
.lpOutput
= lpData
;
116 iccmp
.lpbiInput
= lpbiInput
;
117 iccmp
.lpInput
= lpBits
;
119 iccmp
.lpckid
= lpckid
;
120 iccmp
.lpdwFlags
= lpdwFlags
;
121 iccmp
.lFrameNum
= lFrameNum
;
122 iccmp
.dwFrameSize
= dwFrameSize
;
123 iccmp
.dwQuality
= dwQuality
;
124 iccmp
.lpbiPrev
= lpbiPrev
;
125 iccmp
.lpPrev
= lpPrev
;
126 return ICSendMessage(hic
,ICM_COMPRESS
,(long)&iccmp
,sizeof(iccmp
));
129 /***********************************************************************
130 * ICDecompress [MSVFW.26]
133 ICDecompress(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
136 icd
.dwFlags
= dwFlags
;
137 icd
.lpbiInput
= lpbiFormat
;
138 icd
.lpInput
= lpData
;
140 icd
.lpbiOutput
= lpbi
;
141 icd
.lpOutput
= lpBits
;
143 result
=ICSendMessage(hic
,ICM_DECOMPRESS
,(long)&icd
,sizeof(icd
));
147 /***********************************************************************
148 * ICDecompressEx [MSVFW.26]
151 ICDecompressEx(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
155 icd
.dwFlags
= dwFlags
;
157 icd
.lpbiSrc
= lpbiFormat
;
164 icd
.dxSrc
=lpbiFormat
->biWidth
;
165 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
168 icd
.dxDst
=lpbi
->biWidth
;
169 icd
.dyDst
=abs(lpbi
->biHeight
);
172 result
=ICSendMessage(hic
,ICM_DECOMPRESSEX
,(long)&icd
,sizeof(icd
));
177 ICUniversalEx(HIC hic
,int command
,LPBITMAPINFOHEADER lpbiFormat
,LPBITMAPINFOHEADER lpbi
) {
183 icd
.lpbiSrc
= lpbiFormat
;
190 icd
.dxSrc
=lpbiFormat
->biWidth
;
191 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
194 icd
.dxDst
=lpbi
->biWidth
;
195 icd
.dyDst
=abs(lpbi
->biHeight
);
198 result
=ICSendMessage(hic
,command
,(long)&icd
,sizeof(icd
));
203 /***********************************************************************
204 * ICSendMessage [MSVFW.40]
207 ICSendMessage(HIC hic
,unsigned int msg
,long lParam1
,long lParam2
) {
208 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
209 return SendDriverMessage(whic
->hdrv
, msg
, lParam1
,lParam2
);
213 /***********************************************************************
216 LRESULT VFWAPI
ICClose(HIC hic
) {
217 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
218 /* FIXME: correct? */
219 // CloseDriver(whic->hdrv,0,0);
220 DrvClose(whic
->hdrv
);
221 //#warning FIXME: DrvClose
226 int VFWAPI
ICDoSomething()