22#define NONAMELESSUNION
23#define WINE_NO_NAMELESS_EXTENSION
33#include "wmcodecdsp.h"
40 .nSamplesPerSec = 11025,
43 .nAvgBytesPerSec = 2 * 11025,
49 .majortype = {0x73647561, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
50 .subtype = {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
51 .formattype = {0x05589f81, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}},
59 .bmiHeader.biWidth = 333,
60 .bmiHeader.biHeight = -444,
61 .bmiHeader.biPlanes = 1,
62 .bmiHeader.biBitCount = 8,
63 .bmiHeader.biCompression =
BI_RGB,
69 .bmiHeader.biWidth = 333,
70 .bmiHeader.biHeight = -444,
71 .bmiHeader.biPlanes = 1,
72 .bmiHeader.biBitCount = 16,
73 .bmiHeader.biCompression =
BI_RGB,
79 .bmiHeader.biWidth = 333,
80 .bmiHeader.biHeight = -444,
81 .bmiHeader.biPlanes = 1,
82 .bmiHeader.biBitCount = 16,
84 .u.dwBitMasks = {0xf800, 0x07e0, 0x001f},
90 .bmiHeader.biWidth = 333,
91 .bmiHeader.biHeight = -444,
92 .bmiHeader.biPlanes = 1,
93 .bmiHeader.biBitCount = 24,
94 .bmiHeader.biCompression =
BI_RGB,
100 .bmiHeader.biWidth = 333,
101 .bmiHeader.biHeight = -444,
102 .bmiHeader.biPlanes = 1,
103 .bmiHeader.biBitCount = 32,
104 .bmiHeader.biCompression =
BI_RGB,
110 .majortype = {0x73646976, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
111 .subtype = {0xe436eb7a, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}},
112 .formattype = {0x05589f80, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}},
120 .majortype = {0x73646976, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
121 .subtype = {0xe436eb7c, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}},
122 .formattype = {0x05589f80, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}},
130 .majortype = {0x73646976, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
131 .subtype = {0xe436eb7b, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}},
132 .formattype = {0x05589f80, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}},
140 .majortype = {0x73646976, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
141 .subtype = {0xe436eb7d, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}},
142 .formattype = {0x05589f80, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}},
150 .majortype = {0x73646976, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}},
151 .subtype = {0xe436eb7e, 0x524f, 0x11ce, {0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}},
152 .formattype = {0x05589f80, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}},
163 .ddpfPixelFormat.u1.dwRGBBitCount = 8,
171 .ddpfPixelFormat.dwFlags =
DDPF_RGB,
172 .ddpfPixelFormat.u1.dwRGBBitCount = 16,
173 .ddpfPixelFormat.u2.dwRBitMask = 0x7c00,
174 .ddpfPixelFormat.u3.dwGBitMask = 0x03e0,
175 .ddpfPixelFormat.u4.dwBBitMask = 0x001f,
183 .ddpfPixelFormat.dwFlags =
DDPF_RGB,
184 .ddpfPixelFormat.u1.dwRGBBitCount = 16,
185 .ddpfPixelFormat.u2.dwRBitMask = 0xf800,
186 .ddpfPixelFormat.u3.dwGBitMask = 0x07e0,
187 .ddpfPixelFormat.u4.dwBBitMask = 0x001f,
195 .ddpfPixelFormat.dwFlags =
DDPF_RGB,
196 .ddpfPixelFormat.u1.dwRGBBitCount = 24,
197 .ddpfPixelFormat.u2.dwRBitMask = 0xff0000,
198 .ddpfPixelFormat.u3.dwGBitMask = 0x00ff00,
199 .ddpfPixelFormat.u4.dwBBitMask = 0x0000ff,
207 .ddpfPixelFormat.dwFlags =
DDPF_RGB,
208 .ddpfPixelFormat.u1.dwRGBBitCount = 32,
209 .ddpfPixelFormat.u2.dwRBitMask = 0xff0000,
210 .ddpfPixelFormat.u3.dwGBitMask = 0x00ff00,
211 .ddpfPixelFormat.u4.dwBBitMask = 0x0000ff,
220 .ddpfPixelFormat.u1.dwRGBBitCount = 32,
221 .ddpfPixelFormat.u2.dwRBitMask = 0xff0000,
222 .ddpfPixelFormat.u3.dwGBitMask = 0x00ff00,
223 .ddpfPixelFormat.u4.dwBBitMask = 0x0000ff,
224 .ddpfPixelFormat.u5.dwRGBAlphaBitMask = 0xff000000,
233 .ddpfPixelFormat.dwFourCC =
MAKEFOURCC(
'Y',
'U',
'Y',
'2'),
234 .ddpfPixelFormat.u1.dwYUVBitCount = 16,
243 .ddpfPixelFormat.dwFourCC =
MAKEFOURCC(
'Y',
'V',
'1',
'2'),
244 .ddpfPixelFormat.u1.dwYUVBitCount = 12,
261 ok(!!
path,
"Failed to allocate temp path string.\n");
289#define EXPECT_REF(obj,ref) _expect_ref((IUnknown*)obj, ref, __LINE__)
293 IUnknown_AddRef(
obj);
294 rc = IUnknown_Release(
obj);
295 ok_(__FILE__,
line)(rc ==
ref,
"expected refcount %ld, got %ld\n",
ref, rc);
302 &IID_IAMMultiMediaStream, (
void **)&
stream);
311 return IUnknown_Release(
unknown);
314#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
323 hr = IUnknown_QueryInterface(iface, iid, (
void **)&unk);
326 IUnknown_Release(unk);
351 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
369 IMediaStreamFilter_Release(
filter);
371 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
391 IMediaStream_Release(
stream);
393 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
414 IMediaStream_Release(
stream);
416 ref = IAMMultiMediaStream_Release(mmstream);
417 ok(!
ref,
"Got outstanding refcount %lu.\n",
ref);
423 IMediaControl *media_control;
432 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
434 ok(!
graph,
"Expected NULL graph.\n");
436 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
437 ok(!!
filter,
"Expected non-NULL filter.\n");
447 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
449 ok(!!
graph,
"Expected non-NULL graph.\n");
450 IGraphBuilder_Release(
graph);
451 IMediaStreamFilter_Release(
filter);
453 ref = IAMMultiMediaStream_Release(mmstream);
454 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
458 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
460 ok(!
graph,
"Expected NULL graph.\n");
462 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
463 ok(!!
filter,
"Expected non-NULL filter.\n");
473 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
475 ok(!!
graph,
"Expected non-NULL graph.\n");
477 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
484 IMediaFilter_GetSyncSource(media_filter, &
clock);
485 ok(!!
clock,
"Expected non-NULL clock.\n");
490 ref = IAMMultiMediaStream_Release(mmstream);
491 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
492 IMediaFilter_Release(media_filter);
494 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
495 ref = IMediaStreamFilter_Release(
filter);
496 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
497 ref = IReferenceClock_Release(
clock);
498 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
501 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
503 ok(!
graph,
"Expected NULL graph.\n");
505 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
506 ok(!!
filter,
"Expected non-NULL filter.\n");
516 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
518 ok(!!
graph,
"Expected non-NULL graph.\n");
519 IGraphBuilder_Release(
graph);
520 IMediaStreamFilter_Release(
filter);
522 ref = IAMMultiMediaStream_Release(mmstream);
523 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
526 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
528 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
530 ok(!!
graph,
"Expected non-NULL graph.\n");
531 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
533 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
547 IMediaFilter_GetSyncSource(media_filter, &
clock);
548 ok(!!
clock,
"Expected non-NULL clock.\n");
553 ref = IAMMultiMediaStream_Release(mmstream);
554 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
555 IMediaFilter_Release(media_filter);
557 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
558 ref = IMediaStreamFilter_Release(
filter);
559 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
560 ref = IReferenceClock_Release(
clock);
561 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
564 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
566 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
568 ok(!!
graph,
"Expected non-NULL graph.\n");
569 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaControl, (
void **)&media_control);
572 hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path,
AMMSF_RUN);
580 ref = IAMMultiMediaStream_Release(mmstream);
581 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
582 IMediaControl_Release(media_control);
584 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
587 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
589 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
591 ok(!!
graph,
"Expected non-NULL graph.\n");
592 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
595 hr = IAMMultiMediaStream_OpenFile(mmstream, test_avi_path,
AMMSF_NOCLOCK);
602 IMediaFilter_GetSyncSource(media_filter, &
clock);
608 ref = IAMMultiMediaStream_Release(mmstream);
609 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
610 IMediaFilter_Release(media_filter);
612 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
622 duration = 0xdeadbeefdeadbeefULL;
623 hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
627 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0,
NULL);
637 duration = 0xdeadbeefdeadbeefULL;
638 hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
639 if (audio_hr ==
S_OK)
650 ref = IAMMultiMediaStream_Release(mmstream);
651 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
654 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
657 duration = 0xdeadbeefdeadbeefULL;
658 hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
662 ref = IAMMultiMediaStream_Release(mmstream);
663 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
670 duration = 0xdeadbeefdeadbeefULL;
671 hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
675 ref = IAMMultiMediaStream_Release(mmstream);
676 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
679 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
685 duration = 0xdeadbeefdeadbeefULL;
686 hr = IAMMultiMediaStream_GetDuration(mmstream, &duration);
690 ref = IAMMultiMediaStream_Release(mmstream);
691 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
722 return IAMMediaStream_QueryInterface(&
stream->IAMMediaStream_iface, iid,
out);
728 return IAMMediaStream_AddRef(&
stream->IAMMediaStream_iface);
734 return IAMMediaStream_Release(&
stream->IAMMediaStream_iface);
739 ok(0,
"Unexpected call.\n");
745 ok(0,
"Unexpected call.\n");
763 ok(0,
"Unexpected call.\n");
769 ok(0,
"Unexpected call.\n");
782 ok(0,
"Unexpected call.\n");
788 ok(0,
"Unexpected call.\n");
794 ok(0,
"Unexpected call.\n");
800 ok(0,
"Unexpected call.\n");
806 ok(0,
"Unexpected call.\n");
812 ok(0,
"Unexpected call.\n");
818 ok(0,
"Unexpected call.\n");
824 ok(0,
"Unexpected call.\n");
858 IAMMediaStream_AddRef(iface);
864 IAMMediaStream_AddRef(iface);
887 ok(0,
"Unexpected call.\n");
904 ok(0,
"Unexpected call.\n");
910 ok(0,
"Unexpected call.\n");
917 ok(0,
"Unexpected call.\n");
923 ok(0,
"Unexpected call.\n");
930 ok(0,
"Unexpected call.\n");
940 return stream->set_state_result;
995#define check_enum_stream(a,b,c,d) check_enum_stream_(__LINE__,a,b,c,d)
1004 "IAMMultiMediaStream::EnumMediaStreams() returned %#lx.\n",
hr);
1005 hr = IMediaStreamFilter_EnumMediaStreams(
filter,
index, &stream2);
1007 "IMediaStreamFilter::EnumMediaStreams() returned %#lx.\n",
hr);
1012 IMediaStream_Release(
stream);
1013 IMediaStream_Release(stream2);
1048 return &
filter->source.pin;
1067 hr = IMemAllocator_Commit(
filter->source.pAllocator);
1071 return filter->init_stream_hr;
1081 hr = IMemAllocator_Decommit(
filter->source.pAllocator);
1085 return filter->cleanup_stream_hr;
1132 else if (
IsEqualGUID(iid, &IID_IQualityControl) &&
filter->IQualityControl_iface.lpVtbl)
1152 &IID_IMemAllocator, (
void **)
alloc);
1155 IMemInputPin_GetAllocatorRequirements(pin, &
props);
1159 return IMemInputPin_NotifyAllocator(pin, *
alloc,
FALSE);
1176 return IMemAllocator_SetProperties(
alloc, requested, &actual);
1194 filter->stop_position = 0x8000000000000000ULL;
1206 return IBaseFilter_QueryInterface(&
filter->
filter.IBaseFilter_iface, iid,
out);
1212 return IBaseFilter_AddRef(&
filter->
filter.IBaseFilter_iface);
1218 return IBaseFilter_Release(&
filter->
filter.IBaseFilter_iface);
1228 ok(0,
"Unexpected call.\n");
1239 return filter->is_format_supported_hr;
1244 ok(0,
"Unexpected call.\n");
1250 ok(0,
"Unexpected call.\n");
1261 ok(0,
"Unexpected call.\n");
1270 *duration = 0x8000000000000000ULL;
1272 return filter->get_duration_hr;
1280 *stop = 0x8000000000000000ULL;
1282 return filter->get_stop_position_hr;
1294 ok(0,
"Unexpected call.\n");
1306 filter->current_position = *current_ptr;
1309 filter->stop_position = *stop_ptr;
1312 return filter->set_positions_hr;
1317 ok(0,
"Unexpected call.\n");
1323 ok(0,
"Unexpected call.\n");
1329 ok(0,
"Unexpected call.\n");
1335 ok(0,
"Unexpected call.\n");
1341 ok(0,
"Unexpected call.\n");
1377 return IBaseFilter_QueryInterface(&
filter->
filter.IBaseFilter_iface, iid,
out);
1383 return IBaseFilter_AddRef(&
filter->
filter.IBaseFilter_iface);
1389 return IBaseFilter_Release(&
filter->
filter.IBaseFilter_iface);
1396 filter->qc_notify_sender = sender;
1397 filter->qc_notify_quality =
q;
1399 return filter->qc_notify_hr;
1404 ok(0,
"Unexpected call.\n");
1417#define check_get_stream(a,b,c,d) check_get_stream_(__LINE__,a,b,c,d)
1424 hr = IAMMultiMediaStream_GetMediaStream(mmstream, mspid, &
stream);
1426 "IAMMultiMediaStream::GetMediaStream() returned %#lx.\n",
hr);
1427 hr = IMediaStreamFilter_GetMediaStream(
filter, mspid, &stream2);
1429 "IMediaStreamFilter::GetMediaStream() returned %#lx.\n",
hr);
1437 if (stream2) IMediaStream_Release(stream2);
1447 IDirectDraw *
ddraw, *ddraw2;
1458 hr = IAMMultiMediaStream_GetFilter(
mmstream, &stream_filter);
1463 hr = IMediaStreamFilter_EnumMediaStreams(stream_filter, 0,
NULL);
1466 hr = IAMMultiMediaStream_GetMediaStream(
mmstream, &MSPID_PrimaryAudio,
NULL);
1468 hr = IMediaStreamFilter_GetMediaStream(stream_filter, &MSPID_PrimaryAudio,
NULL);
1470 hr = IAMMultiMediaStream_GetMediaStream(
mmstream, &MSPID_PrimaryVideo,
NULL);
1472 hr = IMediaStreamFilter_GetMediaStream(stream_filter, &MSPID_PrimaryVideo,
NULL);
1483 ok(
hr == MS_E_PURPOSEID,
"Got hr %#lx.\n",
hr);
1485 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryVideo, 0, &video_stream);
1489 ok(
hr == MS_E_PURPOSEID,
"Got hr %#lx.\n",
hr);
1493 hr = IMediaStreamFilter_EnumMediaStreams(stream_filter, 0,
NULL);
1497 hr = IMediaStreamFilter_EnumMediaStreams(stream_filter, 1,
NULL);
1519 ok(
hr == MS_E_PURPOSEID,
"Got hr %#lx.\n",
hr);
1521 hr = IMediaStreamFilter_QueryFilterInfo(stream_filter, &
info);
1527 IMediaStream_Release(
stream);
1529 ok(
teststream.
filter == stream_filter,
"IMediaStreamFilter objects didn't match.\n");
1532 IFilterGraph_Release(
info.pGraph);
1544 ok(
hr == MS_E_PURPOSEID,
"Got hr %#lx.\n",
hr);
1548 ok(!!
graph,
"Expected a non-NULL graph.\n");
1556 "Expected filter %p, got %p.\n", stream_filter, filters[0]);
1557 IBaseFilter_Release(filters[0]);
1559 IGraphBuilder_Release(
graph);
1561 IMediaStreamFilter_Release(stream_filter);
1563 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1564 ref = IMediaStream_Release(video_stream);
1565 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1567 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1574 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryVideo, 0,
NULL);
1577 hr = IAMMultiMediaStream_GetMediaStream(
mmstream, &MSPID_PrimaryVideo, &
stream);
1579 IMediaStream_Release(
stream);
1582 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1593 hr = IMediaStream_QueryInterface(video_stream, &IID_IDirectDrawMediaStream, (
void **)&
ddraw_stream);
1595 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw2);
1597 ok(ddraw2 ==
ddraw,
"Expected IDirectDraw %p, got %p.\n",
ddraw, ddraw2);
1598 IDirectDraw_Release(ddraw2);
1602 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1603 ref = IMediaStream_Release(video_stream);
1604 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1606 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1610 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryVideo, 0, &video_stream);
1613 hr = IMediaStream_QueryInterface(video_stream, &IID_IDirectDrawMediaStream, (
void **)&
ddraw_stream);
1617 ok(!!
ddraw,
"Expected a non-NULL IDirectDraw.\n");
1618 IDirectDraw_Release(
ddraw);
1622 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1623 ref = IMediaStream_Release(video_stream);
1624 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1630 hr = IAMMultiMediaStream_GetFilter(
mmstream, &stream_filter);
1633 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryVideo,
1637 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryVideo,
1639 ok(
hr == MS_E_PURPOSEID,
"Got hr %#lx.\n",
hr);
1641 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryAudio,
1645 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryAudio,
1665 "Expected filter %p, got %p.\n", stream_filter, filters[1]);
1666 hr = IBaseFilter_GetClassID(filters[0], &
clsid);
1669 IBaseFilter_Release(filters[0]);
1670 IBaseFilter_Release(filters[1]);
1672 IGraphBuilder_Release(
graph);
1677 ok(
hr == MS_E_PURPOSEID,
"Got hr %#lx.\n",
hr);
1683 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1684 ref = IMediaStreamFilter_Release(stream_filter);
1685 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1700 ok(
hr ==
S_OK,
"IAMMultiMediaStream_Initialize returned: %lx\n",
hr);
1703 hr = IAMMultiMediaStream_GetFilter(pams,
NULL);
1704 ok(
hr ==
E_POINTER,
"IAMMultiMediaStream_GetFilter returned: %lx\n",
hr);
1705 hr = IAMMultiMediaStream_GetFilter(pams, &media_stream_filter);
1706 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetFilter returned: %lx\n",
hr);
1708 hr = IAMMultiMediaStream_AddMediaStream(pams,
NULL, &MSPID_PrimaryVideo, 0,
NULL);
1709 ok(
hr ==
S_OK,
"IAMMultiMediaStream_AddMediaStream returned: %lx\n",
hr);
1710 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream);
1711 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetMediaStream returned: %lx\n",
hr);
1723 hr = IMediaStream_QueryInterface(video_stream, &IID_IAMMediaStream, (
LPVOID*)&am_media_stream);
1724 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %lx\n",
hr);
1725 ok((
void*)am_media_stream == (
void*)video_stream,
"Not same interface, got %p expected %p\n", am_media_stream, video_stream);
1727 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream,
NULL);
1730 multi_media_stream = (
void *)0xdeadbeef;
1731 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, &multi_media_stream);
1732 ok(
hr ==
S_OK,
"IAMMediaStream_GetMultiMediaStream returned: %lx\n",
hr);
1733 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
1734 IMultiMediaStream_Release(multi_media_stream);
1736 IAMMediaStream_Release(am_media_stream);
1738 hr = IMediaStream_QueryInterface(video_stream, &
IID_IPin, (
void **)&pin);
1739 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %lx\n",
hr);
1743 hr = IMediaStream_QueryInterface(video_stream, &IID_IAudioMediaStream, (
LPVOID*)&audio_media_stream);
1746 hr = IMediaStream_QueryInterface(video_stream, &IID_IDirectDrawMediaStream, (
LPVOID*)&
ddraw_stream);
1747 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %lx\n",
hr);
1756 ok(
hr == MS_E_NOSTREAM,
"IDirectDrawoMediaStream_GetFormat returned: %lx\n",
hr);
1759 ok(
hr ==
S_OK,
"IDirectDrawMediaStream_CreateSample returned: %lx\n",
hr);
1764 multi_media_stream = (
void *)0xdeadbeef;
1765 hr = IDirectDrawMediaStream_GetMultiMediaStream(
ddraw_stream, &multi_media_stream);
1766 ok(
hr ==
S_OK,
"IDirectDrawMediaStream_GetMultiMediaStream returned: %lx\n",
hr);
1767 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
1768 IMultiMediaStream_Release(multi_media_stream);
1777 hr = IAMMultiMediaStream_AddMediaStream(pams,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
1778 ok(
hr ==
S_OK,
"IAMMultiMediaStream_AddMediaStream returned: %lx\n",
hr);
1779 hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryAudio, &
audio_stream);
1780 ok(
hr ==
S_OK,
"IAMMultiMediaStream_GetMediaStream returned: %lx\n",
hr);
1792 hr = IMediaStream_QueryInterface(
audio_stream, &IID_IAMMediaStream, (
LPVOID*)&am_media_stream);
1793 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %lx\n",
hr);
1794 ok((
void*)am_media_stream == (
void*)
audio_stream,
"Not same interface, got %p expected %p\n", am_media_stream,
audio_stream);
1796 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream,
NULL);
1799 multi_media_stream = (
void *)0xdeadbeef;
1800 hr = IAMMediaStream_GetMultiMediaStream(am_media_stream, &multi_media_stream);
1801 ok(
hr ==
S_OK,
"IAMMediaStream_GetMultiMediaStream returned: %lx\n",
hr);
1802 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
1803 IMultiMediaStream_Release(multi_media_stream);
1805 IAMMediaStream_Release(am_media_stream);
1808 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %lx\n",
hr);
1815 hr = IMediaStream_QueryInterface(
audio_stream, &IID_IAudioMediaStream, (
LPVOID*)&audio_media_stream);
1816 ok(
hr ==
S_OK,
"IMediaStream_QueryInterface returned: %lx\n",
hr);
1822 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
1823 ok(
hr ==
S_OK,
"CoCreateInstance returned: %lx\n",
hr);
1826 ok(
hr ==
E_POINTER,
"IAudioMediaStream_CreateSample returned: %lx\n",
hr);
1830 hr = IAudioMediaStream_CreateSample(audio_media_stream, audio_data, 0, &
audio_sample);
1831 ok(
hr ==
S_OK,
"IAudioMediaStream_CreateSample returned: %lx\n",
hr);
1835 hr = IAudioMediaStream_GetMultiMediaStream(audio_media_stream,
NULL);
1838 multi_media_stream = (
void *)0xdeadbeef;
1839 hr = IAudioMediaStream_GetMultiMediaStream(audio_media_stream, &multi_media_stream);
1840 ok(
hr ==
S_OK,
"IAudioMediaStream_GetMultiMediaStream returned: %lx\n",
hr);
1841 ok((
void *)multi_media_stream == (
void *)pams,
"Expected %p, got %p\n", pams, multi_media_stream);
1842 IMultiMediaStream_Release(multi_media_stream);
1845 IAudioData_Release(audio_data);
1848 if (audio_media_stream)
1849 IAudioMediaStream_Release(audio_media_stream);
1853 if (media_stream_filter)
1857 hr = IMediaStreamFilter_EnumPins(media_stream_filter, &
enum_pins);
1858 ok(
hr ==
S_OK,
"IBaseFilter_EnumPins returned: %lx\n",
hr);
1866 hr = IEnumPins_Next(
enum_pins, 3, pins, &nb_pins);
1868 ok(nb_pins == expected_nb_pins,
"Number of pins is %lu instead of %lu\n", nb_pins, expected_nb_pins);
1869 for (
i = 0;
i <
min(nb_pins, expected_nb_pins);
i++)
1873 hr = IPin_ConnectedTo(pins[
i], &pin);
1875 IPin_Release(pins[
i]);
1886 IMediaStream_Release(video_stream);
1889 if (media_stream_filter)
1890 IMediaStreamFilter_Release(media_stream_filter);
1892 IAMMultiMediaStream_Release(pams);
1899 IPin *pins[3], *pin0, *pin1;
1909 ok(
ref == 3,
"Got unexpected refcount %ld.\n",
ref);
1914 hr = IMediaStreamFilter_EnumPins(
filter, &enum1);
1917 ok(
ref == 3,
"Got unexpected refcount %ld.\n",
ref);
1919 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
1924 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
1927 hr = IEnumPins_Reset(enum1);
1930 hr = IEnumPins_Skip(enum1, 0);
1933 hr = IEnumPins_Skip(enum1, 1);
1936 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryVideo, 0, &stream0);
1938 hr = IAMMultiMediaStream_AddMediaStream(
mmstream,
NULL, &MSPID_PrimaryAudio, 0, &stream1);
1940 hr = IMediaStream_QueryInterface(stream0, &
IID_IPin, (
void **)&pin0);
1942 hr = IMediaStream_QueryInterface(stream1, &
IID_IPin, (
void **)&pin1);
1947 hr = IEnumPins_Reset(enum1);
1950 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
1953 IEnumPins_Release(enum1);
1955 hr = IMediaStreamFilter_EnumPins(
filter, &enum1);
1959 ok(
ref == 4,
"Got unexpected refcount %ld.\n",
ref);
1961 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
1963 ok(
ref == 4,
"Got unexpected refcount %ld.\n",
ref);
1965 ok(
ref == 4,
"Got unexpected refcount %ld.\n",
ref);
1967 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
1969 ok(pins[0] == pin0,
"Expected pin %p, got %p.\n", pin0, pins[0]);
1971 ok(
ref == 4,
"Got unexpected refcount %ld.\n",
ref);
1973 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
1975 ok(
ref == 5,
"Got unexpected refcount %ld.\n",
ref);
1976 IPin_Release(pins[0]);
1978 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
1980 ok(pins[0] == pin1,
"Expected pin %p, got %p.\n", pin1, pins[0]);
1982 ok(
ref == 4,
"Got unexpected refcount %ld.\n",
ref);
1984 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
1986 ok(
ref == 5,
"Got unexpected refcount %ld.\n",
ref);
1987 IPin_Release(pins[0]);
1989 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
1992 hr = IEnumPins_Reset(enum1);
1995 hr = IEnumPins_Next(enum1, 1, pins, &
count);
1998 ok(pins[0] == pin0,
"Expected pin %p, got %p.\n", pin0, pins[0]);
1999 IPin_Release(pins[0]);
2001 hr = IEnumPins_Next(enum1, 1, pins, &
count);
2004 ok(pins[0] == pin1,
"Expected pin %p, got %p.\n", pin1, pins[0]);
2005 IPin_Release(pins[0]);
2007 hr = IEnumPins_Reset(enum1);
2010 hr = IEnumPins_Next(enum1, 3, pins,
NULL);
2013 hr = IEnumPins_Next(enum1, 3, pins, &
count);
2016 ok(pins[0] == pin0,
"Expected pin %p, got %p.\n", pin0, pins[0]);
2017 ok(pins[1] == pin1,
"Expected pin %p, got %p.\n", pin1, pins[1]);
2018 IPin_Release(pins[0]);
2019 IPin_Release(pins[1]);
2021 hr = IEnumPins_Reset(enum1);
2024 hr = IEnumPins_Clone(enum1, &enum2);
2027 hr = IEnumPins_Skip(enum1, 0);
2030 hr = IEnumPins_Skip(enum1, 2);
2033 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
2036 hr = IEnumPins_Next(enum2, 1, pins,
NULL);
2038 ok(pins[0] == pin0,
"Expected pin %p, got %p.\n", pin0, pins[0]);
2039 IPin_Release(pins[0]);
2041 hr = IEnumPins_Next(enum2, 1, pins,
NULL);
2043 ok(pins[0] == pin1,
"Expected pin %p, got %p.\n", pin1, pins[0]);
2044 IPin_Release(pins[0]);
2046 IEnumPins_Release(enum2);
2047 IEnumPins_Release(enum1);
2049 IMediaStreamFilter_Release(
filter);
2051 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2052 IMediaStream_Release(stream1);
2053 IMediaStream_Release(stream0);
2054 ref = IPin_Release(pin1);
2055 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2056 ref = IPin_Release(pin0);
2057 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2082 ok(pin2 == pin,
"Expected pin %p, got %p.\n", pin, pin2);
2086 IMediaStream_Release(
stream);
2087 IMediaStreamFilter_Release(
filter);
2089 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2112 hr = IPin_QueryPinInfo(pin, &
info);
2117 IBaseFilter_Release(
info.pFilter);
2119 hr = IPin_QueryDirection(pin, &
dir);
2123 hr = IPin_QueryId(pin, &
id);
2128 hr = IPin_QueryInternalConnections(pin,
NULL, &
count);
2132 IMediaStream_Release(
stream);
2139 hr = IPin_QueryPinInfo(pin, &
info);
2144 IBaseFilter_Release(
info.pFilter);
2146 hr = IPin_QueryDirection(pin, &
dir);
2150 hr = IPin_QueryId(pin, &
id);
2155 hr = IPin_QueryInternalConnections(pin,
NULL, &
count);
2159 IMediaStream_Release(
stream);
2161 IMediaStreamFilter_Release(
filter);
2163 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2203 IFilterGraph2_AddRef(iface);
2209 IFilterGraph2_AddRef(iface);
2246 ok(0,
"Unexpected call.\n");
2254 return IFilterGraph2_EnumFilters(
graph->
inner, enumfilters);
2259 ok(0,
"Unexpected call.\n");
2271 ok(0,
"Unexpected call.\n");
2278 return IFilterGraph2_Disconnect(
graph->
inner, pin);
2283 ok(0,
"Unexpected call.\n");
2289 ok(0,
"Unexpected call.\n");
2295 ok(0,
"Unexpected call.\n");
2301 ok(0,
"Unexpected call.\n");
2308 ok(0,
"Unexpected call.\n");
2314 ok(0,
"Unexpected call.\n");
2320 ok(0,
"Unexpected call.\n");
2326 ok(0,
"Unexpected call.\n");
2333 ok(0,
"Unexpected call.\n");
2339 ok(0,
"Unexpected call.\n");
2345 ok(0,
"Unexpected call.\n");
2435 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2450 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2452 ok(!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2454 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
2456 ok(!!
filter,
"Expected a non-NULL filter.");
2457 IMediaStreamFilter_Release(
filter);
2470 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2472 ok(!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2474 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
2480 IMediaStream_Release(
stream);
2483 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2485 ok(!!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2486 IGraphBuilder_Release(ret_graph);
2488 ref = IAMMultiMediaStream_Release(mmstream);
2489 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2504 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2506 ok(!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2508 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
2514 IMediaStream_Release(
stream);
2516 ref = IAMMultiMediaStream_Release(mmstream);
2517 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2532 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2534 ok(!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2536 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
2542 IMediaStream_Release(
stream);
2544 ref = IAMMultiMediaStream_Release(mmstream);
2545 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2549 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
2558 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2560 ok(!!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2561 IGraphBuilder_Release(ret_graph);
2571 IMediaStream_Release(
stream);
2572 ref = IAMMultiMediaStream_Release(mmstream);
2573 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2582 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2584 ok(!ret_graph,
"Got unexpected graph %p.\n", ret_graph);
2586 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
2588 ok(!!
filter,
"Expected a non-NULL filter.");
2597 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &ret_graph);
2600 IGraphBuilder_Release(ret_graph);
2603 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
2608 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0,
NULL);
2621 IMediaStreamFilter_Release(
filter);
2622 ref = IAMMultiMediaStream_Release(mmstream);
2623 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2644 IMediaControl *media_control;
2654 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
2656 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
2659 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaControl, (
void **)&media_control);
2742 hr = IAMMultiMediaStream_GetState(mmstream,
NULL);
2747 hr = IAMMultiMediaStream_GetState(mmstream, &
state);
2751 hr = IMediaControl_Run(media_control);
2755 hr = IAMMultiMediaStream_GetState(mmstream, &
state);
2759 hr = IMediaControl_Stop(media_control);
2766 hr = IAMMultiMediaStream_GetState(mmstream, &
state);
2774 hr = IAMMultiMediaStream_GetState(mmstream, &
state);
2783 hr = IAMMultiMediaStream_GetState(mmstream, &
state);
2787 ref = IAMMultiMediaStream_Release(mmstream);
2788 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2789 IMediaControl_Release(media_control);
2790 ref = IGraphBuilder_Release(
graph);
2791 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2804 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
2809 hr = IPin_EnumMediaTypes(pin, &enum1);
2812 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
2815 hr = IEnumMediaTypes_Next(enum1, 0, mts, &
count);
2819 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
2824 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
2828 hr = IEnumMediaTypes_Reset(enum1);
2831 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
2836 hr = IEnumMediaTypes_Reset(enum1);
2839 hr = IEnumMediaTypes_Clone(enum1, &enum2);
2842 hr = IEnumMediaTypes_Skip(enum1, 2);
2845 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
2849 hr = IEnumMediaTypes_Next(enum2, 1, mts, &
count);
2854 IEnumMediaTypes_Release(enum2);
2855 IEnumMediaTypes_Release(enum1);
2857 IMediaStream_Release(
stream);
2859 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
2864 hr = IPin_EnumMediaTypes(pin, &enum1);
2867 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
2870 hr = IEnumMediaTypes_Next(enum1, 0, mts, &
count);
2874 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
2880 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
2884 hr = IEnumMediaTypes_Reset(enum1);
2887 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
2893 hr = IEnumMediaTypes_Reset(enum1);
2896 hr = IEnumMediaTypes_Clone(enum1, &enum2);
2899 hr = IEnumMediaTypes_Skip(enum1, 2);
2902 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
2906 hr = IEnumMediaTypes_Next(enum2, 1, mts, &
count);
2912 IEnumMediaTypes_Release(enum2);
2913 IEnumMediaTypes_Release(enum1);
2915 IMediaStream_Release(
stream);
2917 ref = IAMMultiMediaStream_Release(mmstream);
2918 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2932 .nSamplesPerSec = 11025,
2933 .nAvgBytesPerSec = 11025 * 2,
2935 .wBitsPerSample = 16,
2956 {&FORMAT_None,
NULL, 0 },
2964 static const GUID *rejected_subtypes[] =
2968 &MEDIASUBTYPE_RGB565,
2969 &MEDIASUBTYPE_RGB555,
2970 &MEDIASUBTYPE_RGB24,
2971 &MEDIASUBTYPE_RGB32,
2972 &MEDIASUBTYPE_ARGB32,
2973 &MEDIASUBTYPE_ARGB1555,
2974 &MEDIASUBTYPE_ARGB4444,
2986 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
2991 hr = IPin_EnumMediaTypes(pin, &enummt);
2994 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
2997 hr = IEnumMediaTypes_Next(enummt, 1, &pmt, &
count);
3000 ok(
IsEqualGUID(&pmt->majortype, &MEDIATYPE_Video),
"Got major type %s\n",
3002 ok(
IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_RGB8),
"Got subtype %s\n",
3004 ok(pmt->bFixedSizeSamples ==
TRUE,
"Got fixed size %d.\n", pmt->bFixedSizeSamples);
3005 ok(!pmt->bTemporalCompression,
"Got temporal compression %d.\n", pmt->bTemporalCompression);
3006 ok(pmt->lSampleSize == 10000,
"Got sample size %lu.\n", pmt->lSampleSize);
3009 ok(!pmt->pUnk,
"Got pUnk %p.\n", pmt->pUnk);
3013 pmt->formattype = *
tests[
i].type;
3014 pmt->cbFormat =
tests[
i].size;
3015 pmt->pbFormat =
tests[
i].format;
3016 hr = IPin_QueryAccept(pin, pmt);
3020 pmt->bFixedSizeSamples =
FALSE;
3021 pmt->bTemporalCompression =
TRUE;
3022 pmt->lSampleSize = 123;
3023 hr = IPin_QueryAccept(pin, pmt);
3027 hr = IPin_QueryAccept(pin, pmt);
3029 pmt->majortype = MEDIATYPE_Audio;
3030 hr = IPin_QueryAccept(pin, pmt);
3032 pmt->majortype = MEDIATYPE_Stream;
3033 hr = IPin_QueryAccept(pin, pmt);
3035 pmt->majortype = MEDIATYPE_Video;
3039 pmt->subtype = *rejected_subtypes[
i];
3040 hr = IPin_QueryAccept(pin, pmt);
3047 hr = IEnumMediaTypes_Next(enummt, 1, &pmt, &
count);
3050 IEnumMediaTypes_Release(enummt);
3052 IMediaStream_Release(
stream);
3054 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
3059 hr = IPin_EnumMediaTypes(pin, &enummt);
3062 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
3065 hr = IEnumMediaTypes_Next(enummt, 1, &pmt, &
count);
3068 ok(
IsEqualGUID(&pmt->majortype, &MEDIATYPE_Audio),
"Got major type %s\n",
3072 ok(pmt->bFixedSizeSamples ==
TRUE,
"Got fixed size %d.\n", pmt->bFixedSizeSamples);
3073 ok(!pmt->bTemporalCompression,
"Got temporal compression %d.\n", pmt->bTemporalCompression);
3074 ok(pmt->lSampleSize == 2,
"Got sample size %lu.\n", pmt->lSampleSize);
3075 ok(
IsEqualGUID(&pmt->formattype, &FORMAT_WaveFormatEx),
"Got format type %s.\n",
3077 ok(!pmt->pUnk,
"Got pUnk %p.\n", pmt->pUnk);
3078 ok(pmt->cbFormat ==
sizeof(
WAVEFORMATEX),
"Got format size %lu.\n", pmt->cbFormat);
3079 ok(!
memcmp(pmt->pbFormat, &expect_wfx, pmt->cbFormat),
"Format blocks didn't match.\n");
3081 hr = IPin_QueryAccept(pin, pmt);
3087 hr = IEnumMediaTypes_Next(enummt, 1, &pmt, &
count);
3090 IEnumMediaTypes_Release(enummt);
3092 IMediaStream_Release(
stream);
3094 ref = IAMMultiMediaStream_Release(mmstream);
3095 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3112 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
3114 ok(!!
filter,
"Expected non-null filter.\n");
3115 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
3119 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
3121 ok(!!
graph,
"Expected non-NULL graph.\n");
3127 hr = IAMMultiMediaStream_GetEndOfStreamEventHandle(mmstream,
NULL);
3131 hr = IAMMultiMediaStream_GetEndOfStreamEventHandle(mmstream, &
event);
3147 hr = IPin_EndOfStream(pin);
3165 IGraphBuilder_Disconnect(
graph, pin);
3166 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
3168 ref = IAMMultiMediaStream_Release(mmstream);
3169 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3170 ref = IGraphBuilder_Release(
graph);
3171 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3172 ref = IMediaStreamFilter_Release(
filter);
3173 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3176 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3196 result = IUnknown_QueryInterface(
unknown, &IID_IMemoryData, (
void **)&memory_data);
3199 result = IUnknown_QueryInterface(
unknown, &IID_IAudioData, (
void **)&audio_data);
3203 result = IAudioData_QueryInterface(audio_data, &IID_IMemoryData, (
void **)&memory_data);
3206 IAudioData_Release(audio_data);
3219 result = IUnknown_QueryInterface(
unknown, &IID_IAudioData, (
void **)&audio_data);
3223 skip(
"No IAudioData\n");
3230 IAudioData_Release(audio_data);
3246 result = IUnknown_QueryInterface(
unknown, &IID_IAudioData, (
void **)&audio_data);
3250 skip(
"No IAudioData\n");
3254 result = IAudioData_SetBuffer(audio_data, 100,
NULL, 0);
3264 result = IAudioData_SetBuffer(audio_data, 0,
buffer, 0);
3277 IAudioData_Release(audio_data);
3288 DWORD actual_data = 0;
3292 result = IUnknown_QueryInterface(
unknown, &IID_IAudioData, (
void **)&audio_data);
3296 skip(
"No IAudioData\n");
3300 result = IAudioData_SetActual(audio_data, 0);
3306 result = IAudioData_SetActual(audio_data,
sizeof(
buffer) + 1);
3309 result = IAudioData_SetActual(audio_data,
sizeof(
buffer));
3312 actual_data = 0xdeadbeef;
3313 result = IAudioData_GetInfo(audio_data,
NULL,
NULL, &actual_data);
3315 ok(
sizeof(
buffer) == actual_data,
"got %lu\n", actual_data);
3317 result = IAudioData_SetActual(audio_data, 0);
3320 actual_data = 0xdeadbeef;
3321 result = IAudioData_GetInfo(audio_data,
NULL,
NULL, &actual_data);
3323 ok(0 == actual_data,
"got %lu\n", actual_data);
3325 IAudioData_Release(audio_data);
3339 result = IUnknown_QueryInterface(
unknown, &IID_IAudioData, (
void **)&audio_data);
3343 skip(
"No IAudioData\n");
3347 result = IAudioData_GetFormat(audio_data,
NULL);
3356 wave_format.
cbSize = 0xdead;
3357 result = IAudioData_GetFormat(audio_data, &wave_format);
3367 IAudioData_Release(audio_data);
3381 result = IUnknown_QueryInterface(
unknown, &IID_IAudioData, (
void **)&audio_data);
3385 skip(
"No IAudioData\n");
3389 result = IAudioData_SetFormat(audio_data,
NULL);
3402 result = IAudioData_SetFormat(audio_data, &wave_format.
Format);
3412 result = IAudioData_SetFormat(audio_data, &wave_format.
Format);
3422 result = IAudioData_GetFormat(audio_data, &wave_format.
Format);
3432 IAudioData_Release(audio_data);
3468 IReferenceClock_AddRef(iface);
3491 return clock->get_time_hr;
3497 if (
clock->advise_time_cookie)
3502 SetEvent(
clock->advise_time_cookie->advise_time_called_event);
3514 ok(0,
"Unexpected call.\n");
3548 .nSamplesPerSec = 44100,
3549 .wBitsPerSample = 16,
3551 .nAvgBytesPerSec = 4 * 44100,
3555 .majortype = MEDIATYPE_Audio,
3556 .subtype = MEDIASUBTYPE_PCM,
3557 .formattype = FORMAT_WaveFormatEx,
3559 .pbFormat = (
BYTE *)&pin_format,
3571 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
3578 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
3580 ok(!!
graph,
"Expected non-NULL graph.\n");
3584 hr = IGraphBuilder_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
L"source");
3591 ok(
hr == MS_E_NOSTREAM,
"Got hr %#lx.\n",
hr);
3593 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3600 ok(
format.nChannels == 2,
"Got %u channels.\n",
format.nChannels);
3601 ok(
format.nSamplesPerSec == 44100,
"Got sample rate %lu.\n",
format.nSamplesPerSec);
3602 ok(
format.nAvgBytesPerSec == 176400,
"Got %lu bytes/sec.\n",
format.nAvgBytesPerSec);
3603 ok(
format.nBlockAlign == 4,
"Got alignment %u.\n",
format.nBlockAlign);
3604 ok(
format.wBitsPerSample == 16,
"Got %u bits/sample.\n",
format.wBitsPerSample);
3607 hr = IGraphBuilder_Disconnect(
graph, pin);
3609 hr = IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
3613 ok(
hr == MS_E_NOSTREAM,
"Got hr %#lx.\n",
hr);
3615 ref = IAMMultiMediaStream_Release(mmstream);
3616 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3617 ref = IGraphBuilder_Release(
graph);
3618 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3622 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3623 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
3624 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3635 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
3642 ref = IAMMultiMediaStream_Release(mmstream);
3643 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3646 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3657 .nSamplesPerSec = 44100,
3658 .wBitsPerSample = 16,
3660 .nAvgBytesPerSec = 4 * 44100,
3665 .majortype = MEDIATYPE_Audio,
3666 .subtype = MEDIASUBTYPE_PCM,
3667 .formattype = FORMAT_WaveFormatEx,
3669 .pbFormat = (
BYTE *)&valid_format,
3688 extensible_format.
Format = valid_format;
3703 format.nAvgBytesPerSec = 1234;
3709 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
3718 ok(
hr == MS_E_NOSTREAM,
"Got hr %#lx.\n",
hr);
3726 format.nSamplesPerSec = 11025;
3731 format.nAvgBytesPerSec = 1234;
3741 format.wBitsPerSample = 8;
3753 ref = IAMMultiMediaStream_Release(mmstream);
3754 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3757 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3761 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
3768 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
3770 ok(!!
graph,
"Expected non-NULL graph.\n");
3777 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3785 hr = IGraphBuilder_Disconnect(
graph, pin);
3787 hr = IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
3795 ref = IAMMultiMediaStream_Release(mmstream);
3796 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3797 ref = IGraphBuilder_Release(
graph);
3798 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3802 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3803 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
3804 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3822 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
3828 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
3837 IGraphBuilder_Disconnect(
graph, pin);
3838 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
3842 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
3846 mt.subtype = MEDIASUBTYPE_RGB24;
3847 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3849 IGraphBuilder_Disconnect(
graph, pin);
3850 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
3854 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
3859 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3869 mt.cbFormat =
sizeof(extensible_format);
3870 mt.pbFormat = (
BYTE *)&extensible_format;
3871 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3881 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
3886 IGraphBuilder_Disconnect(
graph, pin);
3887 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
3889 ref = IAMMultiMediaStream_Release(mmstream);
3890 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3891 ref = IGraphBuilder_Release(
graph);
3892 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3896 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3897 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
3898 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3916 static const VIDEOINFO yuy2_video_info =
3919 .bmiHeader.biWidth = 333,
3920 .bmiHeader.biHeight = -444,
3921 .bmiHeader.biPlanes = 1,
3922 .bmiHeader.biBitCount = 16,
3923 .bmiHeader.biCompression =
MAKEFOURCC(
'Y',
'U',
'Y',
'2'),
3928 .majortype = MEDIATYPE_Video,
3929 .subtype = MEDIASUBTYPE_YUY2,
3930 .formattype = FORMAT_VideoInfo,
3932 .pbFormat = (
BYTE *)&yuy2_video_info,
3937 .majortype = MEDIATYPE_Video,
3938 .subtype = MEDIASUBTYPE_RGB8,
3939 .formattype = FORMAT_VideoInfo,
3941 .pbFormat = (
BYTE *)&req_vih,
3944 static const GUID *subtypes[] =
3946 &MEDIASUBTYPE_RGB24,
3947 &MEDIASUBTYPE_RGB32,
3948 &MEDIASUBTYPE_RGB555,
3949 &MEDIASUBTYPE_RGB565,
3952 &MEDIASUBTYPE_ARGB32,
3953 &MEDIASUBTYPE_ARGB1555,
3954 &MEDIASUBTYPE_ARGB4444,
3967 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
3977 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
3979 hr = IPin_Disconnect(pin);
3985 mt.subtype = *subtypes[
i];
3986 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
3990 hr = IPin_Disconnect(pin);
4002 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb32_mt);
4004 hr = IPin_Disconnect(pin);
4018 mt.pbFormat = (
BYTE *)&video_info;
4019 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
4021 hr = IPin_Disconnect(pin);
4024 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb32_mt);
4026 hr = IPin_Disconnect(pin);
4033 mt.pbFormat = (
BYTE *)&video_info;
4034 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
4041 mt.pbFormat = (
BYTE *)&video_info;
4042 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
mt);
4051 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb8_mt);
4053 hr = IPin_Disconnect(pin);
4064 hr = IPin_Disconnect(pin);
4070 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb24_mt);
4075 hr = IPin_Disconnect(pin);
4081 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb32_mt);
4084 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb24_mt);
4086 hr = IPin_Disconnect(pin);
4092 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb8_mt);
4095 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
rgb32_mt);
4097 hr = IPin_Disconnect(pin);
4103 hr = IPin_ReceiveConnection(pin, &
source.source.pin.IPin_iface, &
yuy2_mt);
4107 format.ddpfPixelFormat.u2.dwRBitMask = 0xf800;
4108 format.ddpfPixelFormat.u3.dwGBitMask = 0x07e0;
4109 format.ddpfPixelFormat.u4.dwBBitMask = 0x001f;
4123 hr = IPin_Disconnect(pin);
4126 ref = IAMMultiMediaStream_Release(mmstream);
4127 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4131 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4132 ref = IBaseFilter_Release(&
source.filter.IBaseFilter_iface);
4133 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4160 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
4164 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
4172 hr = IMemAllocator_SetProperties(
allocator, &properties, &actual);
4182 hr = IMemInputPin_Receive(
source.source.pMemInputPin, sample1);
4184 ref = IMediaSample_Release(sample1);
4185 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4192 hr = IMemInputPin_Receive(
source.source.pMemInputPin, sample1);
4195 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4199 hr = IMemInputPin_Receive(
source.source.pMemInputPin, sample2);
4202 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4204 hr = IPin_EndOfStream(pin);
4209 hr = IMemInputPin_Receive(
source.source.pMemInputPin, sample3);
4212 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4217 ref = IMediaSample_Release(sample1);
4218 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4219 ref = IMediaSample_Release(sample2);
4220 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4221 ref = IMediaSample_Release(sample3);
4222 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4226 hr = IMemInputPin_Receive(
source.source.pMemInputPin, sample1);
4228 ref = IMediaSample_Release(sample1);
4229 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4231 IGraphBuilder_Disconnect(
graph, pin);
4232 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
4237 ref = IAMMultiMediaStream_Release(mmstream);
4238 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4239 ref = IGraphBuilder_Release(
graph);
4240 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4243 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4245 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4269 hr = IAMMediaStream_GetInformation(
stream, &mspid, &
type);
4277 hr = IAMMediaStream_GetInformation(
stream, &mspid, &
type);
4283 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4289 static const MSPID mspid = {0x88888888, 1};
4308 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
4310 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream2);
4314 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream2, &mspid, 0,
NULL);
4320 hr = IAMMediaStream_QueryInterface(stream2, &
IID_IPin, (
void **)&pin2);
4322 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
4331 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
4333 hr = IAudioData_SetBuffer(audio_data, 16,
NULL, 0);
4335 hr = IAudioMediaStream_CreateSample(
audio_stream, audio_data, 0, &stream_sample);
4349 hr = IMemAllocator_GetBuffer(
source.source.pAllocator, &media_sample,
NULL,
NULL, 0);
4351 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
4354 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4356 hr = IPin_EndOfStream(pin);
4359 hr = IPin_BeginFlush(pin);
4362 ref = IMediaSample_Release(media_sample);
4363 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4365 hr = IMemAllocator_GetBuffer(
source.source.pAllocator, &media_sample,
NULL,
NULL, 0);
4367 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
4370 ref = IMediaSample_Release(media_sample);
4371 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4374 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
4376 hr = IPin_EndOfStream(pin);
4379 hr = IPin_EndFlush(pin);
4382 hr = IMemAllocator_GetBuffer(
source.source.pAllocator, &media_sample,
NULL,
NULL, 0);
4384 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
4386 ref = IMediaSample_Release(media_sample);
4387 ok(
ref == 1,
"Got outstanding refcount %ld.\n",
ref);
4389 hr = IPin_EndOfStream(pin);
4397 hr = IPin_BeginFlush(pin);
4399 hr = IPin_EndFlush(pin);
4402 hr = IPin_EndOfStream(pin);
4407 hr = IPin_EndOfStream(pin2);
4418 hr = IPin_EndOfStream(pin);
4421 hr = IPin_BeginFlush(pin);
4423 hr = IPin_EndFlush(pin);
4429 hr = IPin_EndOfStream(pin2);
4434 hr = IPin_EndOfStream(pin);
4445 hr = IPin_EndOfStream(pin);
4448 hr = IPin_BeginFlush(pin);
4450 hr = IPin_EndFlush(pin);
4452 hr = IPin_BeginFlush(pin);
4454 hr = IPin_EndFlush(pin);
4457 hr = IPin_EndOfStream(pin);
4463 hr = IPin_EndOfStream(pin2);
4477 ref = IAudioStreamSample_Release(stream_sample);
4478 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4479 ref = IAudioData_Release(audio_data);
4480 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4481 ref = IAMMultiMediaStream_Release(mmstream);
4482 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4484 ref = IMediaStreamFilter_Release(
filter);
4485 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4489 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4491 ref = IAMMediaStream_Release(stream2);
4492 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4507 hr = IMediaSample_SetActualDataLength(
sample, input_length);
4535 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
4541 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
4543 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
4549 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
4551 hr = IAudioMediaStream_CreateSample(
audio_stream, audio_data, 0, &stream_sample);
4553 hr = IAudioData_SetBuffer(audio_data, 5,
NULL, 0);
4561 hr = IPin_NewSegment(pin, 11111111, 22222222, 1.0);
4566 end_time = 23456789;
4567 hr = IMediaSample_SetTime(media_sample, &
start_time, &end_time);
4569 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
4571 IMediaSample_Release(media_sample);
4573 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4577 end_time = 0xdeadbeefdeadbeef;
4578 hr = IAudioStreamSample_GetSampleTimes(stream_sample, &
start_time, &end_time,
NULL);
4583 hr = IPin_NewSegment(pin, 11111111, 22222222, 2.0);
4588 end_time = 23456789;
4589 hr = IMediaSample_SetTime(media_sample, &
start_time, &end_time);
4591 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
4593 IMediaSample_Release(media_sample);
4595 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4599 end_time = 0xdeadbeefdeadbeef;
4600 hr = IAudioStreamSample_GetSampleTimes(stream_sample, &
start_time, &end_time,
NULL);
4607 IGraphBuilder_Disconnect(
graph, pin);
4608 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
4610 ref = IAudioStreamSample_Release(stream_sample);
4611 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4612 ref = IAudioData_Release(audio_data);
4613 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4614 ref = IAMMultiMediaStream_Release(mmstream);
4615 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4616 ref = IGraphBuilder_Release(
graph);
4617 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4619 IMemInputPin_Release(mem_input_pin);
4622 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4669 hr = IMemInputPin_Receive(
param->mem_input_pin,
param->media_sample);
4672 ref = IMediaSample_Release(
param->media_sample);
4673 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4688 hr = IMediaSample_SetTime(
sample, &start_time, &end_time);
4692 param->mem_input_pin =
source->source.pMemInputPin;
4718 IMediaControl *media_control;
4726 DWORD actual_length;
4736 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
4742 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
4744 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
4747 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaControl, (
void **)&media_control);
4752 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
4754 hr = IAudioMediaStream_CreateSample(
audio_stream, audio_data, 0, &stream_sample);
4760 ok(
hr == MS_E_NOTINIT,
"Got hr %#lx.\n",
hr);
4762 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4763 ok(
hr == MS_E_NOTINIT,
"Got hr %#lx.\n",
hr);
4765 hr = IAudioData_SetBuffer(audio_data,
sizeof(
buffer),
buffer, 0);
4771 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4772 ok(
hr == MS_E_NOTRUNNING,
"Got hr %#lx.\n",
hr);
4777 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4778 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
4788 hr = IMemInputPin_Receive(mem_input_pin, media_sample1);
4791 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4793 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4796 hr = IAudioData_GetInfo(audio_data,
NULL,
NULL, &actual_length);
4798 ok(actual_length == 6,
"Got actual length %lu.\n", actual_length);
4803 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4806 hr = IMemInputPin_Receive(mem_input_pin, media_sample2);
4809 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
4811 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4814 hr = IAudioData_GetInfo(audio_data,
NULL,
NULL, &actual_length);
4816 ok(actual_length == 6,
"Got actual length %lu.\n", actual_length);
4821 ref = IMediaSample_Release(media_sample1);
4822 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4824 hr = IPin_EndOfStream(pin);
4827 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4830 hr = IAudioData_GetInfo(audio_data,
NULL,
NULL, &actual_length);
4832 ok(actual_length == 4,
"Got actual length %lu.\n", actual_length);
4836 ref = IMediaSample_Release(media_sample2);
4837 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4839 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4840 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
4844 hr = IMediaControl_Pause(media_control);
4848 hr = IMemInputPin_Receive(mem_input_pin, media_sample1);
4850 ref = IMediaSample_Release(media_sample1);
4851 ok(
ref == 1,
"Got outstanding refcount %ld.\n",
ref);
4853 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4854 ok(
hr == MS_E_NOTRUNNING,
"Got hr %#lx.\n",
hr);
4856 hr = IMediaControl_Stop(media_control);
4869 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4872 hr = IAudioData_GetInfo(audio_data,
NULL,
NULL, &actual_length);
4874 ok(actual_length == 6,
"Got actual length %lu.\n", actual_length);
4881 ref = IMediaSample_Release(media_sample1);
4882 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4889 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4890 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
4901 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
4903 IAudioStreamSample_AddRef(stream_sample);
4904 ref = IAudioStreamSample_Release(stream_sample);
4905 ok(
ref == 1,
"Got outstanding refcount %ld.\n",
ref);
4908 ok(
hr == MS_E_BUSY,
"Got hr %#lx.\n",
hr);
4912 IGraphBuilder_Disconnect(
graph, pin);
4913 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
4917 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
4918 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
4923 ref = IAudioStreamSample_Release(stream_sample);
4924 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4925 ref = IAudioData_Release(audio_data);
4926 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4927 ref = IAMMultiMediaStream_Release(mmstream);
4928 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4929 IMediaControl_Release(media_control);
4930 ref = IGraphBuilder_Release(
graph);
4931 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4933 IMemInputPin_Release(mem_input_pin);
4936 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4941 static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
4962 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
4968 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
4974 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data1);
4976 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data2);
4978 hr = IAudioData_SetBuffer(audio_data1, 6,
NULL, 0);
4980 hr = IAudioData_SetBuffer(audio_data2, 6,
NULL, 0);
4982 hr = IAudioMediaStream_CreateSample(
audio_stream, audio_data1, 0, &stream_sample1);
4984 hr = IAudioMediaStream_CreateSample(
audio_stream, audio_data2, 0, &stream_sample2);
4992 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
4996 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
4998 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
4999 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5002 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
5004 ref = IMediaSample_Release(media_sample);
5005 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5007 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
5011 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5014 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5017 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
5019 ref = IMediaSample_Release(media_sample);
5020 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5022 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
5025 hr = IAudioStreamSample_CompletionStatus(stream_sample2, 0, 0);
5029 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5031 hr = IPin_EndOfStream(pin);
5034 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
5035 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
5043 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5048 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
5049 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5055 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
5057 ref = IMediaSample_Release(media_sample);
5058 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5060 hr = IAudioStreamSample_CompletionStatus(stream_sample1, 0, 0);
5066 IGraphBuilder_Disconnect(
graph, pin);
5067 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
5069 ref = IAudioStreamSample_Release(stream_sample1);
5070 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5071 ref = IAudioStreamSample_Release(stream_sample2);
5072 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5073 ref = IAudioData_Release(audio_data1);
5074 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5075 ref = IAudioData_Release(audio_data2);
5076 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5077 ref = IAMMultiMediaStream_Release(mmstream);
5078 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5079 ref = IGraphBuilder_Release(
graph);
5080 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5084 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5114 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
5116 ok(!!
filter,
"Expected non-null filter.\n");
5117 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
5123 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
5125 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
5128 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&graph_media_filter);
5133 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
5135 hr = IAudioMediaStream_CreateSample(
audio_stream, audio_data, 0, &stream_sample);
5137 hr = IAudioData_SetBuffer(audio_data, 5,
NULL, 0);
5141 clock.time = 12345678;
5143 current_time = 0xdeadbeefdeadbeef;
5144 hr = IAudioStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
5148 hr = IMediaFilter_SetSyncSource(graph_media_filter, &
clock.IReferenceClock_iface);
5151 current_time = 0xdeadbeefdeadbeef;
5152 hr = IAudioStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
5161 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &filter_start_time);
5166 current_time = 0xdeadbeefdeadbeef;
5167 hr = IAudioStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
5169 ok(current_time == 0xdeadbeefddf15da1 + filter_start_time,
"Expected current time %s, got %s.\n",
5174 current_time = 0xdeadbeefdeadbeef;
5175 hr = IAudioStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
5177 ok(current_time == filter_start_time,
"Expected current time %s, got %s.\n",
5180 clock.time = 23456789;
5182 current_time = 0xdeadbeefdeadbeef;
5183 hr = IAudioStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
5185 ok(current_time == filter_start_time + 11111111,
"Expected current time %s, got %s.\n",
5188 start_time = 0xdeadbeefdeadbeef;
5189 end_time = 0xdeadbeefdeadbeef;
5190 hr = IAudioStreamSample_GetSampleTimes(stream_sample, &start_time, &end_time,
NULL);
5196 start_time = 12345678;
5197 end_time = 23456789;
5198 hr = IMediaSample_SetTime(media_sample, &start_time, &end_time);
5200 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
5202 IMediaSample_Release(media_sample);
5204 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
5207 start_time = 0xdeadbeefdeadbeef;
5208 end_time = 0xdeadbeefdeadbeef;
5209 hr = IAudioStreamSample_GetSampleTimes(stream_sample, &start_time, &end_time,
NULL);
5215 start_time = 12345678;
5216 end_time = 23456789;
5217 hr = IMediaSample_SetTime(media_sample, &start_time, &end_time);
5219 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
5221 IMediaSample_Release(media_sample);
5223 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
5226 start_time = 0xdeadbeefdeadbeef;
5227 end_time = 0xdeadbeefdeadbeef;
5228 hr = IAudioStreamSample_GetSampleTimes(stream_sample, &start_time, &end_time,
NULL);
5233 hr = IPin_EndOfStream(pin);
5236 hr = IAudioStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
5239 start_time = 0xdeadbeefdeadbeef;
5240 end_time = 0xdeadbeefdeadbeef;
5241 hr = IAudioStreamSample_GetSampleTimes(stream_sample, &start_time, &end_time,
NULL);
5248 IGraphBuilder_Disconnect(
graph, pin);
5249 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
5251 ref = IAudioStreamSample_Release(stream_sample);
5252 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5253 ref = IAudioData_Release(audio_data);
5254 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5255 ref = IAMMultiMediaStream_Release(mmstream);
5256 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5257 IMediaFilter_Release(graph_media_filter);
5258 ref = IGraphBuilder_Release(
graph);
5259 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5260 ref = IMediaStreamFilter_Release(
filter);
5261 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5263 IMemInputPin_Release(mem_input_pin);
5266 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5273 IDirectDraw *ddraw2;
5286 hr = IAMMediaStream_QueryInterface(
stream, &IID_IDirectDrawMediaStream, (
void **)&
ddraw_stream);
5299 hr = IAMMediaStream_GetInformation(
stream, &mspid, &
type);
5307 hr = IAMMediaStream_GetInformation(
stream, &mspid, &
type);
5312 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw2);
5314 ok(ddraw2 ==
ddraw,
"Expected ddraw %p, got %p.\n",
ddraw, ddraw2);
5318 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5319 IDirectDraw_Release(ddraw2);
5321 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5324#define check_ddrawstream_get_format(a,b,c) check_ddrawstream_get_format_(__LINE__,a,b,c)
5331 FILTER_INFO filter_info;
5338 hr = IDirectDrawMediaStream_QueryInterface(
stream, &
IID_IPin, (
void **)&pin);
5340 hr = IPin_QueryPinInfo(pin, &pin_info);
5342 hr = IBaseFilter_QueryFilterInfo(pin_info.pFilter, &filter_info);
5347 hr = IFilterGraph_AddFilter(filter_info.pGraph, &
source.filter.IBaseFilter_iface,
L"source");
5350 hr = IFilterGraph_ConnectDirect(filter_info.pGraph, &
source.source.pin.IPin_iface, pin,
mt);
5356 memset(¤t_format, 0xcc,
sizeof(current_format));
5357 current_format.dwSize =
sizeof(current_format);
5358 memset(&desired_format, 0xcc,
sizeof(desired_format));
5359 desired_format.dwSize =
sizeof(desired_format);
5361 hr = IDirectDrawMediaStream_GetFormat(
stream, ¤t_format,
NULL, &desired_format, &
flags);
5365 format.ddpfPixelFormat = expected_format->ddpfPixelFormat;
5374 hr = IFilterGraph_Disconnect(filter_info.pGraph, &
source.source.pin.IPin_iface);
5376 hr = IFilterGraph_Disconnect(filter_info.pGraph, pin);
5379 hr = IFilterGraph_RemoveFilter(filter_info.pGraph, &
source.filter.IBaseFilter_iface);
5382 IFilterGraph_Release(filter_info.pGraph);
5383 IBaseFilter_Release(pin_info.pFilter);
5401 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
5406 current_format.dwSize =
sizeof(current_format);
5407 desired_format.dwSize =
sizeof(desired_format);
5409 ok(
hr == MS_E_NOSTREAM,
"Got hr %#lx.\n",
hr);
5417 mt.pbFormat = (
BYTE *)&video_info;
5423 mt.pbFormat = (
BYTE *)&video_info;
5432 current_format.dwSize =
sizeof(current_format);
5433 desired_format.dwSize =
sizeof(desired_format);
5435 ok(
hr == MS_E_NOSTREAM,
"Got hr %#lx.\n",
hr);
5437 ref = IAMMultiMediaStream_Release(mmstream);
5438 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5441 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5444#define check_ddrawstream_set_format(a,b,c,d) check_ddrawstream_set_format_(__LINE__,a,b,c,d)
5449 FILTER_INFO filter_info;
5454 hr = IDirectDrawMediaStream_QueryInterface(
stream, &
IID_IPin, (
void **)&pin);
5456 hr = IPin_QueryPinInfo(pin, &pin_info);
5458 hr = IBaseFilter_QueryFilterInfo(pin_info.pFilter, &filter_info);
5463 hr = IFilterGraph_AddFilter(filter_info.pGraph, &
source.filter.IBaseFilter_iface,
L"source");
5475 hr = IFilterGraph_ConnectDirect(filter_info.pGraph, &
source.source.pin.IPin_iface, pin,
mt);
5478 memset(¤t_format, 0xcc,
sizeof(current_format));
5479 memset(&desired_format, 0xcc,
sizeof(desired_format));
5481 current_format.dwSize =
sizeof(current_format);
5482 desired_format.dwSize =
sizeof(desired_format);
5483 hr = IDirectDrawMediaStream_GetFormat(
stream, ¤t_format,
NULL, &desired_format, &
flags);
5488 "Got current format flags %#lx.\n", current_format.dwFlags);
5490 "Current pixel format didn't match.\n");
5492 "Desired pixel format didn't match.\n");
5497 "Got flags %#lx.\n", current_format.dwFlags);
5500 "Got desired format flags %#lx.\n", desired_format.dwFlags);
5502 "Got current format caps %#lx.\n", current_format.ddsCaps.dwCaps);
5504 "Got desired format caps %#lx.\n", desired_format.ddsCaps.dwCaps);
5507 hr = IFilterGraph_Disconnect(filter_info.pGraph, &
source.source.pin.IPin_iface);
5509 hr = IFilterGraph_Disconnect(filter_info.pGraph, pin);
5513 hr = IFilterGraph_RemoveFilter(filter_info.pGraph, &
source.filter.IBaseFilter_iface);
5516 IFilterGraph_Release(filter_info.pGraph);
5517 IBaseFilter_Release(pin_info.pFilter);
5529 .ddpfPixelFormat.u1.dwRGBBitCount = 1,
5537 .ddpfPixelFormat.u1.dwRGBBitCount = 2,
5545 .ddpfPixelFormat.u1.dwRGBBitCount = 4,
5553 .ddpfPixelFormat.u1.dwRGBBitCount = 4,
5560 .ddpfPixelFormat.dwFlags =
DDPF_RGB,
5561 .ddpfPixelFormat.u1.dwRGBBitCount = 8,
5562 .ddpfPixelFormat.u2.dwRBitMask = 0xe0,
5563 .ddpfPixelFormat.u3.dwGBitMask = 0x1c,
5564 .ddpfPixelFormat.u4.dwBBitMask = 0x03,
5583 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
5628 format.ddpfPixelFormat.dwFlags &= ~DDPF_RGB;
5644 format.ddpfPixelFormat.u2.dwRBitMask = 0x001f;
5645 format.ddpfPixelFormat.u3.dwGBitMask = 0x07e0;
5646 format.ddpfPixelFormat.u4.dwBBitMask = 0xf800;
5650 format.ddpfPixelFormat.u2.dwRBitMask = 0x00ff00;
5651 format.ddpfPixelFormat.u3.dwGBitMask = 0x0000ff;
5652 format.ddpfPixelFormat.u4.dwBBitMask = 0xff0000;
5656 format.ddpfPixelFormat.u1.dwYUVBitCount = 0;
5667 ref = IAMMultiMediaStream_Release(mmstream);
5668 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5671 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5675 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
5682 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
5684 ok(!!
graph,
"Expected non-NULL graph.\n");
5688 hr = IGraphBuilder_AddFilter(
graph, &
source.filter.IBaseFilter_iface,
L"source");
5702 ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 8,
5703 "Got rgb bit count %lu.\n", current_format.ddpfPixelFormat.u1.dwRGBBitCount);
5704 ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 8,
5705 "Got rgb bit count %lu.\n", desired_format.ddpfPixelFormat.u1.dwRGBBitCount);
5725 ok(current_format.ddpfPixelFormat.u1.dwRGBBitCount == 16,
5726 "Got rgb bit count %lu.\n", current_format.ddpfPixelFormat.u1.dwRGBBitCount);
5727 ok(desired_format.ddpfPixelFormat.u1.dwRGBBitCount == 16,
5728 "Got rgb bit count %lu.\n", desired_format.ddpfPixelFormat.u1.dwRGBBitCount);
5734 mt.pbFormat = (
BYTE *)&video_info;
5746 "Got width %ld.\n", ((
VIDEOINFO *)
source.source.pin.mt.pbFormat)->bmiHeader.biWidth);
5748 "Got height %ld.\n", ((
VIDEOINFO *)
source.source.pin.mt.pbFormat)->bmiHeader.biHeight);
5750 hr = IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
5752 hr = IGraphBuilder_Disconnect(
graph, pin);
5755 ref = IAMMultiMediaStream_Release(mmstream);
5756 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5757 ref = IGraphBuilder_Release(
graph);
5758 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5762 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5789 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
5791 ok(!!
filter,
"Expected non-null filter.\n");
5792 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
5796 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
5804 hr = IMemAllocator_SetProperties(
allocator, &properties, &actual);
5817 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5840 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5847 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5849 IGraphBuilder_Disconnect(
graph, pin);
5850 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
5855 ref = IAMMultiMediaStream_Release(mmstream);
5856 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5857 ref = IGraphBuilder_Release(
graph);
5858 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5859 ref = IMediaStreamFilter_Release(
filter);
5860 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5863 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5865 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5871 static const MSPID mspid = {0x88888888, 1};
5893 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
5895 hr =
CoCreateInstance(&CLSID_AMDirectDrawStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream2);
5899 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream2, &mspid, 0,
NULL);
5905 hr = IAMMediaStream_QueryInterface(stream2, &
IID_IPin, (
void **)&pin2);
5909 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
5919 hr = IMediaFilter_SetSyncSource(media_filter,
NULL);
5926 mt.pbFormat = (
BYTE *)&video_info;
5941 hr = IMemAllocator_GetBuffer(
source.source.pAllocator, &media_sample,
NULL,
NULL, 0);
5950 hr = IPin_BeginFlush(pin);
5956 ref = IMediaSample_Release(media_sample);
5957 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5959 hr = IMemAllocator_GetBuffer(
source.source.pAllocator, &media_sample,
NULL,
NULL, 0);
5961 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
5964 ref = IMediaSample_Release(media_sample);
5965 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5968 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
5970 hr = IPin_EndOfStream(pin);
5973 hr = IPin_EndFlush(pin);
5976 hr = IMemAllocator_GetBuffer(
source.source.pAllocator, &media_sample,
NULL,
NULL, 0);
5978 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
5980 ref = IMediaSample_Release(media_sample);
5981 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5983 hr = IPin_EndOfStream(pin);
5991 hr = IPin_BeginFlush(pin);
5993 hr = IPin_EndFlush(pin);
5996 hr = IPin_EndOfStream(pin);
6001 hr = IPin_EndOfStream(pin2);
6012 hr = IPin_EndOfStream(pin);
6015 hr = IPin_BeginFlush(pin);
6017 hr = IPin_EndFlush(pin);
6023 hr = IPin_EndOfStream(pin2);
6028 hr = IPin_EndOfStream(pin);
6039 hr = IPin_EndOfStream(pin);
6042 hr = IPin_BeginFlush(pin);
6044 hr = IPin_EndFlush(pin);
6046 hr = IPin_BeginFlush(pin);
6048 hr = IPin_EndFlush(pin);
6051 hr = IPin_EndOfStream(pin);
6057 hr = IPin_EndOfStream(pin2);
6071 ref = IDirectDrawStreamSample_Release(stream_sample);
6072 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6073 ref = IAMMultiMediaStream_Release(mmstream);
6074 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6075 IMediaFilter_Release(media_filter);
6077 ref = IMediaStreamFilter_Release(
filter);
6078 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6082 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6084 ref = IAMMediaStream_Release(stream2);
6085 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6090 static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
6110 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
6116 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
6118 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
6121 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
6127 hr = IMediaFilter_SetSyncSource(media_filter,
NULL);
6134 mt.pbFormat = (
BYTE *)&video_info;
6135 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
6144 hr = IPin_NewSegment(pin, 11111111, 22222222, 1.0);
6148 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
6152 end_time = 23456789;
6153 hr = IMediaSample_SetTime(media_sample, &
start_time, &end_time);
6155 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
6157 IMediaSample_Release(media_sample);
6160 end_time = 0xdeadbeefdeadbeef;
6161 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample, &
start_time, &end_time,
NULL);
6166 hr = IPin_NewSegment(pin, 11111111, 22222222, 2.0);
6170 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
6174 end_time = 23456789;
6175 hr = IMediaSample_SetTime(media_sample, &
start_time, &end_time);
6177 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
6179 IMediaSample_Release(media_sample);
6182 end_time = 0xdeadbeefdeadbeef;
6183 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample, &
start_time, &end_time,
NULL);
6190 IGraphBuilder_Disconnect(
graph, pin);
6191 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
6193 ref = IDirectDrawStreamSample_Release(stream_sample);
6194 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6195 ref = IAMMultiMediaStream_Release(mmstream);
6196 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6197 IMediaFilter_Release(media_filter);
6198 ref = IGraphBuilder_Release(
graph);
6199 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6201 IMemInputPin_Release(mem_input_pin);
6204 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6223 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
6229 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
6239 hr = IDirectDrawMediaStream_GetTimePerFrame(
ddraw_stream, &frame_time);
6240 ok(
hr == MS_E_NOSTREAM,
"Got hr %#lx.\n",
hr);
6245 mt.pbFormat = (
BYTE *)&video_info;
6246 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &
mt);
6249 frame_time = 0xdeadbeefdeadbeef;
6250 hr = IDirectDrawMediaStream_GetTimePerFrame(
ddraw_stream, &frame_time);
6254 ref = IAMMultiMediaStream_Release(mmstream);
6255 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6256 ref = IGraphBuilder_Release(
graph);
6257 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6261 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6278 hr = IAMMediaStream_JoinAMMultiMediaStream(
stream, mmstream);
6282 ok(
ref == mmstream_ref,
"Expected outstanding refcount %ld, got %ld.\n", mmstream_ref,
ref);
6284 hr = IAMMediaStream_GetMultiMediaStream(
stream, &mmstream2);
6286 ok(mmstream2 == (
IMultiMediaStream *)mmstream,
"Expected mmstream %p, got %p.\n", mmstream, mmstream2);
6288 IMultiMediaStream_Release(mmstream2);
6290 hr = IAMMediaStream_JoinAMMultiMediaStream(
stream,
NULL);
6293 hr = IAMMediaStream_GetMultiMediaStream(
stream, &mmstream2);
6295 ok(mmstream2 ==
NULL,
"Got mmstream %p.\n", mmstream2);
6298 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6299 ref = IAMMultiMediaStream_Release(mmstream);
6300 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6317 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
6319 ok(!!
filter,
"Expected non-null filter.\n");
6327 &IID_IMediaStreamFilter, (
void **)&filter2);
6332 hr = IAMMediaStream_JoinFilter(
stream, filter2);
6344 hr = IAMMultiMediaStream_GetFilter(mmstream, &filter3);
6346 ok(filter3 ==
filter,
"Expected filter %p, got %p.\n",
filter, filter3);
6349 IMediaStreamFilter_Release(filter3);
6352 ref = IMediaStreamFilter_Release(filter2);
6353 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6355 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6357 ref = IAMMultiMediaStream_Release(mmstream);
6358 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6360 ref = IMediaStreamFilter_Release(
filter);
6361 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6381 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
6383 ok(!!
filter,
"Expected non-null filter.\n");
6388 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &builder);
6390 ok(!!builder,
"Expected non-null graph.\n");
6393 hr = IMediaStreamFilter_QueryFilterInfo(
filter, &
info);
6397 IFilterGraph_Release(
info.pGraph);
6417 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &builder2);
6419 ok(builder2 == builder,
"Expected graph %p, got %p.\n", builder, builder2);
6422 IGraphBuilder_Release(builder2);
6426 hr = IMediaStreamFilter_QueryFilterInfo(
filter, &
info);
6431 IFilterGraph_Release(
info.pGraph);
6436 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6437 ref = IAMMultiMediaStream_Release(mmstream);
6438 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6439 ref = IGraphBuilder_Release(builder);
6440 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6441 ref = IMediaStreamFilter_Release(
filter);
6442 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6444 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6463 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL,
id, 0, &
stream);
6465 hr = IMediaStream_QueryInterface(
stream, &IID_IAMMediaStream, (
void **)&am_stream);
6468 hr = IAMMediaStream_SetState(am_stream, 4);
6471 hr = IAMMediaStream_SetState(am_stream, State_Running);
6474 hr = IAMMediaStream_SetState(am_stream, State_Paused);
6477 hr = IAMMediaStream_SetState(am_stream, State_Stopped);
6480 ref = IAMMultiMediaStream_Release(mmstream);
6481 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6482 IAMMediaStream_Release(am_stream);
6484 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6508 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL,
id, 0, &
stream);
6512 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
6525 hr = IPin_EndOfStream(pin);
6528 hr = IPin_EndOfStream(pin);
6534 hr = IPin_EndOfStream(pin);
6537 hr = IPin_EndOfStream(pin);
6543 hr = IPin_EndOfStream(pin);
6552 hr = IPin_EndOfStream(pin);
6564 ref = IAMMultiMediaStream_Release(mmstream);
6565 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6567 ref = IMediaStreamFilter_Release(
filter);
6568 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6571 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6590 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
6592 ok(!!
filter,
"Expected non-null filter.\n");
6605 ref = IAMMultiMediaStream_Release(mmstream);
6606 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6607 ref = IMediaStreamFilter_Release(
filter);
6608 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6624 teststream2.
mspid.Data2 = 1;
6640 teststream2.
state = 0xcc;
6644 ok(teststream2.
state == expected_state,
"Got state %#x.\n", teststream2.
state);
6647 ok(
state == expected_state,
"Got state %#x.\n",
state);
6650 teststream2.
state = 0xcc;
6654 ok(teststream2.
state == 0xcc,
"Got state %#x.\n", teststream2.
state);
6661 teststream2.
state = 0xcc;
6665 ok(teststream2.
state == expected_state,
"Got state %#x.\n", teststream2.
state);
6668 ok(
state == expected_state,
"Got state %#x.\n",
state);
6676 teststream2.
state = 0xcc;
6680 ok(teststream2.
state == 0xcc,
"Got state %#x.\n", teststream2.
state);
6683 ok(
state == expected_state,
"Got state %#x.\n",
state);
6686 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6687 ref = IMediaStreamFilter_Release(
filter);
6688 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6690 ok(teststream2.
refcount == 1,
"Got outstanding refcount %ld.\n", teststream2.
refcount);
6695 return IMediaStreamFilter_Stop(
filter);
6700 return IMediaStreamFilter_Pause(
filter);
6705 return IMediaStreamFilter_Run(
filter, 0);
6718 static const MSPID mspid1 = {0x88888888, 1};
6719 static const MSPID mspid2 = {0x88888888, 2};
6720 static const MSPID mspid3 = {0x88888888, 3};
6724 IPin *pin1, *pin2, *pin3;
6731 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream1);
6733 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream2);
6735 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream3);
6743 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream1, &mspid1, 0,
NULL);
6745 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream2, &mspid2, 0,
NULL);
6747 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream3, &mspid3, 0,
NULL);
6749 hr = IAMMediaStream_QueryInterface(stream1, &
IID_IPin, (
void **)&pin1);
6751 hr = IAMMediaStream_QueryInterface(stream2, &
IID_IPin, (
void **)&pin2);
6753 hr = IAMMediaStream_QueryInterface(stream3, &
IID_IPin, (
void **)&pin3);
6755 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
6757 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
6807 IGraphBuilder_Disconnect(
graph, pin1);
6808 IGraphBuilder_Disconnect(
graph, &source1.
source.pin.IPin_iface);
6810 IGraphBuilder_Disconnect(
graph, pin2);
6811 IGraphBuilder_Disconnect(
graph, &source2.
source.pin.IPin_iface);
6813 IGraphBuilder_Disconnect(
graph, pin3);
6814 IGraphBuilder_Disconnect(
graph, &source3.
source.pin.IPin_iface);
6816 ref = IAMMultiMediaStream_Release(mmstream);
6817 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6818 ref = IGraphBuilder_Release(
graph);
6819 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6820 ref = IMediaStreamFilter_Release(
filter);
6821 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6823 ref = IAMMediaStream_Release(stream1);
6824 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6826 ref = IAMMediaStream_Release(stream2);
6827 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6829 ref = IAMMediaStream_Release(stream3);
6830 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6837 static const MSPID mspid1 = {0x88888888, 1};
6838 static const MSPID mspid2 = {0x88888888, 2};
6839 static const MSPID mspid3 = {0x88888888, 3};
6857 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream1);
6859 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream2);
6861 hr =
CoCreateInstance(&CLSID_AMAudioStream,
NULL, CLSCTX_INPROC_SERVER, &IID_IAMMediaStream, (
void **)&stream3);
6869 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream1, &mspid1, 0,
NULL);
6871 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream2, &mspid2, 0,
NULL);
6873 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)stream3, &mspid3, 0,
NULL);
6875 hr = IAMMediaStream_QueryInterface(stream1, &
IID_IPin, (
void **)&pin1);
6877 hr = IAMMediaStream_QueryInterface(stream2, &
IID_IPin, (
void **)&pin2);
6879 hr = IAMMediaStream_QueryInterface(stream3, &
IID_IPin, (
void **)&pin3);
6881 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
6883 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
6910 hr = IMediaStreamFilter_QueryInterface(
filter, &IID_IMediaSeeking, (
void **)&seeking);
6923 IGraphBuilder_Disconnect(
graph, pin2);
6924 IGraphBuilder_Disconnect(
graph, &source2.
source.pin.IPin_iface);
6928 IGraphBuilder_Disconnect(
graph, pin2);
6929 IGraphBuilder_Disconnect(
graph, &source2.
source.pin.IPin_iface);
6930 IGraphBuilder_Disconnect(
graph, pin3);
6931 IGraphBuilder_Disconnect(
graph, &source3.
source.pin.IPin_iface);
6933 ref = IAMMultiMediaStream_Release(mmstream);
6934 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6935 ref = IGraphBuilder_Release(
graph);
6936 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6937 IMediaSeeking_Release(seeking);
6938 ref = IMediaStreamFilter_Release(
filter);
6939 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6941 ref = IAMMediaStream_Release(stream1);
6942 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6944 ref = IAMMediaStream_Release(stream2);
6945 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6947 ref = IAMMediaStream_Release(stream3);
6948 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
6970 ok(source1->
stop_position == 0xdeadbeefdeadbeefULL,
"Got stop position %s.\n",
6981 ok(source3->
stop_position == 0xdeadbeefdeadbeefULL,
"Got stop position %s.\n",
6988 LONGLONG duration = 0xdeadbeefdeadbeefULL;
6992 hr = IMediaSeeking_GetDuration(seeking, &duration);
7003 LONGLONG stop = 0xdeadbeefdeadbeefULL;
7007 hr = IMediaSeeking_GetStopPosition(seeking, &stop);
7021 hr = IMediaSeeking_IsFormatSupported(seeking, &TIME_FORMAT_MEDIA_TIME);
7047 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
7049 ok(!!
filter,
"Expected non-null filter.\n");
7050 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0,
NULL);
7052 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
7055 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
7062 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter,
NULL);
7064 hr = IAMMultiMediaStream_GetTime(mmstream,
NULL);
7068 time = 0xdeadbeefdeadbeef;
7069 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &
time);
7072 time = 0xdeadbeefdeadbeef;
7073 hr = IAMMultiMediaStream_GetTime(mmstream, &
time);
7077 hr = IMediaFilter_SetSyncSource(media_filter, &
clock.IReferenceClock_iface);
7082 time = 0xdeadbeefdeadbeef;
7083 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &
time);
7086 time = 0xdeadbeefdeadbeef;
7087 hr = IAMMultiMediaStream_GetTime(mmstream, &
time);
7091 clock.time = 23456789;
7097 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &filter_start_time);
7100 clock.time = 34567890;
7102 time = 0xdeadbeefdeadbeef;
7103 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &
time);
7106 time = 0xdeadbeefdeadbeef;
7107 hr = IAMMultiMediaStream_GetTime(mmstream, &
time);
7111 ref = IAMMultiMediaStream_Release(mmstream);
7112 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7113 IMediaFilter_Release(media_filter);
7114 ref = IGraphBuilder_Release(
graph);
7115 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7116 ref = IMediaStreamFilter_Release(
filter);
7117 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7129 &IID_IMediaStreamFilter, (
void **)&
filter);
7133 hr = IMediaStreamFilter_ReferenceTimeToStreamTime(
filter,
NULL);
7136 time = 0xdeadbeefdeadbeef;
7137 hr = IMediaStreamFilter_ReferenceTimeToStreamTime(
filter, &
time);
7141 hr = IMediaStreamFilter_SetSyncSource(
filter, &
clock.IReferenceClock_iface);
7149 hr = IMediaStreamFilter_ReferenceTimeToStreamTime(
filter,
NULL);
7153 time = 0xdeadbeefdeadbeef;
7154 hr = IMediaStreamFilter_ReferenceTimeToStreamTime(
filter, &
time);
7158 hr = IMediaStreamFilter_Run(
filter, 23456789);
7161 time = 0xdeadbeefdeadbeef;
7162 hr = IMediaStreamFilter_ReferenceTimeToStreamTime(
filter, &
time);
7166 clock.time = 34567890;
7169 time = 0xdeadbeefdeadbeef;
7170 hr = IMediaStreamFilter_ReferenceTimeToStreamTime(
filter, &
time);
7174 ref = IMediaStreamFilter_Release(
filter);
7175 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7210 &IID_IMediaStreamFilter, (
void **)&
filter);
7216 hr = IMediaStreamFilter_Run(
filter, 12345678);
7219 hr = IMediaStreamFilter_WaitUntil(
filter, 23456789);
7222 hr = IMediaStreamFilter_Stop(
filter);
7225 hr = IMediaStreamFilter_SetSyncSource(
filter, &
clock.IReferenceClock_iface);
7228 clock.advise_time_cookie = &cookie1;
7231 params1.
time = 23456789;
7239 ok(!!cookie1.
event,
"Expected non-NULL event.\n");
7248 hr = IMediaStreamFilter_Run(
filter, 12345678);
7251 clock.time = 30000000;
7253 clock.advise_time_cookie = &cookie1;
7256 params1.
time = 23456789;
7264 ok(!!cookie1.
event,
"Expected non-NULL event.\n");
7266 clock.advise_time_cookie = &cookie2;
7269 params2.
time = 11111111;
7277 ok(!!cookie2.
event,
"Expected non-NULL event.\n");
7291 clock.advise_time_cookie = &cookie1;
7294 params1.
time = 23456789;
7300 clock.advise_time_cookie = &cookie2;
7303 params2.
time = 23456789;
7320 clock.advise_time_cookie = &cookie1;
7323 params1.
time = 23456789;
7329 clock.advise_time_cookie = &cookie2;
7332 params2.
time = 23456789;
7338 hr = IMediaStreamFilter_Stop(
filter);
7352 ref = IMediaStreamFilter_Release(
filter);
7353 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7361 IMediaControl *media_control;
7374 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &stream1);
7376 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &stream2);
7378 hr = IMediaStream_QueryInterface(stream1, &
IID_IPin, (
void **)&pin1);
7380 hr = IMediaStream_QueryInterface(stream2, &
IID_IPin, (
void **)&pin2);
7382 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
7403 hr = IMediaStreamFilter_EndOfStream(
filter);
7405 hr = IMediaStreamFilter_EndOfStream(
filter);
7422 hr = IMediaStreamFilter_EndOfStream(
filter);
7424 hr = IMediaStreamFilter_EndOfStream(
filter);
7443 hr = IMediaStreamFilter_EndOfStream(
filter);
7448 hr = IMediaStreamFilter_EndOfStream(
filter);
7460 hr = IMediaStreamFilter_EndOfStream(
filter);
7462 hr = IMediaStreamFilter_EndOfStream(
filter);
7467 hr = IMediaControl_Pause(media_control);
7472 hr = IMediaControl_Run(media_control);
7477 hr = IMediaControl_Run(media_control);
7482 hr = IMediaControl_Stop(media_control);
7489 hr = IMediaStreamFilter_EndOfStream(
filter);
7491 hr = IMediaStreamFilter_EndOfStream(
filter);
7496 hr = IMediaControl_Pause(media_control);
7501 hr = IMediaControl_Run(media_control);
7506 hr = IMediaControl_Stop(media_control);
7515 hr = IMediaStreamFilter_EndOfStream(
filter);
7523 hr = IMediaStreamFilter_EndOfStream(
filter);
7532 hr = IMediaControl_Run(media_control);
7537 hr = IMediaStreamFilter_EndOfStream(
filter);
7540 hr = IMediaControl_Pause(media_control);
7542 hr = IMediaControl_Run(media_control);
7545 hr = IMediaStreamFilter_EndOfStream(
filter);
7550 hr = IMediaControl_Stop(media_control);
7554 hr = IMediaStreamFilter_EndOfStream(
filter);
7557 hr = IMediaStreamFilter_Stop(
filter);
7560 hr = IMediaStreamFilter_EndOfStream(
filter);
7579 hr = IMediaStreamFilter_EndOfStream(
filter);
7584 hr = IMediaStreamFilter_EndOfStream(
filter);
7598 hr = IMediaStreamFilter_EndOfStream(
filter);
7600 hr = IMediaStreamFilter_EndOfStream(
filter);
7608 hr = IMediaStreamFilter_EndOfStream(
filter);
7625 hr = IMediaStreamFilter_EndOfStream(
filter);
7627 hr = IMediaStreamFilter_EndOfStream(
filter);
7632 hr = IMediaStreamFilter_EndOfStream(
filter);
7646 hr = IMediaStreamFilter_EndOfStream(
filter);
7651 hr = IMediaStreamFilter_EndOfStream(
filter);
7659 ref = IAMMultiMediaStream_Release(mmstream);
7660 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7661 IMediaControl_Release(media_control);
7663 ref = IMediaStreamFilter_Release(
filter);
7664 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7666 ref = IMediaStream_Release(stream1);
7667 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7669 ref = IMediaStream_Release(stream2);
7670 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7676 IDirectDraw *
ddraw, *ddraw2, *ddraw3, *ddraw4;
7686 hr = IDirectDraw_QueryInterface(
ddraw, &IID_IDirectDraw7, (
void **)&ddraw7);
7696 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)ddraw7, &MSPID_PrimaryVideo, 0, &
stream);
7706 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw2);
7708 ok(ddraw2 ==
ddraw,
"Expected ddraw %p, got %p.\n",
ddraw, ddraw2);
7711 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw3);
7713 ok(ddraw3 == ddraw2,
"Expected ddraw %p, got %p.\n", ddraw2, ddraw3);
7715 IDirectDraw_Release(ddraw3);
7723 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw3);
7725 ok(ddraw3 ==
NULL,
"Expected NULL, got %p.\n", ddraw3);
7731 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw3);
7733 ok(ddraw3 == ddraw2,
"Expected ddraw %p, got %p.\n", ddraw2, ddraw3);
7735 IDirectDraw_Release(ddraw3);
7754 ok(
hr == MS_E_SAMPLEALLOC,
"Got hr %#lx.\n",
hr);
7756 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw4);
7758 ok(ddraw4 == ddraw2,
"Expected ddraw %p, got %p.\n", ddraw2, ddraw4);
7760 IDirectDraw_Release(ddraw4);
7763 ref = IDirectDrawStreamSample_Release(
sample);
7764 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7771 hr = IDirectDrawMediaStream_GetDirectDraw(
ddraw_stream, &ddraw4);
7773 ok(ddraw4 == ddraw3,
"Expected ddraw %p, got %p.\n", ddraw3, ddraw4);
7775 IDirectDraw_Release(ddraw4);
7782 ref = IDirectDraw_Release(ddraw3);
7783 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7788 ref = IAMMultiMediaStream_Release(mmstream);
7789 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7792 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7793 ref = IDirectDraw7_Release(ddraw7);
7794 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7795 IDirectDraw_Release(ddraw2);
7798 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7814 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
7820 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
7836 ok(stream2 ==
stream,
"Expected stream %p, got %p.\n",
stream, stream2);
7839 IMediaStream_Release(stream2);
7843 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7844 ref = IAudioData_Release(audio_data);
7845 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7846 ref = IAMMultiMediaStream_Release(mmstream);
7847 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7849 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7865 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryAudio, 0, &
stream);
7871 hr =
CoCreateInstance(&CLSID_AMAudioData,
NULL, CLSCTX_INPROC_SERVER, &IID_IAudioData, (
void **)&audio_data);
7881 hr = IAudioStreamSample_GetAudioData(
audio_sample, &audio_data2);
7883 ok(audio_data2 == audio_data,
"Expected audio data %p, got %p.\n", audio_data, audio_data2);
7886 IAudioData_Release(audio_data2);
7890 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7891 ref = IAudioData_Release(audio_data);
7892 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7893 ref = IAMMultiMediaStream_Release(mmstream);
7894 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7896 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7899#define get_ddrawstream_create_sample_desc(a,b,c,d) get_ddrawstream_create_sample_desc_(__LINE__,a,b,c,d)
7906 IDirectDrawSurface *surface;
7916 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
7922 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
7942 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin,
mt);
7945 hr = IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
7947 hr = IGraphBuilder_Disconnect(
graph, pin);
7954 hr = IDirectDrawStreamSample_GetSurface(
sample, &surface,
NULL);
7956 ok_(__FILE__,
line)(!!surface,
"Expected non-NULL sufrace.\n");
7958 desc->dwSize =
sizeof(*desc);
7959 hr = IDirectDrawSurface_GetSurfaceDesc(surface,
desc);
7962 ref = IDirectDrawStreamSample_Release(
sample);
7963 ok_(__FILE__,
line)(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7964 ref = IDirectDrawSurface_Release(surface);
7965 ok_(__FILE__,
line)(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7966 ref = IAMMultiMediaStream_Release(mmstream);
7967 ok_(__FILE__,
line)(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7968 ref = IGraphBuilder_Release(
graph);
7969 ok_(__FILE__,
line)(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7973 ok_(__FILE__,
line)(!
ref,
"Got outstanding refcount %ld.\n",
ref);
7980 IDirectDrawSurface *surface, *surface2;
8001 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)
ddraw, &MSPID_PrimaryVideo, 0, &
stream);
8031 hr = IDirectDrawStreamSample_GetSurface(
sample, &surface,
NULL);
8033 ok(surface !=
NULL,
"Expected non-NULL surface.\n");
8034 IDirectDrawSurface_Release(surface);
8037 hr = IDirectDrawStreamSample_GetSurface(
sample, &surface, &
rect);
8039 ok(surface !=
NULL,
"Expected non-NULL surface.\n");
8041 hr = IDirectDrawSurface_GetSurfaceDesc(surface, &
desc);
8043 ok(
desc.dwWidth == 100,
"Expected width 100, got %ld.\n",
desc.dwWidth);
8044 ok(
desc.dwHeight == 100,
"Expected height 100, got %ld.\n",
desc.dwHeight);
8045 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Expected format flags DDPF_RGB, got %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
8046 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount,
"Expected non-zero RGB bit count.\n");
8047 IDirectDrawSurface_Release(surface);
8048 IDirectDrawStreamSample_Release(
sample);
8065 hr = IDirectDrawStreamSample_GetSurface(
sample, &surface2, &
rect);
8067 ok(surface2 == surface,
"Expected surface %p, got %p.\n", surface, surface2);
8070 IDirectDrawSurface_Release(surface2);
8072 IDirectDrawStreamSample_Release(
sample);
8078 ref = IDirectDrawStreamSample_Release(
sample);
8079 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8080 ref = IDirectDrawSurface_Release(surface);
8081 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8087 desc.dwHeight = 400;
8090 desc.ddpfPixelFormat.u1.dwRGBBitCount = 32;
8091 desc.ddpfPixelFormat.u2.dwRBitMask = 0xff0000;
8092 desc.ddpfPixelFormat.u3.dwGBitMask = 0x00ff00;
8093 desc.ddpfPixelFormat.u4.dwBBitMask = 0x0000ff;
8094 desc.ddpfPixelFormat.u5.dwRGBAlphaBitMask = 0xff000000;
8103 ref = IDirectDrawStreamSample_Release(
sample);
8104 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8109 hr = IDirectDrawStreamSample_GetSurface(
sample, &surface2, &
rect);
8112 hr = IDirectDrawSurface_GetSurfaceDesc(surface, &
desc);
8114 hr = IDirectDrawSurface_GetSurfaceDesc(surface2, &desc2);
8116 ok(desc2.dwWidth == 222,
"Got width %lu.\n", desc2.dwWidth);
8117 ok(desc2.dwHeight == 200,
"Got height %lu.\n", desc2.dwHeight);
8119 "Pixel format didn't match.\n");
8121 ref = IDirectDrawStreamSample_Release(
sample);
8122 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8123 ref = IDirectDrawSurface_Release(surface);
8124 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8125 ref = IDirectDrawSurface_Release(surface2);
8126 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8132 desc.dwHeight = 400;
8135 desc.ddpfPixelFormat.u1.dwRGBBitCount = 4;
8144 ref = IDirectDrawSurface_Release(surface);
8145 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8146 ref = IAMMultiMediaStream_Release(mmstream);
8147 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8149 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8151 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8154 format1.dwFlags = 0;
8155 format1.dwWidth = 333;
8156 format1.dwHeight = 444;
8158 ok(
desc.dwWidth == 100,
"Got width %lu.\n",
desc.dwWidth);
8159 ok(
desc.dwHeight == 100,
"Got height %lu.\n",
desc.dwHeight);
8160 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Got flags %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
8161 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount == 32,
"Got rgb bit count %lu.\n",
desc.ddpfPixelFormat.u1.dwRGBBitCount);
8162 ok(
desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000,
"Got r bit mask %#lx.\n",
desc.ddpfPixelFormat.u2.dwRBitMask);
8163 ok(
desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00,
"Got g bit mask %#lx.\n",
desc.ddpfPixelFormat.u3.dwGBitMask);
8164 ok(
desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff,
"Got b bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8168 format1.dwWidth = 333;
8169 format1.dwHeight = 444;
8171 format2.dwFlags = 0;
8173 ok(
desc.dwWidth == 333,
"Got width %lu.\n",
desc.dwWidth);
8174 ok(
desc.dwHeight == 444,
"Got height %lu.\n",
desc.dwHeight);
8178 format1.dwWidth = 333;
8179 format1.dwHeight = 444;
8181 format2.dwFlags = 0;
8183 ok(
desc.dwWidth == 333,
"Got width %lu.\n",
desc.dwWidth);
8184 ok(
desc.dwHeight == 444,
"Got height %lu.\n",
desc.dwHeight);
8187 ok(
desc.dwWidth == 333,
"Got width %lu.\n",
desc.dwWidth);
8188 ok(
desc.dwHeight == 444,
"Got height %lu.\n",
desc.dwHeight);
8189 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Got flags %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
8190 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount == 32,
"Got rgb bit count %lu.\n",
desc.ddpfPixelFormat.u1.dwRGBBitCount);
8191 ok(
desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000,
"Got r bit mask %#lx.\n",
desc.ddpfPixelFormat.u2.dwRBitMask);
8192 ok(
desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00,
"Got g bit mask %#lx.\n",
desc.ddpfPixelFormat.u3.dwGBitMask);
8193 ok(
desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff,
"Got b bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8196 ok(
desc.dwWidth == 100,
"Got width %lu.\n",
desc.dwWidth);
8197 ok(
desc.dwHeight == 100,
"Got height %lu.\n",
desc.dwHeight);
8198 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Got flags %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
8199 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount == 16,
"Got rgb bit count %lu.\n",
desc.ddpfPixelFormat.u1.dwRGBBitCount);
8200 ok(
desc.ddpfPixelFormat.u2.dwRBitMask == 0xf800,
"Got r bit mask %#lx.\n",
desc.ddpfPixelFormat.u2.dwRBitMask);
8201 ok(
desc.ddpfPixelFormat.u3.dwGBitMask == 0x07e0,
"Got g bit mask %#lx.\n",
desc.ddpfPixelFormat.u3.dwGBitMask);
8202 ok(
desc.ddpfPixelFormat.u4.dwBBitMask == 0x001f,
"Got b bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8205 ok(
desc.dwWidth == 100,
"Got width %lu.\n",
desc.dwWidth);
8206 ok(
desc.dwHeight == 100,
"Got height %lu.\n",
desc.dwHeight);
8208 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount == 32,
"Got rgb bit count %lu.\n",
desc.ddpfPixelFormat.u1.dwRGBBitCount);
8209 ok(
desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000,
"Got r bit mask %#lx.\n",
desc.ddpfPixelFormat.u2.dwRBitMask);
8210 ok(
desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00,
"Got g bit mask %#lx.\n",
desc.ddpfPixelFormat.u3.dwGBitMask);
8211 ok(
desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff,
"Got b bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8212 ok(
desc.ddpfPixelFormat.u5.dwRGBAlphaBitMask == 0xff000000,
8213 "Got alpha bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8222 ok(
desc.dwWidth == 100,
"Got width %lu.\n",
desc.dwWidth);
8223 ok(
desc.dwHeight == 100,
"Got height %lu.\n",
desc.dwHeight);
8224 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Got flags %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
8225 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount == 32,
"Got rgb bit count %lu.\n",
desc.ddpfPixelFormat.u1.dwRGBBitCount);
8226 ok(
desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000,
"Got r bit mask %#lx.\n",
desc.ddpfPixelFormat.u2.dwRBitMask);
8227 ok(
desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00,
"Got g bit mask %#lx.\n",
desc.ddpfPixelFormat.u3.dwGBitMask);
8228 ok(
desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff,
"Got b bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8232 format1.ddckCKSrcBlt.dwColorSpaceLowValue = 0xff00ff;
8233 format1.ddckCKSrcBlt.dwColorSpaceHighValue = 0xff00ff;
8236 ok(
desc.dwWidth == 100,
"Got width %lu.\n",
desc.dwWidth);
8237 ok(
desc.dwHeight == 100,
"Got height %lu.\n",
desc.dwHeight);
8238 ok(
desc.ddpfPixelFormat.dwFlags ==
DDPF_RGB,
"Got flags %#lx.\n",
desc.ddpfPixelFormat.dwFlags);
8239 ok(
desc.ddpfPixelFormat.u1.dwRGBBitCount == 32,
"Got rgb bit count %lu.\n",
desc.ddpfPixelFormat.u1.dwRGBBitCount);
8240 ok(
desc.ddpfPixelFormat.u2.dwRBitMask == 0xff0000,
"Got r bit mask %#lx.\n",
desc.ddpfPixelFormat.u2.dwRBitMask);
8241 ok(
desc.ddpfPixelFormat.u3.dwGBitMask == 0x00ff00,
"Got g bit mask %#lx.\n",
desc.ddpfPixelFormat.u3.dwGBitMask);
8242 ok(
desc.ddpfPixelFormat.u4.dwBBitMask == 0x0000ff,
"Got b bit mask %#lx.\n",
desc.ddpfPixelFormat.u4.dwBBitMask);
8243 ok(
desc.ddckCKSrcBlt.dwColorSpaceLowValue == 0,
"Got color key low value %#lx.\n",
8244 desc.ddckCKSrcBlt.dwColorSpaceLowValue);
8245 ok(
desc.ddckCKSrcBlt.dwColorSpaceHighValue == 0,
"Got color key high value %#lx.\n",
8246 desc.ddckCKSrcBlt.dwColorSpaceHighValue);
8251 static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
8275 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
8277 ok(!!
filter,
"Expected non-null filter.\n");
8278 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
8284 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
8286 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
8289 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&graph_media_filter);
8297 ok(
cookie.advise_time_called_event !=
NULL,
"Expected non-NULL event.");
8303 mt.pbFormat = (
BYTE *)&video_info;
8304 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &mt);
8311 hr = IMediaFilter_SetSyncSource(graph_media_filter,
NULL);
8318 source.qc_notify_quality.Type = Flood;
8319 source.qc_notify_quality.Proportion = 0xdeadbeef;
8320 source.qc_notify_quality.Late = 0xdeadbeef;
8321 source.qc_notify_quality.TimeStamp = 0xdeadbeef;
8327 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8334 source.qc_notify_sender);
8335 ok(
source.qc_notify_quality.Type == Flood,
"Got type %d.\n",
8336 source.qc_notify_quality.Type);
8337 ok(
source.qc_notify_quality.Proportion == 0xdeadbeef,
"Got proportion %ld.\n",
8338 source.qc_notify_quality.Proportion);
8339 ok(
source.qc_notify_quality.Late == 0xdeadbeef,
8341 ok(
source.qc_notify_quality.TimeStamp == 0xdeadbeef,
"Got time stamp %s.\n",
8347 hr = IMediaFilter_SetSyncSource(graph_media_filter, &
clock.IReferenceClock_iface);
8350 clock.time = 12345678;
8355 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &filter_start_time);
8363 source.qc_notify_quality.Type = Flood;
8364 source.qc_notify_quality.Proportion = 0xdeadbeef;
8365 source.qc_notify_quality.Late = 0xdeadbeef;
8366 source.qc_notify_quality.TimeStamp = 0xdeadbeef;
8368 clock.time = 12345678 - filter_start_time + 11111111;
8371 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
8374 clock.time = 12345678 - filter_start_time + 11111111 + 100000;
8376 start_time = 11111111 + 200000;
8377 end_time = 11111111 + 200000;
8383 source.qc_notify_sender);
8384 ok(
source.qc_notify_quality.Type == Flood,
"Got type %d.\n",
8385 source.qc_notify_quality.Type);
8386 ok(
source.qc_notify_quality.Proportion == 0xdeadbeef,
"Got proportion %ld.\n",
8387 source.qc_notify_quality.Proportion);
8388 ok(
source.qc_notify_quality.Late == 0xdeadbeef,
8390 ok(
source.qc_notify_quality.TimeStamp == 0xdeadbeef,
"Got time stamp %s.\n",
8393 clock.time = 12345678 - filter_start_time + 11111111 + 200000;
8400 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample, 0, 0);
8404 source.qc_notify_sender);
8405 ok(
source.qc_notify_quality.Type == Famine,
"Got type %d.\n",
8406 source.qc_notify_quality.Type);
8407 ok(
source.qc_notify_quality.Proportion == 1000,
"Got proportion %ld.\n",
8408 source.qc_notify_quality.Proportion);
8409 ok(
source.qc_notify_quality.Late == 0,
"Got late %s.\n",
8411 ok(
source.qc_notify_quality.TimeStamp == start_time,
"Got time stamp %s.\n",
8416 source.qc_notify_quality.Type = Flood;
8417 source.qc_notify_quality.Proportion = 0xdeadbeef;
8418 source.qc_notify_quality.Late = 0xdeadbeef;
8419 source.qc_notify_quality.TimeStamp = 0xdeadbeef;
8422 clock.time = 12345678 - filter_start_time + 11111111 + 300000;
8424 start_time = 11111111 + 400000;
8425 end_time = 11111111 + 400000;
8430 clock.time = 12345678 - filter_start_time + 11111111 + 400000;
8436 source.qc_notify_sender);
8437 ok(
source.qc_notify_quality.Type == Flood,
"Got type %d.\n",
8438 source.qc_notify_quality.Type);
8439 ok(
source.qc_notify_quality.Proportion == 0xdeadbeef,
"Got proportion %ld.\n",
8440 source.qc_notify_quality.Proportion);
8441 ok(
source.qc_notify_quality.Late == 0xdeadbeef,
8443 ok(
source.qc_notify_quality.TimeStamp == 0xdeadbeef,
"Got time stamp %s.\n",
8446 clock.time = 12345678 - filter_start_time + 11111111 + 500000;
8448 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8455 source.qc_notify_sender);
8456 ok(
source.qc_notify_quality.Type == Famine,
"Got type %d.\n",
8457 source.qc_notify_quality.Type);
8458 ok(
source.qc_notify_quality.Proportion == 1000,
"Got proportion %ld.\n",
8459 source.qc_notify_quality.Proportion);
8460 ok(
source.qc_notify_quality.Late == 100000,
"Got late %s.\n",
8462 ok(
source.qc_notify_quality.TimeStamp == start_time,
"Got time stamp %s.\n",
8467 IGraphBuilder_Disconnect(
graph, pin);
8468 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
8471 ref = IDirectDrawStreamSample_Release(stream_sample);
8472 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8473 ref = IAMMultiMediaStream_Release(mmstream);
8474 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8475 IMediaFilter_Release(graph_media_filter);
8476 ref = IGraphBuilder_Release(
graph);
8477 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8478 ref = IMediaStreamFilter_Release(
filter);
8479 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8481 IMemInputPin_Release(mem_input_pin);
8484 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8506 hr = IAMMultiMediaStream_AddMediaStream(mmstream, (
IUnknown *)
ddraw, &MSPID_PrimaryVideo, 0, &
stream);
8518 hr = IDirectDrawStreamSample_GetMediaStream(
sample,
NULL);
8523 hr = IDirectDrawStreamSample_GetMediaStream(
sample, &stream2);
8525 ok(stream2 ==
stream,
"Expected stream %p, got %p.\n",
stream, stream2);
8527 IMediaStream_Release(stream2);
8531 ref = IDirectDrawStreamSample_Release(
sample);
8532 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8533 ref = IAMMultiMediaStream_Release(mmstream);
8534 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8536 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8538 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8543 static const BYTE initial_data[] =
8545 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef,
8549 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
8550 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
8556 IMediaControl *media_control;
8557 IDirectDrawSurface *surface;
8581 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
8587 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
8591 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
8594 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaControl, (
void **)&media_control);
8596 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
8605 ok(
cookie.advise_time_called_event !=
NULL,
"Expected non-NULL event.");
8607 hr = IMediaFilter_SetSyncSource(media_filter,
NULL);
8621 hr = IDirectDrawMediaStream_CreateSample(
ddraw_stream, surface, &
rect, 0, &stream_sample);
8624 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
event,
apc_func, 0);
8627 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8628 ok(
hr == MS_E_NOTRUNNING,
"Got hr %#lx.\n",
hr);
8633 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8634 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
8642 mt.pbFormat = (
BYTE *)&video_info;
8643 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &mt);
8651 for (
i = 0;
i < 5; ++
i)
8653 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8665 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8669 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8672 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8673 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8674 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8680 ref = IMediaSample_Release(media_sample);
8681 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8685 IGraphBuilder_Disconnect(
graph, pin);
8686 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
8691 mt.pbFormat = (
BYTE *)&video_info;
8692 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &mt);
8699 for (
i = 0;
i < 5; ++
i)
8701 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8713 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8717 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8720 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8721 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8722 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8728 ref = IMediaSample_Release(media_sample);
8729 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8731 hr = IPin_EndOfStream(pin);
8734 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8735 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
8739 hr = IMediaControl_Pause(media_control);
8742 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8743 ok(
hr == MS_E_NOTRUNNING,
"Got hr %#lx.\n",
hr);
8745 hr = IMediaControl_Stop(media_control);
8752 for (
i = 0;
i < 5; ++
i)
8754 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8765 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8769 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8772 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8773 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8774 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8780 ref = IMediaSample_Release(media_sample);
8781 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8788 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8789 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
8801 for (
i = 0;
i < 5; ++
i)
8803 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8818 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8821 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8822 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8823 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8829 ref = IMediaSample_Release(media_sample);
8830 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8833 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
8837 for (
i = 0;
i < 5; ++
i)
8839 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8843 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
8845 ref = IMediaSample_Release(media_sample);
8846 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8850 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8853 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8854 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8855 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8860 for (
i = 0;
i < 5; ++
i)
8862 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8866 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
8868 ref = IMediaSample_Release(media_sample);
8869 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8873 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8876 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8877 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8878 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8881 hr = IPin_EndOfStream(pin);
8889 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
event,
NULL, 0);
8890 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
8895 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
8897 ref = IMediaSample_Release(media_sample);
8898 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8903 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
8907 ok(
hr == MS_E_BUSY,
"Got hr %#lx.\n",
hr);
8911 hr = IMediaFilter_SetSyncSource(media_filter, &
clock.IReferenceClock_iface);
8918 for (
i = 0;
i < 5; ++
i)
8920 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8924 ok(
hr == MS_E_BUSY,
"Got hr %#lx.\n",
hr);
8929 start_time = 11111111;
8930 end_time = 11111111;
8931 hr = IMediaSample_SetTime(media_sample, &start_time, &end_time);
8944 for (
i = 0;
i < 5; ++
i)
8945 ok(
memcmp((
BYTE *)
desc.lpSurface +
i *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8946 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8956 ok(
memcmp((
BYTE *)
desc.lpSurface + 0 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8959 ok(
memcmp((
BYTE *)
desc.lpSurface + 3 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8960 ok(
memcmp((
BYTE *)
desc.lpSurface + 4 *
desc.u1.lPitch, initial_data, 12) == 0,
"Sample data didn't match.\n");
8961 hr = IDirectDrawSurface_Unlock(surface,
desc.lpSurface);
8964 ref = IMediaSample_Release(media_sample);
8965 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8969 IGraphBuilder_Disconnect(
graph, pin);
8970 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
8974 hr = IDirectDrawStreamSample_Update(stream_sample, 0,
NULL,
NULL, 0);
8975 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
8982 ref = IDirectDrawStreamSample_Release(stream_sample);
8983 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8984 ref = IDirectDrawSurface_Release(surface);
8985 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8986 ref = IAMMultiMediaStream_Release(mmstream);
8987 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8988 IMediaControl_Release(media_control);
8989 IMediaFilter_Release(media_filter);
8990 ref = IGraphBuilder_Release(
graph);
8991 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8993 IMemInputPin_Release(mem_input_pin);
8996 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
8998 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9003 static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
9026 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
9028 ok(!!
filter,
"Expected non-null filter.\n");
9029 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
9035 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
9038 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&media_filter);
9046 hr = IMediaFilter_SetSyncSource(media_filter,
NULL);
9051 video_info.bmiHeader.biHeight = 1;
9053 mt.pbFormat = (
BYTE *)&video_info;
9054 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &mt);
9065 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9073 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9075 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9076 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9078 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1,
COMPSTAT_WAIT, 100);
9079 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9083 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9085 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9086 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9089 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9091 ref = IMediaSample_Release(media_sample);
9092 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9094 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9100 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9101 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9104 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9106 ref = IMediaSample_Release(media_sample);
9107 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9109 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9114 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9117 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9120 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9123 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9126 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9128 ref = IMediaSample_Release(media_sample);
9129 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9131 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9132 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9134 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9139 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9142 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9144 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1,
COMPSTAT_ABORT, 0);
9145 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9148 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9151 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9153 ref = IMediaSample_Release(media_sample);
9154 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9156 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9157 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9159 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9164 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9167 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9171 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9174 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9178 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9180 hr = IPin_EndOfStream(pin);
9183 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9184 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
9187 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
9191 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
9193 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9194 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
9197 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
9206 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9209 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9213 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9215 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1,
COMPSTAT_ABORT, 0);
9216 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9221 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9224 ok(
hr == MS_E_BUSY,
"Got hr %#lx.\n",
hr);
9227 ok(
hr == MS_E_BUSY,
"Got hr %#lx.\n",
hr);
9230 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9232 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9233 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9236 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9238 ref = IMediaSample_Release(media_sample);
9239 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9241 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9242 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9244 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9245 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9248 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9250 ref = IMediaSample_Release(media_sample);
9251 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9253 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9254 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9256 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample2, 0, 0);
9264 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9266 hr = IPin_BeginFlush(pin);
9269 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9270 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9272 hr = IPin_EndFlush(pin);
9275 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9276 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9282 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9283 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9288 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9289 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9292 hr = IPin_EndOfStream(pin);
9295 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9296 ok(
hr == MS_S_ENDOFSTREAM,
"Got hr %#lx.\n",
hr);
9305 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9307 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1,
COMPSTAT_WAIT, 0);
9308 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9311 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9313 ref = IMediaSample_Release(media_sample);
9314 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9316 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9321 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9331 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9333 ref = IMediaSample_Release(media_sample);
9334 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9339 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9349 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9359 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9361 ref = IMediaSample_Release(media_sample);
9362 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9369 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9378 hr = IPin_EndOfStream(pin);
9391 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9396 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9397 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9403 hr = IMemInputPin_Receive(
source.source.pMemInputPin, media_sample);
9405 ref = IMediaSample_Release(media_sample);
9406 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9408 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9416 ok(
hr == MS_E_NOTRUNNING,
"Got hr %#lx.\n",
hr);
9418 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9425 hr = IMediaFilter_SetSyncSource(media_filter, &
clock.IReferenceClock_iface);
9428 clock.time = 12345678;
9433 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &filter_start_time);
9436 clock.time = 12345678 - filter_start_time + 11111111;
9441 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9448 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0,
INFINITE);
9454 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9464 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9465 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9467 clock.time = 12345678 - filter_start_time + 11111111 + 10000;
9473 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9477 hr = IPin_NewSegment(pin, 22222222, 33333333, 1.0);
9481 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9492 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9496 clock.time = 12345678 - filter_start_time + 11111111 + 20000;
9503 hr = IDirectDrawStreamSample_Update(stream_sample1, 0,
NULL,
NULL, 0);
9510 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9521 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9525 clock.time = 12345678 - filter_start_time + 11111111 + 30000;
9530 hr = IDirectDrawStreamSample_Update(stream_sample1, 0,
NULL,
NULL, 0);
9539 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9549 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1,
COMPSTAT_ABORT, 0);
9550 ok(
hr == MS_S_NOUPDATE,
"Got hr %#lx.\n",
hr);
9554 clock.time = 12345678 - filter_start_time + 11111111 + 40000;
9559 hr = IDirectDrawStreamSample_Update(stream_sample1, 0,
NULL,
NULL, 0);
9567 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9583 hr = IDirectDrawStreamSample_CompletionStatus(stream_sample1, 0, 0);
9584 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9586 IGraphBuilder_Disconnect(
graph, pin);
9587 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
9590 ref = IDirectDrawStreamSample_Release(stream_sample1);
9591 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9592 ref = IDirectDrawStreamSample_Release(stream_sample2);
9593 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9594 ref = IAMMultiMediaStream_Release(mmstream);
9595 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9596 IMediaFilter_Release(media_filter);
9597 ref = IGraphBuilder_Release(
graph);
9598 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9599 ref = IMediaStreamFilter_Release(
filter);
9600 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9604 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9609 static const BYTE test_data[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
9633 hr = IAMMultiMediaStream_GetFilter(mmstream, &
filter);
9635 ok(!!
filter,
"Expected non-null filter.\n");
9636 hr = IAMMultiMediaStream_AddMediaStream(mmstream,
NULL, &MSPID_PrimaryVideo, 0, &
stream);
9642 hr = IMediaStream_QueryInterface(
stream, &IID_IMemInputPin, (
void **)&mem_input_pin);
9644 hr = IAMMultiMediaStream_GetFilterGraph(mmstream, &
graph);
9647 hr = IGraphBuilder_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&graph_media_filter);
9658 mt.pbFormat = (
BYTE *)&video_info;
9659 hr = IGraphBuilder_ConnectDirect(
graph, &
source.source.pin.IPin_iface, pin, &mt);
9665 clock.time = 12345678;
9667 current_time = 0xdeadbeefdeadbeef;
9668 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
9672 hr = IMediaFilter_SetSyncSource(graph_media_filter, &
clock.IReferenceClock_iface);
9675 current_time = 0xdeadbeefdeadbeef;
9676 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
9683 hr = IMediaStreamFilter_GetCurrentStreamTime(
filter, &filter_start_time);
9688 current_time = 0xdeadbeefdeadbeef;
9689 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
9691 ok(current_time == 0xdeadbeefddf15da1 + filter_start_time,
"Expected current time %s, got %s.\n",
9696 current_time = 0xdeadbeefdeadbeef;
9697 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
9699 ok(current_time == filter_start_time,
"Expected current time %s, got %s.\n",
9702 clock.time = 23456789;
9704 current_time = 0xdeadbeefdeadbeef;
9705 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample,
NULL,
NULL, ¤t_time);
9707 ok(current_time == filter_start_time + 11111111,
"Expected current time %s, got %s.\n",
9710 start_time = 0xdeadbeefdeadbeef;
9711 end_time = 0xdeadbeefdeadbeef;
9712 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample, &start_time, &end_time,
NULL);
9718 ok(
hr == MS_S_PENDING,
"Got hr %#lx.\n",
hr);
9721 start_time = 12345678;
9722 end_time = 23456789;
9723 hr = IMediaSample_SetTime(media_sample, &start_time, &end_time);
9725 hr = IMemInputPin_Receive(mem_input_pin, media_sample);
9727 IMediaSample_Release(media_sample);
9729 start_time = 0xdeadbeefdeadbeef;
9730 end_time = 0xdeadbeefdeadbeef;
9731 hr = IDirectDrawStreamSample_GetSampleTimes(stream_sample, &start_time, &end_time,
NULL);
9738 IGraphBuilder_Disconnect(
graph, pin);
9739 IGraphBuilder_Disconnect(
graph, &
source.source.pin.IPin_iface);
9741 ref = IDirectDrawStreamSample_Release(stream_sample);
9742 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9743 ref = IAMMultiMediaStream_Release(mmstream);
9744 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9745 IMediaFilter_Release(graph_media_filter);
9746 ref = IGraphBuilder_Release(
graph);
9747 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9748 ref = IMediaStreamFilter_Release(
filter);
9749 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9751 IMemInputPin_Release(mem_input_pin);
9754 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
9759 const WCHAR *test_avi_path;
static void test_ddrawstream_receive_connection(void)
#define check_ddrawstream_get_format(a, b, c)
static DWORD CALLBACK ammediastream_receive_release(void *p)
static void test_mediastreamfilter_get_current_stream_time(void)
static const IPinVtbl pin_vtbl
static DWORD CALLBACK mediastreamfilter_wait_until(void *p)
static void test_ddrawstreamsample_update(void)
static HRESULT WINAPI testsource_seeking_GetDuration(IMediaSeeking *iface, LONGLONG *duration)
static HRESULT WINAPI testclock_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME start, REFERENCE_TIME period, HSEMAPHORE semaphore, DWORD_PTR *cookie)
static void get_ddrawstream_create_sample_desc_(int line, const DDSURFACEDESC *format1, const DDSURFACEDESC *format2, const AM_MEDIA_TYPE *mt, DDSURFACEDESC *desc)
static void test_ddrawstream_set_format(void)
static HRESULT WINAPI testsource_DecideBufferSize(struct strmbase_source *iface, IMemAllocator *alloc, ALLOCATOR_PROPERTIES *requested)
static ULONG WINAPI testclock_Release(IReferenceClock *iface)
static ULONG WINAPI pin_Release(IPin *iface)
static void graph_destroy(struct graph *graph)
static void test_ddrawstream_new_segment(void)
static HRESULT WINAPI pin_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static HRESULT WINAPI pin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
static void testfilter_destroy(struct strmbase_filter *iface)
static HRESULT WINAPI stream_CreateSharedSample(IAMMediaStream *iface, IStreamSample *existing, DWORD flags, IStreamSample **out)
static HRESULT WINAPI pin_QueryInterface(IPin *iface, REFIID iid, void **out)
static void test_add_stream(void)
static void test_audiostreamsample_get_audio_data(void)
static ULONG WINAPI graph_Release(IFilterGraph2 *iface)
static HRESULT WINAPI graph_RenderEx(IFilterGraph2 *iface, IPin *pin, DWORD flags, DWORD *context)
static const IAMMediaStreamVtbl stream_vtbl
static void test_openfile(const WCHAR *test_avi_path)
static void check_ddrawstream_get_format_(int line, IDirectDrawMediaStream *stream, const AM_MEDIA_TYPE *mt, const DDSURFACEDESC *expected_format)
static HRESULT testfilter_cleanup_stream(struct strmbase_filter *iface)
static void test_get_end_of_stream_event_handle(void)
static HRESULT streamsample_expected_hr
static const VIDEOINFO rgb24_video_info
static STREAM_STATE mmstream_state
static void CALLBACK apc_func(ULONG_PTR param)
static HRESULT WINAPI graph_AddFilter(IFilterGraph2 *iface, IBaseFilter *filter, const WCHAR *name)
static HRESULT WINAPI pin_QueryInternalConnections(IPin *iface, IPin **pins, ULONG *count)
static ULONG WINAPI testsource_seeking_AddRef(IMediaSeeking *iface)
static HRESULT WINAPI graph_RemoveFilter(IFilterGraph2 *iface, IBaseFilter *filter)
static const VIDEOINFO rgb555_video_info
static void test_ammediastream_join_am_multi_media_stream(void)
static ULONG WINAPI testsource_qc_AddRef(IQualityControl *iface)
static void test_audiostream_initialize(void)
static HRESULT WINAPI graph_QueryInterface(IFilterGraph2 *iface, REFIID iid, void **out)
static HRESULT WINAPI testsource_seeking_GetCapabilities(IMediaSeeking *iface, DWORD *capabilities)
static const AM_MEDIA_TYPE rgb24_mt
static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
static void test_ddrawstream_get_time_per_frame(void)
static void check_ammediastream_join_am_multi_media_stream(const CLSID *clsid)
static struct testfilter * impl_from_IQualityControl(IQualityControl *iface)
static HRESULT WINAPI stream_JoinFilterGraph(IAMMediaStream *iface, IFilterGraph *graph)
static IMediaSample * ammediastream_allocate_sample(struct testfilter *source, const BYTE *input_data, DWORD input_length)
static HRESULT WINAPI testsource_seeking_GetAvailable(IMediaSeeking *iface, LONGLONG *earliest, LONGLONG *latest)
static void test_audiostream_begin_flush_end_flush(void)
static const WCHAR primary_video_sink_id[]
static const DDSURFACEDESC rgb8_format
static HRESULT WINAPI pin_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static void test_audiostream_receive_connection(void)
static HRESULT WINAPI stream_AllocateSample(IAMMediaStream *iface, DWORD flags, IStreamSample **sample)
static IAMMultiMediaStream * mmstream_mmstream
static HRESULT WINAPI stream_SetState(IAMMediaStream *iface, FILTER_STATE state)
static void testclock_init(struct testclock *clock)
static const DDSURFACEDESC argb32_format
static const DDSURFACEDESC rgb32_format
static const AM_MEDIA_TYPE audio_mt
static HRESULT WINAPI pin_EndOfStream(IPin *iface)
static HRESULT WINAPI stream_QueryInterface(IAMMediaStream *iface, REFIID iid, void **out)
static void test_ddrawstream_initialize(void)
static void test_audiodata_query_interface(void)
static HRESULT WINAPI testsource_seeking_GetRate(IMediaSeeking *iface, double *rate)
static struct graph * impl_from_IFilterGraph2(IFilterGraph2 *iface)
static ULONG get_refcount(void *iface)
static HRESULT WINAPI pin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *mt)
static IUnknown * create_audio_data(void)
static DWORD CALLBACK ammediastream_receive(void *param)
static void test_set_state(void)
static void check_mediastreamfilter_is_format_supported(IMediaSeeking *seeking, struct testfilter *source1, struct testfilter *source2, struct testfilter *source3, HRESULT source2_hr, HRESULT expected_hr)
static HRESULT WINAPI stream_SetSameFormat(IAMMediaStream *iface, IMediaStream *ref, DWORD flags)
static void test_mediastreamfilter_reference_time_to_stream_time(void)
static HRESULT WINAPI testsource_seeking_SetRate(IMediaSeeking *iface, double rate)
static void test_audiostream_receive(void)
static void test_pin_info(void)
static const DDSURFACEDESC rgb24_format
static struct testfilter * impl_from_IMediaSeeking(IMediaSeeking *iface)
static void _expect_ref(IUnknown *obj, ULONG ref, int line)
static void test_mediastreamfilter_seeking(void)
static HRESULT WINAPI testsource_seeking_SetPositions(IMediaSeeking *iface, LONGLONG *current_ptr, DWORD current_flags, LONGLONG *stop_ptr, DWORD stop_flags)
static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static void test_audiostreamsample_get_sample_times(void)
static ULONG WINAPI pin_AddRef(IPin *iface)
static DWORD ammediastream_sleep_time
static HRESULT WINAPI testsource_seeking_QueryPreferredFormat(IMediaSeeking *iface, GUID *format)
static HRESULT WINAPI pin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **out)
static void check_ammediastream_join_filter(const CLSID *clsid)
static DWORD CALLBACK mmstream_set_state(void *param)
static HRESULT WINAPI graph_Reconnect(IFilterGraph2 *iface, IPin *pin)
static HRESULT WINAPI testsource_DecideAllocator(struct strmbase_source *iface, IMemInputPin *pin, IMemAllocator **alloc)
static void test_find_pin(void)
static void test_ddrawstream_getsetdirectdraw(void)
static HRESULT WINAPI testsource_seeking_CheckCapabilities(IMediaSeeking *iface, DWORD *capabilities)
static const GUID test_mspid
static HRESULT WINAPI testsource_seeking_IsUsingTimeFormat(IMediaSeeking *iface, const GUID *format)
static ULONG WINAPI testclock_AddRef(IReferenceClock *iface)
static struct graph * impl_from_IMediaEventSink(IMediaEventSink *iface)
void test_mediastreamfilter_stop_pause_run(void)
static HRESULT testfilter_wait_state(struct strmbase_filter *iface, DWORD timeout)
static void check_ddrawstream_set_format_(int line, IDirectDrawMediaStream *stream, const DDSURFACEDESC *format, const AM_MEDIA_TYPE *mt, HRESULT expected_hr)
static void test_ddrawstreamsample_completion_status(void)
static HRESULT WINAPI graph_ConnectDirect(IFilterGraph2 *iface, IPin *source, IPin *sink, const AM_MEDIA_TYPE *mt)
static const VIDEOINFO rgb8_video_info
static void test_audiostreamsample_get_media_stream(void)
static HRESULT WINAPI pin_BeginFlush(IPin *iface)
static HRESULT WINAPI pin_QueryPinInfo(IPin *iface, PIN_INFO *info)
static HRESULT WINAPI graph_AddSourceFilter(IFilterGraph2 *iface, const WCHAR *filename, const WCHAR *filter_name, IBaseFilter **filter)
static const struct strmbase_source_ops testsource_ops
static HRESULT WINAPI pin_ConnectedTo(IPin *iface, IPin **peer)
static HRESULT WINAPI stream_JoinFilter(IAMMediaStream *iface, IMediaStreamFilter *filter)
static struct testfilter * impl_from_BaseFilter(struct strmbase_filter *iface)
static HRESULT set_audiostream_format(const WAVEFORMATEX *format)
static HRESULT WINAPI graph_ReconnectEx(IFilterGraph2 *iface, IPin *pin, const AM_MEDIA_TYPE *mt)
static void test_enum_media_types(void)
static IMemInputPin * ammediastream_mem_input_pin
static IMediaSample * ammediastream_media_sample
static void test_mediastreamfilter_support_seeking(void)
static const VIDEOINFO rgb565_video_info
static void test_interfaces(void)
static HRESULT testsource_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
static HRESULT WINAPI pin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt)
static void check_mediastreamfilter_seeking(void(*check)(IMediaSeeking *seeking, struct testfilter *source1, struct testfilter *source2, struct testfilter *source3, HRESULT source2_hr, HRESULT expected_hr))
static const IFilterGraph2Vtbl graph_vtbl
static HRESULT WINAPI graph_SetLogFile(IFilterGraph2 *iface, DWORD_PTR file)
static HRESULT WINAPI graph_SetDefaultSyncSource(IFilterGraph2 *iface)
static HRESULT WINAPI testclock_GetTime(IReferenceClock *iface, REFERENCE_TIME *time)
#define check_ddrawstream_set_format(a, b, c, d)
static HRESULT mediastreamfilter_pause(IMediaStreamFilter *filter)
static HRESULT WINAPI graph_RenderFile(IFilterGraph2 *iface, const WCHAR *filename, const WCHAR *playlist)
static void check_ammediastream_set_state(const MSPID *id)
static HRESULT WINAPI testsource_seeking_GetStopPosition(IMediaSeeking *iface, LONGLONG *stop)
static void test_ddrawstream_begin_flush_end_flush(void)
static const DDSURFACEDESC yuy2_format
static HRESULT WINAPI testsource_seeking_GetTimeFormat(IMediaSeeking *iface, GUID *format)
static void test_ammediastream_join_filter(void)
static HRESULT WINAPI graph_FindFilterByName(IFilterGraph2 *iface, const WCHAR *name, IBaseFilter **filter)
static DWORD CALLBACK streamsample_completion_status(void *param)
static struct teststream * impl_from_IPin(IPin *iface)
static void check_mediastreamfilter_set_positions(IMediaSeeking *seeking, struct testfilter *source1, struct testfilter *source2, struct testfilter *source3, HRESULT source2_hr, HRESULT expected_hr)
static HRESULT WINAPI testclock_Unadvise(IReferenceClock *iface, DWORD_PTR cookie)
#define check_get_stream(a, b, c, d)
static void test_mmstream_get_duration(const WCHAR *test_avi_path)
static void test_media_types(void)
static HRESULT WINAPI pin_EndFlush(IPin *iface)
static HRESULT WINAPI graph_ShouldOperationContinue(IFilterGraph2 *iface)
static const DDSURFACEDESC rgb555_format
static void test_mediastreamfilter_wait_until(void)
static const AM_MEDIA_TYPE rgb32_mt
static void check_ammediastream_join_filter_graph(const MSPID *id)
static ULONG WINAPI event_sink_AddRef(IMediaEventSink *iface)
static void teststream_init(struct teststream *stream)
static HRESULT WINAPI graph_Disconnect(IFilterGraph2 *iface, IPin *pin)
static void test_audiodata_set_actual(void)
static void check_ammediastream_end_of_stream(const CLSID *clsid, const MSPID *id, const AM_MEDIA_TYPE *mt)
static HRESULT WINAPI pin_QueryId(IPin *iface, WCHAR **id)
static void test_initialize(void)
static struct strmbase_pin * testfilter_get_pin(struct strmbase_filter *iface, unsigned int index)
static HRESULT WINAPI pin_Disconnect(IPin *iface)
static void test_enum_pins(void)
static HRESULT testfilter_init_stream(struct strmbase_filter *iface)
static HRESULT WINAPI graph_Abort(IFilterGraph2 *iface)
static const WCHAR primary_audio_sink_id[]
static void test_mediastreamfilter_end_of_stream(void)
static void test_ammediastream_set_state(void)
static DWORD streamsample_timeout
static void test_audiodata_get_info(void)
static ULONG WINAPI testsource_seeking_Release(IMediaSeeking *iface)
static HRESULT WINAPI stream_Initialize(IAMMediaStream *iface, IUnknown *source, DWORD flags, REFMSPID id, const STREAM_TYPE type)
static const AM_MEDIA_TYPE rgb565_mt
#define EXPECT_REF(obj, ref)
void test_mediastreamfilter_get_state(void)
static HRESULT WINAPI testsource_qc_QueryInterface(IQualityControl *iface, REFIID iid, void **out)
static void test_audiostream_set_format(void)
static HRESULT WINAPI testsource_seeking_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *target, const GUID *target_format, LONGLONG source, const GUID *source_format)
#define check_enum_stream(a, b, c, d)
static void check_enum_stream_(int line, IAMMultiMediaStream *mmstream, IMediaStreamFilter *filter, LONG index, IMediaStream *expect)
static IPin * ammediastream_pin
static struct teststream * impl_from_IAMMediaStream(IAMMediaStream *iface)
static ULONG WINAPI graph_AddRef(IFilterGraph2 *iface)
void check_mediastreamfilter_state(FILTER_STATE expected_state, HRESULT(*set_state)(IMediaStreamFilter *), HRESULT(*reset_state)(IMediaStreamFilter *))
static HRESULT WINAPI pin_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
static void test_ddrawstream_create_sample(void)
static void test_ddrawstream_receive(void)
static HRESULT WINAPI graph_Connect(IFilterGraph2 *iface, IPin *source, IPin *sink)
static ULONG WINAPI event_sink_Release(IMediaEventSink *iface)
static HRESULT WINAPI testclock_QueryInterface(IReferenceClock *iface, REFIID iid, void **out)
static HRESULT WINAPI event_sink_QueryInterface(IMediaEventSink *iface, REFIID iid, void **out)
static const DDSURFACEDESC rgb565_format
static void check_mediastreamfilter_get_duration(IMediaSeeking *seeking, struct testfilter *source1, struct testfilter *source2, struct testfilter *source3, HRESULT source2_hr, HRESULT expected_hr)
static HRESULT WINAPI graph_AddSourceFilterForMoniker(IFilterGraph2 *iface, IMoniker *moniker, IBindCtx *bind_ctx, const WCHAR *filter_name, IBaseFilter **filter)
static void test_audiodata_get_format(void)
static HRESULT WINAPI testsource_seeking_GetPositions(IMediaSeeking *iface, LONGLONG *current, LONGLONG *stop)
static HRESULT WINAPI stream_SendEndOfStream(IAMMediaStream *iface, DWORD flags)
#define check_interface(a, b, c)
static void test_ammediastream_join_filter_graph(void)
static HRESULT WINAPI testsource_seeking_GetPreroll(IMediaSeeking *iface, LONGLONG *preroll)
static void test_ddrawstreamsample_get_sample_times(void)
static const IMediaSeekingVtbl testsource_seeking_vtbl
static void test_audiodata_set_format(void)
static const AM_MEDIA_TYPE rgb555_mt
static HRESULT WINAPI testsource_seeking_QueryInterface(IMediaSeeking *iface, REFIID iid, void **out)
static ULONG WINAPI stream_Release(IAMMediaStream *iface)
static DWORD CALLBACK ammediastream_end_of_stream(void *param)
static void test_ammediastream_end_of_stream(void)
static void unload_resource(const WCHAR *path)
static IAMMultiMediaStream * create_ammultimediastream(void)
static IStreamSample * streamsample_sample
static HRESULT WINAPI testsource_seeking_SetTimeFormat(IMediaSeeking *iface, const GUID *format)
void test_audiostreamsample_completion_status(void)
static void test_media_streams(void)
static void test_ddrawstream_qc(void)
static const VIDEOINFO rgb32_video_info
static void test_audiostreamsample_update(void)
static void test_audiostream_new_segment(void)
static struct testclock * impl_from_IReferenceClock(IReferenceClock *iface)
static HRESULT WINAPI testclock_AdviseTime(IReferenceClock *iface, REFERENCE_TIME base, REFERENCE_TIME offset, HEVENT event, DWORD_PTR *cookie)
static HRESULT WINAPI testsource_seeking_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *current)
static ULONG WINAPI stream_AddRef(IAMMediaStream *iface)
static const WAVEFORMATEX audio_format
static void test_ddrawstream_get_format(void)
static void test_ddrawstreamsample_get_media_stream(void)
static const DDSURFACEDESC yv12_format
static HANDLE ammediastream_async_receive_time(struct testfilter *source, REFERENCE_TIME start_time, REFERENCE_TIME end_time, const BYTE *input_data, DWORD input_length)
static void test_audiostream_get_format(void)
static HRESULT WINAPI graph_EnumFilters(IFilterGraph2 *iface, IEnumFilters **enumfilters)
static DWORD streamsample_flags
static const struct strmbase_filter_ops testfilter_ops
static void check_get_stream_(int line, IAMMultiMediaStream *mmstream, IMediaStreamFilter *filter, const GUID *mspid, IMediaStream *expect)
static HRESULT mediastreamfilter_run(IMediaStreamFilter *filter)
static const IQualityControlVtbl testsource_qc_vtbl
static const IMediaEventSinkVtbl event_sink_vtbl
static const AM_MEDIA_TYPE rgb8_mt
static HRESULT WINAPI event_sink_Notify(IMediaEventSink *iface, LONG code, LONG_PTR param1, LONG_PTR param2)
static HRESULT mediastreamfilter_stop(IMediaStreamFilter *filter)
static HRESULT WINAPI testsource_qc_SetSink(IQualityControl *iface, IQualityControl *sink)
#define get_ddrawstream_create_sample_desc(a, b, c, d)
static HRESULT WINAPI stream_GetInformation(IAMMediaStream *iface, MSPID *id, STREAM_TYPE *type)
static HRESULT WINAPI graph_Render(IFilterGraph2 *iface, IPin *source)
static void test_audiodata_set_buffer(void)
static ULONG WINAPI testsource_qc_Release(IQualityControl *iface)
static HRESULT ammediastream_expected_hr
static HRESULT WINAPI stream_GetMultiMediaStream(IAMMediaStream *iface, IMultiMediaStream **mmstream)
static void check_mediastreamfilter_get_stop_position(IMediaSeeking *seeking, struct testfilter *source1, struct testfilter *source2, struct testfilter *source3, HRESULT source2_hr, HRESULT expected_hr)
static void graph_init(struct graph *graph)
static HRESULT WINAPI stream_JoinAMMultiMediaStream(IAMMediaStream *iface, IAMMultiMediaStream *mmstream)
static struct testfilter * impl_from_base_pin(struct strmbase_pin *iface)
static HRESULT WINAPI testsource_seeking_IsFormatSupported(IMediaSeeking *iface, const GUID *format)
static HRESULT WINAPI testsource_qc_Notify(IQualityControl *iface, IBaseFilter *sender, Quality q)
static IReferenceClockVtbl testclock_vtbl
static void testfilter_init(struct testfilter *filter)
#define InterlockedIncrement
#define InterlockedDecrement
@ AM_SEEKING_AbsolutePositioning
enum _PinDirection PIN_DIRECTION
static enum parser_state set_state(struct parser *parser, enum parser_state state)
const GUID IID_IBaseFilter
HRESULT WINAPI DirectDrawCreate(LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN pUnkOuter)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
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]
#define INVALID_HANDLE_VALUE
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
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)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
_ACRTIMP clock_t __cdecl clock(void)
#define check(expected, result)
@ AMMSF_ADDDEFAULTRENDERER
struct tagVIDEOINFO VIDEOINFO
struct tagVIDEOINFOHEADER VIDEOINFOHEADER
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble q
GLenum const GLfloat * params
GLuint GLsizei GLsizei * length
GLsizei GLenum GLboolean sink
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
#define memcpy(s1, s2, n)
struct task_struct * current
static struct test_info tests[]
DWORD WINAPI thread1(LPVOID crap)
DWORD WINAPI thread2(LPVOID crap)
D3D11_SHADER_VARIABLE_DESC desc
#define load_resource(a, b, c)
static const AM_MEDIA_TYPE yuy2_mt
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
#define IsEqualGUID(rguid1, rguid2)
HWND WINAPI GetDesktopWindow(void)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define DDPF_PALETTEINDEXEDTO8
#define DDPF_PALETTEINDEXED4
#define DDPF_PALETTEINDEXED2
#define DDPF_ALPHAPREMULT
#define DDSCAPS_PRIMARYSURFACE
DDPIXELFORMAT ddpfPixelFormat
struct _DDPIXELFORMAT DDPIXELFORMAT
#define DDPF_STENCILBUFFER
#define DDSCAPS_OFFSCREENPLAIN
#define DDPF_PALETTEINDEXED1
#define DDPF_BUMPLUMINANCE
#define DDSCAPS_VIDEOMEMORY
#define DDSCAPS_SYSTEMMEMORY
#define DDERR_INVALIDSURFACETYPE
static __inline const char * wine_dbgstr_guid(const GUID *id)
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
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)
union WAVEFORMATEXTENSIBLE::@3739 Samples
HANDLE advise_time_called_event
IMediaSeeking IMediaSeeking_iface
unsigned int got_add_filter
IFilterGraph2 IFilterGraph2_iface
IMediaEventSink * inner_event_sink
IMediaEventSink IMediaEventSink_iface
const struct strmbase_source_ops * pFuncsTable
BITMAPINFOHEADER bmiHeader
REFERENCE_TIME AvgTimePerFrame
struct advise_time_cookie * advise_time_cookie
IReferenceClock IReferenceClock_iface
LONGLONG current_position
HRESULT is_format_supported_hr
HRESULT cleanup_stream_hr
IMediaSeeking IMediaSeeking_iface
Quality qc_notify_quality
IQualityControl IQualityControl_iface
const AM_MEDIA_TYPE * preferred_mt
struct strmbase_source source
struct strmbase_filter filter
IBaseFilter * qc_notify_sender
REFERENCE_TIME start_time
HRESULT get_stop_position_hr
IAMMediaStream IAMMediaStream_iface
IAMMultiMediaStream * mmstream
IMediaStreamFilter * filter
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_WRONG_STATE
#define VFW_S_STATE_INTERMEDIATE
#define VFW_S_NO_MORE_ITEMS
#define VFW_E_NO_AUDIO_HARDWARE
#define VFW_E_CANNOT_CONNECT
#define VFW_E_NOT_CONNECTED
static const WCHAR props[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define ERROR_ALREADY_INITIALIZED