- Timestamp:
- Aug 27, 2002, 10:31:48 AM (23 years ago)
- Location:
- trunk/src/msvfw32
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvfw32/LICENSE.TXT
r6379 r9140 1 $Id: LICENSE.TXT,v 1. 1 2001-07-21 08:57:44sandervl Exp $2 @cThis is an additional Odin license agreement.3 @cIt supercedes the main Odin license, but is only valid in4 @cthe source directory in which it is present.1 $Id: LICENSE.TXT,v 1.2 2002-08-27 08:31:47 sandervl Exp $ 2 This is an additional Odin license agreement. 3 It supercedes the main Odin license, but is only valid in 4 the source directory in which it is present. 5 5 6 @c This file is processed by GNU's TeXinfo 7 @c If you modify it or move it to another location, make sure that 8 @c TeXinfo works (type `make' in directory documentation). 9 10 Copyright (c) 1993-2000 the Wine project authors (see the file AUTHORS 6 Copyright (c) 1993-2002 the Wine project authors (see the file AUTHORS 11 7 for a complete list) 12 8 13 Permission is hereby granted, free of charge, to any person obtaining a copy 14 of this software and associated documentation files (the "Software"), to deal 15 in the Software without restriction, including without limitation the rights 16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 copies of the Software, and to permit persons to whom the Software is 18 furnished to do so, subject to the following conditions: 9 Wine is free software; you can redistribute it and/or modify it under 10 the terms of the GNU Lesser General Public License as published by the 11 Free Software Foundation; either version 2.1 of the License, or (at 12 your option) any later version. 19 13 20 The above copyright notice and this permission notice shall be included in 21 all copies or substantial portions of the Software. 14 This program is distributed in the hope that it will be useful, but 15 WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 Lesser General Public License for more details. 22 18 23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 27 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 28 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 A copy of the GNU Lesser General Public License is included in the 20 Wine distribution in the file COPYING.LIB. If you did not receive this 21 copy, write to the Free Software Foundation, Inc., 59 Temple Place, 22 Suite 330, Boston, MA 02111-1307 USA. -
trunk/src/msvfw32/drawdib.c
r7511 r9140 1 /* 1 /* 2 2 * Copyright 2000 Bradley Baetz 3 3 * 4 * Fixme: Some flags are ignored 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 * 18 * FIXME: Some flags are ignored 5 19 * 6 20 * Handle palettes … … 13 27 #include "winuser.h" 14 28 #include "wine/winbase16.h" 15 #include " debugtools.h"29 #include "wine/debug.h" 16 30 #include "vfw.h" 17 31 #include "vfw16.h" 18 32 #include "windef.h" 19 33 20 DEFAULT_DEBUG_CHANNEL(msvideo);34 WINE_DEFAULT_DEBUG_CHANNEL(msvideo); 21 35 22 36 typedef struct { … … 37 51 } WINE_HDD; 38 52 39 #ifdef __WIN32OS2__ 40 #include <heapstring.h> 41 42 #define GlobalAlloc16 GlobalAlloc 43 #define GlobalLock16 GlobalLock 44 #define GlobalUnlock16 GlobalUnlock 45 #define GlobalFree16 GlobalFree 46 47 #endif 53 int num_colours(LPBITMAPINFOHEADER lpbi) 54 { 55 if(lpbi->biClrUsed) 56 return lpbi->biClrUsed; 57 if(lpbi->biBitCount<=8) 58 return 1<<lpbi->biBitCount; 59 return 0; 60 } 48 61 49 62 /*********************************************************************** … … 60 73 61 74 /*********************************************************************** 62 * DrawDibOpen [MSVIDEO.102]63 */64 HDRAWDIB16 VFWAPI DrawDibOpen16(void) {65 return (HDRAWDIB16)DrawDibOpen();66 }67 68 /***********************************************************************69 75 * DrawDibClose [MSVFW32.@] 70 76 */ … … 83 89 GlobalFree16(hdd); 84 90 return TRUE; 85 }86 87 /***********************************************************************88 * DrawDibClose [MSVIDEO.103]89 */90 BOOL16 VFWAPI DrawDibClose16(HDRAWDIB16 hdd) {91 return DrawDibClose(hdd);92 91 } 93 92 … … 98 97 BOOL ret = TRUE; 99 98 WINE_HDD *whdd = GlobalLock16(hdd); 100 99 101 100 TRACE("(0x%08lx)\n",(DWORD)hdd); 102 101 … … 124 123 if (whdd->hDib) 125 124 DeleteObject(whdd->hDib); 126 125 127 126 if (whdd->hic) { 128 127 ICDecompressEnd(whdd->hic); … … 134 133 GlobalUnlock16(hdd); 135 134 return ret; 136 }137 138 /***********************************************************************139 * DrawDibEnd [MSVIDEO.105]140 */141 BOOL16 VFWAPI DrawDibEnd16(HDRAWDIB16 hdd) {142 return DrawDibEnd(hdd);143 135 } 144 136 … … 161 153 ); 162 154 TRACE("lpbi: %ld,%ld/%ld,%d,%d,%ld,%ld,%ld,%ld,%ld,%ld\n", 163 lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 164 lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 165 lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 155 lpbi->biSize, lpbi->biWidth, lpbi->biHeight, lpbi->biPlanes, 156 lpbi->biBitCount, lpbi->biCompression, lpbi->biSizeImage, 157 lpbi->biXPelsPerMeter, lpbi->biYPelsPerMeter, lpbi->biClrUsed, 166 158 lpbi->biClrImportant); 167 159 … … 212 204 /* No compression */ 213 205 TRACE("Not compressed!\n"); 214 dwSize = lpbi->biSize + lpbi->biClrUsed*sizeof(RGBQUAD);206 dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD); 215 207 whdd->lpbiOut = HeapAlloc(GetProcessHeap(),0,dwSize); 216 208 memcpy(whdd->lpbiOut,lpbi,dwSize); … … 219 211 if (ret) { 220 212 /*whdd->lpvbuf = HeapAlloc(GetProcessHeap(),0,whdd->lpbiOut->biSizeImage);*/ 221 213 222 214 whdd->hMemDC = CreateCompatibleDC(hdc); 223 215 TRACE("Creating: %ld,%p\n",whdd->lpbiOut->biSize,whdd->lpvbits); … … 254 246 } 255 247 256 /************************************************************************257 * DrawDibBegin [MSVIDEO.104]258 */259 BOOL16 VFWAPI DrawDibBegin16(HDRAWDIB16 hdd,260 HDC16 hdc,261 INT16 dxDst,262 INT16 dyDst,263 LPBITMAPINFOHEADER lpbi,264 INT16 dxSrc,265 INT16 dySrc,266 UINT16 wFlags) {267 return DrawDibBegin(hdd,hdc,dxDst,dyDst,lpbi,dxSrc,dySrc,wFlags);268 }269 270 248 /********************************************************************** 271 249 * DrawDibDraw [MSVFW32.@] … … 285 263 ); 286 264 287 if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 265 if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | 288 266 DDF_UPDATE | DDF_DONTDRAW)) 289 267 FIXME("wFlags == 0x%08lx not handled\n",(DWORD)wFlags); … … 291 269 if (!lpBits) { 292 270 /* Undocumented? */ 293 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)( lpbi->biClrUsed*sizeof(RGBQUAD));271 lpBits = (LPSTR)lpbi + (WORD)(lpbi->biSize) + (WORD)(num_colours(lpbi)*sizeof(RGBQUAD)); 294 272 } 295 273 … … 318 296 if (lpbi->biCompression) { 319 297 DWORD flags = 0; 320 298 321 299 TRACE("Compression == 0x%08lx\n",lpbi->biCompression); 322 300 323 301 if (wFlags & DDF_NOTKEYFRAME) 324 302 flags |= ICDECOMPRESS_NOTKEYFRAME; 325 303 326 304 ICDecompress(whdd->hic,flags,lpbi,lpBits,whdd->lpbiOut,whdd->lpvbits); 327 305 } else { 328 306 memcpy(whdd->lpvbits,lpBits,lpbi->biSizeImage); 329 } 307 } 330 308 } 331 309 if (!(wFlags & DDF_DONTDRAW) && whdd->hpal) … … 337 315 GlobalUnlock16(hdd); 338 316 return ret; 339 }340 341 /**********************************************************************342 * DrawDibDraw [MSVIDEO.106]343 */344 BOOL16 VFWAPI DrawDibDraw16(HDRAWDIB16 hdd,345 HDC16 hdc,346 INT16 xDst,347 INT16 yDst,348 INT16 dxDst,349 INT16 dyDst,350 LPBITMAPINFOHEADER lpbi,351 LPVOID lpBits,352 INT16 xSrc,353 INT16 ySrc,354 INT16 dxSrc,355 INT16 dySrc,356 UINT16 wFlags) {357 return DrawDibDraw(hdd,hdc,xDst,yDst,dxDst,dyDst,lpbi,lpBits,xSrc,ySrc,dxSrc,dySrc,wFlags);358 317 } 359 318 … … 367 326 368 327 /************************************************************************* 369 * DrawDibStart [MSVIDEO.118]370 */371 BOOL16 VFWAPI DrawDibStart16(HDRAWDIB16 hdd, DWORD rate) {372 return DrawDibStart(hdd,rate);373 }374 375 /*************************************************************************376 328 * DrawDibStop [MSVFW32.@] 377 329 */ … … 381 333 } 382 334 383 /*************************************************************************384 * DrawDibStop [MSVIDEO.119]385 */386 BOOL16 DrawDibStop16(HDRAWDIB16 hdd) {387 return DrawDibStop(hdd);388 }389 390 335 /*********************************************************************** 391 336 * DrawDibSetPalette [MSVFW32.@] … … 398 343 whdd = GlobalLock16(hdd); 399 344 whdd->hpal = hpal; 400 345 401 346 if (whdd->begun) { 402 347 SelectPalette(whdd->hdc,hpal,0); … … 408 353 409 354 /*********************************************************************** 410 * DrawDibSetPalette [MSVIDEO.110]411 */412 BOOL16 VFWAPI DrawDibSetPalette16(HDRAWDIB16 hdd, HPALETTE16 hpal) {413 return DrawDibSetPalette(hdd,hpal);414 }415 416 /***********************************************************************417 355 * DrawDibGetPalette [MSVFW32.@] 418 356 */ … … 430 368 431 369 /*********************************************************************** 432 * DrawDibGetPalette [MSVIDEO.108]433 */434 HPALETTE16 VFWAPI DrawDibGetPalette16(HDRAWDIB16 hdd) {435 return (HPALETTE16)DrawDibGetPalette(hdd);436 }437 438 /***********************************************************************439 370 * DrawDibRealize [MSVFW32.@] 440 371 */ … … 445 376 446 377 FIXME("(%d,0x%08lx,%d), stub\n",hdd,(DWORD)hdc,fBackground); 447 378 448 379 whdd = GlobalLock16(hdd); 449 380 … … 452 383 goto out; 453 384 } 454 385 455 386 if (!whdd->hpal) 456 387 whdd->hpal = CreateHalftonePalette(hdc); … … 458 389 oldPal = SelectPalette(hdc,whdd->hpal,fBackground); 459 390 ret = RealizePalette(hdc); 460 391 461 392 out: 462 393 GlobalUnlock16(hdd); … … 465 396 return ret; 466 397 } 467 468 /***********************************************************************469 * DrawDibRealize [MSVIDEO.112]470 */471 UINT16 VFWAPI DrawDibRealize16(HDRAWDIB16 hdd, HDC16 hdc, BOOL16 fBackground) {472 return (UINT16)DrawDibRealize(hdd,hdc,fBackground);473 } -
trunk/src/msvfw32/makefile
r6386 r9140 1 # $Id: makefile,v 1.1 2 2001-07-21 17:39:44sandervl Exp $1 # $Id: makefile,v 1.13 2002-08-27 08:31:48 sandervl Exp $ 2 2 3 3 # … … 21 21 $(OBJDIR)\drawdib.obj \ 22 22 $(OBJDIR)\msvideo_main.obj \ 23 $(OBJDIR)\mciwnd.obj \ 23 24 $(OBJDIR)\msvfw32rsrc.obj \ 24 25 $(DLLENTRY) … … 31 32 $(ODIN32_LIB)/kernel32.lib \ 32 33 $(ODIN32_LIB)/user32.lib \ 34 $(ODIN32_LIB)/comctl32.lib \ 33 35 $(ODIN32_LIB)/version.lib \ 34 36 $(ODIN32_LIB)/gdi32.lib \ -
trunk/src/msvfw32/msvfw32.cpp
r6386 r9140 1 /* $Id: msvfw32.cpp,v 1. 8 2001-07-21 17:39:44sandervl Exp $ */1 /* $Id: msvfw32.cpp,v 1.9 2002-08-27 08:31:48 sandervl Exp $ */ 2 2 /* 3 3 * Copyright 1998 Marcus Meissner … … 160 160 161 161 /**************************************************************************** 162 * ICImageCompress [MSVFW.31]163 */164 HANDLE VFWAPI ICImageCompress(165 HIC hic, // compressor to use166 UINT uiFlags, // flags (none yet)167 LPBITMAPINFO lpbiIn, // format to compress from168 LPVOID lpBits, // data to compress169 LPBITMAPINFO lpbiOut, // compress to this (NULL ==> default)170 LONG lQuality, // quality to use171 LONG * plSize) // compress to this size (0=whatever)172 {173 #ifdef DEBUG174 dprintf(("MSVFW32: ICImageCompress not implemented\n"));175 #endif176 return 0;177 }178 179 180 /****************************************************************************181 * ICImageDecompress [MSVFW.32]182 */183 HANDLE VFWAPI ICImageDecompress(184 HIC hic, // compressor to use185 UINT uiFlags, // flags (none yet)186 LPBITMAPINFO lpbiIn, // format to decompress from187 LPVOID lpBits, // data to decompress188 LPBITMAPINFO lpbiOut) // decompress to this (NULL ==> default)189 {190 #ifdef DEBUG191 dprintf(("MSVFW32: ICImageDecompress not implemented\n"));192 #endif193 return 0;194 }195 196 197 /****************************************************************************198 162 * ICInstall [MSVFW.34] 199 163 */ -
trunk/src/msvfw32/msvideo_main.c
r7511 r9140 1 1 /* 2 2 * Copyright 1998 Marcus Meissner 3 * Copyright 2000 Bradley Baetz 3 * Copyright 2000 Bradley Baetz 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 4 18 * 5 19 * FIXME: This all assumes 32 bit codecs … … 20 34 #include "vfw16.h" 21 35 #include "wine/winbase16.h" 22 #include "debugtools.h" 23 #include "heap.h" 36 #include "wine/debug.h" 24 37 #include "stackframe.h" 25 38 26 DEFAULT_DEBUG_CHANNEL(msvideo);39 WINE_DEFAULT_DEBUG_CHANNEL(msvideo); 27 40 28 41 #ifdef __WIN32OS2__ 29 #include <heapstring.h> 30 31 #define GlobalAlloc16 GlobalAlloc 32 #define GlobalLock16 GlobalLock 33 #define GlobalUnlock16 GlobalUnlock 34 #define GlobalFree16 GlobalFree 35 #undef SEGPTR_NEW 36 #define SEGPTR_NEW(a) malloc(sizeof(a)) 37 #define SEGPTR_FREE(a) free(a) 38 #define SEGPTR_GET(a) a 39 40 #endif 41 42 #define MSVIDEO_CallTo16_long_lwwll(a,b,c,d,e,f) 0 43 #else 42 44 /* ### start build ### */ 43 45 extern LONG CALLBACK MSVIDEO_CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG); 44 46 /* ### stop build ### */ 47 #endif 45 48 46 49 LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2); 47 50 void MSVIDEO_UnmapMsg16To32(UINT msg, LPVOID lpv, LPDWORD lParam1, LPDWORD lParam2); 48 51 LRESULT MSVIDEO_SendMessage(HIC hic, UINT msg, DWORD lParam1, DWORD lParam2, BOOL bFrom32); 52 53 #define HDRVR_16(h32) (LOWORD(h32)) 54 49 55 50 56 /*********************************************************************** … … 162 168 return FALSE; 163 169 } 164 #ifndef __WIN32OS2__ 170 165 171 /*********************************************************************** 166 172 * ICInfo [MSVIDEO.200] … … 182 188 183 189 MSVIDEO_UnmapMsg16To32(ICM_GETINFO,lpv,&lParam,&size); 184 190 185 191 return ret; 186 192 } 187 #endif 193 188 194 /*********************************************************************** 189 195 * ICOpen [MSVFW32.@] … … 203 209 sprintf(codecname,"%s.%s",type,handler); 204 210 205 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 211 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the 206 212 * same layout as ICOPEN 207 213 */ … … 239 245 char type[5],handler[5],codecname[20]; 240 246 HIC16 hic; 241 ICOPEN* icopen = SEGPTR_NEW(ICOPEN); 247 ICOPEN icopen; 248 SEGPTR seg_icopen; 242 249 WINE_HIC *whic; 243 250 … … 245 252 memcpy(handler,&fccHandler,4);handler[4]=0; 246 253 TRACE("(%s,%s,%d,%p,%d)\n",type,handler,wMode,lpfnHandler,bFrom32?32:16); 247 248 icopen->fccType= fccType;249 icopen->fccHandler= fccHandler;250 icopen->dwSize= sizeof(ICOPEN);251 icopen->dwFlags= wMode;252 253 254 255 icopen.fccType = fccType; 256 icopen.fccHandler = fccHandler; 257 icopen.dwSize = sizeof(ICOPEN); 258 icopen.dwFlags = wMode; 259 260 sprintf(codecname,"%s.%s",type,handler); 254 261 255 262 hic = GlobalAlloc16(GHND,sizeof(WINE_HIC)); … … 258 265 whic = GlobalLock16(hic); 259 266 whic->driverproc = lpfnHandler; 260 267 261 268 #ifdef __WIN32OS2__ 262 269 whic->privatevfw = bFrom32; … … 264 271 whic->private = bFrom32; 265 272 #endif 266 267 273 /* Now try opening/loading the driver. Taken from DRIVER_AddToList */ 268 274 /* What if the function is used more than once? */ 269 275 270 276 if (MSVIDEO_SendMessage(hic,DRV_LOAD,0L,0L,bFrom32) != DRV_SUCCESS) { 271 277 WARN("DRV_LOAD failed for hic 0x%08lx\n",(DWORD)hic); … … 276 282 MSVIDEO_SendMessage(hic,DRV_ENABLE,0L,0L,bFrom32); 277 283 278 whic->hdrv = MSVIDEO_SendMessage(hic,DRV_OPEN,0,(LPARAM)(SEGPTR_GET(icopen)),FALSE); 284 seg_icopen = MapLS( &icopen ); 285 whic->hdrv = (HDRVR)MSVIDEO_SendMessage(hic,DRV_OPEN,0,seg_icopen,FALSE); 286 UnMapLS( seg_icopen ); 279 287 if (whic->hdrv == 0) { 280 288 WARN("DRV_OPEN failed for hic 0x%08lx\n",(DWORD)hic); … … 295 303 } 296 304 297 #ifndef __WIN32OS2__298 /***********************************************************************299 * ICOpen [MSVIDEO.203]300 */301 HIC16 VFWAPI ICOpen16(DWORD fccType, DWORD fccHandler, UINT16 wMode) {302 return (HIC16)ICOpen(fccType, fccHandler, wMode);303 }304 305 305 /*********************************************************************** 306 306 * ICOpenFunction [MSVIDEO.206] … … 310 310 return MSVIDEO_OpenFunc(fccType, fccHandler, wMode, (FARPROC)lpfnHandler,FALSE); 311 311 } 312 #endif313 312 314 313 /*********************************************************************** … … 323 322 return ret; 324 323 } 325 326 #ifndef __WIN32OS2__327 /***********************************************************************328 * ICGetInfo [MSVIDEO.212]329 */330 LRESULT VFWAPI ICGetInfo16(HIC16 hic, ICINFO16 *picinfo,DWORD cb) {331 LRESULT ret;332 333 TRACE("(0x%08lx,%p,%ld)\n",(DWORD)hic,picinfo,cb);334 ret = ICSendMessage16(hic,ICM_GETINFO,(DWORD)picinfo,cb);335 TRACE(" -> 0x%08lx\n",ret);336 return ret;337 }338 #endif339 324 340 325 /*********************************************************************** … … 357 342 switch (wMode) { 358 343 case ICMODE_FASTCOMPRESS: 359 case ICMODE_COMPRESS: 344 case ICMODE_COMPRESS: 360 345 querymsg = ICM_COMPRESS_QUERY; 361 346 break; … … 385 370 /* Now try each driver in turn. 32 bit codecs only. */ 386 371 /* FIXME: Move this to an init routine? */ 387 372 388 373 pszBuffer = (LPSTR)HeapAlloc(GetProcessHeap(),0,1024); 389 374 if (GetPrivateProfileSectionA("drivers32",pszBuffer,1024,"system.ini")) { … … 408 393 } 409 394 HeapFree(GetProcessHeap(),0,pszBuffer); 410 395 411 396 if (fccType==streamtypeVIDEO) { 412 397 hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode); … … 420 405 } 421 406 422 #ifndef __WIN32OS2__423 /***********************************************************************424 * ICLocate [MSVIDEO.213]425 */426 HIC16 VFWAPI ICLocate16(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn,427 LPBITMAPINFOHEADER lpbiOut, WORD wFlags) {428 return (HIC16)ICLocate(fccType, fccHandler, lpbiIn, lpbiOut, wFlags);429 }430 #endif431 432 407 /*********************************************************************** 433 408 * ICGetDisplayFormat [MSVFW32.@] … … 437 412 INT depth,INT dx,INT dy) 438 413 { 439 HIC tmphic = hic; 414 HIC tmphic = hic; 440 415 441 416 FIXME("(0x%08lx,%p,%p,%d,%d,%d),stub!\n",(DWORD)hic,lpbiIn,lpbiOut,depth,dx,dy); … … 474 449 if (lpbiIn->biBitCount == 8) 475 450 depth = 8; 476 451 477 452 TRACE("=> 0x%08lx\n",(DWORD)tmphic); 478 453 return tmphic; … … 484 459 return 0; 485 460 } 486 487 #ifndef __WIN32OS2__488 /***********************************************************************489 * ICGetDisplayFormat [MSVIDEO.239]490 */491 HIC16 VFWAPI ICGetDisplayFormat16(HIC16 hic, LPBITMAPINFOHEADER lpbiIn,492 LPBITMAPINFOHEADER lpbiOut, INT16 depth, INT16 dx, INT16 dy) {493 return (HIC16)ICGetDisplayFormat(hic,lpbiIn,lpbiOut,depth,dx,dy);494 }495 #endif496 461 497 462 /*********************************************************************** … … 526 491 } 527 492 528 #ifndef __WIN32OS2__529 /***********************************************************************530 * _ICCompress [MSVIDEO.224]531 */532 DWORD VFWAPIV ICCompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiOutput, LPVOID lpData,533 LPBITMAPINFOHEADER lpbiInput, LPVOID lpBits, LPDWORD lpckid,534 LPDWORD lpdwFlags, LONG lFrameNum, DWORD dwFrameSize, DWORD dwQuality,535 LPBITMAPINFOHEADER lpbiPrev, LPVOID lpPrev) {536 537 DWORD ret;538 ICCOMPRESS *iccmp = SEGPTR_NEW(ICCOMPRESS);539 540 TRACE("(0x%08lx,%ld,%p,%p,%p,%p,...)\n",(DWORD)hic,dwFlags,lpbiOutput,lpData,lpbiInput,lpBits);541 542 iccmp->dwFlags = dwFlags;543 544 iccmp->lpbiOutput = lpbiOutput;545 iccmp->lpOutput = lpData;546 iccmp->lpbiInput = lpbiInput;547 iccmp->lpInput = lpBits;548 549 iccmp->lpckid = lpckid;550 iccmp->lpdwFlags = lpdwFlags;551 iccmp->lFrameNum = lFrameNum;552 iccmp->dwFrameSize = dwFrameSize;553 iccmp->dwQuality = dwQuality;554 iccmp->lpbiPrev = lpbiPrev;555 iccmp->lpPrev = lpPrev;556 ret = ICSendMessage16(hic,ICM_COMPRESS,(DWORD)SEGPTR_GET(iccmp),sizeof(ICCOMPRESS));557 SEGPTR_FREE(iccmp);558 return ret;559 }560 #endif561 562 493 /*********************************************************************** 563 494 * ICDecompress [MSVFW32.@] … … 589 520 } 590 521 591 #ifndef __WIN32OS2__592 /***********************************************************************593 * _ICDecompress [MSVIDEO.230]594 */595 DWORD VFWAPIV ICDecompress16(HIC16 hic, DWORD dwFlags, LPBITMAPINFOHEADER lpbiFormat,596 LPVOID lpData, LPBITMAPINFOHEADER lpbi, LPVOID lpBits) {597 598 ICDECOMPRESS *icd = SEGPTR_NEW(ICDECOMPRESS);599 DWORD ret;600 601 TRACE("(0x%08lx,%ld,%p,%p,%p,%p)\n",(DWORD)hic,dwFlags,lpbiFormat,lpData,lpbi,lpBits);602 603 icd->dwFlags = dwFlags;604 icd->lpbiInput = lpbiFormat;605 icd->lpInput = lpData;606 icd->lpbiOutput = lpbi;607 icd->lpOutput = lpBits;608 icd->ckid = 0;609 610 ret = ICSendMessage16(hic,ICM_DECOMPRESS,(DWORD)SEGPTR_GET(icd),sizeof(ICDECOMPRESS));611 612 SEGPTR_FREE(icd);613 return ret;614 }615 616 522 #define COPY(x,y) (x->y = x##16->y); 617 523 #define COPYPTR(x,y) (x->y = MapSL((SEGPTR)x##16->y)); … … 623 529 ICDECOMPRESSEX16 *icdx16 = MapSL(*lParam); 624 530 ret = icdx16; 625 531 626 532 COPY(icdx,dwFlags); 627 533 COPYPTR(icdx,lpbiSrc); … … 637 543 COPY(icdx,dxSrc); 638 544 COPY(icdx,dySrc); 639 545 640 546 *lParam = (DWORD)(icdx); 641 547 return ret; … … 644 550 LPVOID MSVIDEO_MapMsg16To32(UINT msg, LPDWORD lParam1, LPDWORD lParam2) { 645 551 LPVOID ret = 0; 646 552 647 553 TRACE("Mapping %d\n",msg); 648 554 … … 714 620 COPYPTR(icc,lpbiPrev); 715 621 COPYPTR(icc,lpPrev); 716 622 717 623 *lParam1 = (DWORD)(icc); 718 624 *lParam2 = sizeof(ICCOMPRESS); … … 723 629 ICDECOMPRESS *icd = HeapAlloc(GetProcessHeap(),0,sizeof(ICDECOMPRESS)); 724 630 ICDECOMPRESS *icd16; /* Same structure except for the pointers */ 725 631 726 632 icd16 = MapSL(*lParam1); 727 633 ret = icd16; 728 634 729 635 COPY(icd,dwFlags); 730 636 COPYPTR(icd,lpbiInput); … … 733 639 COPYPTR(icd,lpOutput); 734 640 COPY(icd,ckid); 735 641 736 642 *lParam1 = (DWORD)(icd); 737 643 *lParam2 = sizeof(ICDECOMPRESS); … … 762 668 else 763 669 addr[1] = 0; 764 670 765 671 ret = addr; 766 672 } … … 801 707 ICDRAWSUGGEST *icds = HeapAlloc(GetProcessHeap(),0,sizeof(ICDRAWSUGGEST)); 802 708 ICDRAWSUGGEST16 *icds16 = MapSL(*lParam1); 803 709 804 710 ret = icds16; 805 711 … … 894 800 ERR("Unmapping unmapped msg %d\n",msg); 895 801 } 896 #undef UNCOPY 897 } 898 #endif 802 #undef UNCOPY 803 } 899 804 900 805 LRESULT MSVIDEO_SendMessage(HIC hic,UINT msg,DWORD lParam1,DWORD lParam2, BOOL bFrom32) { … … 974 879 if (whic->driverproc) { /* IC is a function */ 975 880 #ifdef __WIN32OS2__ 976 881 bDrv32 = whic->privatevfw; 977 882 #else 978 883 bDrv32 = whic->private; … … 982 887 } 983 888 984 #ifndef __WIN32OS2__985 889 if (!bFrom32) { 986 890 if (bDrv32) … … 993 897 } 994 898 } 995 #endif 996 899 997 900 if (whic->driverproc) { 998 #ifdef __WIN32OS2__999 ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2);1000 #else1001 901 if (bDrv32) { 1002 902 ret = whic->driverproc(whic->hdrv,hic,msg,lParam1,lParam2); 1003 903 } else { 1004 ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,whic->hdrv,hic,msg,lParam1,lParam2); 1005 } 1006 #endif 904 ret = MSVIDEO_CallTo16_long_lwwll((FARPROC16)whic->driverproc,HDRVR_16(whic->hdrv),hic,msg,lParam1,lParam2); 905 } 1007 906 } else { 1008 907 ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2); 1009 908 } 1010 909 1011 #ifndef __WIN32OS2__1012 910 if (data16) 1013 911 MSVIDEO_UnmapMsg16To32(msg,data16,&lParam1,&lParam2); 1014 #endif 1015 912 1016 913 out: 1017 914 GlobalUnlock16(hic); 1018 915 1019 916 TRACE(" -> 0x%08lx\n",ret); 1020 917 return ret; … … 1027 924 return MSVIDEO_SendMessage(hic,msg,lParam1,lParam2,TRUE); 1028 925 } 1029 #ifndef __WIN32OS2__ 926 1030 927 /*********************************************************************** 1031 928 * ICSendMessage [MSVIDEO.205] … … 1035 932 } 1036 933 1037 /***********************************************************************1038 * _ICMessage [MSVIDEO.207]1039 */1040 LRESULT VFWAPIV ICMessage16(void) {1041 HIC16 hic;1042 UINT16 msg;1043 UINT16 cb;1044 LPWORD lpData;1045 LRESULT ret;1046 UINT16 i;1047 1048 VA_LIST16 valist;1049 1050 VA_START16(valist);1051 hic = VA_ARG16(valist, HIC16);1052 msg = VA_ARG16(valist, UINT16);1053 cb = VA_ARG16(valist, UINT16);1054 1055 lpData = SEGPTR_ALLOC(cb);1056 1057 TRACE("0x%08lx, %u, %u, ...)\n",(DWORD)hic,msg,cb);1058 1059 for(i=0;i<cb/sizeof(WORD);i++) {1060 lpData[i] = VA_ARG16(valist, WORD);1061 }1062 1063 VA_END16(valist);1064 ret = ICSendMessage16(hic, msg, (DWORD)(SEGPTR_GET(lpData)), (DWORD)cb);1065 1066 SEGPTR_FREE(lpData);1067 return ret;1068 }1069 #endif1070 934 /*********************************************************************** 1071 935 * ICDrawBegin [MSVFW32.@] … … 1089 953 DWORD dwScale) /* [in] */ 1090 954 { 1091 955 1092 956 ICDRAWBEGIN icdb; 1093 957 … … 1114 978 } 1115 979 1116 #ifndef __WIN32OS2__1117 /***********************************************************************1118 * _ICDrawBegin [MSVIDEO.232]1119 */1120 DWORD VFWAPIV ICDrawBegin16(1121 HIC16 hic, /* [in] */1122 DWORD dwFlags, /* [in] flags */1123 HPALETTE16 hpal, /* [in] palette to draw with */1124 HWND16 hwnd, /* [in] window to draw to */1125 HDC16 hdc, /* [in] HDC to draw to */1126 INT16 xDst, /* [in] destination rectangle */1127 INT16 yDst, /* [in] */1128 INT16 dxDst, /* [in] */1129 INT16 dyDst, /* [in] */1130 LPBITMAPINFOHEADER lpbi, /* [in] format of frame to draw NOTE: SEGPTR */1131 INT16 xSrc, /* [in] source rectangle */1132 INT16 ySrc, /* [in] */1133 INT16 dxSrc, /* [in] */1134 INT16 dySrc, /* [in] */1135 DWORD dwRate, /* [in] frames/second = (dwRate/dwScale) */1136 DWORD dwScale) /* [in] */1137 {1138 DWORD ret;1139 ICDRAWBEGIN16* icdb = SEGPTR_NEW(ICDRAWBEGIN16); /* SEGPTR for mapper to deal with */1140 1141 TRACE("(0x%08lx,%ld,0x%08lx,0x%08lx,0x%08lx,%u,%u,%u,%u,%p,%u,%u,%u,%u,%ld,%ld)\n",1142 (DWORD)hic, dwFlags, (DWORD)hpal, (DWORD)hwnd, (DWORD)hdc, xDst, yDst, dxDst, dyDst,1143 lpbi, xSrc, ySrc, dxSrc, dySrc, dwRate, dwScale);1144 1145 icdb->dwFlags = dwFlags;1146 icdb->hpal = hpal;1147 icdb->hwnd = hwnd;1148 icdb->hdc = hdc;1149 icdb->xDst = xDst;1150 icdb->yDst = yDst;1151 icdb->dxDst = dxDst;1152 icdb->dyDst = dyDst;1153 icdb->lpbi = lpbi; /* Keep this as SEGPTR for the mapping code to deal with */1154 icdb->xSrc = xSrc;1155 icdb->ySrc = ySrc;1156 icdb->dxSrc = dxSrc;1157 icdb->dySrc = dySrc;1158 icdb->dwRate = dwRate;1159 icdb->dwScale = dwScale;1160 1161 ret = (DWORD)ICSendMessage16(hic,ICM_DRAW_BEGIN,(DWORD)SEGPTR_GET(icdb),sizeof(ICDRAWBEGIN16));1162 SEGPTR_FREE(icdb);1163 return ret;1164 }1165 #endif1166 1167 980 /*********************************************************************** 1168 981 * ICDraw [MSVFW32.@] … … 1181 994 return ICSendMessage(hic,ICM_DRAW,(DWORD)&icd,sizeof(icd)); 1182 995 } 1183 1184 #ifndef __WIN32OS2__1185 /***********************************************************************1186 * _ICDraw [MSVIDEO.234]1187 */1188 DWORD VFWAPIV ICDraw16(1189 HIC16 hic,1190 DWORD dwFlags,1191 LPVOID lpFormat, /* [???] NOTE: SEGPTR */1192 LPVOID lpData, /* [???] NOTE: SEGPTR */1193 DWORD cbData,1194 LONG lTime)1195 {1196 ICDRAW* icd = SEGPTR_NEW(ICDRAW); /* SEGPTR for mapper to deal with */1197 1198 TRACE("(0x%08lx,0x%08lx,%p,%p,%ld,%ld)\n",(DWORD)hic,dwFlags,lpFormat,lpData,cbData,lTime);1199 icd->dwFlags = dwFlags;1200 icd->lpFormat = lpFormat;1201 icd->lpData = lpData;1202 icd->cbData = cbData;1203 icd->lTime = lTime;1204 1205 return ICSendMessage16(hic,ICM_DRAW,(DWORD)SEGPTR_GET(icd),sizeof(ICDRAW));1206 }1207 #endif1208 996 1209 997 /*********************************************************************** … … 1226 1014 } 1227 1015 1228 #ifndef __WIN32OS2__ 1229 /*********************************************************************** 1230 * ICClose [MSVIDEO.204] 1231 */ 1232 LRESULT WINAPI ICClose16(HIC16 hic) { 1233 return ICClose(hic); 1234 } 1235 #endif 1236 1237 /*********************************************************************** 1238 * MCIWndCreate [MSVFW32.@] 1239 * MCIWndCreateA [MSVFW32.@] 1240 */ 1241 HWND VFWAPIV MCIWndCreateA(HWND hwndParent, HINSTANCE hInstance, 1242 DWORD dwStyle,LPCSTR szFile) 1016 1017 1018 /*********************************************************************** 1019 * ICImageCompress [MSVFW32.@] 1020 */ 1021 HANDLE VFWAPI ICImageCompress( 1022 HIC hic, UINT uiFlags, 1023 LPBITMAPINFO lpbiIn, LPVOID lpBits, 1024 LPBITMAPINFO lpbiOut, LONG lQuality, 1025 LONG* plSize) 1243 1026 { 1244 FIXME("%x %x %lx %s\n",hwndParent, hInstance, dwStyle, szFile); 1245 return 0; 1246 } 1247 1248 /*********************************************************************** 1249 * MCIWndCreateW [MSVFW32.@] 1250 */ 1251 HWND VFWAPIV MCIWndCreateW(HWND hwndParent, HINSTANCE hInstance, 1252 DWORD dwStyle,LPCWSTR szFile) 1027 FIXME("(%08x,%08x,%p,%p,%p,%ld,%p)\n", 1028 hic, uiFlags, lpbiIn, lpBits, lpbiOut, lQuality, plSize); 1029 1030 return (HANDLE)NULL; 1031 } 1032 1033 /*********************************************************************** 1034 * ICImageDecompress [MSVFW32.@] 1035 */ 1036 1037 HANDLE VFWAPI ICImageDecompress( 1038 HIC hic, UINT uiFlags, LPBITMAPINFO lpbiIn, 1039 LPVOID lpBits, LPBITMAPINFO lpbiOut) 1253 1040 { 1254 FIXME("%x %x %lx %s\n",hwndParent, hInstance, dwStyle, debugstr_w(szFile)); 1255 return 0; 1256 } 1041 HGLOBAL hMem = (HGLOBAL)NULL; 1042 BYTE* pMem = NULL; 1043 BOOL bReleaseIC = FALSE; 1044 BYTE* pHdr = NULL; 1045 LONG cbHdr = 0; 1046 BOOL bSucceeded = FALSE; 1047 BOOL bInDecompress = FALSE; 1048 DWORD biSizeImage; 1049 1050 TRACE("(%08x,%08x,%p,%p,%p)\n", 1051 hic, uiFlags, lpbiIn, lpBits, lpbiOut); 1052 1053 if ( hic == (HIC)NULL ) 1054 { 1055 hic = ICDecompressOpen( mmioFOURCC('V','I','D','C'), 0, &lpbiIn->bmiHeader, (lpbiOut != NULL) ? &lpbiOut->bmiHeader : NULL ); 1056 if ( hic == (HIC)NULL ) 1057 { 1058 WARN("no handler\n" ); 1059 goto err; 1060 } 1061 bReleaseIC = TRUE; 1062 } 1063 if ( uiFlags != 0 ) 1064 { 1065 FIXME( "unknown flag %08x\n", uiFlags ); 1066 goto err; 1067 } 1068 if ( lpbiIn == NULL || lpBits == NULL ) 1069 { 1070 WARN("invalid argument\n"); 1071 goto err; 1072 } 1073 1074 if ( lpbiOut != NULL ) 1075 { 1076 if ( lpbiOut->bmiHeader.biSize != sizeof(BITMAPINFOHEADER) ) 1077 goto err; 1078 cbHdr = sizeof(BITMAPINFOHEADER); 1079 if ( lpbiOut->bmiHeader.biCompression == 3 ) 1080 cbHdr += sizeof(DWORD)*3; 1081 else 1082 if ( lpbiOut->bmiHeader.biBitCount <= 8 ) 1083 { 1084 if ( lpbiOut->bmiHeader.biClrUsed == 0 ) 1085 cbHdr += sizeof(RGBQUAD) * (1<<lpbiOut->bmiHeader.biBitCount); 1086 else 1087 cbHdr += sizeof(RGBQUAD) * lpbiOut->bmiHeader.biClrUsed; 1088 } 1089 } 1090 else 1091 { 1092 TRACE( "get format\n" ); 1093 1094 cbHdr = ICDecompressGetFormatSize(hic,lpbiIn); 1095 if ( cbHdr < sizeof(BITMAPINFOHEADER) ) 1096 goto err; 1097 pHdr = (BYTE*)HeapAlloc(GetProcessHeap(),0,cbHdr+sizeof(RGBQUAD)*256); 1098 if ( pHdr == NULL ) 1099 goto err; 1100 ZeroMemory( pHdr, cbHdr+sizeof(RGBQUAD)*256 ); 1101 if ( ICDecompressGetFormat( hic, lpbiIn, (BITMAPINFO*)pHdr ) != ICERR_OK ) 1102 goto err; 1103 lpbiOut = (BITMAPINFO*)pHdr; 1104 if ( lpbiOut->bmiHeader.biBitCount <= 8 && 1105 ICDecompressGetPalette( hic, lpbiIn, lpbiOut ) != ICERR_OK && 1106 lpbiIn->bmiHeader.biBitCount == lpbiOut->bmiHeader.biBitCount ) 1107 { 1108 if ( lpbiIn->bmiHeader.biClrUsed == 0 ) 1109 memcpy( lpbiOut->bmiColors, lpbiIn->bmiColors, sizeof(RGBQUAD)*(1<<lpbiOut->bmiHeader.biBitCount) ); 1110 else 1111 memcpy( lpbiOut->bmiColors, lpbiIn->bmiColors, sizeof(RGBQUAD)*lpbiIn->bmiHeader.biClrUsed ); 1112 } 1113 if ( lpbiOut->bmiHeader.biBitCount <= 8 && 1114 lpbiOut->bmiHeader.biClrUsed == 0 ) 1115 lpbiOut->bmiHeader.biClrUsed = 1<<lpbiOut->bmiHeader.biBitCount; 1116 1117 lpbiOut->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); 1118 cbHdr = sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*lpbiOut->bmiHeader.biClrUsed; 1119 } 1120 1121 biSizeImage = lpbiOut->bmiHeader.biSizeImage; 1122 if ( biSizeImage == 0 ) 1123 biSizeImage = ((((lpbiOut->bmiHeader.biWidth * lpbiOut->bmiHeader.biBitCount + 7) >> 3) + 3) & (~3)) * abs(lpbiOut->bmiHeader.biHeight); 1124 1125 TRACE( "call ICDecompressBegin\n" ); 1126 1127 if ( ICDecompressBegin( hic, lpbiIn, lpbiOut ) != ICERR_OK ) 1128 goto err; 1129 bInDecompress = TRUE; 1130 1131 TRACE( "cbHdr %ld, biSizeImage %ld\n", cbHdr, biSizeImage ); 1132 1133 hMem = GlobalAlloc( GMEM_MOVEABLE|GMEM_ZEROINIT, cbHdr + biSizeImage ); 1134 if ( hMem == (HGLOBAL)NULL ) 1135 { 1136 WARN( "out of memory\n" ); 1137 goto err; 1138 } 1139 pMem = (BYTE*)GlobalLock( hMem ); 1140 if ( pMem == NULL ) 1141 goto err; 1142 memcpy( pMem, lpbiOut, cbHdr ); 1143 1144 TRACE( "call ICDecompress\n" ); 1145 if ( ICDecompress( hic, 0, &lpbiIn->bmiHeader, lpBits, &lpbiOut->bmiHeader, pMem+cbHdr ) != ICERR_OK ) 1146 goto err; 1147 1148 bSucceeded = TRUE; 1149 err: 1150 if ( bInDecompress ) 1151 ICDecompressEnd( hic ); 1152 if ( bReleaseIC ) 1153 ICClose(hic); 1154 if ( pHdr != NULL ) 1155 HeapFree(GetProcessHeap(),0,pHdr); 1156 if ( pMem != NULL ) 1157 GlobalUnlock( hMem ); 1158 if ( !bSucceeded && hMem != (HGLOBAL)NULL ) 1159 { 1160 GlobalFree(hMem); hMem = (HGLOBAL)NULL; 1161 } 1162 1163 return (HANDLE)hMem; 1164 } -
trunk/src/msvfw32/vfw16.h
r6386 r9140 1 /* 2 * Copyright 1999 Marcus Meissner 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 */ 18 1 19 #ifndef __WINE_VFW16_H 2 20 #define __WINE_VFW16_H … … 8 26 extern "C" { 9 27 #endif /* __cplusplus */ 28 29 #ifdef __WIN32OS2__ 30 #include <heapstring.h> 31 32 #define GlobalAlloc16 GlobalAlloc 33 #define GlobalLock16 GlobalLock 34 #define GlobalUnlock16 GlobalUnlock 35 #define GlobalFree16 GlobalFree 36 37 #define MapLS(a) a 38 #define UnMapLS(a) 39 40 #define HIC16 DWORD 41 42 #endif 10 43 11 44 typedef HANDLE16 HDRAWDIB16;
Note:
See TracChangeset
for help on using the changeset viewer.