Commit 80064d78 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Take palette into account while responding on

ICM_DECOMPRESS_GETFORMAT.
parent 8e7f81c4
......@@ -783,20 +783,26 @@ LRESULT ICCVID_DecompressQuery( ICCVID_Info *info, LPBITMAPINFO in, LPBITMAPINFO
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 )
......
......@@ -346,21 +346,27 @@ CRAM_DecompressQuery( Msvideo1Context *info, LPBITMAPINFO in, LPBITMAPINFO out )
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 )
......
......@@ -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(CodecInfo *pi, LPCBITMAPINFOHEADER lpbiIn,
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;
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment