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