ReactOS 0.4.17-dev-966-gf06eace
msvfw.c
Go to the documentation of this file.
1/*
2 * Unit tests for video playback
3 *
4 * Copyright 2008,2010 Jörg Höhle
5 * Copyright 2008 Austin English
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22#define WIN32_LEAN_AND_MEAN
23#include <windows.h>
24#include <vfw.h>
25
26#include "wine/test.h"
27
28static inline int get_stride(int width, int depth)
29{
30 return ((depth * width + 31) >> 3) & ~3;
31}
32
33static void test_OpenCase(void)
34{
35 HIC h;
37 /* Check if default handler works */
38 h = ICOpen(mmioFOURCC('v','i','d','c'),0,ICMODE_DECOMPRESS);
39 ok(0!=h,"ICOpen(vidc.0) failed\n");
40 if (h) {
41 info.dwSize = sizeof(info);
42 info.szName[0] = 0;
43 ICGetInfo(h, &info, sizeof(info));
44 trace("The default decompressor is %s\n", wine_dbgstr_w(info.szName));
45 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
46 }
47 h = ICOpen(mmioFOURCC('v','i','d','c'),0,ICMODE_COMPRESS);
48 ok(0!=h || broken(h == 0),"ICOpen(vidc.0) failed\n"); /* Not present in Win8 */
49 if (h) {
50 info.dwSize = sizeof(info);
51 info.szName[0] = 0;
52 ICGetInfo(h, &info, sizeof(info));
53 trace("The default compressor is %s\n", wine_dbgstr_w(info.szName));
54 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
55 }
56
57 /* Open a compressor with combinations of lowercase
58 * and uppercase compressortype and handler.
59 */
60 h = ICOpen(mmioFOURCC('v','i','d','c'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
61 ok(0!=h,"ICOpen(vidc.msvc) failed\n");
62 if (h) {
63 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
64 }
65 h = ICOpen(mmioFOURCC('v','i','d','c'),mmioFOURCC('M','S','V','C'),ICMODE_DECOMPRESS);
66 ok(0!=h,"ICOpen(vidc.MSVC) failed\n");
67 if (h) {
68 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
69 }
70 h = ICOpen(mmioFOURCC('V','I','D','C'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
71 ok(0!=h,"ICOpen(VIDC.msvc) failed\n");
72 if (h) {
73 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
74 }
75 h = ICOpen(mmioFOURCC('V','I','D','C'),mmioFOURCC('M','S','V','C'),ICMODE_DECOMPRESS);
76 ok(0!=h,"ICOpen(VIDC.MSVC) failed\n");
77 if (h) {
78 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
79 }
80 h = ICOpen(mmioFOURCC('v','i','d','c'),mmioFOURCC('m','S','v','C'),ICMODE_DECOMPRESS);
81 ok(0!=h,"ICOpen(vidc.mSvC) failed\n");
82 if (h) {
83 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
84 }
85 h = ICOpen(mmioFOURCC('v','I','d','C'),mmioFOURCC('m','s','v','c'),ICMODE_DECOMPRESS);
86 ok(0!=h,"ICOpen(vIdC.msvc) failed\n");
87 if (h) {
88 ok(ICClose(h)==ICERR_OK,"ICClose failed\n");
89 }
90}
91
92static void test_Locate(void)
93{
94 static BITMAPINFOHEADER bi = {sizeof(BITMAPINFOHEADER),32,8, 1,8, BI_RLE8, 0,100000,100000, 0,0};
95 static BITMAPINFOHEADER bo = {sizeof(BITMAPINFOHEADER),32,8, 1,8, BI_RGB, 0,100000,100000, 0,0};
96 BITMAPINFOHEADER tmp = {sizeof(BITMAPINFOHEADER)};
97 HIC h;
98 DWORD err;
99
100 /* Oddly, MSDN documents that ICLocate takes BITMAPINFOHEADER
101 * pointers, while ICDecompressQuery takes the larger
102 * BITMAPINFO. Probably it's all the same as long as the
103 * variable length color quads are present when they are
104 * needed. */
105
106 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
107 ok(h != 0, "RLE8->RGB failed\n");
108 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
109
110 bo.biHeight = - bo.biHeight;
111 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
112 ok(h == 0, "RLE8->RGB height<0 succeeded\n");
113 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
114 bo.biHeight = - bo.biHeight;
115
116 bi.biCompression = mmioFOURCC('c','v','i','d'); /* Cinepak */
117 h = ICOpen(ICTYPE_VIDEO, mmioFOURCC('c','v','i','d'), ICMODE_DECOMPRESS);
118 if (h == 0) win_skip("Cinepak/ICCVID codec not found\n");
119 else {
120 bo.biBitCount = bi.biBitCount = 32;
121 err = ICDecompressQuery(h, &bi, &bo);
122 ok(err == ICERR_OK, "Query cvid->RGB32: %ld\n", err);
123
124 err = ICDecompressQuery(h, &bi, NULL);
125 ok(err == ICERR_OK, "Query cvid 32: %ld\n", err);
126
127 bo.biHeight = -bo.biHeight;
128 err = ICDecompressQuery(h, &bi, &bo);
129 ok(err == ICERR_OK, "Query cvid->RGB32 height<0: %ld\n", err);
130 bo.biHeight = -bo.biHeight;
131
132 bi.biWidth = 17;
133
134 bi.biBitCount = 8;
135 err = ICDecompressGetFormat(h, &bi, &tmp);
136 ok(err == ICERR_OK, "Query cvid output format: %ld\n", err);
137 ok(tmp.biBitCount == 24, "Expected 24 bit, got %d bit\n", tmp.biBitCount);
138 ok(tmp.biSizeImage == get_stride(17, 24) * 8, "Expected size %d, got %ld\n",
139 get_stride(17, 24) * 8, tmp.biSizeImage);
140
141 bi.biBitCount = 15;
142 err = ICDecompressGetFormat(h, &bi, &tmp);
143 ok(err == ICERR_OK, "Query cvid output format: %ld\n", err);
144 ok(tmp.biBitCount == 24, "Expected 24 bit, got %d bit\n", tmp.biBitCount);
145 ok(tmp.biSizeImage == get_stride(17, 24) * 8, "Expected size %d, got %ld\n",
146 get_stride(17, 24) * 8, tmp.biSizeImage);
147
148 bi.biBitCount = 16;
149 err = ICDecompressGetFormat(h, &bi, &tmp);
150 ok(err == ICERR_OK, "Query cvid output format: %ld\n", err);
151 ok(tmp.biBitCount == 24, "Expected 24 bit, got %d bit\n", tmp.biBitCount);
152 ok(tmp.biSizeImage == get_stride(17, 24) * 8, "Expected size %d, got %ld\n",
153 get_stride(17, 24) * 8, tmp.biSizeImage);
154
155 bi.biBitCount = 24;
156 err = ICDecompressGetFormat(h, &bi, &tmp);
157 ok(err == ICERR_OK, "Query cvid output format: %ld\n", err);
158 ok(tmp.biBitCount == 24, "Expected 24 bit, got %d bit\n", tmp.biBitCount);
159 ok(tmp.biSizeImage == get_stride(17, 24) * 8, "Expected size %d, got %ld\n",
160 get_stride(17, 24) * 8, tmp.biSizeImage);
161
162 bi.biBitCount = 32;
163 err = ICDecompressGetFormat(h, &bi, &tmp);
164 ok(err == ICERR_OK, "Query cvid output format: %ld\n", err);
165 ok(tmp.biBitCount == 24, "Expected 24 bit, got %d bit\n", tmp.biBitCount);
166 ok(tmp.biSizeImage == get_stride(17, 24) * 8, "Expected size %d, got %ld\n",
167 get_stride(17, 24) * 8, tmp.biSizeImage);
168
169 bi.biWidth = 32;
170
171 ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
172
173 bo.biBitCount = bi.biBitCount = 8;
174 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
175 todo_wine ok(h != 0, "cvid->RGB8 failed\n");
176 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
177 bo.biHeight = - bo.biHeight;
178 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
179 todo_wine ok(h != 0, "cvid->RGB8 height<0 failed\n");
180 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
181 bo.biHeight = - bo.biHeight;
182
183 bo.biBitCount = bi.biBitCount = 16;
184 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
185 ok(h != 0, "cvid->RGB16 failed\n");
186 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
187 bo.biHeight = - bo.biHeight;
188 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
189 ok(h != 0, "cvid->RGB16 height<0 failed\n");
190 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
191 bo.biHeight = - bo.biHeight;
192
193 bo.biCompression = mmioFOURCC('U','Y','V','Y');
194 bo.biBitCount = bi.biBitCount = 16;
195 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
196 ok(h == 0, "cvid->UYVY succeeded\n");
197 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
199
200 bo.biBitCount = bi.biBitCount = 32;
201 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
202 ok(h != 0, "cvid->RGB32 failed\n");
203 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
204 bo.biHeight = - bo.biHeight;
205 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
206 ok(h != 0, "cvid->RGB32 height<0 failed\n");
207 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
208 bo.biHeight = - bo.biHeight;
209
210 bi.biCompression = mmioFOURCC('C','V','I','D');
211 /* Unlike ICOpen, upper case fails with ICLocate. */
212 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
213 ok(h == 0, "CVID->RGB32 upper case succeeded\n");
214 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
215 }
216
217 bi.biCompression = mmioFOURCC('M','S','V','C'); /* MS Video 1 */
218
219 bo.biBitCount = bi.biBitCount = 16;
220 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
221 ok(h != 0, "MSVC->RGB16 failed\n");
222 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
223
224 bo.biHeight = - bo.biHeight;
225 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
226 todo_wine ok(h != 0, "MSVC->RGB16 height<0 failed\n");
227 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
228 bo.biHeight = - bo.biHeight;
229
230 bo.biHeight--;
231 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
232 ok(h == 0, "MSVC->RGB16 height too small succeeded\n");
233 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
234 bo.biHeight++;
235
236 /* ICLocate wants upper case MSVC */
237 bi.biCompression = mmioFOURCC('m','s','v','c');
238 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
239 ok(h == 0, "msvc->RGB16 succeeded\n");
240 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
241
242 bi.biCompression = mmioFOURCC('M','S','V','C');
243 h = ICOpen(ICTYPE_VIDEO, mmioFOURCC('M','S','V','C'), ICMODE_DECOMPRESS);
244 ok(h != 0, "No MSVC codec installed!?\n");
245 if (h != 0) {
246 err = ICDecompressQuery(h, &bi, &bo);
247 ok(err == ICERR_OK, "Query MSVC->RGB16: %ld\n", err);
248
249 err = ICDecompressQuery(h, &bi, NULL);
250 ok(err == ICERR_OK, "Query MSVC 16: %ld\n", err);
251
252 bo.biHeight = -bo.biHeight;
253 err = ICDecompressQuery(h, &bi, &bo);
254 todo_wine ok(err == ICERR_OK, "Query MSVC->RGB16 height<0: %ld\n", err);
255 bo.biHeight = -bo.biHeight;
256
257 bo.biBitCount = 24;
258 err = ICDecompressQuery(h, &bi, &bo);
259 ok(err == ICERR_OK, "Query MSVC 16->24: %ld\n", err);
260 bo.biBitCount = 16;
261
262 bi.biWidth = 553;
263
264 bi.biBitCount = 8;
265 err = ICDecompressGetFormat(h, &bi, &tmp);
266 ok(err == ICERR_OK, "Query MSVC output format: %ld\n", err);
267 ok(tmp.biBitCount == 8, "Expected 8 bit, got %d bit\n", tmp.biBitCount);
268 ok(tmp.biWidth == 552, "Expected width 552, got %ld\n", tmp.biWidth);
269 ok(tmp.biSizeImage == get_stride(552, 8) * 8, "Expected size %d, got %ld\n",
270 get_stride(552, 8) * 8, tmp.biSizeImage);
271
272 bi.biBitCount = 15;
273 err = ICDecompressGetFormat(h, &bi, &tmp);
274 ok(err == ICERR_BADFORMAT, "Query MSVC output format: %ld\n", err);
275
276 bi.biBitCount = 16;
277 err = ICDecompressGetFormat(h, &bi, &tmp);
278 ok(err == ICERR_OK, "Query MSVC output format: %ld\n", err);
279 ok(tmp.biBitCount == 16, "Expected 16 bit, got %d bit\n", tmp.biBitCount);
280 ok(tmp.biWidth == 552, "Expected width 552, got %ld\n", tmp.biWidth);
281 ok(tmp.biSizeImage == get_stride(552, 16) * 8, "Expected size %d, got %ld\n",
282 get_stride(552, 16) * 8, tmp.biSizeImage);
283
284 bi.biBitCount = 24;
285 err = ICDecompressGetFormat(h, &bi, &tmp);
286 ok(err == ICERR_BADFORMAT, "Query MSVC output format: %ld\n", err);
287
288 bi.biBitCount = 32;
289 err = ICDecompressGetFormat(h, &bi, &tmp);
290 ok(err == ICERR_BADFORMAT, "Query MSVC output format: %ld\n", err);
291
292 bi.biHeight = 17;
293 bi.biBitCount = 8;
294 err = ICDecompressGetFormat(h, &bi, &tmp);
295 ok(err == ICERR_OK, "Query MSVC output format: %ld\n", err);
296 ok(tmp.biHeight == 16, "Expected height 16, got %ld\n", tmp.biHeight);
297 bi.biHeight = 8;
298
299 bi.biWidth = 32;
300
301 bi.biCompression = mmioFOURCC('m','s','v','c');
302 err = ICDecompressQuery(h, &bi, &bo);
303 ok(err == ICERR_BADFORMAT, "Query msvc->RGB16: %ld\n", err);
304
305 ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
306 }
307
309 bo.biBitCount = bi.biBitCount = 8;
310 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
311 ok(h != 0, "RGB8->RGB identity failed\n");
312 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
313
315 h = ICLocate(ICTYPE_VIDEO, 0, &bi, &bo, ICMODE_DECOMPRESS);
316 ok(h != 0, "RLE8->RGB again failed\n");
317 if (h) ok(ICClose(h) == ICERR_OK,"ICClose failed\n");
318}
319
320static void test_ICSeqCompress(void)
321{
322 /* The purpose of this test is to validate sequential frame compressing
323 * functions. The MRLE codec will be used because Wine supports it and
324 * it is present in any Windows.
325 */
326 HIC h;
327 DWORD err, vidc = mmioFOURCC('v','i','d','c'), mrle = mmioFOURCC('m', 'r', 'l', 'e');
328 DWORD i;
329 LONG frame_len;
330 BOOL key_frame, ret;
331 char *frame;
332 COMPVARS pc;
333 struct { BITMAPINFOHEADER header; RGBQUAD map[256]; }
334 input_header = { {sizeof(BITMAPINFOHEADER), 32, 1, 1, 8, 0, 32*8, 0, 0, 256, 256},
335 {{255,0,0}, {0,255,0}, {0,0,255}, {255,255,255}}};
336 PBITMAPINFO bitmap = (PBITMAPINFO) &input_header;
337 static BYTE input[32] = {1,2,3,3,3,3,2,3,1};
338 static const BYTE output_kf[] = {1,1,1,2,4,3,0,3,2,3,1,0,23,0,0,0,0,1}, /* key frame*/
339 output_nkf[] = {0,0,0,1}; /* non key frame */
340
341 h = ICOpen(vidc, mrle, ICMODE_COMPRESS);
342 ok(h != NULL, "Expected non-NULL\n");
343
344 pc.cbSize = sizeof(pc);
346 pc.fccType = vidc;
347 pc.fccHandler = mrle;
348 pc.hic = h;
349 pc.lpbiIn = NULL;
350 pc.lpbiOut = NULL;
351 pc.lpBitsOut = pc.lpBitsPrev = pc.lpState = NULL;
353 pc.lKey = 1;
354 pc.lDataRate = 300;
355 pc.lpState = NULL;
356 pc.cbState = 0;
357
359 ok(ret == TRUE, "Expected TRUE\n");
360 /* Check that reserved pointers were allocated */
361 ok(pc.lpbiIn != NULL, "Expected non-NULL\n");
362 ok(pc.lpbiOut != NULL, "Expected non-NULL\n");
363
364 for(i = 0; i < 9; i++)
365 {
366 frame_len = 0;
367 frame = ICSeqCompressFrame(&pc, 0, input, &key_frame, &frame_len);
368 ok(frame != NULL, "Frame[%ld]: Expected non-NULL\n", i);
369 if (frame_len == sizeof(output_nkf))
370 ok(!memcmp(output_nkf, frame, frame_len), "Frame[%ld]: Contents do not match\n", i);
371 else if (frame_len == sizeof(output_kf))
372 ok(!memcmp(output_kf, frame, frame_len), "Frame[%ld]: Contents do not match\n", i);
373 else
374 ok(0, "Unknown frame size of %ld byten\n", frame_len);
375 }
376
378 ICCompressorFree(&pc);
379 /* ICCompressorFree already closed the HIC */
380 err = ICClose(h);
381 ok(err == ICERR_BADHANDLE, "Expected -8, got %ld\n", err);
382}
383
385
387 LPARAM lparam1, LPARAM lparam2)
388{
389 ICINFO *info = (ICINFO *)lparam1;
390
391 ok(!id, "Got unexpected id %#Ix.\n", id);
392 ok(msg == ICM_GETINFO, "Got unexpected message %#x.\n", msg);
393 ok(info == &enum_info, "Expected lparam1 %p, got %p.\n", &enum_info, info);
394 ok(lparam2 == sizeof(ICINFO), "Got lparam2 %Id.\n", lparam2);
395
396 ok(!info->fccType, "Got unexpected type %#lx.\n", info->fccType);
397 ok(!info->fccHandler, "Got unexpected handler %#lx.\n", info->fccHandler);
398 ok(!info->dwFlags, "Got unexpected flags %#lx.\n", info->dwFlags);
399 ok(!info->dwVersion, "Got unexpected version %#lx.\n", info->dwVersion);
400 ok(info->dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", info->dwVersionICM);
401 ok(!info->szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(info->szName));
402 ok(!info->szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(info->szDescription));
403 ok(!info->szDriver[0], "Got unexpected driver %s.\n", wine_dbgstr_w(info->szDriver));
404
405 info->dwVersion = 0xdeadbeef;
406 return sizeof(ICINFO);
407}
408
409static void test_ICInfo(void)
410{
411 static const DWORD test_type = mmioFOURCC('w','i','n','e');
412 static const DWORD test_handler = mmioFOURCC('t','e','s','t');
413 DWORD i = 0, found = 0;
414 char buffer[MAX_PATH];
415 ICINFO info, info2;
416 unsigned char *fcc;
417 DWORD size;
418 BOOL ret;
419 HKEY key;
420 LONG res;
421
422 for (;;)
423 {
424 memset(&info, 0x55, sizeof(info));
425 info.dwSize = sizeof(info);
426 if (!ICInfo(0, i++, &info))
427 break;
428 trace("Codec name: %s, fccHandler: 0x%08lx\n", wine_dbgstr_w(info.szName), info.fccHandler);
429 ok(info.fccType, "Expected nonzero type.\n");
430 ok(info.fccHandler, "Expected nonzero handler.\n");
431 ok(!info.dwFlags, "Got unexpected flags %#lx.\n", info.dwFlags);
432 ok(!info.dwVersion, "Got unexpected version %#lx.\n", info.dwVersion);
433 ok(info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", info.dwVersionICM);
434 ok(!info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szName));
435 ok(!info.szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szDescription));
436
437 ok(ICInfo(info.fccType, info.fccHandler, &info2),
438 "ICInfo failed on fcc 0x%08lx\n", info.fccHandler);
439
440 fcc = (unsigned char *)&info.fccHandler;
441 if (!isalpha(fcc[0])) continue;
442
443 found++;
444 /* Test getting info with a different case - bug 41602 */
445 fcc[0] ^= 0x20;
446 ok(ICInfo(info.fccType, info.fccHandler, &info2),
447 "ICInfo failed on fcc 0x%08lx\n", info.fccHandler);
448 }
449 ok(found != 0, "expected at least one codec\n");
450
451 memset(&info, 0x55, sizeof(info));
452 info.dwSize = sizeof(info);
453 ok(!ICInfo(ICTYPE_VIDEO, mmioFOURCC('f','a','k','e'), &info), "expected failure\n");
454 ok(info.fccType == ICTYPE_VIDEO, "got 0x%08lx\n", info.fccType);
455 ok(info.fccHandler == mmioFOURCC('f','a','k','e'), "got 0x%08lx\n", info.fccHandler);
456 ok(!info.dwFlags, "Got unexpected flags %#lx.\n", info.dwFlags);
457 ok(!info.dwVersion, "Got unexpected version %#lx.\n", info.dwVersion);
458 ok(info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", info.dwVersionICM);
459 ok(!info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szName));
460 ok(!info.szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szDescription));
461 ok(!info.szDriver[0], "Got unexpected driver %s.\n", wine_dbgstr_w(info.szDriver));
462
463 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows NT"
464 "\\CurrentVersion\\Drivers32", 0, KEY_ALL_ACCESS, &key))
465 {
467 ok(ret, "Failed to install driver.\n");
468
469 size = sizeof(buffer);
470 res = RegQueryValueExA(key, "wine.test", NULL, NULL, (BYTE *)buffer, &size);
471 ok(!res, "Failed to query value, error %ld.\n", res);
472 ok(!strcmp(buffer, "bogus"), "Got unexpected value \"%s\".\n", buffer);
473
474 memset(&info, 0x55, sizeof(info));
475 info.dwSize = sizeof(info);
476 ok(ICInfo(test_type, test_handler, &info), "Expected success.\n");
477 ok(info.fccType == test_type, "Got unexpected type %#lx.\n", info.fccType);
478 ok(info.fccHandler == test_handler, "Got unexpected handler %#lx.\n", info.fccHandler);
479 ok(!info.dwFlags, "Got unexpected flags %#lx.\n", info.dwFlags);
480 ok(!info.dwVersion, "Got unexpected version %#lx.\n", info.dwVersion);
481 ok(info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", info.dwVersionICM);
482 ok(!info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szName));
483 ok(!info.szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szDescription));
484 ok(!lstrcmpW(info.szDriver, L"bogus"), "Got unexpected driver %s.\n", wine_dbgstr_w(info.szDriver));
485
486 /* Drivers installed after msvfw32 is loaded are not enumerated. */
488 ok(!ICInfo(test_type, 0, &info), "Expected failure.\n");
489
491 ok(ret, "Failed to remove driver.\n");
492
493 res = RegDeleteValueA(key, "wine.test");
494 ok(res == ERROR_FILE_NOT_FOUND, "Got error %lu.\n", res);
496 }
497 else
498 win_skip("Not enough permissions to register codec drivers.\n");
499
500 if (WritePrivateProfileStringA("drivers32", "wine.test", "bogus", "system.ini"))
501 {
502 memset(&info, 0x55, sizeof(info));
503 info.dwSize = sizeof(info);
504 ok(ICInfo(test_type, test_handler, &info), "Expected success.\n");
505 ok(info.fccType == test_type, "Got unexpected type %#lx.\n", info.fccType);
506 ok(info.fccHandler == test_handler, "Got unexpected handler %#lx.\n", info.fccHandler);
507 ok(!info.dwFlags, "Got unexpected flags %#lx.\n", info.dwFlags);
508 ok(!info.dwVersion, "Got unexpected version %#lx.\n", info.dwVersion);
509 ok(info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", info.dwVersionICM);
510 ok(!info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szName));
511 ok(!info.szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(info.szDescription));
512 ok(!lstrcmpW(info.szDriver, L"bogus"), "Got unexpected driver %s.\n", wine_dbgstr_w(info.szDriver));
513
514 /* Drivers installed after msvfw32 is loaded are not enumerated. */
516 ok(!ICInfo(test_type, 0, &info), "Expected failure.\n");
517
518 ret = WritePrivateProfileStringA("drivers32", "wine.test", NULL, "system.ini");
519 ok(ret, "Failed to remove INI entry.\n");
520 }
521
523 ok(ret, "Failed to install driver.\n");
524
525 memset(&enum_info, 0x55, sizeof(enum_info));
526 enum_info.dwSize = sizeof(enum_info);
527 ok(ICInfo(test_type, test_handler, &enum_info), "Expected success.\n");
528 ok(!enum_info.fccType, "Got unexpected type %#lx.\n", enum_info.fccType);
529 ok(!enum_info.fccHandler, "Got unexpected handler %#lx.\n", enum_info.fccHandler);
530 ok(!enum_info.dwFlags, "Got unexpected flags %#lx.\n", enum_info.dwFlags);
531 ok(enum_info.dwVersion == 0xdeadbeef, "Got unexpected version %#lx.\n", enum_info.dwVersion);
532 ok(enum_info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", enum_info.dwVersionICM);
533 ok(!enum_info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(enum_info.szName));
534 ok(!enum_info.szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(enum_info.szDescription));
535 ok(!enum_info.szDriver[0], "Got unexpected driver %s.\n", wine_dbgstr_w(enum_info.szDriver));
536
537 /* Functions installed after msvfw32 is loaded are enumerated. */
538 memset(&enum_info, 0x55, sizeof(enum_info));
539 enum_info.dwSize = sizeof(enum_info);
540 ok(ICInfo(test_type, 0, &enum_info), "Expected success.\n");
541 ok(!enum_info.fccType, "Got unexpected type %#lx.\n", enum_info.fccType);
542 ok(!enum_info.fccHandler, "Got unexpected handler %#lx.\n", enum_info.fccHandler);
543 ok(!enum_info.dwFlags, "Got unexpected flags %#lx.\n", enum_info.dwFlags);
544 ok(enum_info.dwVersion == 0xdeadbeef, "Got unexpected version %#lx.\n", enum_info.dwVersion);
545 ok(enum_info.dwVersionICM == ICVERSION, "Got unexpected ICM version %#lx.\n", enum_info.dwVersionICM);
546 ok(!enum_info.szName[0], "Got unexpected name %s.\n", wine_dbgstr_w(enum_info.szName));
547 ok(!enum_info.szDescription[0], "Got unexpected name %s.\n", wine_dbgstr_w(enum_info.szDescription));
548 ok(!enum_info.szDriver[0], "Got unexpected driver %s.\n", wine_dbgstr_w(enum_info.szDriver));
549
551 ok(ret, "Failed to remove driver.\n");
552}
553
555
557{
558 DWORD ret = width * depth;
559 ret = (ret + 7) / 8; /* divide by byte size, rounding up */
560 ret = (ret + 3) & ~3; /* align to 4 bytes */
561 ret *= abs(height);
562 return ret;
563}
564
565static const RGBQUAD color_yellow = {0x00, 0xff, 0xff, 0x00};
566
568
570 LPARAM lparam1, LPARAM lparam2)
571{
572 LRESULT ret = 0;
573
574 if (winetest_debug > 1)
575 trace("(%#Ix, %p, %#x, %#Ix, %#Ix)\n", id, driver, msg, lparam1, lparam2);
576
577 switch(msg)
578 {
579 case DRV_LOAD:
580 case DRV_OPEN:
581 case DRV_CLOSE:
582 case DRV_FREE:
583 return 1;
585 {
587 DWORD expected_size;
588
589 ok(lparam1 == (LPARAM)&gdf_in, "got input %#Ix\n", lparam1);
590
591 if (!out)
592 return ICERR_OK;
593
594 ok(out == gdf_out, "got output %p\n", out);
595
596 ok(out->biSize == sizeof(*out), "got size %ld\n", out->biSize);
597 expected_size = get_size_image(out->biWidth, out->biHeight, out->biBitCount);
598 ok(out->biSizeImage == expected_size, "expected image size %ld, got %ld\n",
599 expected_size, out->biSizeImage);
600
601 ok(out->biPlanes == 0xcccc, "got planes %d\n", out->biPlanes);
602 ok(out->biXPelsPerMeter == 0xcccccccc && out->biYPelsPerMeter == 0xcccccccc,
603 "got resolution %ldx%ld\n", out->biXPelsPerMeter, out->biYPelsPerMeter);
604 ok(out->biClrUsed == 0xcccccccc, "got biClrUsed %lu\n", out->biClrUsed);
605 ok(out->biClrImportant == 0xcccccccc, "got biClrImportant %lu\n", out->biClrImportant);
606
608 {
609 case 0:
610 return ICERR_OK;
611 case 1:
612 if (out->biWidth == 30 && out->biHeight == 40 && out->biCompression == BI_RGB && out->biBitCount == 16)
613 return ICERR_OK;
614 break;
615 case 2:
616 if (out->biWidth == 30 && out->biHeight == 40 && out->biCompression == BI_BITFIELDS && out->biBitCount == 16)
617 return ICERR_OK;
618 break;
619 case 3:
620 if (out->biWidth == 30 && out->biHeight == 40 && out->biCompression == BI_RGB && out->biBitCount == 24)
621 return ICERR_OK;
622 break;
623 case 4:
624 if (out->biWidth == 30 && out->biHeight == 40 && out->biCompression == BI_RGB && out->biBitCount == 32)
625 return ICERR_OK;
626 break;
627 case 5:
628 if (out->biWidth == 10 && out->biHeight == 20 && out->biCompression == BI_RGB && out->biBitCount == 32)
629 return ICERR_OK;
630 break;
631 case 6:
632 break;
633 }
634
635 return ICERR_BADFORMAT;
636 }
638 {
640
641 ok(lparam1 == (LPARAM)&gdf_in, "got input %#Ix\n", lparam1);
642 if (out)
643 {
644 ok(out == gdf_out, "got output %p\n", out);
645
646 memset(out, 0x55, sizeof(*out));
647 out->biWidth = 50;
648 out->biHeight = 60;
649 out->biBitCount = 0xdead;
650 out->biCompression = 0xbeef;
651 out->biSizeImage = 0;
652
653 return ICERR_OK;
654 }
655 }
657 {
658 BITMAPINFO *out = (BITMAPINFO *)lparam2;
659
660 ok(lparam1 == (LPARAM)&gdf_in, "got input %#Ix\n", lparam1);
661 if (out)
662 {
663 ok(out == (BITMAPINFO *)gdf_out, "got output %p\n", out);
664
665 out->bmiHeader.biClrUsed = 1;
666 out->bmiColors[0] = color_yellow;
667
668 return 0xdeadbeef;
669 }
670 }
671 }
672
673 return ret;
674}
675
677{
678 ok_(__FILE__, line)(header->biWidth == width, "expected %ld, got %ld\n", width, header->biWidth);
679 ok_(__FILE__, line)(header->biHeight == height, "expected %ld, got %ld\n", height, header->biHeight);
680 ok_(__FILE__, line)(header->biBitCount == depth, "expected %d, got %d\n", depth, header->biBitCount);
681 ok_(__FILE__, line)(header->biCompression == compression, "expected %#lx, got %#lx\n", compression, header->biCompression);
682}
683#define check_bitmap_header(a,b,c,d,e) check_bitmap_header_(__LINE__,a,b,c,d,e)
684
685static void test_ICGetDisplayFormat(void)
686{
687 static const DWORD testcc = mmioFOURCC('t','e','s','t');
688#ifdef __REACTOS__
689 char outbuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)];
690#else
691 char outbuf[FIELD_OFFSET(BITMAPINFO, bmiColors[256])];
692#endif
693 BITMAPINFO *out_bmi;
694 LRESULT lres;
695 BOOL ret;
696 HIC hic;
697
698 memset(&gdf_in, 0xcc, sizeof(gdf_in));
699 gdf_in.biSize = sizeof(gdf_in);
700 gdf_in.biWidth = 10;
701 gdf_in.biHeight = 20;
702 gdf_in.biBitCount = 1;
703 gdf_in.biCompression = testcc;
704
706 ok(ret, "ICInstall failed\n");
707
708 hic = ICOpen(ICTYPE_VIDEO, testcc, ICMODE_DECOMPRESS);
709 ok(ret, "ICOpen failed\n");
710
711 memset(outbuf, 0, sizeof(outbuf));
712 gdf_out = (BITMAPINFOHEADER *)outbuf;
713
714 /* ICGetDisplayFormat tries several default formats; make sure those work */
716 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
717 ok(hic != NULL, "ICGetDisplayFormat failed\n");
719
721 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
722 ok(hic != NULL, "ICGetDisplayFormat failed\n");
723 check_bitmap_header(gdf_out, 30, 40, 16, BI_RGB);
724
726 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
727 ok(hic != NULL, "ICGetDisplayFormat failed\n");
729
731 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
732 ok(hic != NULL, "ICGetDisplayFormat failed\n");
733 check_bitmap_header(gdf_out, 30, 40, 24, BI_RGB);
734
736 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
737 ok(hic != NULL, "ICGetDisplayFormat failed\n");
738 check_bitmap_header(gdf_out, 30, 40, 32, BI_RGB);
739
741 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
742 ok(hic != NULL, "ICGetDisplayFormat failed\n");
743 check_bitmap_header(gdf_out, 10, 20, 32, BI_RGB);
744
745 /* if every default format is rejected, the output of
746 * ICM_DECOMPRESS_GET_FORMAT is returned */
748 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 40);
749 ok(hic != NULL, "ICGetDisplayFormat failed\n");
750 check_bitmap_header(gdf_out, 50, 60, 0xdead, 0xbeef);
751
752 /* given bpp is treated as a lower bound */
754 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 24, 30, 40);
755 ok(hic != NULL, "ICGetDisplayFormat failed\n");
756 check_bitmap_header(gdf_out, 50, 60, 0xdead, 0xbeef);
757
759 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 24, 30, 40);
760 ok(hic != NULL, "ICGetDisplayFormat failed\n");
761 check_bitmap_header(gdf_out, 30, 40, 24, BI_RGB);
762
764
765 /* width or height <= 0 causes the input width and height to be supplied */
766 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 0, 40);
767 ok(hic != NULL, "ICGetDisplayFormat failed\n");
769
770 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, 0);
771 ok(hic != NULL, "ICGetDisplayFormat failed\n");
773
774 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, -10, 40);
775 ok(hic != NULL, "ICGetDisplayFormat failed\n");
777
778 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 1, 30, -10);
779 ok(hic != NULL, "ICGetDisplayFormat failed\n");
781
782 /* zero bpp causes 32 bpp to be supplied */
783 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 0, 30, 40);
784 ok(hic != NULL, "ICGetDisplayFormat failed\n");
785 ok(gdf_out->biBitCount == 32 || gdf_out->biBitCount == 24,
786 "got %d\n", gdf_out->biBitCount);
787 ok(gdf_out->biCompression == BI_RGB, "got %#lx\n", gdf_out->biCompression);
788
789 /* specifying 8 bpp yields a request for palette colours */
790 hic = ICGetDisplayFormat(hic, &gdf_in, gdf_out, 8, 30, 40);
791 ok(hic != NULL, "ICGetDisplayFormat failed\n");
793 ok(gdf_out->biClrUsed == 1, "got biClrUsed %lu\n", gdf_out->biClrUsed);
794 out_bmi = (BITMAPINFO *)gdf_out;
795 ok(!memcmp(&out_bmi->bmiColors[0], &color_yellow, sizeof(color_yellow)),
796 "got wrong colour\n");
797
798 lres = ICClose(hic);
799 ok(lres == ICERR_OK, "got %Id\n", lres);
800
801 ret = ICRemove(ICTYPE_VIDEO, testcc, 0);
802 ok(ret, "ICRemove failed\n");
803}
804
806{
808 test_Locate();
810 test_ICInfo();
812}
#define isalpha(c)
Definition: acclib.h:74
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ok_(x1, x2)
Definition: atltest.h:61
#define msg(x)
Definition: auth_time.c:54
#define RegCloseKey(hKey)
Definition: registry.h:49
_In_ fcb _In_ chunk _In_ uint64_t _In_ uint64_t _In_ bool _In_opt_ void _In_opt_ PIRP _In_ LIST_ENTRY _In_ uint8_t compression
Definition: btrfs_drv.h:1365
Definition: _map.h:48
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
Definition: reg.c:3298
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
Definition: reg.c:2287
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
Definition: reg.c:4009
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
BOOL WINAPI DECLSPEC_HOTPATCH WritePrivateProfileStringA(LPCSTR section, LPCSTR entry, LPCSTR string, LPCSTR filename)
Definition: profile.c:1484
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324
ULONG RGBQUAD
Definition: precomp.h:47
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
#define abs(i)
Definition: fconv.c:206
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint res
Definition: glext.h:9613
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum GLenum input
Definition: glext.h:9031
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: sysinfo.c:13
#define DRV_LOAD(x)
#define wine_dbgstr_w
Definition: kernel32.h:34
if(dx< 0)
Definition: linetemp.h:194
int winetest_debug
#define win_skip
Definition: minitest.h:67
#define todo_wine
Definition: minitest.h:80
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
#define BI_BITFIELDS
Definition: mmreg.h:507
#define ICTYPE_VIDEO
Definition: mmreg.h:531
#define DRV_CLOSE
Definition: mmsystem.h:122
#define DRV_OPEN
Definition: mmsystem.h:121
#define mmioFOURCC(c0, c1, c2, c3)
Definition: mmsystem.h:38
#define DRV_FREE
Definition: mmsystem.h:124
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static BG_JOB_TYPE test_type
Definition: job.c:40
static const DWORD test_handler
Definition: avidec.c:28
static void test_ICGetDisplayFormat(void)
Definition: msvfw.c:685
static int get_stride(int width, int depth)
Definition: msvfw.c:28
static const RGBQUAD color_yellow
Definition: msvfw.c:565
static void test_ICSeqCompress(void)
Definition: msvfw.c:320
static LRESULT CALLBACK gdf_driver_proc(DWORD_PTR id, HDRVR driver, UINT msg, LPARAM lparam1, LPARAM lparam2)
Definition: msvfw.c:569
static void test_OpenCase(void)
Definition: msvfw.c:33
static void test_ICInfo(void)
Definition: msvfw.c:409
static ICINFO enum_info
Definition: msvfw.c:384
static BITMAPINFOHEADER * gdf_out
Definition: msvfw.c:567
static int get_display_format_test
Definition: msvfw.c:554
static void check_bitmap_header_(int line, BITMAPINFOHEADER *header, LONG width, LONG height, WORD depth, DWORD compression)
Definition: msvfw.c:676
#define check_bitmap_header(a, b, c, d, e)
Definition: msvfw.c:683
static void test_Locate(void)
Definition: msvfw.c:92
static LRESULT CALLBACK enum_driver_proc(DWORD_PTR id, HDRVR driver, UINT msg, LPARAM lparam1, LPARAM lparam2)
Definition: msvfw.c:386
static BITMAPINFOHEADER gdf_in
Definition: msvfw.c:567
static DWORD get_size_image(LONG width, LONG height, WORD depth)
Definition: msvfw.c:556
HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
Definition: msvideo_main.c:428
BOOL VFWAPI ICInstall(DWORD type, DWORD handler, LPARAM lparam, char *desc, UINT flags)
Definition: msvideo_main.c:336
BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
LRESULT VFWAPI ICGetInfo(HIC hic, ICINFO *picinfo, DWORD cb)
Definition: msvideo_main.c:581
HIC VFWAPI ICLocate(DWORD type, DWORD handler, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, WORD mode)
Definition: msvideo_main.c:620
void VFWAPI ICCompressorFree(PCOMPVARS pc)
HIC VFWAPI ICGetDisplayFormat(HIC hic, BITMAPINFOHEADER *in, BITMAPINFOHEADER *out, int depth, int width, int height)
Definition: msvideo_main.c:686
void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc)
BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
Definition: msvideo_main.c:257
LPVOID VFWAPI ICSeqCompressFrame(PCOMPVARS pc, UINT uiFlags, LPVOID lpBits, BOOL *pfKey, LONG *plSize)
LRESULT WINAPI ICClose(HIC hic)
BOOL VFWAPI ICRemove(DWORD type, DWORD handler, UINT flags)
Definition: msvideo_main.c:388
#define KEY_ALL_ACCESS
Definition: nt_native.h:1044
long LONG
Definition: pedump.c:60
#define err(...)
#define memset(x, y, z)
Definition: compat.h:39
DWORD biCompression
Definition: amvideo.idl:35
DWORD biSizeImage
Definition: amvideo.idl:36
Definition: vfw.h:817
DWORD dwFlags
Definition: vfw.h:819
LPVOID lpState
Definition: vfw.h:832
LONG lKey
Definition: vfw.h:828
LPVOID lpBitsPrev
Definition: vfw.h:826
DWORD fccHandler
Definition: vfw.h:822
LONG cbSize
Definition: vfw.h:818
LPBITMAPINFO lpbiOut
Definition: vfw.h:824
LONG lQ
Definition: vfw.h:830
HIC hic
Definition: vfw.h:820
LPVOID lpBitsOut
Definition: vfw.h:825
LONG cbState
Definition: vfw.h:833
DWORD fccType
Definition: vfw.h:821
LPBITMAPINFO lpbiIn
Definition: vfw.h:823
LONG lDataRate
Definition: vfw.h:829
Definition: vfw.h:280
Definition: uimain.c:89
Definition: copy.c:22
Definition: parser.c:49
RGBQUAD bmiColors[1]
Definition: wingdi.h:1923
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define BI_RGB
Definition: uefivid.c:46
#define ICINSTALL_DRIVER
Definition: vfw.h:626
#define ICMODE_DECOMPRESS
Definition: vfw.h:269
#define ICDecompressQuery(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:377
#define ICERR_BADHANDLE
Definition: vfw.h:63
#define ICVERSION
Definition: vfw.h:45
#define ICERR_OK
Definition: vfw.h:50
#define ICQUALITY_DEFAULT
Definition: vfw.h:278
#define ICM_DECOMPRESS_GET_PALETTE
Definition: vfw.h:112
#define ICM_DECOMPRESS_QUERY
Definition: vfw.h:107
#define ICM_GETINFO
Definition: vfw.h:82
#define ICERR_BADFORMAT
Definition: vfw.h:57
#define ICMODE_COMPRESS
Definition: vfw.h:268
#define ICM_DECOMPRESS_GET_FORMAT
Definition: vfw.h:106
#define ICMF_COMPVARS_VALID
Definition: vfw.h:836
#define ICINSTALL_FUNCTION
Definition: vfw.h:625
#define ICDecompressGetFormat(hic, lpbiInput, lpbiOutput)
Definition: vfw.h:383
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
static WORD const char * driver
Definition: odbccp32.c:56
struct tagBITMAPINFO * PBITMAPINFO
#define BI_RLE8
Definition: wingdi.h:35
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
unsigned char BYTE
Definition: xxhash.c:193