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