Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/programs/icinfo/icinfo.c
4389 views
1
/*
2
* Copyright 1999 Marcus Meissner
3
*
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17
*/
18
19
#include <stdio.h>
20
#include <string.h>
21
#include "windows.h"
22
#include "mmsystem.h"
23
#include "vfw.h"
24
25
static int WINAPIV mywprintf(const WCHAR *format, ...)
26
{
27
static char output_bufA[65536];
28
static WCHAR output_bufW[sizeof(output_bufA)];
29
va_list parms;
30
DWORD nOut;
31
BOOL res = FALSE;
32
HANDLE hout = GetStdHandle(STD_OUTPUT_HANDLE);
33
34
va_start(parms, format);
35
vswprintf(output_bufW, ARRAY_SIZE(output_bufW), format, parms);
36
va_end(parms);
37
38
res = WriteConsoleW(hout, output_bufW, lstrlenW(output_bufW), &nOut, NULL);
39
if (!res)
40
{
41
DWORD convertedChars;
42
43
/* Convert to OEM, then output */
44
convertedChars = WideCharToMultiByte(GetOEMCP(), 0, output_bufW, -1,
45
output_bufA, sizeof(output_bufA),
46
NULL, NULL);
47
res = WriteFile(hout, output_bufA, convertedChars, &nOut, FALSE);
48
}
49
50
return res ? nOut : 0;
51
}
52
53
int __cdecl wmain(int argc, WCHAR* argv[])
54
{
55
int i, n=0,doabout=0,doconfigure=0;
56
57
for (i = 1; i < argc; i++) {
58
if (!lstrcmpW(argv[i], L"-about"))
59
doabout = 1;
60
else if (!lstrcmpW(argv[i], L"-configure"))
61
doconfigure = 1;
62
else {
63
mywprintf(L"Unknown option: %s\n", argv[i]);
64
return -1;
65
}
66
}
67
68
mywprintf(L"%s", L"Currently installed Video Compressors:\n");
69
while (1) {
70
ICINFO ii;
71
HIC hic;
72
73
ii.dwSize = sizeof(ii);
74
if (!ICInfo(ICTYPE_VIDEO,n++,&ii))
75
break;
76
if (!(hic=ICOpen(ii.fccType,ii.fccHandler,ICMODE_QUERY)))
77
continue;
78
if (!ICGetInfo(hic,&ii,sizeof(ii))) {
79
ICClose(hic);
80
continue;
81
}
82
83
mywprintf(L"%c%c%c%c.%c%c%c%c: %s\n",
84
LOBYTE(ii.fccType),LOBYTE(ii.fccType>>8),LOBYTE(ii.fccType>>16),LOBYTE(ii.fccType>>24),
85
LOBYTE(ii.fccHandler),LOBYTE(ii.fccHandler>>8),LOBYTE(ii.fccHandler>>16),LOBYTE(ii.fccHandler>>24),
86
ii.szName);
87
mywprintf(L"\tdwFlags: 0x%08x (",ii.dwFlags);
88
89
if (ii.dwFlags & VIDCF_QUALITY) mywprintf(L"%s ", L"VIDCF_QUALITY");
90
if (ii.dwFlags & VIDCF_CRUNCH) mywprintf(L"%s ", L"VIDCF_CRUNCH");
91
if (ii.dwFlags & VIDCF_TEMPORAL) mywprintf(L"%s ", L"VIDCF_TEMPORAL");
92
if (ii.dwFlags & VIDCF_COMPRESSFRAMES) mywprintf(L"%s ", L"VIDCF_COMPRESSFRAMES");
93
if (ii.dwFlags & VIDCF_DRAW) mywprintf(L"%s ", L"VIDCF_DRAW");
94
if (ii.dwFlags & VIDCF_FASTTEMPORALC) mywprintf(L"%s ", L"VIDCF_FASTTEMPORALC");
95
if (ii.dwFlags & VIDCF_FASTTEMPORALD) mywprintf(L"%s ", L"VIDCF_FASTTEMPORALD");
96
if (ii.dwFlags & VIDCF_QUALITYTIME) mywprintf(L"%s ", L"VIDCF_QUALITYTIME");
97
98
mywprintf(L"%s", L")\n");
99
mywprintf(L"\tdwVersion: 0x%08x\n", ii.dwVersion);
100
mywprintf(L"\tdwVersionICM: 0x%08x\n", ii.dwVersionICM);
101
mywprintf(L"\tszDescription: %s\n", ii.szDescription);
102
if (doabout) ICAbout(hic,0);
103
if (doconfigure && ICQueryConfigure(hic))
104
ICConfigure(hic,0);
105
ICClose(hic);
106
}
107
return 0;
108
}
109
110