4 * Copyright 1998 Marcus Meissner
6 * Modified for use with MPlayer, detailed CVS changelog at
7 * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
9 * File now distributed as part of VLC media player with no modifications.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
34 #include "wine/winbase.h"
35 #include "wine/windef.h"
36 #include "wine/winuser.h"
38 #include "wine/winestring.h"
39 #include "wine/driver.h"
40 #include "wine/avifmt.h"
43 #define OpenDriverA DrvOpen
44 #define CloseDriver DrvClose
46 /***********************************************************************
47 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
48 * Returns the version in major.minor form.
49 * In Windows95 this returns 0x040003b6 (4.950)
51 long VFWAPI
VideoForWindowsVersion(void) {
52 return 0x040003B6; /* 4.950 */
55 /* system.ini: [drivers] */
57 /***********************************************************************
59 * Get information about an installable compressor. Return TRUE if there
64 long fccType
, /* [in] type of compressor ('vidc') */
65 long fccHandler
, /* [in] <n>th compressor */
66 ICINFO
*lpicinfo
/* [out] information about compressor */
68 /* does OpenDriver/CloseDriver */
69 lpicinfo
->dwSize
= sizeof(ICINFO
);
70 lpicinfo
->fccType
= fccType
;
71 lpicinfo
->dwFlags
= 0;
75 /***********************************************************************
77 * Opens an installable compressor. Return special handle.
80 //ICOpen(long fccType,long fccHandler,unsigned int wMode) {
81 ICOpen(long filename
,long fccHandler
,unsigned int wMode
) {
86 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
87 * same layout as ICOPEN
89 icopen
.fccType
= 0x63646976; // "vidc" //fccType;
90 icopen
.fccHandler
= fccHandler
;
91 icopen
.dwSize
= sizeof(ICOPEN
);
92 icopen
.dwFlags
= wMode
;
93 icopen
.pV1Reserved
= (void*)filename
;
94 /* FIXME: do we need to fill out the rest too? */
95 hdrv
=OpenDriverA((long)&icopen
);
97 whic
= (WINE_HIC
*)malloc(sizeof(WINE_HIC
));
99 whic
->driverproc
= ((DRVR
*)hdrv
)->DriverProc
;
100 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
101 whic
->driverid
= ((DRVR
*)hdrv
)->dwDriverID
;
105 /***********************************************************************
106 * ICGetInfo [MSVFW.30]
109 ICGetInfo(HIC hic
,ICINFO
*picinfo
,long cb
) {
112 ret
= ICSendMessage(hic
,ICM_GETINFO
,(long)picinfo
,cb
);
117 /***********************************************************************
118 * ICCompress [MSVFW.23]
122 HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiOutput
,void* lpData
,
123 LPBITMAPINFOHEADER lpbiInput
,void* lpBits
,long* lpckid
,
124 long* lpdwFlags
,long lFrameNum
,long dwFrameSize
,long dwQuality
,
125 LPBITMAPINFOHEADER lpbiPrev
,void* lpPrev
129 iccmp
.dwFlags
= dwFlags
;
131 iccmp
.lpbiOutput
= lpbiOutput
;
132 iccmp
.lpOutput
= lpData
;
133 iccmp
.lpbiInput
= lpbiInput
;
134 iccmp
.lpInput
= lpBits
;
136 iccmp
.lpckid
= lpckid
;
137 iccmp
.lpdwFlags
= lpdwFlags
;
138 iccmp
.lFrameNum
= lFrameNum
;
139 iccmp
.dwFrameSize
= dwFrameSize
;
140 iccmp
.dwQuality
= dwQuality
;
141 iccmp
.lpbiPrev
= lpbiPrev
;
142 iccmp
.lpPrev
= lpPrev
;
143 return ICSendMessage(hic
,ICM_COMPRESS
,(long)&iccmp
,sizeof(iccmp
));
146 /***********************************************************************
147 * ICDecompress [MSVFW.26]
150 ICDecompress(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
153 icd
.dwFlags
= dwFlags
;
154 icd
.lpbiInput
= lpbiFormat
;
155 icd
.lpInput
= lpData
;
157 icd
.lpbiOutput
= lpbi
;
158 icd
.lpOutput
= lpBits
;
160 result
=ICSendMessage(hic
,ICM_DECOMPRESS
,(long)&icd
,sizeof(icd
));
164 /***********************************************************************
165 * ICDecompressEx [MSVFW.26]
168 ICDecompressEx(HIC hic
,long dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,void* lpData
,LPBITMAPINFOHEADER lpbi
,void* lpBits
) {
172 icd
.dwFlags
= dwFlags
;
174 icd
.lpbiSrc
= lpbiFormat
;
181 icd
.dxSrc
=lpbiFormat
->biWidth
;
182 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
185 icd
.dxDst
=lpbi
->biWidth
;
186 icd
.dyDst
=abs(lpbi
->biHeight
);
189 result
=ICSendMessage(hic
,ICM_DECOMPRESSEX
,(long)&icd
,sizeof(icd
));
194 ICUniversalEx(HIC hic
,int command
,LPBITMAPINFOHEADER lpbiFormat
,LPBITMAPINFOHEADER lpbi
) {
200 icd
.lpbiSrc
= lpbiFormat
;
207 icd
.dxSrc
=lpbiFormat
->biWidth
;
208 icd
.dySrc
=abs(lpbiFormat
->biHeight
);
211 icd
.dxDst
=lpbi
->biWidth
;
212 icd
.dyDst
=abs(lpbi
->biHeight
);
215 result
=ICSendMessage(hic
,command
,(long)&icd
,sizeof(icd
));
220 /***********************************************************************
221 * ICSendMessage [MSVFW.40]
224 ICSendMessage(HIC hic
,unsigned int msg
,long lParam1
,long lParam2
) {
225 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
226 return SendDriverMessage(whic
->hdrv
, msg
, lParam1
,lParam2
);
230 /***********************************************************************
233 LRESULT VFWAPI
ICClose(HIC hic
) {
234 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
235 /* FIXME: correct? */
236 // CloseDriver(whic->hdrv,0,0);
237 DrvClose(whic
->hdrv
);
238 //#warning FIXME: DrvClose
243 int VFWAPI
ICDoSomething()