2 * Copyright 1998 Marcus Meissner
4 * Modified for use with MPlayer, detailed changelog at
5 * http://svn.mplayerhq.hu/mplayer/trunk/
18 #include "wine/winbase.h"
19 #include "wine/windef.h"
20 #include "wine/winuser.h"
22 #include "wine/winestring.h"
23 #include "wine/driver.h"
24 #include "wine/avifmt.h"
27 #define OpenDriverA DrvOpen
28 #define CloseDriver DrvClose
30 /***********************************************************************
31 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
32 * Returns the version in major.minor form.
33 * In Windows95 this returns 0x040003b6 (4.950)
35 long VFWAPI
VideoForWindowsVersion(void) {
36 return 0x040003B6; /* 4.950 */
39 /* system.ini: [drivers] */
41 /***********************************************************************
43 * Get information about an installable compressor. Return TRUE if there
48 long fccType
, /* [in] type of compressor ('vidc') */
49 long fccHandler
, /* [in] <n>th compressor */
50 ICINFO
*lpicinfo
/* [out] information about compressor */
52 /* does OpenDriver/CloseDriver */
53 lpicinfo
->dwSize
= sizeof(ICINFO
);
54 lpicinfo
->fccType
= fccType
;
55 lpicinfo
->dwFlags
= 0;
59 /***********************************************************************
61 * Opens an installable compressor. Return special handle.
64 //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
65 ICOpen(long filename
,long fccHandler
,unsigned int wMode
) {
70 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
71 * same layout as ICOPEN
73 icopen
.fccType
= 0x63646976; // "vidc" //fccType;
74 icopen
.fccHandler
= fccHandler
;
75 icopen
.dwSize
= sizeof(ICOPEN
);
76 icopen
.dwFlags
= wMode
;
77 icopen
.pV1Reserved
= (void*)filename
;
78 /* FIXME: do we need to fill out the rest too? */
79 hdrv
=OpenDriverA((long)&icopen
);
81 whic
= malloc(sizeof(WINE_HIC
));
83 whic
->driverproc
= ((DRVR
*)hdrv
)->DriverProc
;
84 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
85 whic
->driverid
= ((DRVR
*)hdrv
)->dwDriverID
;
89 /***********************************************************************
90 * ICGetInfo [MSVFW.30]
93 ICGetInfo(HIC hic
,ICINFO
*picinfo
,long cb
) {
96 ret
= ICSendMessage(hic
,ICM_GETINFO
,(long)picinfo
,cb
);
101 /***********************************************************************
102 * ICCompress [MSVFW.23]
106 HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiOutput
,void* lpData
,
107 LPBITMAPINFOHEADER lpbiInput
,void* lpBits
,long* lpckid
,
108 long* lpdwFlags
,long lFrameNum
,long dwFrameSize
,long dwQuality
,
109 LPBITMAPINFOHEADER lpbiPrev
,void* lpPrev
113 iccmp
.dwFlags
= dwFlags
;
115 iccmp
.lpbiOutput
= lpbiOutput
;
116 iccmp
.lpOutput
= lpData
;
117 iccmp
.lpbiInput
= lpbiInput
;
118 iccmp
.lpInput
= lpBits
;
120 iccmp
.lpckid
= lpckid
;
121 iccmp
.lpdwFlags
= lpdwFlags
;
122 iccmp
.lFrameNum
= lFrameNum
;
123 iccmp
.dwFrameSize
= dwFrameSize
;
124 iccmp
.dwQuality
= dwQuality
;
125 iccmp
.lpbiPrev
= lpbiPrev
;
126 iccmp
.lpPrev
= lpPrev
;
127 return ICSendMessage(hic
,ICM_COMPRESS
,(long)&iccmp
,sizeof(iccmp
));
130 /***********************************************************************
131 * ICDecompress [MSVFW.26]
134 ICDecompress(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
137 icd
.dwFlags
= dwFlags
;
138 icd
.lpbiInput
= lpbiFormat
;
139 icd
.lpInput
= lpData
;
141 icd
.lpbiOutput
= lpbi
;
142 icd
.lpOutput
= lpBits
;
144 result
=ICSendMessage(hic
,ICM_DECOMPRESS
,(long)&icd
,sizeof(icd
));
148 /***********************************************************************
149 * ICDecompressEx [MSVFW.26]
152 ICDecompressEx(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
156 icd
.dwFlags
= dwFlags
;
158 icd
.lpbiSrc
= lpbiFormat
;
165 icd
.dxSrc
=lpbiFormat
->biWidth
;
166 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
169 icd
.dxDst
=lpbi
->biWidth
;
170 icd
.dyDst
=abs(lpbi
->biHeight
);
173 result
=ICSendMessage(hic
,ICM_DECOMPRESSEX
,(long)&icd
,sizeof(icd
));
178 ICUniversalEx(HIC hic
,int command
,LPBITMAPINFOHEADER lpbiFormat
,LPBITMAPINFOHEADER lpbi
) {
184 icd
.lpbiSrc
= lpbiFormat
;
191 icd
.dxSrc
=lpbiFormat
->biWidth
;
192 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
195 icd
.dxDst
=lpbi
->biWidth
;
196 icd
.dyDst
=abs(lpbi
->biHeight
);
199 result
=ICSendMessage(hic
,command
,(long)&icd
,sizeof(icd
));
204 /***********************************************************************
205 * ICSendMessage [MSVFW.40]
208 ICSendMessage(HIC hic
,unsigned int msg
,long lParam1
,long lParam2
) {
209 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
210 return SendDriverMessage(whic
->hdrv
, msg
, lParam1
,lParam2
);
214 /***********************************************************************
217 LRESULT VFWAPI
ICClose(HIC hic
) {
218 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
219 /* FIXME: correct? */
220 // CloseDriver(whic->hdrv,0,0);
221 DrvClose(whic
->hdrv
);
222 //#warning FIXME: DrvClose
227 int VFWAPI
ICDoSomething()