2002-03-09 23:29:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1999 Marcus Meissner
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-09 23:29:33 +00:00
|
|
|
*/
|
|
|
|
|
1999-01-29 15:12:10 +00:00
|
|
|
#include <stdio.h>
|
1999-03-25 15:52:09 +00:00
|
|
|
#include <string.h>
|
1999-01-29 15:12:10 +00:00
|
|
|
#include "windows.h"
|
|
|
|
#include "mmsystem.h"
|
|
|
|
#include "vfw.h"
|
|
|
|
|
2019-04-29 08:48:09 +00:00
|
|
|
static int WINAPIV mywprintf(const WCHAR *format, ...)
|
2011-11-03 20:54:11 +00:00
|
|
|
{
|
|
|
|
static char output_bufA[65536];
|
2018-06-26 14:14:33 +00:00
|
|
|
static WCHAR output_bufW[sizeof(output_bufA)];
|
2021-10-25 09:01:02 +00:00
|
|
|
va_list parms;
|
2011-11-03 20:54:11 +00:00
|
|
|
DWORD nOut;
|
|
|
|
BOOL res = FALSE;
|
|
|
|
HANDLE hout = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
|
|
|
2021-10-25 09:01:02 +00:00
|
|
|
va_start(parms, format);
|
2019-04-29 08:48:09 +00:00
|
|
|
vswprintf(output_bufW, ARRAY_SIZE(output_bufW), format, parms);
|
2021-10-25 09:01:02 +00:00
|
|
|
va_end(parms);
|
2011-11-03 20:54:11 +00:00
|
|
|
|
2022-04-28 09:22:40 +00:00
|
|
|
res = WriteConsoleW(hout, output_bufW, lstrlenW(output_bufW), &nOut, NULL);
|
|
|
|
if (!res)
|
2011-11-03 20:54:11 +00:00
|
|
|
{
|
|
|
|
DWORD convertedChars;
|
|
|
|
|
|
|
|
/* Convert to OEM, then output */
|
2022-04-28 09:22:40 +00:00
|
|
|
convertedChars = WideCharToMultiByte(GetOEMCP(), 0, output_bufW, -1,
|
2011-11-03 20:54:11 +00:00
|
|
|
output_bufA, sizeof(output_bufA),
|
2013-04-10 14:16:35 +00:00
|
|
|
NULL, NULL);
|
2011-11-03 20:54:11 +00:00
|
|
|
res = WriteFile(hout, output_bufA, convertedChars, &nOut, FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
return res ? nOut : 0;
|
|
|
|
}
|
1999-01-29 15:12:10 +00:00
|
|
|
|
2019-10-17 15:05:47 +00:00
|
|
|
int __cdecl wmain(int argc, WCHAR* argv[])
|
1999-01-29 15:12:10 +00:00
|
|
|
{
|
2011-11-03 20:54:05 +00:00
|
|
|
int i, n=0,doabout=0,doconfigure=0;
|
2011-11-03 20:54:11 +00:00
|
|
|
|
2011-11-03 20:54:05 +00:00
|
|
|
for (i = 1; i < argc; i++) {
|
2020-11-10 21:50:34 +00:00
|
|
|
if (!lstrcmpW(argv[i], L"-about"))
|
2011-11-03 20:54:05 +00:00
|
|
|
doabout = 1;
|
2020-11-10 21:50:34 +00:00
|
|
|
else if (!lstrcmpW(argv[i], L"-configure"))
|
2011-11-03 20:54:05 +00:00
|
|
|
doconfigure = 1;
|
|
|
|
else {
|
2020-11-10 21:50:34 +00:00
|
|
|
mywprintf(L"Unknown option: %s\n", argv[i]);
|
2011-11-03 20:54:05 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
1999-01-29 15:12:10 +00:00
|
|
|
|
2020-11-10 21:50:34 +00:00
|
|
|
mywprintf(L"%s", L"Currently installed Video Compressors:\n");
|
1999-01-29 15:12:10 +00:00
|
|
|
while (1) {
|
|
|
|
ICINFO ii;
|
|
|
|
HIC hic;
|
|
|
|
|
|
|
|
ii.dwSize = sizeof(ii);
|
2003-12-02 05:33:26 +00:00
|
|
|
if (!ICInfo(ICTYPE_VIDEO,n++,&ii))
|
1999-01-29 15:12:10 +00:00
|
|
|
break;
|
2003-12-02 05:33:26 +00:00
|
|
|
if (!(hic=ICOpen(ii.fccType,ii.fccHandler,ICMODE_QUERY)))
|
1999-01-29 15:12:10 +00:00
|
|
|
continue;
|
2003-12-02 05:33:26 +00:00
|
|
|
if (!ICGetInfo(hic,&ii,sizeof(ii))) {
|
|
|
|
ICClose(hic);
|
1999-01-29 15:12:10 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2020-11-10 21:50:34 +00:00
|
|
|
mywprintf(L"%c%c%c%c.%c%c%c%c: %s\n",
|
2011-11-03 20:54:11 +00:00
|
|
|
LOBYTE(ii.fccType),LOBYTE(ii.fccType>>8),LOBYTE(ii.fccType>>16),LOBYTE(ii.fccType>>24),
|
|
|
|
LOBYTE(ii.fccHandler),LOBYTE(ii.fccHandler>>8),LOBYTE(ii.fccHandler>>16),LOBYTE(ii.fccHandler>>24),
|
|
|
|
ii.szName);
|
2020-11-10 21:50:34 +00:00
|
|
|
mywprintf(L"\tdwFlags: 0x%08x (",ii.dwFlags);
|
2011-11-03 20:54:11 +00:00
|
|
|
|
2020-11-10 21:50:34 +00:00
|
|
|
if (ii.dwFlags & VIDCF_QUALITY) mywprintf(L"%s ", L"VIDCF_QUALITY");
|
|
|
|
if (ii.dwFlags & VIDCF_CRUNCH) mywprintf(L"%s ", L"VIDCF_CRUNCH");
|
|
|
|
if (ii.dwFlags & VIDCF_TEMPORAL) mywprintf(L"%s ", L"VIDCF_TEMPORAL");
|
|
|
|
if (ii.dwFlags & VIDCF_COMPRESSFRAMES) mywprintf(L"%s ", L"VIDCF_COMPRESSFRAMES");
|
|
|
|
if (ii.dwFlags & VIDCF_DRAW) mywprintf(L"%s ", L"VIDCF_DRAW");
|
|
|
|
if (ii.dwFlags & VIDCF_FASTTEMPORALC) mywprintf(L"%s ", L"VIDCF_FASTTEMPORALC");
|
|
|
|
if (ii.dwFlags & VIDCF_FASTTEMPORALD) mywprintf(L"%s ", L"VIDCF_FASTTEMPORALD");
|
|
|
|
if (ii.dwFlags & VIDCF_QUALITYTIME) mywprintf(L"%s ", L"VIDCF_QUALITYTIME");
|
2011-11-03 20:54:11 +00:00
|
|
|
|
2020-11-10 21:50:34 +00:00
|
|
|
mywprintf(L"%s", L")\n");
|
|
|
|
mywprintf(L"\tdwVersion: 0x%08x\n", ii.dwVersion);
|
|
|
|
mywprintf(L"\tdwVersionICM: 0x%08x\n", ii.dwVersionICM);
|
|
|
|
mywprintf(L"\tszDescription: %s\n", ii.szDescription);
|
1999-01-29 15:12:10 +00:00
|
|
|
if (doabout) ICAbout(hic,0);
|
1999-02-26 11:11:13 +00:00
|
|
|
if (doconfigure && ICQueryConfigure(hic))
|
1999-01-29 15:12:10 +00:00
|
|
|
ICConfigure(hic,0);
|
2003-12-02 05:33:26 +00:00
|
|
|
ICClose(hic);
|
1999-01-29 15:12:10 +00:00
|
|
|
}
|
2002-05-31 23:06:46 +00:00
|
|
|
return 0;
|
1999-01-29 15:12:10 +00:00
|
|
|
}
|