Take palette into account while responding on ICM_DECOMPRESS_GETFORMAT
Dmitry Timoshkov
dmitry at baikal.ru
Sun Feb 15 02:04:14 CST 2004
Hello,
This patch makes the AVIs with a palette look as they should.
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Take palette into account while responding on ICM_DECOMPRESS_GETFORMAT.
diff -u cvs/hq/wine/dlls/iccvid/iccvid.c wine/dlls/iccvid/iccvid.c
--- cvs/hq/wine/dlls/iccvid/iccvid.c 2004-01-22 20:39:29.000000000 +0800
+++ wine/dlls/iccvid/iccvid.c 2004-02-15 15:47:23.000000000 +0800
@@ -783,20 +783,26 @@ LRESULT ICCVID_DecompressQuery( ICCVID_I
LRESULT ICCVID_DecompressGetFormat( ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out )
{
+ DWORD size;
+
TRACE("ICM_DECOMPRESS_GETFORMAT %p %p %p\n", info, in, out);
if( (info==NULL) || (info->dwMagic!=ICCVID_MAGIC) )
return ICERR_BADPARAM;
+ size = in->bmiHeader.biSize;
+ if (in->bmiHeader.biBitCount <= 8)
+ size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD);
+
if( out )
{
- memcpy( out, in, sizeof (BITMAPINFO) );
+ memcpy( out, in, size );
out->bmiHeader.biCompression = BI_RGB;
out->bmiHeader.biSizeImage = in->bmiHeader.biHeight
* in->bmiHeader.biWidth *4;
+ return ICERR_OK;
}
-
- return sizeof (BITMAPINFO);
+ return size;
}
LRESULT ICCVID_DecompressBegin( ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO out )
diff -u cvs/hq/wine/dlls/msvidc32/msvideo1.c wine/dlls/msvidc32/msvideo1.c
--- cvs/hq/wine/dlls/msvidc32/msvideo1.c 2004-02-11 11:35:18.000000000 +0800
+++ wine/dlls/msvidc32/msvideo1.c 2004-02-15 15:40:13.000000000 +0800
@@ -346,21 +346,27 @@ CRAM_DecompressQuery( Msvideo1Context *i
static LRESULT
CRAM_DecompressGetFormat( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
{
+ DWORD size;
+
TRACE("ICM_DECOMPRESS_GETFORMAT %p %p %p\n", info, in, out);
if( (info==NULL) || (info->dwMagic!=CRAM_MAGIC) )
return ICERR_BADPARAM;
+ size = in->bmiHeader.biSize;
+ if (in->bmiHeader.biBitCount <= 8)
+ size += in->bmiHeader.biClrUsed * sizeof(RGBQUAD);
+
if( out )
{
- memcpy( out, in, sizeof (BITMAPINFO) );
+ memcpy( out, in, size );
out->bmiHeader.biCompression = BI_RGB;
out->bmiHeader.biSizeImage = in->bmiHeader.biHeight
* in->bmiHeader.biWidth *4;
- out->bmiHeader.biBitCount = in->bmiHeader.biBitCount;
+ return ICERR_OK;
}
- return sizeof (BITMAPINFO);
+ return size;
}
LRESULT CRAM_DecompressBegin( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
diff -u cvs/hq/wine/dlls/msvideo/msrle32/msrle32.c wine/dlls/msvideo/msrle32/msrle32.c
--- cvs/hq/wine/dlls/msvideo/msrle32/msrle32.c 2004-01-27 15:31:27.000000000 +0800
+++ wine/dlls/msvideo/msrle32/msrle32.c 2004-02-15 15:43:53.000000000 +0800
@@ -1551,7 +1551,7 @@ static LRESULT CompressEnd(CodecInfo *pi
static LRESULT DecompressGetFormat(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
LPBITMAPINFOHEADER lpbiOut)
{
- int size;
+ DWORD size;
TRACE("(%p,%p,%p)\n",pi,lpbiIn,lpbiOut);
@@ -1566,19 +1566,15 @@ static LRESULT DecompressGetFormat(Codec
size = lpbiIn->biSize;
+ if (lpbiIn->biBitCount <= 8)
+ size += lpbiIn->biClrUsed * sizeof(RGBQUAD);
+
if (lpbiOut != NULL) {
memcpy(lpbiOut, lpbiIn, size);
- lpbiOut->biBitCount = 32;
lpbiOut->biCompression = BI_RGB;
lpbiOut->biSizeImage = DIBWIDTHBYTES(*lpbiOut) * lpbiOut->biHeight;
- lpbiOut->biClrImportant = 0;
-
- if (lpbiOut->biBitCount <= 8 && lpbiOut->biClrUsed == 0)
- lpbiOut->biClrUsed = 1 << lpbiOut->biBitCount;
- else
- lpbiOut->biClrUsed = 0;
- return size;
+ return ICERR_OK;
} else
return size;
}
diff -u cvs/hq/wine/dlls/msvideo/msvideo_main.c wine/dlls/msvideo/msvideo_main.c
--- cvs/hq/wine/dlls/msvideo/msvideo_main.c 2003-12-16 16:45:47.000000000 +0800
+++ wine/dlls/msvideo/msvideo_main.c 2004-02-15 15:45:02.000000000 +0800
@@ -575,7 +575,8 @@ HIC VFWAPI ICGetDisplayFormat(
{
HIC tmphic = hic;
- FIXME("(%p,%p,%p,%d,%d,%d),stub!\n",hic,lpbiIn,lpbiOut,depth,dx,dy);
+ TRACE("(%p,%p,%p,%d,%d,%d)!\n",hic,lpbiIn,lpbiOut,depth,dx,dy);
+
if (!tmphic) {
tmphic=ICLocate(ICTYPE_VIDEO,0,lpbiIn,NULL,ICMODE_DECOMPRESS);
if (!tmphic)
More information about the wine-patches
mailing list