Commit 0a1e28fe authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

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

parent 5f6cf2a3
......@@ -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:
/*
* 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"
}
/*
* 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 */
......@@ -38,13 +38,15 @@
#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;
}
/*
* 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"
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