2 * Copyright 1998 Marcus Meissner
14 /****************************************************************************
15 * VideoForWindowsVersion [MSVFW32.2][MSVIDEO.2]
16 * Returns the version in major.minor form.
17 * In Windows95 this returns 0x040003b6 (4.950)
20 VideoForWindowsVersion(void) {
21 return 0x040003B6; /* 4.950 */
24 /* system.ini: [drivers32] */
26 /**************************************************************************
28 * Get information about an installable compressor. Return TRUE if there
33 DWORD fccType
, /* [in] type of compressor ('vidc') */
34 DWORD fccHandler
, /* [in] <n>th compressor */
35 ICINFO
*lpicinfo
/* [out] information about compressor */
37 char type
[5],buf
[2000];
39 memcpy(type
,&fccType
,4);type
[4]=0;
40 TRACE(msvideo
,"(%s,%ld,%p).\n",type
,fccHandler
,lpicinfo
);
41 /* does OpenDriver/CloseDriver */
42 lpicinfo
->dwSize
= sizeof(ICINFO
);
43 lpicinfo
->fccType
= fccType
;
44 lpicinfo
->dwFlags
= 0;
45 if (GetPrivateProfileStringA("drivers32",NULL
,NULL
,buf
,2000,"system.ini")) {
48 if (!lstrncmpiA(type
,s
,4)) {
50 lpicinfo
->fccHandler
= mmioStringToFOURCCA(s
+5,0);
54 s
=s
+lstrlenA(s
)+1; /* either next char or \0 */
60 /**************************************************************************
62 * Opens an installable compressor. Return special handle.
65 ICOpen(DWORD fccType
,DWORD fccHandler
,UINT wMode
) {
66 char type
[5],handler
[5],codecname
[20];
71 memcpy(type
,&fccType
,4);type
[4]=0;
72 memcpy(handler
,&fccHandler
,4);handler
[4]=0;
73 TRACE(msvideo
,"(%s,%s,0x%08lx)\n",type
,handler
,(DWORD
)wMode
);
74 sprintf(codecname
,"%s.%s",type
,handler
);
76 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
77 * same layout as ICOPEN
79 icopen
.fccType
= fccType
;
80 icopen
.fccHandler
= fccHandler
;
81 icopen
.dwSize
= sizeof(ICOPEN
);
82 icopen
.dwFlags
= wMode
;
83 /* FIXME: do we need to fill out the rest too? */
84 hdrv
=OpenDriverA(codecname
,"drivers32",(LPARAM
)&icopen
);
86 if (!strcasecmp(type
,"vids")) {
87 sprintf(codecname
,"vidc.%s",handler
);
88 fccType
= mmioFOURCC('v','i','d','c');
90 hdrv
=OpenDriverA(codecname
,"drivers32",(LPARAM
)&icopen
);
93 whic
= HeapAlloc(GetProcessHeap(),0,sizeof(WINE_HIC
));
96 whic
->driverproc
= GetProcAddress(GetDriverModuleHandle(hdrv
),"DriverProc");
97 whic
->private = whic
->driverproc(0,hdrv
,DRV_OPEN
,0,&icopen
);
103 ICGetInfo(HIC hic
,ICINFO
*picinfo
,DWORD cb
) {
106 TRACE(msvideo
,"(0x%08lx,%p,%ld)\n",(DWORD
)hic
,picinfo
,cb
);
107 ret
= ICSendMessage(hic
,ICM_GETINFO
,(DWORD
)picinfo
,cb
);
108 TRACE(msvideo
," -> 0x%08lx\n",ret
);
114 DWORD fccType
, DWORD fccHandler
, LPBITMAPINFOHEADER lpbiIn
,
115 LPBITMAPINFOHEADER lpbiOut
, WORD wMode
117 char type
[5],handler
[5];
122 case ICMODE_FASTCOMPRESS
:
123 case ICMODE_COMPRESS
:
124 querymsg
= ICM_COMPRESS_QUERY
;
126 case ICMODE_DECOMPRESS
:
127 case ICMODE_FASTDECOMPRESS
:
128 querymsg
= ICM_DECOMPRESS_QUERY
;
131 querymsg
= ICM_DRAW_QUERY
;
134 FIXME(msvideo
,"Unknown mode (%d)\n",wMode
);
138 /* Easy case: handler/type match, we just fire a query and return */
139 hic
= ICOpen(fccType
,fccHandler
,wMode
);
141 if (!ICSendMessage(hic
,querymsg
,(DWORD
)lpbiIn
,(DWORD
)lpbiOut
))
145 type
[4]='\0';memcpy(type
,&fccType
,4);
146 handler
[4]='\0';memcpy(handler
,&fccHandler
,4);
147 FIXME(msvideo
,"(%s,%s,%p,%p,0x%04x),unhandled!\n",type
,handler
,lpbiIn
,lpbiOut
,wMode
);
153 HIC hic
,DWORD dwFlags
,LPBITMAPINFOHEADER lpbiOutput
,LPVOID lpData
,
154 LPBITMAPINFOHEADER lpbiInput
,LPVOID lpBits
,LPDWORD lpckid
,
155 LPDWORD lpdwFlags
,LONG lFrameNum
,DWORD dwFrameSize
,DWORD dwQuality
,
156 LPBITMAPINFOHEADER lpbiPrev
,LPVOID lpPrev
160 iccmp
.dwFlags
= dwFlags
;
162 iccmp
.lpbiOutput
= lpbiOutput
;
163 iccmp
.lpOutput
= lpData
;
164 iccmp
.lpbiInput
= lpbiInput
;
165 iccmp
.lpInput
= lpBits
;
167 iccmp
.lpckid
= lpckid
;
168 iccmp
.lpdwFlags
= lpdwFlags
;
169 iccmp
.lFrameNum
= lFrameNum
;
170 iccmp
.dwFrameSize
= dwFrameSize
;
171 iccmp
.dwQuality
= dwQuality
;
172 iccmp
.lpbiPrev
= lpbiPrev
;
173 iccmp
.lpPrev
= lpPrev
;
174 return ICSendMessage(hic
,ICM_COMPRESS
,(LPARAM
)&iccmp
,sizeof(iccmp
));
178 ICDecompress(HIC hic
,DWORD dwFlags
,LPBITMAPINFOHEADER lpbiFormat
,LPVOID lpData
,LPBITMAPINFOHEADER lpbi
,LPVOID lpBits
) {
181 icd
.dwFlags
= dwFlags
;
182 icd
.lpbiInput
= lpbiFormat
;
183 icd
.lpInput
= lpData
;
185 icd
.lpbiOutput
= lpbi
;
186 icd
.lpOutput
= lpBits
;
188 icd.ckid = ??? ckid from AVI file? how do we get it? ;
190 return ICSendMessage(hic
,ICM_DECOMPRESS
,(LPARAM
)&icd
,sizeof(icd
));
194 ICSendMessage(HIC hic
,UINT msg
,DWORD lParam1
,DWORD lParam2
) {
196 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
198 #define XX(x) case x: TRACE(msvideo,"(0x%08lx,"#x",0x%08lx,0x%08lx)\n",(DWORD)hic,lParam1,lParam2);break;
203 XX(ICM_COMPRESS_FRAMES_INFO
)
204 XX(ICM_COMPRESS_GET_FORMAT
)
205 XX(ICM_COMPRESS_GET_SIZE
)
206 XX(ICM_COMPRESS_QUERY
)
207 XX(ICM_COMPRESS_BEGIN
)
210 XX(ICM_DECOMPRESS_GET_FORMAT
)
211 XX(ICM_DECOMPRESS_QUERY
)
212 XX(ICM_DECOMPRESS_BEGIN
)
214 XX(ICM_DECOMPRESS_END
)
215 XX(ICM_DECOMPRESS_SET_PALETTE
)
216 XX(ICM_DECOMPRESS_GET_PALETTE
)
219 XX(ICM_DRAW_GET_PALETTE
)
229 XX(ICM_DRAW_RENDERBUFFER
)
230 XX(ICM_DRAW_START_PLAY
)
231 XX(ICM_DRAW_STOP_PLAY
)
232 XX(ICM_DRAW_SUGGESTFORMAT
)
233 XX(ICM_DRAW_CHANGEPALETTE
)
234 XX(ICM_GETBUFFERSWANTED
)
235 XX(ICM_GETDEFAULTKEYFRAMERATE
)
236 XX(ICM_DECOMPRESSEX_BEGIN
)
237 XX(ICM_DECOMPRESSEX_QUERY
)
239 XX(ICM_DECOMPRESSEX_END
)
240 XX(ICM_SET_STATUS_PROC
)
242 FIXME(msvideo
,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx)\n",(DWORD
)hic
,(DWORD
)msg
,lParam1
,lParam2
);
244 ret
= SendDriverMessage(whic
->hdrv
,msg
,lParam1
,lParam2
);
245 /* ret = whic->driverproc(whic->private,whic->hdrv,msg,lParam1,lParam2);*/
246 TRACE(msvideo
," -> 0x%08lx\n",ret
);
250 DWORD VFWAPIV
ICDrawBegin(
252 DWORD dwFlags
,/* flags */
253 HPALETTE hpal
, /* palette to draw with */
254 HWND hwnd
, /* window to draw to */
255 HDC hdc
, /* HDC to draw to */
256 INT xDst
, /* destination rectangle */
260 LPBITMAPINFOHEADER lpbi
, /* format of frame to draw */
261 INT xSrc
, /* source rectangle */
265 DWORD dwRate
, /* frames/second = (dwRate/dwScale) */
270 LRESULT WINAPI
ICClose(HIC hic
) {
271 WINE_HIC
*whic
= (WINE_HIC
*)hic
;
272 TRACE(msvideo
,"(%d).\n",hic
);
273 /* FIXME: correct? */
274 CloseDriver(whic
->hdrv
,0,0);
275 HeapFree(GetProcessHeap(),0,whic
);
279 HANDLE
/* HDRAWDIB */ WINAPI
280 DrawDibOpen( void ) {
281 FIXME(msvideo
,"stub!\n");
284 HWND VFWAPIV
MCIWndCreate (HWND hwndParent
, HINSTANCE hInstance
,
285 DWORD dwStyle
,LPVOID szFile
)
286 { FIXME(msvideo
,"%x %x %lx %p\n",hwndParent
, hInstance
, dwStyle
, szFile
);
289 HWND VFWAPIV
MCIWndCreateA(HWND hwndParent
, HINSTANCE hInstance
,
290 DWORD dwStyle
,LPCSTR szFile
)
291 { FIXME(msvideo
,"%x %x %lx %s\n",hwndParent
, hInstance
, dwStyle
, szFile
);
294 HWND VFWAPIV
MCIWndCreateW(HWND hwndParent
, HINSTANCE hInstance
,
295 DWORD dwStyle
,LPCWSTR szFile
)
296 { FIXME(msvideo
,"%x %x %lx %s\n",hwndParent
, hInstance
, dwStyle
, debugstr_w(szFile
));