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

This commit is contained in:
Dmitry Timoshkov 2005-11-28 10:44:54 +01:00 committed by Alexandre Julliard
parent e1e83cac75
commit 5f6cf2a342
5 changed files with 118 additions and 3 deletions

View File

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

View File

@ -47,13 +47,15 @@
#include "winuser.h" #include "winuser.h"
#include "commdlg.h" #include "commdlg.h"
#include "vfw.h" #include "vfw.h"
#include "mmsystem.h" #include "mmsystem.h"
#include "iccvid_private.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(iccvid); WINE_DEFAULT_DEBUG_CHANNEL(iccvid);
static HINSTANCE ICCVID_hModule;
#define ICCVID_MAGIC mmioFOURCC('c', 'v', 'i', 'd') #define ICCVID_MAGIC mmioFOURCC('c', 'v', 'i', 'd')
#define DBUG 0 #define DBUG 0
@ -910,8 +912,27 @@ static LRESULT ICCVID_Close( ICCVID_Info *info )
return 1; return 1;
} }
static LRESULT ICCVID_GetInfo( ICCVID_Info *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 : ICCVID_MAGIC;
icinfo->dwFlags = 0;
icinfo->dwVersion = 0x00010000; /* Version 1.0 build 0 */
icinfo->dwVersionICM = 0x01040000; /* Version 1.4 build 0 */
LoadStringW(ICCVID_hModule, IDS_NAME, icinfo->szName, sizeof(icinfo->szName)/sizeof(WCHAR));
LoadStringW(ICCVID_hModule, IDS_DESCRIPTION, icinfo->szDescription, sizeof(icinfo->szDescription)/sizeof(WCHAR));
/* msvfw32 will fill icinfo->szDriver for us */
return sizeof(ICINFO);
}
LRESULT WINAPI ICCVID_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg, LRESULT WINAPI ICCVID_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg,
LONG lParam1, LONG lParam2) LPARAM lParam1, LPARAM lParam2)
{ {
ICCVID_Info *info = (ICCVID_Info *) dwDriverId; ICCVID_Info *info = (ICCVID_Info *) dwDriverId;
@ -939,6 +960,9 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg,
} }
return (LRESULT) info; return (LRESULT) info;
case ICM_GETINFO:
return ICCVID_GetInfo( info, (ICINFO *)lParam1, (DWORD)lParam2 );
case ICM_DECOMPRESS_QUERY: case ICM_DECOMPRESS_QUERY:
return ICCVID_DecompressQuery( info, (LPBITMAPINFO) lParam1, return ICCVID_DecompressQuery( info, (LPBITMAPINFO) lParam1,
(LPBITMAPINFO) lParam2 ); (LPBITMAPINFO) lParam2 );
@ -963,3 +987,20 @@ LRESULT WINAPI ICCVID_DriverProc( DWORD dwDriverId, HDRVR hdrvr, UINT msg,
} }
return 0; return 0;
} }
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);
ICCVID_hModule = hModule;
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}

25
dlls/iccvid/iccvid_En.rc Normal file
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 "Cinepak Video codec"
IDS_DESCRIPTION "Cinepak 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 __ICCVID_PRIVATE_H
#define __ICCVID_PRIVATE_H
#define IDS_NAME 100
#define IDS_DESCRIPTION 101
#endif /* __ICCVID_PRIVATE_H */

22
dlls/iccvid/rsrc.rc Normal file
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 "iccvid_private.h"
#include "iccvid_En.rc"