1 | /* $Id: msvfw32.cpp,v 1.2 1999-09-18 15:57:30 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * Copyright 1998 Marcus Meissner
|
---|
4 | * Copyright 1999 Jens Wiessner
|
---|
5 | */
|
---|
6 |
|
---|
7 | #include <stdlib.h>
|
---|
8 | #include <string.h>
|
---|
9 | #include <odin.h>
|
---|
10 |
|
---|
11 | #define ICOM_CINTERFACE 1
|
---|
12 | #define strcasecmp strcmp
|
---|
13 |
|
---|
14 | #include "winerror.h"
|
---|
15 | #include "heap.h"
|
---|
16 | #include "resource.h"
|
---|
17 | #include "win.h"
|
---|
18 | #include "commdlg.h"
|
---|
19 | #include "spy.h"
|
---|
20 |
|
---|
21 | #include "wine/obj_base.h"
|
---|
22 | #include "wingdi.h"
|
---|
23 | #include "vfw.h"
|
---|
24 | #include "driver.h"
|
---|
25 | #include "msvfw32.h"
|
---|
26 |
|
---|
27 | #include "debugtools.h"
|
---|
28 | #include <debugstr.h>
|
---|
29 |
|
---|
30 |
|
---|
31 | // DEFAULT_DEBUG_CHANNEL(msvideo)
|
---|
32 |
|
---|
33 |
|
---|
34 | /****************************************************************************
|
---|
35 | * VideoForWindowsVersion [MSVFW.2]
|
---|
36 | * Returns the version in major.minor form.
|
---|
37 | * In Windows95 this returns 0x040003b6 (4.950)
|
---|
38 | */
|
---|
39 | DWORD WINAPI VideoForWindowsVersion(void)
|
---|
40 | {
|
---|
41 | return 0x040003B6; /* 4.950 */
|
---|
42 | }
|
---|
43 |
|
---|
44 | /* system.ini: [drivers] */
|
---|
45 |
|
---|
46 |
|
---|
47 | /****************************************************************************
|
---|
48 | * DrawDibBegin [MSVFW.3]
|
---|
49 | */
|
---|
50 | BOOL VFWAPI DrawDibBegin(HANDLE /*HDRAWDIB*/ hdd,
|
---|
51 | HDC hdc,
|
---|
52 | INT dxDst,
|
---|
53 | INT dyDst,
|
---|
54 | LPBITMAPINFOHEADER lpbi,
|
---|
55 | INT dxSrc,
|
---|
56 | INT dySrc,
|
---|
57 | UINT wFlags)
|
---|
58 | {
|
---|
59 | return TRUE;
|
---|
60 | }
|
---|
61 |
|
---|
62 |
|
---|
63 | /****************************************************************************
|
---|
64 | * DrawDibChangePalette [MSVFW.4]
|
---|
65 | */
|
---|
66 |
|
---|
67 | BOOL VFWAPI DrawDibChangePalette(HANDLE /*HDRAWDIB*/ hdd, int iStart, int iLen, LPPALETTEENTRY lppe)
|
---|
68 | {
|
---|
69 | return TRUE;
|
---|
70 | }
|
---|
71 |
|
---|
72 |
|
---|
73 | /****************************************************************************
|
---|
74 | * DrawDibClose [MSVFW.5]
|
---|
75 | */
|
---|
76 | BOOL WINAPI DrawDibClose( HANDLE /*HDRAWDIB*/ hDib )
|
---|
77 | {
|
---|
78 | return TRUE;
|
---|
79 | }
|
---|
80 |
|
---|
81 |
|
---|
82 | /****************************************************************************
|
---|
83 | * DrawDibDraw [MSVFW.6]
|
---|
84 | */
|
---|
85 | BOOL VFWAPI DrawDibDraw(HANDLE /*HDRAWDIB*/ hdd,
|
---|
86 | HDC hdc,
|
---|
87 | int xDst,
|
---|
88 | int yDst,
|
---|
89 | int dxDst,
|
---|
90 | int dyDst,
|
---|
91 | LPBITMAPINFOHEADER lpbi,
|
---|
92 | LPVOID lpBits,
|
---|
93 | int xSrc,
|
---|
94 | int ySrc,
|
---|
95 | int dxSrc,
|
---|
96 | int dySrc,
|
---|
97 | UINT wFlags)
|
---|
98 | {
|
---|
99 | return TRUE;
|
---|
100 | }
|
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 | /****************************************************************************
|
---|
105 | * DrawDibEnd [MSVFW.7]
|
---|
106 | */
|
---|
107 | BOOL VFWAPI DrawDibEnd(HANDLE /*HDRAWDIB*/ hdd)
|
---|
108 | {
|
---|
109 | return TRUE;
|
---|
110 | }
|
---|
111 |
|
---|
112 |
|
---|
113 | /****************************************************************************
|
---|
114 | * DrawDibGetBuffer [MSVFW.8]
|
---|
115 | */
|
---|
116 | LPVOID VFWAPI DrawDibGetBuffer(HANDLE /*HDRAWDIB*/ hdd, LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags)
|
---|
117 | {
|
---|
118 | return 0;
|
---|
119 | }
|
---|
120 |
|
---|
121 |
|
---|
122 | /****************************************************************************
|
---|
123 | * DrawDibGetPalette [MSVFW.9]
|
---|
124 | */
|
---|
125 | HPALETTE VFWAPI DrawDibGetPalette(HANDLE /*HDRAWDIB*/ hdd)
|
---|
126 | {
|
---|
127 | return TRUE;
|
---|
128 | }
|
---|
129 |
|
---|
130 |
|
---|
131 | /****************************************************************************
|
---|
132 | * DrawDibOpen [MSVFW.10]
|
---|
133 | */
|
---|
134 | HANDLE /* HDRAWDIB */ WINAPI DrawDibOpen( void )
|
---|
135 | {
|
---|
136 | return 0xdead;
|
---|
137 | }
|
---|
138 |
|
---|
139 |
|
---|
140 | /****************************************************************************
|
---|
141 | * DrawDibProfileDisplay [MSVFW.11]
|
---|
142 | */
|
---|
143 | DWORD VFWAPI DrawDibProfileDisplay(LPBITMAPINFOHEADER lpbi)
|
---|
144 | {
|
---|
145 | return TRUE;
|
---|
146 | }
|
---|
147 |
|
---|
148 |
|
---|
149 |
|
---|
150 | /****************************************************************************
|
---|
151 | * DrawDibRealize [MSVFW.12]
|
---|
152 | */
|
---|
153 | UINT VFWAPI DrawDibRealize(HANDLE /*HDRAWDIB*/ hdd, HDC hdc, BOOL fBackground)
|
---|
154 | {
|
---|
155 | return 0;
|
---|
156 | }
|
---|
157 |
|
---|
158 |
|
---|
159 | /****************************************************************************
|
---|
160 | * DrawDibSetPalette [MSVFW.13]
|
---|
161 | */
|
---|
162 | BOOL VFWAPI DrawDibSetPalette(HANDLE /*HDRAWDIB*/ hdd, HPALETTE hpal)
|
---|
163 | {
|
---|
164 | return TRUE;
|
---|
165 | }
|
---|
166 |
|
---|
167 |
|
---|
168 | /****************************************************************************
|
---|
169 | * DrawDibStart [MSVFW.14]
|
---|
170 | */
|
---|
171 | BOOL VFWAPI DrawDibStart(HANDLE /*HDRAWDIB*/ hdd, DWORD rate)
|
---|
172 | {
|
---|
173 | return TRUE;
|
---|
174 | }
|
---|
175 |
|
---|
176 |
|
---|
177 | /****************************************************************************
|
---|
178 | * DrawDibStop [MSVFW.15]
|
---|
179 | */
|
---|
180 | BOOL VFWAPI DrawDibStop(HANDLE /*HDRAWDIB*/ hdd)
|
---|
181 | {
|
---|
182 | return TRUE;
|
---|
183 | }
|
---|
184 |
|
---|
185 |
|
---|
186 |
|
---|
187 | /****************************************************************************
|
---|
188 | * DrawDibTime [MSVFW.16]
|
---|
189 | */
|
---|
190 | BOOL VFWAPI DrawDibTime(HANDLE /*HDRAWDIB*/ hdd, LPDRAWDIBTIME lpddtime)
|
---|
191 | {
|
---|
192 | return TRUE;
|
---|
193 | }
|
---|
194 |
|
---|
195 |
|
---|
196 |
|
---|
197 | /****************************************************************************
|
---|
198 | * GetOpenFileNamePreview [MSVFW.17]
|
---|
199 | */
|
---|
200 |
|
---|
201 | /* NO */
|
---|
202 |
|
---|
203 |
|
---|
204 | /****************************************************************************
|
---|
205 | * GetOpenFileNamePreviewA [MSVFW.18]
|
---|
206 | */
|
---|
207 | BOOL VFWAPI GetOpenFileNamePreviewA(LPOPENFILENAMEA lpofn)
|
---|
208 | {
|
---|
209 | return TRUE;
|
---|
210 | }
|
---|
211 |
|
---|
212 |
|
---|
213 | /****************************************************************************
|
---|
214 | * GetOpenFileNamePreviewW [MSVFW.19]
|
---|
215 | */
|
---|
216 | BOOL VFWAPI GetOpenFileNamePreviewW(LPOPENFILENAMEW lpofn)
|
---|
217 | {
|
---|
218 | return TRUE;
|
---|
219 | }
|
---|
220 |
|
---|
221 |
|
---|
222 | /****************************************************************************
|
---|
223 | * GetSaveFileNamePreviewA [MSVFW.20]
|
---|
224 | */
|
---|
225 | BOOL VFWAPI GetSaveFileNamePreviewA(LPOPENFILENAMEA lpofn)
|
---|
226 | {
|
---|
227 | return TRUE;
|
---|
228 | }
|
---|
229 |
|
---|
230 |
|
---|
231 | /****************************************************************************
|
---|
232 | * GetSaveFileNamePreviewW [MSVFW.21]
|
---|
233 | */
|
---|
234 | BOOL VFWAPI GetSaveFileNamePreviewW(LPOPENFILENAMEW lpofn)
|
---|
235 | {
|
---|
236 | return TRUE;
|
---|
237 | }
|
---|
238 |
|
---|
239 |
|
---|
240 | /****************************************************************************
|
---|
241 | * ICClose [MSVFW.22]
|
---|
242 | */
|
---|
243 | LRESULT WINAPI ICClose(HIC hic)
|
---|
244 | {
|
---|
245 | WINE_HIC *whic = (WINE_HIC*)hic;
|
---|
246 | /* FIXME: correct? */
|
---|
247 | CloseDriver(whic->hdrv,0,0);
|
---|
248 | HeapFree(GetProcessHeap(),0,whic);
|
---|
249 | return 0;
|
---|
250 | }
|
---|
251 |
|
---|
252 |
|
---|
253 | /****************************************************************************
|
---|
254 | * ICCompress [MSVFW.23]
|
---|
255 | */
|
---|
256 | DWORD VFWAPIV ICCompress(
|
---|
257 | HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
|
---|
258 | LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
|
---|
259 | LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
|
---|
260 | LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev)
|
---|
261 | {
|
---|
262 | ICCOMPRESS iccmp;
|
---|
263 |
|
---|
264 | iccmp.dwFlags = dwFlags;
|
---|
265 |
|
---|
266 | iccmp.lpbiOutput = lpbiOutput;
|
---|
267 | iccmp.lpOutput = lpData;
|
---|
268 | iccmp.lpbiInput = lpbiInput;
|
---|
269 | iccmp.lpInput = lpBits;
|
---|
270 |
|
---|
271 | iccmp.lpckid = lpckid;
|
---|
272 | iccmp.lpdwFlags = lpdwFlags;
|
---|
273 | iccmp.lFrameNum = lFrameNum;
|
---|
274 | iccmp.dwFrameSize = dwFrameSize;
|
---|
275 | iccmp.dwQuality = dwQuality;
|
---|
276 | iccmp.lpbiPrev = lpbiPrev;
|
---|
277 | iccmp.lpPrev = lpPrev;
|
---|
278 | return ICSendMessage(hic,ICM_COMPRESS,(LPARAM)&iccmp,sizeof(iccmp));
|
---|
279 | }
|
---|
280 |
|
---|
281 |
|
---|
282 | /****************************************************************************
|
---|
283 | * ICCompressorChoose [MSVFW.24]
|
---|
284 | */
|
---|
285 | BOOL VFWAPI ICCompressorChoose(
|
---|
286 | HWND hwnd, // parent window for dialog
|
---|
287 | UINT uiFlags, // flags
|
---|
288 | LPVOID pvIn, // input format (optional)
|
---|
289 | LPVOID lpData, // input data (optional)
|
---|
290 | PCOMPVARS pc, // data about the compressor/dlg
|
---|
291 | LPSTR lpszTitle) // dialog title (optional)
|
---|
292 | {
|
---|
293 | return TRUE;
|
---|
294 | }
|
---|
295 |
|
---|
296 |
|
---|
297 | /****************************************************************************
|
---|
298 | * ICCompressorFree [MSVFW.25]
|
---|
299 | */
|
---|
300 | void VFWAPI ICCompressorFree(PCOMPVARS pc)
|
---|
301 | {
|
---|
302 | return;
|
---|
303 | }
|
---|
304 |
|
---|
305 |
|
---|
306 | /****************************************************************************
|
---|
307 | * ICDecompress [MSVFW.26]
|
---|
308 | */
|
---|
309 | DWORD VFWAPIV ICDecompress(HIC hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,
|
---|
310 | LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits)
|
---|
311 | {
|
---|
312 | ICDECOMPRESS icd;
|
---|
313 |
|
---|
314 | icd.dwFlags = dwFlags;
|
---|
315 | icd.lpbiInput = lpbiFormat;
|
---|
316 | icd.lpInput = lpData;
|
---|
317 |
|
---|
318 | icd.lpbiOutput = lpbi;
|
---|
319 | icd.lpOutput = lpBits;
|
---|
320 | icd.ckid = 0;
|
---|
321 | return ICSendMessage(hic,ICM_DECOMPRESS,(LPARAM)&icd,sizeof(icd));
|
---|
322 | }
|
---|
323 |
|
---|
324 |
|
---|
325 | /****************************************************************************
|
---|
326 | * ICDraw [MSVFW.27]
|
---|
327 | */
|
---|
328 | DWORD VFWAPIV ICDraw(HIC hic,DWORD dwFlags,LPVOID lpFormat,LPVOID lpData,
|
---|
329 | DWORD cbData, LONG lTime)
|
---|
330 | {
|
---|
331 | ICDRAW icd;
|
---|
332 |
|
---|
333 | icd.dwFlags = dwFlags;
|
---|
334 | icd.lpFormat = lpFormat;
|
---|
335 | icd.lpData = lpData;
|
---|
336 | icd.cbData = cbData;
|
---|
337 | icd.lTime = lTime;
|
---|
338 | return ICSendMessage(hic,ICM_DRAW,(LPARAM)&icd,sizeof(icd));
|
---|
339 | }
|
---|
340 |
|
---|
341 |
|
---|
342 | /****************************************************************************
|
---|
343 | * ICDrawBegin [MSVFW.28]
|
---|
344 | */
|
---|
345 | DWORD VFWAPIV ICDrawBegin(
|
---|
346 | HIC hic,
|
---|
347 | DWORD dwFlags,/* flags */
|
---|
348 | HPALETTE hpal, /* palette to draw with */
|
---|
349 | HWND hwnd, /* window to draw to */
|
---|
350 | HDC hdc, /* HDC to draw to */
|
---|
351 | INT xDst, /* destination rectangle */
|
---|
352 | INT yDst,
|
---|
353 | INT dxDst,
|
---|
354 | INT dyDst,
|
---|
355 | LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
|
---|
356 | INT xSrc, /* source rectangle */
|
---|
357 | INT ySrc,
|
---|
358 | INT dxSrc,
|
---|
359 | INT dySrc,
|
---|
360 | DWORD dwRate, /* frames/second = (dwRate/dwScale) */
|
---|
361 | DWORD dwScale)
|
---|
362 | {
|
---|
363 | ICDRAWBEGIN icdb;
|
---|
364 |
|
---|
365 | icdb.dwFlags = dwFlags;
|
---|
366 | icdb.hpal = hpal;
|
---|
367 | icdb.hwnd = hwnd;
|
---|
368 | icdb.hdc = hdc;
|
---|
369 | icdb.xDst = xDst;
|
---|
370 | icdb.yDst = yDst;
|
---|
371 | icdb.dxDst = dxDst;
|
---|
372 | icdb.dyDst = dyDst;
|
---|
373 | icdb.lpbi = lpbi;
|
---|
374 | icdb.xSrc = xSrc;
|
---|
375 | icdb.ySrc = ySrc;
|
---|
376 | icdb.dxSrc = dxSrc;
|
---|
377 | icdb.dySrc = dySrc;
|
---|
378 | icdb.dwRate = dwRate;
|
---|
379 | icdb.dwScale = dwScale;
|
---|
380 | return ICSendMessage(hic,ICM_DRAW_BEGIN,(LPARAM)&icdb,sizeof(icdb));
|
---|
381 | }
|
---|
382 |
|
---|
383 |
|
---|
384 | /****************************************************************************
|
---|
385 | * ICGetDisplayFormat [MSVFW.29]
|
---|
386 | */
|
---|
387 | HIC VFWAPI ICGetDisplayFormat(HIC hic,LPBITMAPINFOHEADER lpbiIn,
|
---|
388 | LPBITMAPINFOHEADER lpbiOut, INT depth,INT dx,INT dy)
|
---|
389 | {
|
---|
390 | HIC tmphic = hic;
|
---|
391 | LRESULT lres;
|
---|
392 |
|
---|
393 | if (!tmphic) {
|
---|
394 | tmphic=ICLocate(ICTYPE_VIDEO,0,lpbiIn,NULL,ICMODE_DECOMPRESS);
|
---|
395 | if (!tmphic)
|
---|
396 | return tmphic;
|
---|
397 | }
|
---|
398 | if ((dy == lpbiIn->biHeight) || (dx == lpbiIn->biWidth))
|
---|
399 | dy = dx = 0; /* no resize needed */
|
---|
400 | /* Can we decompress it ? */
|
---|
401 | lres = ICDecompressQuery(tmphic,lpbiIn,NULL);
|
---|
402 | if (lres)
|
---|
403 | goto errout; /* no, sorry */
|
---|
404 | ICDecompressGetFormat(hic,lpbiIn,lpbiOut);
|
---|
405 | *lpbiOut=*lpbiIn;
|
---|
406 | lpbiOut->biCompression = 0;
|
---|
407 | lpbiOut->biSize = sizeof(*lpbiOut);
|
---|
408 | if (!depth) {
|
---|
409 | HDC hdc;
|
---|
410 |
|
---|
411 | hdc = GetDC(0);
|
---|
412 | depth = GetDeviceCaps(hdc,12)*GetDeviceCaps(hdc,14);
|
---|
413 | ReleaseDC(0,hdc);
|
---|
414 | if (depth==15) depth = 16;
|
---|
415 | if (depth<8) depth = 8;
|
---|
416 | /* more constraints and tests */
|
---|
417 | }
|
---|
418 | if (lpbiIn->biBitCount == 8)
|
---|
419 | depth = 8;
|
---|
420 |
|
---|
421 | return hic;
|
---|
422 | errout:
|
---|
423 | if (hic!=tmphic)
|
---|
424 | ICClose(tmphic);
|
---|
425 | return 0;
|
---|
426 | }
|
---|
427 |
|
---|
428 |
|
---|
429 | /****************************************************************************
|
---|
430 | * ICGetInfo [MSVFW.30]
|
---|
431 | */
|
---|
432 | LRESULT WINAPI ICGetInfo(HIC hic,ICINFO *picinfo,DWORD cb)
|
---|
433 | {
|
---|
434 | LRESULT ret;
|
---|
435 |
|
---|
436 | ret = ICSendMessage(hic,ICM_GETINFO,(DWORD)picinfo,cb);
|
---|
437 | return ret;
|
---|
438 | }
|
---|
439 |
|
---|
440 |
|
---|
441 | /****************************************************************************
|
---|
442 | * ICImageCompress [MSVFW.31]
|
---|
443 | */
|
---|
444 | HANDLE VFWAPI ICImageCompress(
|
---|
445 | HIC hic, // compressor to use
|
---|
446 | UINT uiFlags, // flags (none yet)
|
---|
447 | LPBITMAPINFO lpbiIn, // format to compress from
|
---|
448 | LPVOID lpBits, // data to compress
|
---|
449 | LPBITMAPINFO lpbiOut, // compress to this (NULL ==> default)
|
---|
450 | LONG lQuality, // quality to use
|
---|
451 | LONG plSize) // compress to this size (0=whatever)
|
---|
452 | {
|
---|
453 | return 0;
|
---|
454 | }
|
---|
455 |
|
---|
456 |
|
---|
457 | /****************************************************************************
|
---|
458 | * ICImageDecompress [MSVFW.32]
|
---|
459 | */
|
---|
460 | HANDLE VFWAPI ICImageDecompress(
|
---|
461 | HIC hic, // compressor to use
|
---|
462 | UINT uiFlags, // flags (none yet)
|
---|
463 | LPBITMAPINFO lpbiIn, // format to decompress from
|
---|
464 | LPVOID lpBits, // data to decompress
|
---|
465 | LPBITMAPINFO lpbiOut) // decompress to this (NULL ==> default)
|
---|
466 | {
|
---|
467 | return 0;
|
---|
468 | }
|
---|
469 |
|
---|
470 |
|
---|
471 | /**************************************************************************
|
---|
472 | * ICInfo [MSVFW.33]
|
---|
473 | * Get information about an installable compressor. Return TRUE if there
|
---|
474 | * is one.
|
---|
475 | */
|
---|
476 | BOOL WINAPI ICInfo(DWORD fccType,DWORD fccHandler,ICINFO *lpicinfo)
|
---|
477 | {
|
---|
478 |
|
---|
479 | char type[5],buf[2000];
|
---|
480 |
|
---|
481 | memcpy(type,&fccType,4);type[4]=0;
|
---|
482 | /* does OpenDriver/CloseDriver */
|
---|
483 | lpicinfo->dwSize = sizeof(ICINFO);
|
---|
484 | lpicinfo->fccType = fccType;
|
---|
485 | lpicinfo->dwFlags = 0;
|
---|
486 | if (GetPrivateProfileStringA("drivers32",NULL,NULL,buf,2000,"system.ini")) {
|
---|
487 | char *s = buf;
|
---|
488 | while (*s) {
|
---|
489 | if (!lstrncmpiA(type,s,4)) {
|
---|
490 | if(!fccHandler--) {
|
---|
491 | lpicinfo->fccHandler = mmioStringToFOURCCA(s+5,0);
|
---|
492 | return TRUE;
|
---|
493 | }
|
---|
494 | }
|
---|
495 | s=s+lstrlenA(s)+1; /* either next char or \0 */
|
---|
496 | }
|
---|
497 | }
|
---|
498 | return FALSE;
|
---|
499 | }
|
---|
500 |
|
---|
501 |
|
---|
502 | /****************************************************************************
|
---|
503 | * ICInstall [MSVFW.34]
|
---|
504 | */
|
---|
505 | BOOL VFWAPI ICInstall(DWORD fccType, DWORD fccHandler, LPARAM lParam, LPSTR szDesc, UINT wFlags)
|
---|
506 | {
|
---|
507 | return TRUE;
|
---|
508 | }
|
---|
509 |
|
---|
510 |
|
---|
511 | /****************************************************************************
|
---|
512 | * ICLocate [MSVFW.35]
|
---|
513 | */
|
---|
514 | HIC VFWAPI ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn,
|
---|
515 | LPBITMAPINFOHEADER lpbiOut, WORD wMode)
|
---|
516 | {
|
---|
517 | char type[5],handler[5];
|
---|
518 | HIC hic;
|
---|
519 | DWORD querymsg;
|
---|
520 |
|
---|
521 | switch (wMode) {
|
---|
522 | case ICMODE_FASTCOMPRESS:
|
---|
523 | case ICMODE_COMPRESS:
|
---|
524 | querymsg = ICM_COMPRESS_QUERY;
|
---|
525 | break;
|
---|
526 | case ICMODE_DECOMPRESS:
|
---|
527 | case ICMODE_FASTDECOMPRESS:
|
---|
528 | querymsg = ICM_DECOMPRESS_QUERY;
|
---|
529 | break;
|
---|
530 | case ICMODE_DRAW:
|
---|
531 | querymsg = ICM_DRAW_QUERY;
|
---|
532 | break;
|
---|
533 | default:
|
---|
534 | return 0;
|
---|
535 | }
|
---|
536 |
|
---|
537 | /* Easy case: handler/type match, we just fire a query and return */
|
---|
538 | hic = ICOpen(fccType,fccHandler,wMode);
|
---|
539 | if (hic) {
|
---|
540 | if (!ICSendMessage(hic,querymsg,(DWORD)lpbiIn,(DWORD)lpbiOut))
|
---|
541 | return hic;
|
---|
542 | ICClose(hic);
|
---|
543 | }
|
---|
544 | type[4]='\0';memcpy(type,&fccType,4);
|
---|
545 | handler[4]='\0';memcpy(handler,&fccHandler,4);
|
---|
546 | if (fccType==streamtypeVIDEO) {
|
---|
547 | hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode);
|
---|
548 | if (hic)
|
---|
549 | return hic;
|
---|
550 | }
|
---|
551 | return 0;
|
---|
552 | }
|
---|
553 |
|
---|
554 |
|
---|
555 | /**************************************************************************
|
---|
556 | * ICOpen [MSVFW.37]
|
---|
557 | * Opens an installable compressor. Return special handle.
|
---|
558 | */
|
---|
559 | HIC WINAPI ICOpen(DWORD fccType,DWORD fccHandler,UINT wMode)
|
---|
560 | {
|
---|
561 | char type[5],handler[5],codecname[20];
|
---|
562 | ICOPEN icopen;
|
---|
563 | HDRVR hdrv;
|
---|
564 | WINE_HIC *whic;
|
---|
565 |
|
---|
566 | memcpy(type,&fccType,4);type[4]=0;
|
---|
567 | memcpy(handler,&fccHandler,4);handler[4]=0;
|
---|
568 | sprintf(codecname,"%s.%s",type,handler);
|
---|
569 |
|
---|
570 | /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
|
---|
571 | * same layout as ICOPEN
|
---|
572 | */
|
---|
573 | icopen.fccType = fccType;
|
---|
574 | icopen.fccHandler = fccHandler;
|
---|
575 | icopen.dwSize = sizeof(ICOPEN);
|
---|
576 | icopen.dwFlags = wMode;
|
---|
577 | /* FIXME: do we need to fill out the rest too? */
|
---|
578 | hdrv=OpenDriverA(codecname,"drivers32",(LPARAM)&icopen);
|
---|
579 | if (!hdrv) {
|
---|
580 | if (!strcasecmp(type,"vids")) {
|
---|
581 | sprintf(codecname,"vidc.%s",handler);
|
---|
582 | fccType = mmioFOURCC('v','i','d','c');
|
---|
583 | }
|
---|
584 | hdrv=OpenDriverA(codecname,"drivers32",(LPARAM)&icopen);
|
---|
585 | if (!hdrv)
|
---|
586 | return 0;
|
---|
587 | }
|
---|
588 | whic = (PWINE_HIC)HeapAlloc(GetProcessHeap(),0,sizeof(WINE_HIC));
|
---|
589 | whic->hdrv = hdrv;
|
---|
590 | whic->driverproc= NULL;
|
---|
591 | whic->privatevfw= ICSendMessage((HIC)whic,DRV_OPEN,0,(LPARAM)&icopen);
|
---|
592 | return (HIC)whic;
|
---|
593 | }
|
---|
594 |
|
---|
595 |
|
---|
596 | /**************************************************************************
|
---|
597 | * ICOpenFunction [MSVFW.38]
|
---|
598 | */
|
---|
599 | HIC VFWAPI ICOpenFunction(DWORD fccType, DWORD fccHandler, UINT wMode,
|
---|
600 | FARPROC lpfnHandler)
|
---|
601 | {
|
---|
602 | char type[5],handler[5];
|
---|
603 | HIC hic;
|
---|
604 | WINE_HIC *whic;
|
---|
605 |
|
---|
606 | memcpy(type,&fccType,4);type[4]=0;
|
---|
607 | memcpy(handler,&fccHandler,4);handler[4]=0;
|
---|
608 | hic = ICOpen(fccType,fccHandler,wMode);
|
---|
609 | if (!hic)
|
---|
610 | return hic;
|
---|
611 | whic = (WINE_HIC*)hic;
|
---|
612 | whic->driverproc = lpfnHandler;
|
---|
613 | return hic;
|
---|
614 | }
|
---|
615 |
|
---|
616 |
|
---|
617 | /**************************************************************************
|
---|
618 | * ICRemove [MSVFW.39]
|
---|
619 | */
|
---|
620 | BOOL VFWAPI ICRemove(DWORD fccType, DWORD fccHandler, UINT wFlags)
|
---|
621 | {
|
---|
622 | return TRUE;
|
---|
623 | }
|
---|
624 |
|
---|
625 |
|
---|
626 | /**************************************************************************
|
---|
627 | * ICSendMessage [MSVFW.40]
|
---|
628 | */
|
---|
629 | LRESULT VFWAPI ICSendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2)
|
---|
630 |
|
---|
631 | {
|
---|
632 | LRESULT ret;
|
---|
633 | WINE_HIC *whic = (WINE_HIC*)hic;
|
---|
634 | INT tvfw;
|
---|
635 |
|
---|
636 | #define XX(x) case x:
|
---|
637 |
|
---|
638 | switch (msg)
|
---|
639 | {
|
---|
640 |
|
---|
641 | XX(ICM_ABOUT)
|
---|
642 | XX(ICM_GETINFO)
|
---|
643 | XX(ICM_COMPRESS_FRAMES_INFO)
|
---|
644 | XX(ICM_COMPRESS_GET_FORMAT)
|
---|
645 | XX(ICM_COMPRESS_GET_SIZE)
|
---|
646 | XX(ICM_COMPRESS_QUERY)
|
---|
647 | XX(ICM_COMPRESS_BEGIN)
|
---|
648 | XX(ICM_COMPRESS)
|
---|
649 | XX(ICM_COMPRESS_END)
|
---|
650 | XX(ICM_DECOMPRESS_GET_FORMAT)
|
---|
651 | XX(ICM_DECOMPRESS_QUERY)
|
---|
652 | XX(ICM_DECOMPRESS_BEGIN)
|
---|
653 | XX(ICM_DECOMPRESS)
|
---|
654 | XX(ICM_DECOMPRESS_END)
|
---|
655 | XX(ICM_DECOMPRESS_SET_PALETTE)
|
---|
656 | XX(ICM_DECOMPRESS_GET_PALETTE)
|
---|
657 | XX(ICM_DRAW_QUERY)
|
---|
658 | XX(ICM_DRAW_BEGIN)
|
---|
659 | XX(ICM_DRAW_GET_PALETTE)
|
---|
660 | XX(ICM_DRAW_START)
|
---|
661 | XX(ICM_DRAW_STOP)
|
---|
662 | XX(ICM_DRAW_END)
|
---|
663 | XX(ICM_DRAW_GETTIME)
|
---|
664 | XX(ICM_DRAW)
|
---|
665 | XX(ICM_DRAW_WINDOW)
|
---|
666 | XX(ICM_DRAW_SETTIME)
|
---|
667 | XX(ICM_DRAW_REALIZE)
|
---|
668 | XX(ICM_DRAW_FLUSH)
|
---|
669 | XX(ICM_DRAW_RENDERBUFFER)
|
---|
670 | XX(ICM_DRAW_START_PLAY)
|
---|
671 | XX(ICM_DRAW_STOP_PLAY)
|
---|
672 | XX(ICM_DRAW_SUGGESTFORMAT)
|
---|
673 | XX(ICM_DRAW_CHANGEPALETTE)
|
---|
674 | XX(ICM_GETBUFFERSWANTED)
|
---|
675 | XX(ICM_GETDEFAULTKEYFRAMERATE)
|
---|
676 | XX(ICM_DECOMPRESSEX_BEGIN)
|
---|
677 | XX(ICM_DECOMPRESSEX_QUERY)
|
---|
678 | XX(ICM_DECOMPRESSEX)
|
---|
679 | XX(ICM_DECOMPRESSEX_END)
|
---|
680 | XX(ICM_SET_STATUS_PROC)
|
---|
681 | default:
|
---|
682 | tvfw = 0;
|
---|
683 | }
|
---|
684 | #if 0
|
---|
685 | if (whic->driverproc) {
|
---|
686 | ret = whic->driverproc(whic->hdrv,1,msg,lParam1,lParam2);
|
---|
687 | } else
|
---|
688 | #endif
|
---|
689 | ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
|
---|
690 | return ret;
|
---|
691 | }
|
---|
692 |
|
---|
693 |
|
---|
694 | /**************************************************************************
|
---|
695 | * ICSeqCompressFrame [MSVFW.41]
|
---|
696 | */
|
---|
697 | LPVOID VFWAPI ICSeqCompressFrame(
|
---|
698 | PCOMPVARS pc, // set by ICCompressorChoose
|
---|
699 | UINT uiFlags, // flags
|
---|
700 | LPVOID lpBits, // input DIB bits
|
---|
701 | BOOL *pfKey, // did it end up being a key frame?
|
---|
702 | LONG *plSize) // size to compress to/of returned image
|
---|
703 | {
|
---|
704 | return 0;
|
---|
705 | }
|
---|
706 |
|
---|
707 |
|
---|
708 | /**************************************************************************
|
---|
709 | * ICSeqCompressFrameEnd [MSVFW.42]
|
---|
710 | */
|
---|
711 | BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
|
---|
712 | {
|
---|
713 | return TRUE;
|
---|
714 | }
|
---|
715 |
|
---|
716 |
|
---|
717 |
|
---|
718 | /**************************************************************************
|
---|
719 | * ICSeqCompressFrameStart [MSVFW.43]
|
---|
720 | */
|
---|
721 | void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc)
|
---|
722 | {
|
---|
723 | return;
|
---|
724 | }
|
---|
725 |
|
---|
726 |
|
---|
727 | /**************************************************************************
|
---|
728 | * MCIWndCreate [MSVFW.44]
|
---|
729 | */
|
---|
730 | HWND VFWAPIV MCIWndCreate (HWND hwndParent, HINSTANCE hInstance,
|
---|
731 | DWORD dwStyle,LPVOID szFile)
|
---|
732 | {
|
---|
733 | return 0;
|
---|
734 | }
|
---|
735 |
|
---|
736 |
|
---|
737 | /**************************************************************************
|
---|
738 | * MCIWndCreateA [MSVFW.45]
|
---|
739 | */
|
---|
740 | HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance,
|
---|
741 | DWORD dwStyle,LPCSTR szFile)
|
---|
742 | {
|
---|
743 | return 0;
|
---|
744 | }
|
---|
745 |
|
---|
746 |
|
---|
747 | /**************************************************************************
|
---|
748 | * MCIWndCreateW [MSVFW.46]
|
---|
749 | */
|
---|
750 | HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance,
|
---|
751 | DWORD dwStyle,LPCWSTR szFile)
|
---|
752 | {
|
---|
753 | return 0;
|
---|
754 | }
|
---|
755 |
|
---|
756 |
|
---|
757 | /**************************************************************************
|
---|
758 | * MCIWndRegisterClass [MSVFW.47]
|
---|
759 | */
|
---|
760 | BOOL VFWAPIV MCIWndRegisterClass()
|
---|
761 | {
|
---|
762 | return TRUE;
|
---|
763 | }
|
---|
764 |
|
---|
765 |
|
---|
766 | /**************************************************************************
|
---|
767 | * StretchDIB [MSVFW.48]
|
---|
768 | */
|
---|
769 |
|
---|
770 | /* NO */
|
---|