Commit 32b32d8f authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Updated msvideo. New program 'icinfo [-about] [-configure]' to

query installed (win32) compressors. Started on AVIFILE support.
parent 3fb3da29
......@@ -4156,6 +4156,7 @@ ole/Makefile
programs/Makefile
programs/clock/Makefile
programs/control/Makefile
programs/avitools/Makefile
programs/notepad/Makefile
programs/progman/Makefile
programs/regtest/Makefile
......@@ -4310,6 +4311,7 @@ ole/Makefile
programs/Makefile
programs/clock/Makefile
programs/control/Makefile
programs/avitools/Makefile
programs/notepad/Makefile
programs/progman/Makefile
programs/regtest/Makefile
......
......@@ -600,6 +600,7 @@ ole/Makefile
programs/Makefile
programs/clock/Makefile
programs/control/Makefile
programs/avitools/Makefile
programs/notepad/Makefile
programs/progman/Makefile
programs/regtest/Makefile
......
......@@ -89,70 +89,71 @@
#define dbch_mpr 81
#define dbch_msacm 82
#define dbch_msg 83
#define dbch_nativefont 84
#define dbch_nonclient 85
#define dbch_ntdll 86
#define dbch_ole 87
#define dbch_pager 88
#define dbch_palette 89
#define dbch_pidl 90
#define dbch_print 91
#define dbch_process 92
#define dbch_profile 93
#define dbch_progress 94
#define dbch_prop 95
#define dbch_propsheet 96
#define dbch_psapi 97
#define dbch_psdrv 98
#define dbch_ras 99
#define dbch_rebar 100
#define dbch_reg 101
#define dbch_region 102
#define dbch_relay 103
#define dbch_resource 104
#define dbch_scroll 105
#define dbch_security 106
#define dbch_segment 107
#define dbch_selector 108
#define dbch_sem 109
#define dbch_sendmsg 110
#define dbch_server 111
#define dbch_shell 112
#define dbch_shm 113
#define dbch_snoop 114
#define dbch_sound 115
#define dbch_static 116
#define dbch_statusbar 117
#define dbch_stress 118
#define dbch_string 119
#define dbch_syscolor 120
#define dbch_system 121
#define dbch_tab 122
#define dbch_task 123
#define dbch_text 124
#define dbch_thread 125
#define dbch_thunk 126
#define dbch_timer 127
#define dbch_toolbar 128
#define dbch_toolhelp 129
#define dbch_tooltips 130
#define dbch_trackbar 131
#define dbch_treeview 132
#define dbch_tweak 133
#define dbch_uitools 134
#define dbch_updown 135
#define dbch_ver 136
#define dbch_virtual 137
#define dbch_vxd 138
#define dbch_wave 139
#define dbch_win 140
#define dbch_win16drv 141
#define dbch_win32 142
#define dbch_wing 143
#define dbch_winsock 144
#define dbch_wnet 145
#define dbch_x11 146
#define dbch_x11drv 147
#define dbch_msvideo 84
#define dbch_nativefont 85
#define dbch_nonclient 86
#define dbch_ntdll 87
#define dbch_ole 88
#define dbch_pager 89
#define dbch_palette 90
#define dbch_pidl 91
#define dbch_print 92
#define dbch_process 93
#define dbch_profile 94
#define dbch_progress 95
#define dbch_prop 96
#define dbch_propsheet 97
#define dbch_psapi 98
#define dbch_psdrv 99
#define dbch_ras 100
#define dbch_rebar 101
#define dbch_reg 102
#define dbch_region 103
#define dbch_relay 104
#define dbch_resource 105
#define dbch_scroll 106
#define dbch_security 107
#define dbch_segment 108
#define dbch_selector 109
#define dbch_sem 110
#define dbch_sendmsg 111
#define dbch_server 112
#define dbch_shell 113
#define dbch_shm 114
#define dbch_snoop 115
#define dbch_sound 116
#define dbch_static 117
#define dbch_statusbar 118
#define dbch_stress 119
#define dbch_string 120
#define dbch_syscolor 121
#define dbch_system 122
#define dbch_tab 123
#define dbch_task 124
#define dbch_text 125
#define dbch_thread 126
#define dbch_thunk 127
#define dbch_timer 128
#define dbch_toolbar 129
#define dbch_toolhelp 130
#define dbch_tooltips 131
#define dbch_trackbar 132
#define dbch_treeview 133
#define dbch_tweak 134
#define dbch_uitools 135
#define dbch_updown 136
#define dbch_ver 137
#define dbch_virtual 138
#define dbch_vxd 139
#define dbch_wave 140
#define dbch_win 141
#define dbch_win16drv 142
#define dbch_win32 143
#define dbch_wing 144
#define dbch_winsock 145
#define dbch_wnet 146
#define dbch_x11 147
#define dbch_x11drv 148
/* Definitions for classes identifiers */
#define dbcl_fixme 0
#define dbcl_err 1
......
......@@ -4,7 +4,7 @@
#include "debugtools.h"
#endif
#define DEBUG_CHANNEL_COUNT 148
#define DEBUG_CHANNEL_COUNT 149
#ifdef DEBUG_RUNTIME
short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
......@@ -155,6 +155,7 @@ short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
{1, 1, 0, 0},
};
const char* debug_ch_name[] = {
"accel",
......@@ -241,6 +242,7 @@ const char* debug_ch_name[] = {
"mpr",
"msacm",
"msg",
"msvideo",
"nativefont",
"nonclient",
"ntdll",
......
......@@ -158,8 +158,6 @@ typedef short VARIANT_BOOL;
#define VARIANT_TRUE ((VARIANT_BOOL)0xFFFF)
#define VARIANT_FALSE ((VARIANT_BOOL)0x0000)
typedef LONG SCODE;
enum VARENUM {
VT_EMPTY = 0,
VT_NULL = 1,
......
......@@ -4,6 +4,7 @@
extern int WIN32_LastError;
#define FACILITY_ITF 4
#define FACILITY_WIN32 7
#define SEVERITY_ERROR 1
......
......@@ -89,6 +89,7 @@ typedef unsigned short WCHAR;
typedef unsigned short BOOL16;
typedef int BOOL32;
typedef double DATE;
typedef long SCODE;
typedef long LONG_PTR;
typedef unsigned long ULONG_PTR;
#ifdef __i386__
......@@ -301,6 +302,7 @@ DECL_WINELIB_TYPE(HFILE)
DECL_WINELIB_TYPE(HFONT)
DECL_WINELIB_TYPE(HGDIOBJ)
DECL_WINELIB_TYPE(HGLOBAL)
DECL_WINELIB_TYPE(HIC)
DECL_WINELIB_TYPE(HICON)
DECL_WINELIB_TYPE(HINSTANCE)
DECL_WINELIB_TYPE(HLOCAL)
......
......@@ -2,6 +2,7 @@
* Copyright 1998 Marcus Meissner
*/
#include <stdio.h>
#include <strings.h>
#include "windows.h"
#include "driver.h"
......@@ -36,7 +37,7 @@ ICInfo32(
char type[5],buf[2000];
memcpy(type,&fccType,4);type[4]=0;
TRACE(mmsys,"(%s,%ld,%p).\n",type,fccHandler,lpicinfo);
TRACE(msvideo,"(%s,%ld,%p).\n",type,fccHandler,lpicinfo);
/* does OpenDriver/CloseDriver */
lpicinfo->dwSize = sizeof(ICINFO32);
lpicinfo->fccType = fccType;
......@@ -69,7 +70,12 @@ ICOpen32(DWORD fccType,DWORD fccHandler,UINT32 wMode) {
memcpy(type,&fccType,4);type[4]=0;
memcpy(handler,&fccHandler,4);handler[4]=0;
TRACE(mmsys,"(%s,%s,0x%08lx)\n",type,handler,(DWORD)wMode);
TRACE(msvideo,"(%s,%s,0x%08lx)\n",type,handler,(DWORD)wMode);
/* FIXME: When do we use 'vids' , when 'vidc'? Unclear */
if (!strcasecmp(type,"vids")) {
sprintf(codecname,"vidc.%s",handler);
fccType = mmioFOURCC('v','i','d','c');
} else
sprintf(codecname,"%s.%s",type,handler);
hdrv=OpenDriver32A(codecname,"drivers32",0);
if (!hdrv)
......@@ -83,7 +89,8 @@ ICOpen32(DWORD fccType,DWORD fccHandler,UINT32 wMode) {
icopen.fccType = fccType;
icopen.fccHandler = fccHandler;
icopen.dwSize = sizeof(ICOPEN);
/* FIXME: fill out rest too... */
icopen.dwFlags = wMode;
/* FIXME: do we need to fill out the rest too? */
whic->private = whic->driverproc(0,hdrv,DRV_OPEN,0,&icopen);
return (HIC32)whic;
}
......@@ -91,20 +98,60 @@ ICOpen32(DWORD fccType,DWORD fccHandler,UINT32 wMode) {
LRESULT WINAPI
ICGetInfo32(HIC32 hic,ICINFO32 *picinfo,DWORD cb) {
LRESULT ret;
WINE_HIC *whic = (WINE_HIC*)hic;
TRACE(mmsys,"(0x%08lx,%p,%ld)\n",(DWORD)hic,picinfo,cb);
ret = ICSendMessage32(whic,ICM_GETINFO,(DWORD)picinfo,cb);
TRACE(mmsys," -> 0x%08lx\n",ret);
TRACE(msvideo,"(0x%08lx,%p,%ld)\n",(DWORD)hic,picinfo,cb);
ret = ICSendMessage32(hic,ICM_GETINFO,(DWORD)picinfo,cb);
TRACE(msvideo," -> 0x%08lx\n",ret);
return ret;
}
DWORD VFWAPIV
ICCompress32(
HIC32 hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiOutput,LPVOID lpData,
LPBITMAPINFOHEADER lpbiInput,LPVOID lpBits,LPDWORD lpckid,
LPDWORD lpdwFlags,LONG lFrameNum,DWORD dwFrameSize,DWORD dwQuality,
LPBITMAPINFOHEADER lpbiPrev,LPVOID lpPrev
) {
ICCOMPRESS iccmp;
iccmp.dwFlags = dwFlags;
iccmp.lpbiOutput = lpbiOutput;
iccmp.lpOutput = lpData;
iccmp.lpbiInput = lpbiInput;
iccmp.lpInput = lpBits;
iccmp.lpckid = lpckid;
iccmp.lpdwFlags = lpdwFlags;
iccmp.lFrameNum = lFrameNum;
iccmp.dwFrameSize = dwFrameSize;
iccmp.dwQuality = dwQuality;
iccmp.lpbiPrev = lpbiPrev;
iccmp.lpPrev = lpPrev;
return ICSendMessage32(hic,ICM_COMPRESS,(LPARAM)&iccmp,sizeof(iccmp));
}
DWORD VFWAPIV
ICDecompress32(HIC32 hic,DWORD dwFlags,LPBITMAPINFOHEADER lpbiFormat,LPVOID lpData,LPBITMAPINFOHEADER lpbi,LPVOID lpBits) {
ICDECOMPRESS icd;
icd.dwFlags = dwFlags;
icd.lpbiInput = lpbiFormat;
icd.lpInput = lpData;
icd.lpbiOutput = lpbi;
icd.lpOutput = lpBits;
/*
icd.ckid = ??? ckid from AVI file? how do we get it? ;
*/
return ICSendMessage32(hic,ICM_DECOMPRESS,(LPARAM)&icd,sizeof(icd));
}
HIC32 WINAPI
ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn,
LPBITMAPINFOHEADER lpbiOut, WORD wFlags
) {
FIXME(mmsys,"stub!\n");
FIXME(msvideo,"stub!\n");
return 0;
}
......@@ -113,19 +160,57 @@ ICSendMessage32(HIC32 hic,UINT32 msg,DWORD lParam1,DWORD lParam2) {
LRESULT ret;
WINE_HIC *whic = (WINE_HIC*)hic;
#define XX(x) case x: TRACE(msvideo,"(0x%08lx,"#x",0x%08lx,0x%08lx)\n",(DWORD)hic,lParam1,lParam2);break;
switch (msg) {
case ICM_GETINFO:
FIXME(mmsys,"(0x%08lx,ICM_GETINFO,0x%08lx,0x%08lx)\n",(DWORD)hic,lParam1,lParam2);
break;
XX(ICM_ABOUT)
XX(ICM_GETINFO)
XX(ICM_COMPRESS_FRAMES_INFO)
XX(ICM_COMPRESS_GET_FORMAT)
XX(ICM_COMPRESS_GET_SIZE)
XX(ICM_COMPRESS_QUERY)
XX(ICM_COMPRESS_BEGIN)
XX(ICM_COMPRESS)
XX(ICM_COMPRESS_END)
XX(ICM_DECOMPRESS_GET_FORMAT)
XX(ICM_DECOMPRESS_QUERY)
XX(ICM_DECOMPRESS_BEGIN)
XX(ICM_DECOMPRESS)
XX(ICM_DECOMPRESS_END)
XX(ICM_DECOMPRESS_SET_PALETTE)
XX(ICM_DECOMPRESS_GET_PALETTE)
XX(ICM_DRAW_QUERY)
XX(ICM_DRAW_BEGIN)
XX(ICM_DRAW_GET_PALETTE)
XX(ICM_DRAW_START)
XX(ICM_DRAW_STOP)
XX(ICM_DRAW_END)
XX(ICM_DRAW_GETTIME)
XX(ICM_DRAW)
XX(ICM_DRAW_WINDOW)
XX(ICM_DRAW_SETTIME)
XX(ICM_DRAW_REALIZE)
XX(ICM_DRAW_FLUSH)
XX(ICM_DRAW_RENDERBUFFER)
XX(ICM_DRAW_START_PLAY)
XX(ICM_DRAW_STOP_PLAY)
XX(ICM_DRAW_SUGGESTFORMAT)
XX(ICM_DRAW_CHANGEPALETTE)
XX(ICM_GETBUFFERSWANTED)
XX(ICM_GETDEFAULTKEYFRAMERATE)
XX(ICM_DECOMPRESSEX_BEGIN)
XX(ICM_DECOMPRESSEX_QUERY)
XX(ICM_DECOMPRESSEX)
XX(ICM_DECOMPRESSEX_END)
XX(ICM_SET_STATUS_PROC)
default:
FIXME(mmsys,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx)\n",(DWORD)hic,(DWORD)msg,lParam1,lParam2);
FIXME(msvideo,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx)\n",(DWORD)hic,(DWORD)msg,lParam1,lParam2);
}
ret = whic->driverproc(whic->private,whic->hdrv,msg,lParam1,lParam2);
FIXME(mmsys," -> 0x%08lx\n",ret);
TRACE(msvideo," -> 0x%08lx\n",ret);
return ret;
}
DWORD VFWAPIV ICDrawBegin32(
HIC32 hic,
DWORD dwFlags,/* flags */
......@@ -146,23 +231,28 @@ DWORD VFWAPIV ICDrawBegin32(
return 0;
}
LRESULT WINAPI ICClose32(HIC32 hic) {
FIXME(msvideo,"(%d),stub!\n",hic);
return 0;
}
HANDLE32 /* HDRAWDIB */ WINAPI
DrawDibOpen32( void ) {
FIXME(mmsys,"stub!\n");
FIXME(msvideo,"stub!\n");
return 0;
}
HWND32 VFWAPIV MCIWndCreate32 (HWND32 hwndParent, HINSTANCE32 hInstance,
DWORD dwStyle,LPVOID szFile)
{ FIXME(mmsys,"%x %x %lx %p\n",hwndParent, hInstance, dwStyle, szFile);
{ FIXME(msvideo,"%x %x %lx %p\n",hwndParent, hInstance, dwStyle, szFile);
return 0;
}
HWND32 VFWAPIV MCIWndCreate32A(HWND32 hwndParent, HINSTANCE32 hInstance,
DWORD dwStyle,LPCSTR szFile)
{ FIXME(mmsys,"%x %x %lx %s\n",hwndParent, hInstance, dwStyle, szFile);
{ FIXME(msvideo,"%x %x %lx %s\n",hwndParent, hInstance, dwStyle, szFile);
return 0;
}
HWND32 VFWAPIV MCIWndCreate32W(HWND32 hwndParent, HINSTANCE32 hInstance,
DWORD dwStyle,LPCWSTR szFile)
{ FIXME(mmsys,"%x %x %lx %s\n",hwndParent, hInstance, dwStyle, debugstr_w(szFile));
{ FIXME(msvideo,"%x %x %lx %s\n",hwndParent, hInstance, dwStyle, debugstr_w(szFile));
return 0;
}
......@@ -15,5 +15,6 @@
#include "dinput.h"
#include "dsound.h"
#include "dplay.h"
#include "vfw.h"
#endif
SUBDIRS = \
avitools \
clock \
control \
notepad \
......
DEFS = -DWINELIB
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = none
PROGRAMS = icinfo
ALL_LIBS = $(WINELIB) $(X_LIBS) $(XLIB) $(LIBS)
RCFLAGS = -w32 -h
WRCEXTRA = -A -p $*
LANGUAGES =
LICENSELANG =
MOSTSRCS = \
icinfo.c
# Some strings need addresses >= 0x10000
STRINGSRCS = \
$(LICENSELANG:%=License_%.c)
RC_SRCS = $(LANGUAGES:%=%.rc)
C_SRCS = $(MOSTSRCS) $(STRINGSRCS)
MOSTOBJS = $(MOSTSRCS:.c=.o)
STRINGOBJS = $(STRINGSRCS:.c=.o) $(RC_SRCS:.rc=.o)
all: check_wrc $(PROGRAMS)
depend::
@MAKE_RULES@
# Override resource compiler rules
.rc.s:
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -o $*.s
.rc.h:
$(CPP) $(DEFS) $(OPTIONS) $(DIVINCL) -DRC_INVOKED -P -x c $< | $(WRC) $(WRCFLAGS) $(WRCEXTRA) -nH $*.h
icinfo: $(MOSTOBJS) $(STRINGOBJS)
$(CC) -o icinfo $(MOSTOBJS) $(LDOPTIONS) $(ALL_LIBS) $(STRINGOBJS)
install: dummy
$(INSTALL_PROGRAM) clock $(bindir)/clock
uninstall: dummy
$(RM) $(bindir)/clock
$(RC_SRCS:.rc=.s): $(WRC)
dummy:
### Dependencies:
#include <stdio.h>
#include <strings.h>
#include "wintypes.h"
#include "windows.h"
#include "mmsystem.h"
#include "vfw.h"
int PASCAL WinMain (HANDLE hInstance, HANDLE prev, LPSTR cmdline, int show)
{
int n=0,doabout=0,doconfigure=0;
char buf[128],type[5],handler[5];
HMODULE msvfw32 = LoadLibrary("msvfw32.dll");
BOOL32 (VFWAPI *fnICInfo)(DWORD fccType, DWORD fccHandler, ICINFO * lpicinfo);
LRESULT (VFWAPI *fnICClose)(HIC hic);
HIC (VFWAPI *fnICOpen)(DWORD fccType, DWORD fccHandler, UINT wMode);
LRESULT (VFWAPI *fnICGetInfo)(HIC hic,ICINFO *picinfo, DWORD cb);
LRESULT (VFWAPI *fnICSendMessage)(HIC hic, UINT msg, DWORD dw1, DWORD dw2);
#define XX(x) fn##x = (void*)GetProcAddress(msvfw32,#x);
XX(ICInfo);
XX(ICOpen);
XX(ICClose);
XX(ICGetInfo);
XX(ICSendMessage);
#undef XX
if (strstr(cmdline,"-about"))
doabout = 1;
if (strstr(cmdline,"-configure"))
doconfigure = 1;
printf("Currently installed Video Compressors:\n");
while (1) {
ICINFO ii;
HIC hic;
ii.dwSize = sizeof(ii);
if (!fnICInfo(ICTYPE_VIDEO,n++,&ii))
break;
if (!(hic=fnICOpen(ii.fccType,ii.fccHandler,ICMODE_QUERY)))
continue;
if (!fnICGetInfo(hic,&ii,sizeof(ii))) {
fnICClose(hic);
continue;
}
#define w2s(w,s) WideCharToMultiByte(0,0,w,-1,s,128,0,NULL)
w2s(ii.szName,buf);
memcpy(type,&(ii.fccType),4);type[4]='\0';
memcpy(handler,&(ii.fccHandler),4);handler[4]='\0';
printf("%s.%s: %s\n",type,handler,buf);
printf("\tdwFlags: 0x%08lx (",ii.dwFlags);
#define XX(x) if (ii.dwFlags & x) printf(#x" ");
XX(VIDCF_QUALITY);
XX(VIDCF_CRUNCH);
XX(VIDCF_TEMPORAL);
XX(VIDCF_COMPRESSFRAMES);
XX(VIDCF_DRAW);
XX(VIDCF_FASTTEMPORALC);
XX(VIDCF_FASTTEMPORALD);
XX(VIDCF_QUALITYTIME);
#undef XX
printf(")\n");
printf("\tdwVersion: 0x%08lx\n",ii.dwVersion);
printf("\tdwVersionICM: 0x%08lx\n",ii.dwVersionICM);
w2s(ii.szDescription,buf);
printf("\tszDescription: %s\n",buf);
if (doabout) ICAbout(hic,0);
if (doconfigure && ICQueryConfigure32(hic))
ICConfigure(hic,0);
fnICClose(hic);
}
return 0;
}
name msvfw32
type win32
# Yes, ICCompress,ICDecompress,MCIWnd* and ICDraw* are cdecl (VFWAPIV).
# The rest is stdcall (VFWAPI) however. -Marcus Meissner, 990124
2 stdcall VideoForWindowsVersion() VideoForWindowsVersion
3 stub DrawDibBegin
4 stub DrawDibChangePalette
......@@ -21,13 +24,13 @@ type win32
19 stub GetOpenFileNamePreviewW
20 stub GetSaveFileNamePreviewA
21 stub GetSaveFileNamePreviewW
22 stub ICClose
23 stub ICCompress
22 stdcall ICClose(long) ICClose32
23 cdecl ICCompress(long long ptr ptr ptr ptr ptr ptr long long long ptr ptr) ICCompress32
24 stub ICCompressorChoose
25 stub ICCompressorFree
26 stub ICDecompress
27 stub ICDraw
28 stdcall ICDrawBegin(long long long long long long long long long ptr long long long long long long) ICDrawBegin32
26 cdecl ICDecompress(long long ptr ptr ptr ptr) ICDecompress32
27 stub ICDraw # CDECL too
28 cdecl ICDrawBegin(long long long long long long long long long ptr long long long long long long) ICDrawBegin32
29 stub ICGetDisplayFormat
30 stdcall ICGetInfo(long ptr long) ICGetInfo32
31 stub ICImageCompress
......@@ -43,9 +46,9 @@ type win32
41 stub ICSeqCompressFrame
42 stub ICSeqCompressFrameEnd
43 stub ICSeqCompressFrameStart
44 stdcall MCIWndCreate (long long long ptr) MCIWndCreate32
45 stdcall MCIWndCreateA (long long long str) MCIWndCreate32A
46 stdcall MCIWndCreateW (long long long wstr) MCIWndCreate32W
44 cdecl MCIWndCreate (long long long ptr) MCIWndCreate32
45 cdecl MCIWndCreateA (long long long str) MCIWndCreate32A
46 cdecl MCIWndCreateW (long long long wstr) MCIWndCreate32W
47 stub MCIWndRegisterClass
48 stub StretchDIB
49 stub ls_ThunkData32
......
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