39 hr = IBaseFilter_QueryInterface(
filter, &IID_IVMRFilterConfig, (
void **)&
config);
43 IVMRFilterConfig_Release(
config);
53 hr = IBaseFilter_QueryInterface(
filter, &IID_IVMRFilterConfig, (
void **)&
config);
56 hr = IVMRFilterConfig_SetNumberOfStreams(
config, 2);
59 IVMRFilterConfig_Release(
config);
66 && !
memcmp(
a->pbFormat,
b->pbFormat,
a->cbFormat);
99 return IUnknown_Release(
unknown);
110 &IID_IVMRFilterConfig, (
void **)&
config);
128 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
131 &IID_IVMRFilterConfig, (
void **)&
config);
145 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
148 &IID_IVMRFilterConfig, (
void **)&
config);
162 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
165 &IID_IVMRFilterConfig, (
void **)&
config);
171 hr = IVMRFilterConfig_SetNumberOfStreams(
config, 3);
202 skip(
"Mixing mode is not supported.\n");
205 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
208#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
217 hr = IUnknown_QueryInterface(iface, iid, (
void **)&unk);
220 IUnknown_Release(unk);
258 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
291 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
305 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
319 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
374 ok(unk != &
test_outer,
"Returned IUnknown should not be outer IUnknown.\n");
376 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
378 ref = IUnknown_AddRef(unk);
379 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
382 ref = IUnknown_Release(unk);
383 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
388 ok(unk2 == unk,
"Got unexpected IUnknown %p.\n", unk2);
389 IUnknown_Release(unk2);
396 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
400 ok(filter2 == (
IBaseFilter *)0xdeadbeef,
"Got unexpected IBaseFilter %p.\n", filter2);
402 hr = IUnknown_QueryInterface(unk, &
test_iid, (
void **)&unk2);
404 ok(!unk2,
"Got unexpected IUnknown %p.\n", unk2);
408 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
410 IBaseFilter_Release(
filter);
411 ref = IUnknown_Release(unk);
412 ok(!
ref,
"Got unexpected refcount %ld.\n",
ref);
425 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
430 hr = IBaseFilter_EnumPins(
filter, &enum1);
433 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
435 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
440 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
443 ok(
ref == 3,
"Got unexpected refcount %ld.\n",
ref);
445 ok(
ref == 3,
"Got unexpected refcount %ld.\n",
ref);
447 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
448 IPin_Release(pins[0]);
450 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
452 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
455 hr = IEnumPins_Reset(enum1);
458 hr = IEnumPins_Next(enum1, 1, pins, &
count);
461 IPin_Release(pins[0]);
463 hr = IEnumPins_Next(enum1, 1, pins, &
count);
467 hr = IEnumPins_Reset(enum1);
470 hr = IEnumPins_Next(enum1, 2, pins,
NULL);
473 hr = IEnumPins_Next(enum1, 2, pins, &
count);
476 IPin_Release(pins[0]);
478 hr = IEnumPins_Reset(enum1);
481 hr = IEnumPins_Clone(enum1, &enum2);
484 hr = IEnumPins_Skip(enum1, 2);
487 hr = IEnumPins_Skip(enum1, 1);
490 hr = IEnumPins_Skip(enum1, 1);
493 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
496 hr = IEnumPins_Next(enum2, 1, pins,
NULL);
498 IPin_Release(pins[0]);
500 IEnumPins_Release(enum2);
504 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
507 hr = IEnumPins_Reset(enum1);
510 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
512 IPin_Release(pins[0]);
514 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
517 IPin_Release(pins[0]);
519 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
522 hr = IEnumPins_Reset(enum1);
525 hr = IEnumPins_Next(enum1, 2, pins, &
count);
528 IPin_Release(pins[0]);
530 IPin_Release(pins[1]);
532 hr = IEnumPins_Reset(enum1);
535 hr = IEnumPins_Next(enum1, 3, pins, &
count);
538 IPin_Release(pins[0]);
540 IPin_Release(pins[1]);
543 skip(
"Mixing mode is not supported.\n");
545 IEnumPins_Release(enum1);
547 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
560 hr = IBaseFilter_FindPin(
filter,
L"input pin", &pin);
563 hr = IBaseFilter_FindPin(
filter,
L"In", &pin);
566 hr = IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
570 ok(pin == pin2,
"Pins did not match.\n");
574 hr = IBaseFilter_FindPin(
filter,
L"VMR input1", &pin);
581 hr = IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
585 ok(pin == pin2,
"Pins did not match.\n");
589 hr = IBaseFilter_FindPin(
filter,
L"VMR Input1", &pin);
595 ok(pin == pin2,
"Pins did not match.\n");
600 hr = IBaseFilter_FindPin(
filter,
L"VMR Input2", &pin);
604 skip(
"Mixing mode is not supported.\n");
608 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
621 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
622 hr = IPin_QueryPinInfo(pin, &
info);
626 IBaseFilter_Release(
info.pFilter);
628 hr = IPin_QueryDirection(pin, &
dir);
632 hr = IPin_QueryId(pin, &
id);
637 hr = IPin_QueryInternalConnections(pin,
NULL, &
count);
644 hr = IBaseFilter_FindPin(
filter,
L"VMR Input1", &pin);
648 hr = IPin_QueryPinInfo(pin, &
info);
652 IBaseFilter_Release(
info.pFilter);
654 hr = IPin_QueryDirection(pin, &
dir);
658 hr = IPin_QueryId(pin, &
id);
663 hr = IPin_QueryInternalConnections(pin,
NULL, &
count);
670 skip(
"Mixing mode is not supported.\n");
673 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
691 static const GUID *subtype_tests[] =
694 &MEDIASUBTYPE_RGB565,
699 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
701 hr = IPin_EnumMediaTypes(pin, &enummt);
704 hr = IEnumMediaTypes_Next(enummt, 1, &mt,
NULL);
707 IEnumMediaTypes_Release(enummt);
709 req_mt.majortype = MEDIATYPE_Video;
710 req_mt.formattype = FORMAT_VideoInfo;
712 req_mt.pbFormat = (
BYTE *)&vih;
716 req_mt.subtype = *subtype_tests[
i];
717 hr = IPin_QueryAccept(pin, &req_mt);
721 req_mt.subtype = MEDIASUBTYPE_RGB8;
722 hr = IPin_QueryAccept(pin, &req_mt);
724 req_mt.subtype = MEDIASUBTYPE_RGB24;
727 hr = IPin_QueryAccept(pin, &req_mt);
729 req_mt.majortype = MEDIATYPE_Video;
731 req_mt.formattype = FORMAT_None;
732 hr = IPin_QueryAccept(pin, &req_mt);
736 hr = IPin_QueryAccept(pin, &req_mt);
741 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
753 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
755 hr = IPin_EnumMediaTypes(pin, &enum1);
758 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
761 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
765 hr = IEnumMediaTypes_Reset(enum1);
768 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
771 hr = IEnumMediaTypes_Clone(enum1, &enum2);
774 hr = IEnumMediaTypes_Skip(enum1, 1);
777 hr = IEnumMediaTypes_Next(enum2, 1, mts,
NULL);
780 IEnumMediaTypes_Release(enum1);
781 IEnumMediaTypes_Release(enum2);
785 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
842 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
860 return &
filter->source.pin;
902 hr = IMemInputPin_GetAllocatorRequirements(
input, &
props);
905 hr = IMemInputPin_GetAllocator(
input, &ret_allocator);
910 hr = IMemAllocator_GetProperties(ret_allocator, &
props);
912 ok(!
props.cBuffers,
"Got %ld buffers.\n",
props.cBuffers);
914 ok(!
props.cbAlign,
"Got alignment %ld.\n",
props.cbAlign);
915 ok(!
props.cbPrefix,
"Got prefix %ld.\n",
props.cbPrefix);
917 hr = IMemInputPin_NotifyAllocator(
input, ret_allocator,
TRUE);
924 hr = IMemAllocator_SetProperties(ret_allocator, &req_props, &
props);
926 ok(
props.cBuffers == 1,
"Got %ld buffers.\n",
props.cBuffers);
927 ok(
props.cbBuffer == 32 * 16 * 4,
"Got size %ld.\n",
props.cbBuffer);
928 ok(
props.cbAlign == 1,
"Got alignment %ld.\n",
props.cbAlign);
929 ok(!
props.cbPrefix,
"Got prefix %ld.\n",
props.cbPrefix);
931 IMemAllocator_Release(ret_allocator);
938 &IID_IMemAllocator, (
void **)&req_allocator);
940 hr = IMemInputPin_NotifyAllocator(
input, req_allocator,
TRUE);
943 IMemAllocator_Release(req_allocator);
960 IMediaSample_Release(
params->sample);
985 hr = IMediaSample_SetActualDataLength(
sample, IMediaSample_GetSize(
sample));
989 end_time = start_time + 10000000;
990 hr = IMediaSample_SetTime(
sample, &start_time, &end_time);
1012#define join_thread(a) join_thread_(__LINE__, a)
1030 OAFilterState
state;
1166 OAFilterState
state;
1180 hr = IPin_BeginFlush(pin);
1190 hr = IPin_EndFlush(pin);
1211 hr = IPin_BeginFlush(pin);
1218 hr = IPin_EndFlush(pin);
1232 unsigned int ret = 0;
1236 while ((
hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2,
timeout)) ==
S_OK)
1238 if (
code == expected_code)
1240 ok(param1 == expected1,
"Got param1 %#Ix.\n", param1);
1241 ok(param2 == expected2,
"Got param2 %#Ix.\n", param2);
1244 IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
1264 OAFilterState
state;
1276 IBaseFilter_QueryInterface(
filter, &IID_IBasicVideo, (
void **)&video);
1278 hr = IBasicVideo_GetCurrentImage(video,
NULL,
NULL);
1285 hr = IBasicVideo_GetCurrentImage(video, &
size,
NULL);
1290 hr = IBasicVideo_GetCurrentImage(video, &
size,
buffer);
1303 hr = IBasicVideo_GetCurrentImage(video, &
size,
buffer);
1315 hr = IBasicVideo_GetCurrentImage(video, &
size,
buffer);
1321 hr = IBasicVideo_GetCurrentImage(video, &
size,
buffer);
1325 for (
i = 0;
i < 32 * 16; ++
i)
1326 ok((
data[
i] & 0xffffff) == 0x555555,
"Got unexpected color %08lx at %u.\n",
data[
i],
i);
1334 hr = IBasicVideo_GetCurrentImage(video, &
size,
buffer);
1338 for (
i = 0;
i < 32 * 16; ++
i)
1339 ok((
data[
i] & 0xffffff) == 0x555555,
"Got unexpected color %08lx at %u.\n",
data[
i],
i);
1345 IBasicVideo_Release(video);
1351 unsigned int ret = 0;
1355 while ((
hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2,
timeout)) ==
S_OK)
1359 ok(!param1,
"Got param1 %#Ix.\n", param1);
1360 ok(!param2,
"Got param2 %#Ix.\n", param2);
1363 IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
1373 IMediaEvent *eventsrc;
1374 OAFilterState
state;
1381 IMediaControl_QueryInterface(
control, &IID_IMediaEvent, (
void **)&eventsrc);
1382 IPin_QueryInterface(pin, &IID_IOverlay, (
void **)&overlay);
1384 hr = IOverlay_GetWindowHandle(overlay, &
hwnd);
1386 IOverlay_Release(overlay);
1392 ok(!
ret,
"Got unexpected EC_USERABORT.\n");
1399 ok(
ret == 1,
"Expected EC_USERABORT.\n");
1417 ok(!
ret,
"Got unexpected EC_USERABORT.\n");
1422 ok(!
ret,
"Got unexpected EC_USERABORT.\n");
1434 ok(!
ret,
"Got unexpected EC_USERABORT.\n");
1439 ok(
ret == 1,
"Expected EC_USERABORT.\n");
1447 ok(!
ret,
"Got unexpected EC_USERABORT.\n");
1449 IMediaEvent_Release(eventsrc);
1457 .bmiHeader.biWidth = 32,
1458 .bmiHeader.biHeight = 16,
1459 .bmiHeader.biPlanes = 1,
1460 .bmiHeader.biCompression =
BI_RGB,
1464 .majortype = MEDIATYPE_Video,
1465 .subtype = MEDIASUBTYPE_WAVE,
1466 .formattype = FORMAT_VideoInfo,
1467 .cbFormat =
sizeof(vih),
1468 .pbFormat = (
BYTE *)&vih,
1483 static const GUID *subtype_tests[] =
1485 &MEDIASUBTYPE_RGB565,
1486 &MEDIASUBTYPE_RGB24,
1487 &MEDIASUBTYPE_RGB32,
1493 IFilterGraph2_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
NULL);
1495 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
1497 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
1500 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1504 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1508 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1515 hr = IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
1517 hr = IFilterGraph2_Disconnect(
graph, pin);
1522 req_mt.subtype = *subtype_tests[
i];
1523 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1526 hr = IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
1528 hr = IFilterGraph2_Disconnect(
graph, pin);
1532 req_mt.formattype = FORMAT_None;
1533 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1535 req_mt.formattype = FORMAT_VideoInfo;
1537 req_mt.subtype = MEDIASUBTYPE_RGB8;
1538 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1542 IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
1543 IFilterGraph2_Disconnect(
graph, pin);
1545 req_mt.subtype = MEDIASUBTYPE_RGB32;
1547 peer = (
IPin *)0xdeadbeef;
1548 hr = IPin_ConnectedTo(pin, &peer);
1550 ok(!peer,
"Got peer %p.\n", peer);
1552 hr = IPin_ConnectionMediaType(pin, &
mt);
1557 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1562 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
1565 hr = IPin_ConnectedTo(pin, &peer);
1567 ok(peer == &
source.source.pin.IPin_iface,
"Got peer %p.\n", peer);
1570 hr = IPin_ConnectionMediaType(pin, &
mt);
1577 IPin_QueryInterface(pin, &IID_IMemInputPin, (
void **)&
input);
1583 hr = IMemAllocator_SetProperties(
allocator, &req_props, &ret_props);
1585 ok(!
memcmp(&ret_props, &req_props,
sizeof(req_props)),
"Properties did not match.\n");
1590 hr = IMemInputPin_ReceiveCanBlock(
input);
1598 hr = IFilterGraph2_Disconnect(
graph, pin);
1600 hr = IFilterGraph2_Disconnect(
graph, pin);
1602 ok(
source.source.pin.peer == pin,
"Got peer %p.\n", peer);
1603 IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
1605 peer = (
IPin *)0xdeadbeef;
1606 hr = IPin_ConnectedTo(pin, &peer);
1608 ok(!peer,
"Got peer %p.\n", peer);
1610 hr = IPin_ConnectionMediaType(pin, &
mt);
1613 IMemInputPin_Release(
input);
1615 IMediaControl_Release(
control);
1616 ref = IFilterGraph2_Release(
graph);
1617 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1619 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1620 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
1621 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1633 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
1635 hr = IPin_QueryInterface(pin, &IID_IOverlay, (
void **)&overlay);
1639 hr = IOverlay_GetWindowHandle(overlay, &
hwnd);
1643 IOverlay_Release(overlay);
1646 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1672 if (
wparam == 0xdeadbeef)
1684 hr = IVideoWindow_get_Caption(
window, &caption);
1693 hr = IVideoWindow_put_Caption(
window, caption);
1697 hr = IVideoWindow_get_Caption(
window, &caption);
1714 "Got style %#lx.\n",
style);
1718 "Got style %#lx.\n",
style);
1956 hr = IVideoWindow_put_Left(
window, 0);
1958 hr = IVideoWindow_put_Top(
window, 0);
1966 ok(
top == 0,
"Got top %ld.\n",
top);
1976 ok(
top == 0,
"Got top %ld.\n",
top);
1985 hr = IVideoWindow_put_Left(
window, 10);
1993 ok(
top == 0,
"Got top %ld.\n",
top);
2003 ok(
top == 0,
"Got top %ld.\n",
top);
2012 hr = IVideoWindow_put_Height(
window, 200);
2020 ok(
top == 0,
"Got top %ld.\n",
top);
2030 ok(
top == 0,
"Got top %ld.\n",
top);
2039 hr = IVideoWindow_SetWindowPosition(
window, 100, 200, 300, 400);
2047 ok(
top == 200,
"Got top %ld.\n",
top);
2057 ok(
top == 200,
"Got top %ld.\n",
top);
2068 ok(top_hwnd == our_hwnd,
"Got top window %p.\n", top_hwnd);
2080 hr = IVideoWindow_get_Owner(
window, &oahwnd);
2082 ok(!oahwnd,
"Got owner %#Ix.\n", oahwnd);
2089 hr = IVideoWindow_put_Owner(
window, (OAHWND)our_hwnd);
2092 hr = IVideoWindow_get_Owner(
window, &oahwnd);
2094 ok(oahwnd == (OAHWND)our_hwnd,
"Got owner %#Ix.\n", oahwnd);
2103 ok(top_hwnd == our_hwnd,
"Got top window %p.\n", top_hwnd);
2114 hr = IVideoWindow_put_Owner(
window, 0);
2117 hr = IVideoWindow_get_Owner(
window, &oahwnd);
2119 ok(!oahwnd,
"Got owner %#Ix.\n", oahwnd);
2128 ok(top_hwnd ==
hwnd,
"Got top window %p.\n", top_hwnd);
2160 static UINT drain_tests[] =
2188 hr = IVideoWindow_get_MessageDrain(
window, &oahwnd);
2190 ok(!oahwnd,
"Got window %#Ix.\n", oahwnd);
2192 hr = IVideoWindow_put_MessageDrain(
window, (OAHWND)our_hwnd);
2195 hr = IVideoWindow_get_MessageDrain(
window, &oahwnd);
2197 ok(oahwnd == (OAHWND)our_hwnd,
"Got window %#Ix.\n", oahwnd);
2203 ok(
ret,
"Expected a message.\n");
2204 ok(
msg.hwnd == our_hwnd,
"Got hwnd %p.\n",
msg.hwnd);
2205 ok(
msg.message == drain_tests[
i],
"Got message %#x.\n",
msg.message);
2206 ok(
msg.wParam == 0xdeadbeef,
"Got wparam %#Ix.\n",
msg.wParam);
2207 ok(!
msg.lParam,
"Got lparam %#Ix.\n",
msg.lParam);
2211 ok(!
ret,
"Got unexpected message %#x.\n",
msg.message);
2214 hr = IVideoWindow_put_MessageDrain(
window, 0);
2217 hr = IVideoWindow_put_Owner(
window, (OAHWND)our_hwnd);
2258 ok(!
ret,
"Wait timed out.\n");
2272 hr = IVideoWindow_put_Owner(
window, 0);
2282 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
2284 hr = IVideoWindow_get_AutoShow(
window, &
l);
2294 hr = IVideoWindow_get_Visible(
window, &
l);
2301 hr = IVideoWindow_get_Visible(
window, &
l);
2314 hr = IVideoWindow_get_Visible(
window, &
l);
2321 IMediaControl_Release(
control);
2330 .bmiHeader.biBitCount = 32,
2331 .bmiHeader.biWidth = 600,
2332 .bmiHeader.biHeight = 400,
2333 .bmiHeader.biPlanes = 1,
2334 .bmiHeader.biCompression =
BI_RGB,
2338 .majortype = MEDIATYPE_Video,
2339 .subtype = MEDIASUBTYPE_RGB32,
2340 .formattype = FORMAT_VideoInfo,
2341 .cbFormat =
sizeof(vih),
2342 .pbFormat = (
BYTE *)&vih,
2374 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
2375 IPin_QueryInterface(pin, &IID_IMemInputPin, (
void **)&
input);
2377 hr = IPin_QueryInterface(pin, &IID_IOverlay, (
void **)&overlay);
2380 hr = IOverlay_GetWindowHandle(overlay, &
hwnd);
2388 hr = IBaseFilter_QueryInterface(
filter, &IID_IVideoWindow, (
void **)&
window);
2391 hr = IVideoWindow_get_Caption(
window, &caption);
2395 hr = IVideoWindow_put_Caption(
window, caption);
2399 hr = IVideoWindow_get_WindowStyle(
window, &
l);
2405 hr = IVideoWindow_get_AutoShow(
window, &
l);
2411 hr = IVideoWindow_put_Owner(
window, (OAHWND)our_hwnd);
2414 hr = IVideoWindow_put_MessageDrain(
window, (OAHWND)our_hwnd);
2420 hr = IVideoWindow_SetWindowPosition(
window, 100, 200, 300, 400);
2424 IFilterGraph2_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
NULL);
2426 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
2429 req_mt.subtype = MEDIASUBTYPE_RGB24;
2432 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
2440 hr = IMemAllocator_SetProperties(
allocator, &req_props, &ret_props);
2442 ok(!
memcmp(&ret_props, &req_props,
sizeof(req_props)),
"Properties did not match.\n");
2461 hr = IVideoWindow_get_FullScreenMode(
window, &
l);
2469 IVideoWindow_Release(
window);
2471 hr = IFilterGraph2_QueryInterface(
graph, &IID_IVideoWindow, (
void **)&
window);
2475 hr = IVideoWindow_get_FullScreenMode(
window, &
l);
2478 hr = IVideoWindow_put_FullScreenMode(
window,
l);
2481 IFilterGraph2_Release(
graph);
2482 IVideoWindow_Release(
window);
2483 IOverlay_Release(overlay);
2484 IMemInputPin_Release(
input);
2487 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2488 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
2489 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2503 ok_(__FILE__,
line)(
top == expect_top,
"Got top %ld.\n",
top);
2508 hr = IBasicVideo_get_SourceLeft(video, &
l);
2513 hr = IBasicVideo_get_SourceTop(video, &
l);
2518 hr = IBasicVideo_get_SourceWidth(video, &
l);
2519 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get width, hr %#lx.\n",
hr);
2523 hr = IBasicVideo_get_SourceHeight(video, &
l);
2524 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get height, hr %#lx.\n",
hr);
2527#define check_source_position(a,b,c,d,e) check_source_position_(__LINE__,a,b,c,d,e)
2534 hr = IBasicVideo_IsUsingDefaultSource(video);
2537 hr = IBasicVideo_put_SourceLeft(video, -10);
2539 hr = IBasicVideo_put_SourceLeft(video, 10);
2542 hr = IBasicVideo_put_SourceTop(video, -10);
2544 hr = IBasicVideo_put_SourceTop(video, 10);
2547 hr = IBasicVideo_put_SourceWidth(video, -500);
2549 hr = IBasicVideo_put_SourceWidth(video, 0);
2551 hr = IBasicVideo_put_SourceWidth(video, 700);
2553 hr = IBasicVideo_put_SourceWidth(video, 500);
2556 hr = IBasicVideo_IsUsingDefaultSource(video);
2559 hr = IBasicVideo_put_SourceHeight(video, -300);
2561 hr = IBasicVideo_put_SourceHeight(video, 0);
2563 hr = IBasicVideo_put_SourceHeight(video, 600);
2565 hr = IBasicVideo_put_SourceHeight(video, 300);
2568 hr = IBasicVideo_IsUsingDefaultSource(video);
2571 hr = IBasicVideo_put_SourceLeft(video, -10);
2573 hr = IBasicVideo_put_SourceLeft(video, 10);
2576 hr = IBasicVideo_IsUsingDefaultSource(video);
2579 hr = IBasicVideo_put_SourceTop(video, -10);
2581 hr = IBasicVideo_put_SourceTop(video, 20);
2584 hr = IBasicVideo_IsUsingDefaultSource(video);
2587 hr = IBasicVideo_SetSourcePosition(video, 4, 5, 60, 40);
2590 hr = IBasicVideo_IsUsingDefaultSource(video);
2593 hr = IBasicVideo_SetSourcePosition(video, 0, 0, 600, 400);
2596 hr = IBasicVideo_IsUsingDefaultSource(video);
2599 hr = IBasicVideo_SetSourcePosition(video, 4, 5, 60, 40);
2601 hr = IBasicVideo_SetDefaultSourcePosition(video);
2604 hr = IBasicVideo_IsUsingDefaultSource(video);
2616 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get position, hr %#lx.\n",
hr);
2618 ok_(__FILE__,
line)(
top == expect_top,
"Got top %ld.\n",
top);
2623 hr = IBasicVideo_get_DestinationLeft(video, &
l);
2628 hr = IBasicVideo_get_DestinationTop(video, &
l);
2633 hr = IBasicVideo_get_DestinationWidth(video, &
l);
2634 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get width, hr %#lx.\n",
hr);
2638 hr = IBasicVideo_get_DestinationHeight(video, &
l);
2639 ok_(__FILE__,
line)(
hr ==
S_OK,
"Failed to get height, hr %#lx.\n",
hr);
2642#define check_destination_position(a,b,c,d,e) check_destination_position_(__LINE__,a,b,c,d,e)
2650 IBasicVideo_QueryInterface(video, &IID_IVideoWindow, (
void **)&
window);
2653 hr = IBasicVideo_IsUsingDefaultDestination(video);
2656 hr = IBasicVideo_put_DestinationLeft(video, -10);
2659 hr = IBasicVideo_IsUsingDefaultDestination(video);
2662 hr = IBasicVideo_put_DestinationLeft(video, 10);
2665 hr = IBasicVideo_IsUsingDefaultDestination(video);
2668 hr = IBasicVideo_put_DestinationTop(video, -20);
2671 hr = IBasicVideo_IsUsingDefaultDestination(video);
2674 hr = IBasicVideo_put_DestinationTop(video, 20);
2677 hr = IBasicVideo_IsUsingDefaultDestination(video);
2680 hr = IBasicVideo_put_DestinationWidth(video, -700);
2682 hr = IBasicVideo_put_DestinationWidth(video, 0);
2684 hr = IBasicVideo_put_DestinationWidth(video, 700);
2687 hr = IBasicVideo_IsUsingDefaultDestination(video);
2690 hr = IBasicVideo_put_DestinationWidth(video, 500);
2693 hr = IBasicVideo_IsUsingDefaultDestination(video);
2696 hr = IBasicVideo_put_DestinationHeight(video, -500);
2698 hr = IBasicVideo_put_DestinationHeight(video, 0);
2700 hr = IBasicVideo_put_DestinationHeight(video, 500);
2703 hr = IBasicVideo_IsUsingDefaultDestination(video);
2706 hr = IBasicVideo_put_DestinationHeight(video, 300);
2709 hr = IBasicVideo_IsUsingDefaultDestination(video);
2712 hr = IBasicVideo_SetDestinationPosition(video, 4, 5, 60, 40);
2715 hr = IBasicVideo_IsUsingDefaultDestination(video);
2718 hr = IBasicVideo_SetDestinationPosition(video, 0, 0, 600, 400);
2721 hr = IBasicVideo_IsUsingDefaultDestination(video);
2724 hr = IBasicVideo_SetDestinationPosition(video, 4, 5, 60, 40);
2726 hr = IBasicVideo_SetDefaultDestinationPosition(video);
2729 hr = IBasicVideo_IsUsingDefaultDestination(video);
2738 hr = IBasicVideo_IsUsingDefaultDestination(video);
2741 hr = IBasicVideo_SetDestinationPosition(video, 0, 0, 400, 300);
2744 hr = IBasicVideo_IsUsingDefaultDestination(video);
2753 hr = IBasicVideo_IsUsingDefaultDestination(video);
2756 IVideoWindow_Release(
window);
2765 .rcSource = {4, 6, 16, 12},
2766 .rcTarget = {40, 60, 120, 160},
2768 .bmiHeader.biBitCount = 32,
2769 .bmiHeader.biWidth = 600,
2770 .bmiHeader.biHeight = 400,
2771 .bmiHeader.biPlanes = 1,
2772 .bmiHeader.biCompression =
BI_RGB,
2776 .majortype = MEDIATYPE_Video,
2777 .subtype = MEDIASUBTYPE_RGB32,
2778 .formattype = FORMAT_VideoInfo,
2779 .cbFormat =
sizeof(vih),
2780 .pbFormat = (
BYTE *)&vih,
2798 IBaseFilter_QueryInterface(
filter, &IID_IBasicVideo, (
void **)&video);
2799 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
2800 IPin_QueryInterface(pin, &IID_IMemInputPin, (
void **)&
input);
2802 hr = IBasicVideo_GetTypeInfoCount(video, &
count);
2806 hr = IBasicVideo_GetTypeInfo(video, 0, 0, &
typeinfo);
2808 hr = ITypeInfo_GetTypeAttr(
typeinfo, &typeattr);
2810 ok(typeattr->typekind ==
TKIND_DISPATCH,
"Got kind %u.\n", typeattr->typekind);
2812 ITypeInfo_ReleaseTypeAttr(
typeinfo, typeattr);
2815 hr = IBasicVideo_get_AvgTimePerFrame(video,
NULL);
2817 hr = IBasicVideo_get_AvgTimePerFrame(video, &reftime);
2820 hr = IBasicVideo_get_BitRate(video,
NULL);
2822 hr = IBasicVideo_get_BitRate(video, &
l);
2825 hr = IBasicVideo_get_BitErrorRate(video,
NULL);
2827 hr = IBasicVideo_get_BitErrorRate(video, &
l);
2830 hr = IBasicVideo_get_VideoWidth(video,
NULL);
2832 hr = IBasicVideo_get_VideoHeight(video,
NULL);
2835 hr = IBasicVideo_get_SourceLeft(video,
NULL);
2837 hr = IBasicVideo_get_SourceWidth(video,
NULL);
2839 hr = IBasicVideo_get_SourceTop(video,
NULL);
2841 hr = IBasicVideo_get_SourceHeight(video,
NULL);
2844 hr = IBasicVideo_get_DestinationLeft(video,
NULL);
2846 hr = IBasicVideo_get_DestinationWidth(video,
NULL);
2848 hr = IBasicVideo_get_DestinationTop(video,
NULL);
2850 hr = IBasicVideo_get_DestinationHeight(video,
NULL);
2871 hr = IBasicVideo_GetVideoSize(video, &
width,
NULL);
2878 hr = IBasicVideo_GetVideoPaletteEntries(video, 0, 1,
NULL, &
l);
2880 hr = IBasicVideo_GetVideoPaletteEntries(video, 0, 1, &
l,
NULL);
2884 IFilterGraph2_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
L"vmr9");
2886 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
2889 skip(
"Got E_FAIL when connecting.\n");
2898 hr = IMemAllocator_SetProperties(
allocator, &req_props, &ret_props);
2900 ok(!
memcmp(&ret_props, &req_props,
sizeof(req_props)),
"Properties did not match.\n");
2907 hr = IBasicVideo_get_AvgTimePerFrame(video, &reftime);
2909 ok(
compare_double(reftime, 0.02, 1 << 28),
"Got frame rate %.16e.\n", reftime);
2912 hr = IBasicVideo_get_BitRate(video, &
l);
2914 ok(!
l,
"Got bit rate %ld.\n",
l);
2917 hr = IBasicVideo_get_BitErrorRate(video, &
l);
2919 ok(!
l,
"Got bit rate %ld.\n",
l);
2921 hr = IBasicVideo_GetVideoPaletteEntries(video, 0, 1, &
l,
NULL);
2933 hr = IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
2935 hr = IFilterGraph2_Disconnect(
graph, pin);
2940 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
2947 hr = IMemAllocator_SetProperties(
allocator, &req_props, &ret_props);
2949 ok(!
memcmp(&ret_props, &req_props,
sizeof(req_props)),
"Properties did not match.\n");
2963 ref = IFilterGraph2_Release(
graph);
2964 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2965 IBasicVideo_Release(video);
2966 IMemInputPin_Release(
input);
2969 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2970 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
2971 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2980 .bmiHeader.biWidth = 32,
2981 .bmiHeader.biHeight = 16,
2982 .bmiHeader.biBitCount = 32,
2983 .bmiHeader.biPlanes = 1,
2987 .majortype = MEDIATYPE_Video,
2988 .subtype = MEDIASUBTYPE_RGB32,
2989 .formattype = FORMAT_VideoInfo,
2990 .cbFormat =
sizeof(vih),
2991 .pbFormat = (
BYTE *)&vih,
3006 IBaseFilter_QueryInterface(
filter, &IID_IVMRWindowlessControl, (
void **)&windowless_control);
3007 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
3008 IPin_QueryInterface(pin, &IID_IMemInputPin, (
void **)&
input);
3010 IFilterGraph2_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
L"source");
3012 window =
CreateWindowA(
"static",
"quartz_test",
WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0);
3013 ok(!!
window,
"Failed to create a window.\n");
3015 hr = IVMRWindowlessControl_SetVideoClippingWindow(windowless_control,
window);
3018 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3024 hr = IMemAllocator_SetProperties(
allocator, &req_props, &ret_props);
3028 skip(
"Got E_FAIL when setting allocator properties.\n");
3032 ok(!
memcmp(&ret_props, &req_props,
sizeof(req_props)),
"Properties did not match.\n");
3035 hr = IVMRWindowlessControl_GetNativeVideoSize(windowless_control,
NULL, &
height, &aspect_width, &aspect_height);
3037 hr = IVMRWindowlessControl_GetNativeVideoSize(windowless_control, &
width,
NULL, &aspect_width, &aspect_height);
3046 aspect_width = aspect_height = 0xdeadbeef;
3047 hr = IVMRWindowlessControl_GetNativeVideoSize(windowless_control, &
width, &
height, &aspect_width, &aspect_height);
3049 ok(aspect_width == 32,
"Got width %ld.\n", aspect_width);
3050 ok(aspect_height == 16,
"Got height %ld.\n", aspect_height);
3053 hr = IVMRWindowlessControl_GetVideoPosition(windowless_control, &
src,
NULL);
3059 hr = IVMRWindowlessControl_GetVideoPosition(windowless_control,
NULL, &
dst);
3065 hr = IVMRWindowlessControl_SetVideoPosition(windowless_control, &
src,
NULL);
3070 hr = IVMRWindowlessControl_GetVideoPosition(windowless_control, &
src, &
dst);
3078 hr = IVMRWindowlessControl_SetVideoPosition(windowless_control,
NULL, &
dst);
3083 hr = IVMRWindowlessControl_GetVideoPosition(windowless_control, &
src, &
dst);
3095 ref = IFilterGraph2_Release(
graph);
3096 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3097 IMemInputPin_Release(
input);
3099 IVMRWindowlessControl_Release(windowless_control);
3101 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3110 IMediaEvent *eventsrc;
3118 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3121 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaEvent, (
void **)&eventsrc);
3125 ok(!
ret,
"Got %u EC_COMPLETE events.\n",
ret);
3131 ok(!
ret,
"Got %u EC_COMPLETE events.\n",
ret);
3137 ok(
ret == 1,
"Got %u EC_COMPLETE events.\n",
ret);
3143 ok(!
ret,
"Got %u EC_COMPLETE events.\n",
ret);
3149 ok(
ret == 1,
"Got %u EC_COMPLETE events.\n",
ret);
3155 ok(!
ret,
"Got %u EC_COMPLETE events.\n",
ret);
3161 ok(
ret == 1,
"Got %u EC_COMPLETE events.\n",
ret);
3163 IMediaControl_Release(
control);
3164 IMediaEvent_Release(eventsrc);
3165 ref = IFilterGraph2_Release(
graph);
3166 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3168 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3250 todo_wine ok(
info->szAspectRatio.cx == 120,
"Got aspect ratio width %ld.\n",
info->szAspectRatio.cx);
3251 todo_wine ok(
info->szAspectRatio.cy == 60,
"Got aspect ratio height %ld.\n",
info->szAspectRatio.cy);
3254 ok(!
info->dwTypeSpecificFlags,
"Got type-specific flags %#lx.\n",
info->dwTypeSpecificFlags);
3255 ok(!
info->dwInterlaceFlags,
"Got interlace flags %#lx.\n",
info->dwInterlaceFlags);
3259 "Got %u calls to PrepareSurface(); %u calls to PresentImage().\n",
3292 ok(!
IsEqualGUID(iid, &IID_IVMRSurfaceAllocatorEx9),
"Unexpected query for IVMRSurfaceAllocatorEx9.\n");
3322 todo_wine ok(
info->dwMinBuffers == 5,
"Got minimum buffer count %lu.\n",
info->dwMinBuffers);
3323 todo_wine ok(
info->dwMaxBuffers == 5,
"Got maximum buffer count %lu.\n",
info->dwMaxBuffers);
3324 ok(!
info->dwInterlaceFlags,
"Got interlace flags %#lx.\n",
info->dwInterlaceFlags);
3325 todo_wine ok(
info->szAspectRatio.cx == 120,
"Got aspect ratio width %ld.\n",
info->szAspectRatio.cx);
3326 todo_wine ok(
info->szAspectRatio.cy == 60,
"Got aspect ratio height %ld.\n",
info->szAspectRatio.cy);
3327 ok(
info->szNativeSize.cx == 32,
"Got native width %ld.\n",
info->szNativeSize.cx);
3328 ok(
info->szNativeSize.cy == 16,
"Got native height %ld.\n",
info->szNativeSize.cy);
3330 ok(!
info->lpPixFmt,
"Got pixel format %p.\n",
info->lpPixFmt);
3384 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3406 ok(0,
"Unexpected call.\n");
3425 OAFilterState
state;
3429 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3458 IMediaControl_Release(
control);
3466 .rcTarget = {40, 60, 160, 120},
3468 .bmiHeader.biWidth = 32,
3469 .bmiHeader.biHeight = 16,
3470 .bmiHeader.biPlanes = 1,
3474 .majortype = MEDIATYPE_Video,
3475 .subtype = MEDIASUBTYPE_WAVE,
3476 .formattype = FORMAT_VideoInfo,
3477 .cbFormat =
sizeof(vih),
3478 .pbFormat = (
BYTE *)&vih,
3510 {&MEDIASUBTYPE_RGB32, 32,
BI_RGB},
3511 {&MEDIASUBTYPE_NV12, 12,
mmioFOURCC(
'N',
'V',
'1',
'2')},
3512 {&MEDIASUBTYPE_YV12, 12,
mmioFOURCC(
'Y',
'V',
'1',
'2')},
3513 {&MEDIASUBTYPE_UYVY, 16,
mmioFOURCC(
'U',
'Y',
'V',
'Y')},
3514 {&MEDIASUBTYPE_YUY2, 16,
mmioFOURCC(
'Y',
'U',
'Y',
'2')},
3527 IBaseFilter_QueryInterface(
filter, &IID_IVMRSurfaceAllocatorNotify, (
void **)&
notify);
3530 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
3539 hr = IVMRSurfaceAllocatorNotify_AdviseSurfaceAllocator(
notify, 0xabacab,
3547 IFilterGraph2_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
NULL);
3549 IBaseFilter_FindPin(
filter,
L"VMR Input0", &pin);
3550 IPin_QueryInterface(pin, &IID_IMemInputPin, (
void **)&
input);
3556 req_mt.subtype = *
tests[
i].subtype;
3560 hr = IFilterGraph2_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &req_mt);
3566 skip(
"Format is not supported, hr %#lx.\n",
hr);
3581 hr = IMemAllocator_SetProperties(
allocator, &req_props, &ret_props);
3584 skip(
"Format is not supported, hr %#lx.\n",
hr);
3586 hr = IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
3588 hr = IFilterGraph2_Disconnect(
graph, pin);
3594 ok(!
memcmp(&ret_props, &req_props,
sizeof(req_props)),
"Properties did not match.\n");
3598 hr = IVMRSurfaceAllocatorNotify_AdviseSurfaceAllocator(
notify, 0xabacab,
3603 "Bitmap header didn't match.\n");
3611 hr = IFilterGraph2_Disconnect(
graph, &
source.source.pin.IPin_iface);
3613 hr = IFilterGraph2_Disconnect(
graph, pin);
3618 hr = IVMRSurfaceAllocatorNotify_AdviseSurfaceAllocator(
notify, 0xabacab,
3622 ref = IFilterGraph2_Release(
graph);
3623 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3624 IMemInputPin_Release(
input);
3627 IVMRSurfaceAllocatorNotify_Release(
notify);
3629 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3631 ok(presenter2.
refcount == 1,
"Got outstanding refcount %ld.\n", presenter2.
refcount);
3633 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3653 .biCompression =
mmioFOURCC(
'Y',
'U',
'Y',
'2'),
3677 &IID_IVMRSurfaceAllocator, (
void **)&
allocator);
3680 hr = IVMRSurfaceAllocator_FreeSurface(
allocator, 0);
3684 info.dwMinBuffers = 2;
3685 info.dwMaxBuffers = 2;
3686 info.dwInterlaceFlags = 0;
3687 info.szNativeSize.cx =
info.szAspectRatio.cx = 640;
3688 info.szNativeSize.cy =
info.szAspectRatio.cy = 480;
3689 info.lpHdr = &bitmap_header;
3694 DWORD expect_caps = 0;
3712 desc.dwBackBufferCount = 2;
3713 desc.ddpfPixelFormat.dwSize =
sizeof(
desc.ddpfPixelFormat);
3717 desc.ddpfPixelFormat.dwFourCC =
tests[
i].compression;
3722 desc.ddpfPixelFormat.dwRGBBitCount = 32;
3723 desc.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
3724 desc.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
3725 desc.ddpfPixelFormat.dwBBitMask = 0x000000ff;
3734 hr = IDirectDrawSurface7_GetSurfaceDesc(frontbuffer, &
desc);
3737 IDirectDrawSurface7_Release(frontbuffer);
3740 IDirectDraw7_Release(
ddraw);
3746 skip(
"Format is not supported.\n");
3754 hr = IDirectDrawSurface7_GetSurfaceDesc(frontbuffer, &
desc);
3757 "Got flags %#lx.\n",
desc.dwFlags);
3760 ok(!
desc.ddsCaps.dwCaps2,
"Got caps2 %#lx.\n",
desc.ddsCaps.dwCaps2);
3761 ok(!
desc.ddsCaps.dwCaps3,
"Got caps2 %#lx.\n",
desc.ddsCaps.dwCaps3);
3762 ok(!
desc.ddsCaps.dwCaps4,
"Got caps2 %#lx.\n",
desc.ddsCaps.dwCaps4);
3763 ok(
desc.dwWidth == 32,
"Got width %lu.\n",
desc.dwWidth);
3764 ok(
desc.dwHeight == 16,
"Got height %lu.\n",
desc.dwHeight);
3765 ok(
desc.ddpfPixelFormat.dwSize ==
sizeof(
desc.ddpfPixelFormat),
3766 "Got size %lu.\n",
desc.ddpfPixelFormat.dwSize);
3771 "Got fourcc %08lx.\n",
desc.ddpfPixelFormat.dwFourCC);
3775 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Got flags %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
3776 ok(
desc.ddpfPixelFormat.dwRGBBitCount == 32,
"Got depth %lu.\n",
desc.ddpfPixelFormat.dwRGBBitCount);
3777 ok(
desc.ddpfPixelFormat.dwRBitMask == 0x00ff0000,
"Got red mask %#lx.\n",
desc.ddpfPixelFormat.dwRBitMask);
3778 ok(
desc.ddpfPixelFormat.dwGBitMask == 0x0000ff00,
"Got green mask %#lx.\n",
desc.ddpfPixelFormat.dwGBitMask);
3779 ok(
desc.ddpfPixelFormat.dwBBitMask == 0x000000ff,
"Got blue mask %#lx.\n",
desc.ddpfPixelFormat.dwBBitMask);
3783 hr = IDirectDrawSurface7_GetAttachedSurface(frontbuffer, &
desc.ddsCaps, &backbuffer);
3788 hr = IDirectDrawSurface7_GetSurfaceDesc(backbuffer, &
desc);
3791 "Got flags %#lx.\n",
desc.dwFlags);
3796 hr = IDirectDrawSurface7_GetAttachedSurface(backbuffer, &
desc.ddsCaps, &backbuffer2);
3801 hr = IDirectDrawSurface7_GetSurfaceDesc(backbuffer2, &
desc);
3804 "Got flags %#lx.\n",
desc.dwFlags);
3806 "Expected caps %#lx, got %#lx.\n", expect_caps,
desc.ddsCaps.dwCaps);
3809 hr = IDirectDrawSurface7_GetAttachedSurface(backbuffer2, &
desc.ddsCaps, &backbuffer3);
3813 ok(backbuffer3 == frontbuffer,
"Expected only 2 backbuffers.\n");
3814 IDirectDrawSurface7_Release(backbuffer3);
3817 IDirectDrawSurface7_Release(backbuffer2);
3818 IDirectDrawSurface7_Release(backbuffer);
3820 hr = IDirectDrawSurface7_GetDDInterface(frontbuffer, (
void **)&
ddraw);
3824 ok(
ddraw == prev_ddraw,
"Expected the same ddraw object.\n");
3825 IDirectDraw7_Release(
ddraw);
3835 IDirectDrawSurface7_AddRef(frontbuffer);
3837 hr = IVMRSurfaceAllocator_FreeSurface(
allocator, 0);
3840 ref = IDirectDrawSurface7_Release(frontbuffer);
3841 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3847 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3848 ref = IDirectDraw7_Release(prev_ddraw);
3849 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3875 &IID_IVMRSurfaceAllocator, (
void **)&
allocator);
3882 info.dwInterlaceFlags = 0;
3883 info.szNativeSize.cx = 420;
3884 info.szAspectRatio.cx = 400;
3885 info.szNativeSize.cy = 180;
3886 info.szAspectRatio.cy = 200;
3887 info.lpHdr = &bitmap_header;
3893 hr = IVMRSurfaceAllocator_QueryInterface(
allocator, &IID_IVMRWindowlessControl, (
void **)&
control);
3908 hr = IVMRSurfaceAllocator_FreeSurface(
allocator, 0);
3911 IVMRWindowlessControl_Release(
control);
3913 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
#define InterlockedIncrement
#define InterlockedDecrement
static const char * wine_dbgstr_rect(const RECT *prc)
enum _PinDirection PIN_DIRECTION
_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
const GUID IID_IKsPropertySet
const GUID IID_IBaseFilter
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID *lplpDD, REFIID id, LPUNKNOWN pUnkOuter)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
void WINAPI CoTaskMemFree(void *ptr)
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
BOOL WINAPI GetExitCodeThread(IN HANDLE hThread, OUT LPDWORD lpExitCode)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
struct tagVIDEOINFOHEADER VIDEOINFOHEADER
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble top
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
const GLvdpauSurfaceNV * surfaces
GLsizei GLenum GLboolean sink
GLboolean GLboolean GLboolean GLboolean a
GLenum GLenum GLenum input
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
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
#define mmioFOURCC(c0, c1, c2, c3)
static struct test_info tests[]
D3D11_SHADER_VARIABLE_DESC desc
static IHTMLWindow2 * window
static void test_filter_state(void)
static HRESULT WINAPI allocator_FreeSurface(IVMRSurfaceAllocator *iface, DWORD_PTR cookie)
static HRESULT WINAPI allocator_PrepareSurface(IVMRSurfaceAllocator *iface, DWORD_PTR cookie, IDirectDrawSurface7 *surface, DWORD flags)
static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, IMemInputPin *peer, IMemAllocator **allocator)
static struct presenter * impl_from_IVMRSurfaceAllocator(IVMRSurfaceAllocator *iface)
static BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b)
static void testfilter_destroy(struct strmbase_filter *iface)
static HRESULT join_thread_(int line, HANDLE thread)
static ULONG WINAPI allocator_Release(IVMRSurfaceAllocator *iface)
static const IUnknownVtbl outer_vtbl
static void test_video_window_messages(IVideoWindow *window, HWND hwnd, HWND our_hwnd)
static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hwnd)
static void test_default_presenter_window(void)
static void test_aggregation(void)
static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
static void test_windowless_size(void)
static void test_basic_video(void)
static ULONG WINAPI outer_AddRef(IUnknown *iface)
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
static HRESULT set_mixing_mode(IBaseFilter *filter)
static void test_video_window_caption(IVideoWindow *window, HWND hwnd)
static const IVMRSurfaceAllocatorVtbl allocator_vtbl
static HRESULT WINAPI presenter_StartPresenting(IVMRImagePresenter *iface, DWORD_PTR cookie)
static void test_video_window_position(IVideoWindow *window, HWND hwnd, HWND our_hwnd)
static struct testfilter * impl_from_strmbase_filter(struct strmbase_filter *iface)
static HRESULT WINAPI presenter_QueryInterface(IVMRImagePresenter *iface, REFIID iid, void **out)
static ULONG get_refcount(void *iface)
static const IVMRImagePresenterVtbl presenter_vtbl
static HRESULT WINAPI presenter_PresentImage(IVMRImagePresenter *iface, DWORD_PTR cookie, VMRPRESENTATIONINFO *info)
static void test_pin_info(void)
static IUnknown test_outer
static void test_current_image(IBaseFilter *filter, IMemInputPin *input, IMediaControl *control, const BITMAPINFOHEADER *req_bih)
static void test_find_pin(void)
static void test_basic_video_destination(IBasicVideo *video)
static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hwnd)
static void test_flushing(IPin *pin, IMemInputPin *input, IMediaControl *control)
static const struct strmbase_source_ops testsource_ops
static void test_basic_video_source(IBasicVideo *video)
static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
static HRESULT WINAPI allocator_AllocateSurface(IVMRSurfaceAllocator *iface, DWORD_PTR cookie, VMRALLOCATIONINFO *info, DWORD *buffer_count, IDirectDrawSurface7 **surface)
static void test_enum_media_types(void)
static BOOL compare_double(double f, double g, unsigned int ulps)
static HRESULT WINAPI allocator_AdviseNotify(IVMRSurfaceAllocator *iface, IVMRSurfaceAllocatorNotify *notify)
static BOOL CALLBACK top_window_cb(HWND hwnd, LPARAM ctx)
static void test_interfaces(void)
static void test_video_window_autoshow(IVideoWindow *window, IFilterGraph2 *graph, HWND hwnd)
static unsigned int check_ec_userabort(IMediaEvent *eventsrc, DWORD timeout)
static void test_video_window(void)
static IBaseFilter * create_vmr7(DWORD mode)
static void test_connect_pin(void)
static DWORD WINAPI frame_thread(void *arg)
static ULONG WINAPI presenter_Release(IVMRImagePresenter *iface)
static void flush_events(void)
static void test_media_types(void)
static struct presenter * impl_from_IVMRImagePresenter(IVMRImagePresenter *iface)
static ULONG WINAPI presenter_AddRef(IVMRImagePresenter *iface)
static struct strmbase_pin * testfilter_get_pin(struct strmbase_filter *iface, unsigned int index)
static void test_allocator(IMemInputPin *input)
static void commit_allocator(IMemInputPin *input)
static void test_enum_pins(void)
static IFilterGraph2 * create_graph(void)
static IDirectDraw7 * create_ddraw(HWND window)
static void test_overlay(void)
static void test_renderless_present(struct presenter *presenter, IFilterGraph2 *graph, IMemInputPin *input)
static HWND get_top_window(void)
static HRESULT WINAPI presenter_StopPresenting(IVMRImagePresenter *iface, DWORD_PTR cookie)
static void check_destination_position_(int line, IBasicVideo *video, LONG expect_left, LONG expect_top, LONG expect_width, LONG expect_height)
static HANDLE send_frame(IMemInputPin *sink)
#define check_destination_position(a, b, c, d, e)
static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *control)
static DWORD CALLBACK notify_message_proc(void *arg)
#define check_source_position(a, b, c, d, e)
static void test_unconnected_eos(void)
static void test_default_presenter_allocate(void)
static unsigned int check_ec_complete(IMediaEvent *eventsrc, DWORD timeout)
#define check_interface(a, b, c)
static void test_filter_config(void)
static void test_common_interfaces(IBaseFilter *filter)
static void test_renderless_formats(void)
static ULONG WINAPI allocator_AddRef(IVMRSurfaceAllocator *iface)
static unsigned int check_event_code(IMediaEvent *eventsrc, DWORD timeout, LONG expected_code, LONG_PTR expected1, LONG_PTR expected2)
static const struct strmbase_filter_ops testfilter_ops
static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hwnd)
static void check_source_position_(int line, IBasicVideo *video, LONG expect_left, LONG expect_top, LONG expect_width, LONG expect_height)
static void test_unconnected_filter_state(void)
static const GUID test_iid
static HRESULT WINAPI allocator_QueryInterface(IVMRSurfaceAllocator *iface, REFIID iid, void **out)
static void testfilter_init(struct testfilter *filter)
static ULONG WINAPI outer_Release(IUnknown *iface)
#define expect_hr(expected, got)
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define WS_OVERLAPPEDWINDOW
#define WS_EX_TRANSPARENT
const GUID IID_IPersistPropertyBag
#define IsEqualGUID(rguid1, rguid2)
DWORD IDirectDrawSurface7
HWND WINAPI GetFocus(void)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
BOOL WINAPI IsWindow(_In_opt_ HWND)
HWND WINAPI GetActiveWindow(void)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI GetForegroundWindow(void)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
BOOL WINAPI AdjustWindowRect(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define WM_NCRBUTTONDBLCLK
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_SYSCOLORCHANGE
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define WM_NCLBUTTONDBLCLK
BOOL WINAPI IsIconic(_In_ HWND)
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI IsZoomed(_In_ HWND)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define WM_NCMBUTTONDBLCLK
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
int WINAPI GetSystemMetrics(_In_ int)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define offsetof(TYPE, MEMBER)
#define DDSCAPS_FRONTBUFFER
#define DDERR_INVALIDPIXELFORMAT
#define DDSCAPS_OFFSCREENPLAIN
#define DDSCAPS_BACKBUFFER
#define DDSD_BACKBUFFERCOUNT
static __inline const char * wine_dbgstr_guid(const GUID *id)
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
void strmbase_filter_cleanup(struct strmbase_filter *filter)
void strmbase_source_cleanup(struct strmbase_source *pin)
void strmbase_filter_init(struct strmbase_filter *filter, IUnknown *outer, const CLSID *clsid, const struct strmbase_filter_ops *func_table)
HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(struct strmbase_source *pin, IPin *peer, const AM_MEDIA_TYPE *mt)
DDPIXELFORMAT ddpfPixelFormat
IVMRImagePresenter IVMRImagePresenter_iface
unsigned int got_PresentImage
IDirectDrawSurface7 * surfaces[6]
IVMRSurfaceAllocator IVMRSurfaceAllocator_iface
unsigned int got_PrepareSurface
IVMRSurfaceAllocatorNotify * notify
struct strmbase_filter filter
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define CONTAINING_RECORD(address, type, field)
#define MEDIASUBTYPE_NULL
#define VFW_E_VMR_NOT_IN_MIXER_MODE
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_NOT_COMMITTED
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE
#define VFW_E_NOT_STOPPED
#define VFW_E_WRONG_STATE
#define VFW_E_NO_PALETTE_AVAILABLE
#define VFW_S_STATE_INTERMEDIATE
#define VFW_E_NOT_CONNECTED
static const WCHAR props[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
DWORD WINAPI GetCurrentThreadId(void)
DWORD WINAPI GetCurrentProcessId(void)
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
size_t const buffer_count