Add support for ICM_GETINFO in msvidc32 codec (based on msrle32).

oldstable
Dmitry Timoshkov 2005-11-28 10:45:02 +01:00 committed by Alexandre Julliard
parent 5f6cf2a342
commit 0a1e28fe3f
5 changed files with 121 additions and 5 deletions

View File

@ -3,11 +3,13 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = msvidc32.dll
IMPORTS = kernel32
IMPORTS = user32 kernel32
C_SRCS = \
msvideo1.c
RC_SRCS = rsrc.rc
@MAKE_DLL_RULES@
### Dependencies:

View File

@ -0,0 +1,25 @@
/*
* Copyright 2005 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE DISCARDABLE
{
IDS_NAME "WINE-MS-CRAM"
IDS_DESCRIPTION "Wine Video 1 video codec"
}

View File

@ -0,0 +1,25 @@
/*
* Copyright 2005 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __MSVIDC32_PRIVATE_H
#define __MSVIDC32_PRIVATE_H
#define IDS_NAME 100
#define IDS_DESCRIPTION 101
#endif /* __MSVIDC32_PRIVATE_H */

View File

@ -31,20 +31,22 @@
* if it's present, then the data is PAL8; RGB555 otherwise.
*/
#include <stdarg.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "commdlg.h"
#include "vfw.h"
#include "mmsystem.h"
#include "msvidc32_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvidc32);
static HINSTANCE MSVIDC32_hModule;
#define CRAM_MAGIC mmioFOURCC('C', 'R', 'A', 'M')
#define MSVC_MAGIC mmioFOURCC('M', 'S', 'V', 'C')
#define WHAM_MAGIC mmioFOURCC('W', 'H', 'A', 'M')
@ -454,16 +456,35 @@ static LRESULT CRAM_DecompressEx( Msvideo1Context *info, ICDECOMPRESSEX *icd, DW
return ICERR_OK;
}
static LRESULT CRAM_GetInfo( Msvideo1Context *info, ICINFO *icinfo, DWORD dwSize )
{
if (!icinfo) return sizeof(ICINFO);
if (dwSize < sizeof(ICINFO)) return 0;
icinfo->dwSize = sizeof(ICINFO);
icinfo->fccType = ICTYPE_VIDEO;
icinfo->fccHandler = info ? info->dwMagic : CRAM_MAGIC;
icinfo->dwFlags = 0;
icinfo->dwVersion = 0x00010000; /* Version 1.0 build 0 */
icinfo->dwVersionICM = 0x01040000; /* Version 1.4 build 0 */
LoadStringW(MSVIDC32_hModule, IDS_NAME, icinfo->szName, sizeof(icinfo->szName)/sizeof(WCHAR));
LoadStringW(MSVIDC32_hModule, IDS_DESCRIPTION, icinfo->szDescription, sizeof(icinfo->szDescription)/sizeof(WCHAR));
/* msvfw32 will fill icinfo->szDriver for us */
return sizeof(ICINFO);
}
/***********************************************************************
* DriverProc (MSVIDC32.@)
*/
LRESULT WINAPI CRAM_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg,
LONG lParam1, LONG lParam2)
LPARAM lParam1, LPARAM lParam2 )
{
Msvideo1Context *info = (Msvideo1Context *) dwDriverId;
LRESULT r = 0;
TRACE("%ld %p %d %ld %ld\n", dwDriverId, hdrvr, msg, lParam1, lParam2);
TRACE("%ld %p %04x %08lx %08lx\n", dwDriverId, hdrvr, msg, lParam1, lParam2);
switch( msg )
{
@ -486,6 +507,10 @@ LRESULT WINAPI CRAM_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg,
r = (LRESULT) info;
break;
case ICM_GETINFO:
r = CRAM_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
break;
case ICM_DECOMPRESS_QUERY:
r = CRAM_DecompressQuery( info, (LPBITMAPINFO) lParam1,
(LPBITMAPINFO) lParam2 );
@ -535,3 +560,20 @@ LRESULT WINAPI CRAM_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg,
return r;
}
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
{
TRACE("(%p,%ld,%p)\n", hModule, dwReason, lpReserved);
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hModule);
MSVIDC32_hModule = hModule;
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}

View File

@ -0,0 +1,22 @@
/*
* Copyright 2005 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "windef.h"
#include "msvidc32_private.h"
#include "msvidc32_En.rc"