28static const GUID MEDIASUBTYPE_mp3 = {0x00000055,0x0000,0x0010,{0x80,0x00,0x00,0xaa,0x00,0x38,0x9b,0x71}};
42 && !
memcmp(
a->pbFormat,
b->pbFormat,
a->cbFormat);
74 return IUnknown_Release(
unknown);
87 IBaseFilter_QueryInterface(
reader, &IID_IFileSourceFilter, (
void **)&filesource);
91 &IID_IFilterGraph2, (
void **)&
graph);
93 IFilterGraph2_AddFilter(
graph, splitter,
NULL);
95 IBaseFilter_FindPin(splitter,
L"Input", &
sink);
103 IBaseFilter_Release(
reader);
104 IFileSourceFilter_Release(filesource);
108#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
117 hr = IUnknown_QueryInterface(iface, iid, (
void **)&unk);
120 IUnknown_Release(unk);
149 IBaseFilter_FindPin(
filter,
L"Input", &pin);
162 IBaseFilter_FindPin(
filter,
L"Audio", &pin);
175 IBaseFilter_Release(
filter);
176 IFilterGraph2_Release(
graph);
232 ok(unk != &
test_outer,
"Returned IUnknown should not be outer IUnknown.\n");
234 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
236 ref = IUnknown_AddRef(unk);
237 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
240 ref = IUnknown_Release(unk);
241 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
246 ok(unk2 == unk,
"Got unexpected IUnknown %p.\n", unk2);
247 IUnknown_Release(unk2);
254 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
258 ok(filter2 == (
IBaseFilter *)0xdeadbeef,
"Got unexpected IBaseFilter %p.\n", filter2);
260 hr = IUnknown_QueryInterface(unk, &
test_iid, (
void **)&unk2);
262 ok(!unk2,
"Got unexpected IUnknown %p.\n", unk2);
266 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
268 IBaseFilter_Release(
filter);
269 ref = IUnknown_Release(unk);
270 ok(!
ref,
"Got unexpected refcount %ld.\n",
ref);
286 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
288 hr = IBaseFilter_EnumPins(
filter, &enum1);
291 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
293 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
295 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
298 ok(
ref == 3,
"Got unexpected refcount %ld.\n",
ref);
300 ok(
ref == 3,
"Got unexpected refcount %ld.\n",
ref);
302 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
303 IPin_Release(pins[0]);
305 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
308 hr = IEnumPins_Reset(enum1);
311 hr = IEnumPins_Next(enum1, 1, pins, &
count);
314 IPin_Release(pins[0]);
316 hr = IEnumPins_Next(enum1, 1, pins, &
count);
320 hr = IEnumPins_Reset(enum1);
323 hr = IEnumPins_Next(enum1, 2, pins,
NULL);
326 hr = IEnumPins_Next(enum1, 2, pins, &
count);
329 IPin_Release(pins[0]);
331 hr = IEnumPins_Reset(enum1);
334 hr = IEnumPins_Clone(enum1, &enum2);
337 hr = IEnumPins_Skip(enum1, 2);
340 hr = IEnumPins_Skip(enum1, 1);
343 hr = IEnumPins_Skip(enum1, 1);
346 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
349 hr = IEnumPins_Next(enum2, 1, pins,
NULL);
351 IPin_Release(pins[0]);
353 IEnumPins_Release(enum2);
357 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
360 hr = IEnumPins_Reset(enum1);
363 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
365 IPin_Release(pins[0]);
367 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
369 IPin_Release(pins[0]);
371 hr = IEnumPins_Next(enum1, 1, pins,
NULL);
374 hr = IEnumPins_Reset(enum1);
377 hr = IEnumPins_Next(enum1, 2, pins, &
count);
380 IPin_Release(pins[0]);
381 IPin_Release(pins[1]);
383 hr = IEnumPins_Reset(enum1);
386 hr = IEnumPins_Next(enum1, 3, pins, &
count);
389 IPin_Release(pins[0]);
390 IPin_Release(pins[1]);
392 IEnumPins_Release(enum1);
393 IFilterGraph2_Release(
graph);
395 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
411 hr = IBaseFilter_FindPin(
filter,
L"input pin", &pin);
414 hr = IBaseFilter_FindPin(
filter,
L"Input", &pin);
418 hr = IBaseFilter_FindPin(
filter,
L"Audio", &pin);
429 hr = IBaseFilter_FindPin(
filter,
L"Input", &pin);
431 ok(pin == pin2,
"Expected pin %p, got %p.\n", pin2, pin);
438 hr = IBaseFilter_FindPin(
filter,
L"Audio", &pin);
440 ok(pin == pin2,
"Expected pin %p, got %p.\n", pin2, pin);
445 IFilterGraph2_Release(
graph);
447 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
467 hr = IBaseFilter_FindPin(
filter,
L"Input", &pin);
473 hr = IPin_QueryPinInfo(pin, &
info);
482 IBaseFilter_Release(
info.pFilter);
484 hr = IPin_QueryDirection(pin, &
dir);
488 hr = IPin_QueryId(pin, &
id);
495 hr = IBaseFilter_FindPin(
filter,
L"Audio", &pin);
498 hr = IPin_QueryPinInfo(pin, &
info);
503 IBaseFilter_Release(
info.pFilter);
505 hr = IPin_QueryDirection(pin, &
dir);
509 hr = IPin_QueryId(pin, &
id);
516 IFilterGraph2_Release(
graph);
518 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
548 IBaseFilter_FindPin(
filter,
L"Input", &pin);
550 hr = IPin_EnumMediaTypes(pin, &enummt);
553 expect_mt.majortype = MEDIATYPE_Stream;
554 expect_mt.bFixedSizeSamples =
TRUE;
555 expect_mt.bTemporalCompression =
TRUE;
556 expect_mt.lSampleSize = 1;
558 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
560 expect_mt.subtype = MEDIASUBTYPE_MPEG1System;
564 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
566 expect_mt.subtype = MEDIASUBTYPE_MPEG1VideoCD;
570 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
572 expect_mt.subtype = MEDIASUBTYPE_MPEG1Video;
576 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
578 expect_mt.subtype = MEDIASUBTYPE_MPEG1Audio;
582 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
585 IEnumMediaTypes_Release(enummt);
587 mt.majortype = MEDIATYPE_Stream;
588 mt.subtype = MEDIASUBTYPE_MPEG1Audio;
589 hr = IPin_QueryAccept(pin, &mt);
592 mt.subtype = MEDIASUBTYPE_MPEG1Video;
593 hr = IPin_QueryAccept(pin, &mt);
595 mt.subtype = MEDIASUBTYPE_MPEG1VideoCD;
596 hr = IPin_QueryAccept(pin, &mt);
598 mt.subtype = MEDIASUBTYPE_MPEG1System;
599 hr = IPin_QueryAccept(pin, &mt);
601 mt.subtype = MEDIASUBTYPE_MPEG1AudioPayload;
602 hr = IPin_QueryAccept(pin, &mt);
604 mt.subtype = MEDIASUBTYPE_MPEG1Payload;
605 hr = IPin_QueryAccept(pin, &mt);
607 mt.subtype = MEDIASUBTYPE_MPEG1Packet;
608 hr = IPin_QueryAccept(pin, &mt);
611 hr = IPin_QueryAccept(pin, &mt);
613 mt.subtype = MEDIASUBTYPE_MPEG1Audio;
615 mt.majortype = MEDIATYPE_Audio;
616 hr = IPin_QueryAccept(pin, &mt);
619 hr = IPin_QueryAccept(pin, &mt);
621 mt.majortype = MEDIATYPE_Stream;
623 mt.formattype = FORMAT_None;
624 hr = IPin_QueryAccept(pin, &mt);
626 mt.formattype = FORMAT_VideoInfo;
627 hr = IPin_QueryAccept(pin, &mt);
629 mt.formattype = FORMAT_WaveFormatEx;
630 hr = IPin_QueryAccept(pin, &mt);
633 mt.bFixedSizeSamples =
TRUE;
634 mt.bTemporalCompression =
TRUE;
635 mt.lSampleSize = 123;
636 hr = IPin_QueryAccept(pin, &mt);
642 hr = IPin_EnumMediaTypes(pin, &enummt);
645 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
647 expect_mt.subtype = MEDIASUBTYPE_MPEG1System;
651 IEnumMediaTypes_Release(enummt);
654 IBaseFilter_FindPin(
filter,
L"Audio", &pin);
656 hr = IPin_EnumMediaTypes(pin, &enummt);
659 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
661 ok(
IsEqualGUID(&pmt->majortype, &MEDIATYPE_Audio),
"Got major type %s.\n",
665 todo_wine ok(pmt->bFixedSizeSamples ==
TRUE,
"Got fixed size %d.\n", pmt->bFixedSizeSamples);
666 ok(!pmt->bTemporalCompression,
"Got temporal compression %d.\n", pmt->bTemporalCompression);
667 todo_wine ok(pmt->lSampleSize == 1,
"Got sample size %lu.\n", pmt->lSampleSize);
668 ok(
IsEqualGUID(&pmt->formattype, &FORMAT_WaveFormatEx),
"Got format type %s.\n",
670 ok(!pmt->pUnk,
"Got pUnk %p.\n", pmt->pUnk);
679 hr = IPin_QueryAccept(pin, pmt);
682 pmt->bFixedSizeSamples =
FALSE;
683 pmt->bTemporalCompression =
TRUE;
684 pmt->lSampleSize = 123;
685 hr = IPin_QueryAccept(pin, pmt);
688 pmt->majortype = MEDIATYPE_Video;
689 hr = IPin_QueryAccept(pin, pmt);
692 hr = IPin_QueryAccept(pin, pmt);
694 pmt->majortype = MEDIATYPE_Audio;
696 pmt->subtype = MEDIASUBTYPE_MPEG1Audio;
697 hr = IPin_QueryAccept(pin, pmt);
699 pmt->subtype = MEDIASUBTYPE_MPEG1Packet;
700 hr = IPin_QueryAccept(pin, pmt);
702 pmt->subtype = MEDIASUBTYPE_MPEG1Video;
703 hr = IPin_QueryAccept(pin, pmt);
705 pmt->subtype = MEDIASUBTYPE_MPEG1AudioPayload;
707 pmt->formattype = FORMAT_None;
708 hr = IPin_QueryAccept(pin, pmt);
711 hr = IPin_QueryAccept(pin, pmt);
713 pmt->formattype = FORMAT_WaveFormatEx;
718 hr = IPin_QueryAccept(pin, pmt);
723 hr = IPin_QueryAccept(pin, pmt);
730 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
734 ok(
IsEqualGUID(&pmt->majortype, &MEDIATYPE_Audio),
"Got major type %s.\n",
736 ok(
IsEqualGUID(&pmt->subtype, &MEDIASUBTYPE_MPEG1Payload),
"Got subtype %s.\n",
738 ok(pmt->bFixedSizeSamples ==
TRUE,
"Got fixed size %d.\n", pmt->bFixedSizeSamples);
739 ok(!pmt->bTemporalCompression,
"Got temporal compression %d.\n", pmt->bTemporalCompression);
740 ok(pmt->lSampleSize == 1,
"Got sample size %lu.\n", pmt->lSampleSize);
741 ok(
IsEqualGUID(&pmt->formattype, &FORMAT_WaveFormatEx),
"Got format type %s.\n",
743 ok(!pmt->pUnk,
"Got pUnk %p.\n", pmt->pUnk);
744 ok(pmt->cbFormat ==
sizeof(
MPEG1WAVEFORMAT),
"Got format size %lu.\n", pmt->cbFormat);
749 hr = IPin_QueryAccept(pin, pmt);
755 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
757 ok(
IsEqualGUID(&pmt->majortype, &MEDIATYPE_Audio),
"Got major type %s.\n",
761 ok(pmt->bFixedSizeSamples ==
TRUE,
"Got fixed size %d.\n", pmt->bFixedSizeSamples);
762 ok(!pmt->bTemporalCompression,
"Got temporal compression %d.\n", pmt->bTemporalCompression);
763 ok(pmt->lSampleSize == 1,
"Got sample size %lu.\n", pmt->lSampleSize);
764 ok(
IsEqualGUID(&pmt->formattype, &FORMAT_WaveFormatEx),
"Got format type %s.\n",
766 ok(!pmt->pUnk,
"Got pUnk %p.\n", pmt->pUnk);
769 "Format blocks didn't match.\n");
771 hr = IPin_QueryAccept(pin, pmt);
774 pmt->bFixedSizeSamples =
FALSE;
775 pmt->bTemporalCompression =
TRUE;
776 pmt->lSampleSize = 123;
777 hr = IPin_QueryAccept(pin, pmt);
780 pmt->majortype = MEDIATYPE_Video;
781 hr = IPin_QueryAccept(pin, pmt);
783 pmt->majortype = MEDIATYPE_Audio;
785 pmt->subtype = MEDIASUBTYPE_MPEG1Audio;
786 hr = IPin_QueryAccept(pin, pmt);
788 pmt->subtype = MEDIASUBTYPE_MPEG1Packet;
789 hr = IPin_QueryAccept(pin, pmt);
791 pmt->subtype = MEDIASUBTYPE_MPEG1Video;
792 hr = IPin_QueryAccept(pin, pmt);
794 pmt->subtype = MEDIASUBTYPE_MPEG1AudioPayload;
796 pmt->formattype = FORMAT_None;
797 hr = IPin_QueryAccept(pin, pmt);
800 hr = IPin_QueryAccept(pin, pmt);
802 pmt->formattype = FORMAT_WaveFormatEx;
807 hr = IPin_QueryAccept(pin, pmt);
812 hr = IPin_QueryAccept(pin, pmt);
820 hr = IEnumMediaTypes_Next(enummt, 1, &pmt,
NULL);
823 IEnumMediaTypes_Release(enummt);
826 IFilterGraph2_Release(
graph);
828 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
846 IBaseFilter_FindPin(
filter,
L"Input", &pin);
848 hr = IPin_EnumMediaTypes(pin, &enum1);
851 for (
i = 0;
i < 4; ++
i)
853 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
858 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
861 hr = IEnumMediaTypes_Reset(enum1);
864 for (
i = 0;
i < 4; ++
i)
866 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
872 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
876 hr = IEnumMediaTypes_Reset(enum1);
879 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
885 hr = IEnumMediaTypes_Next(enum1, 3, mts, &
count);
891 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
895 hr = IEnumMediaTypes_Reset(enum1);
898 hr = IEnumMediaTypes_Clone(enum1, &enum2);
901 hr = IEnumMediaTypes_Skip(enum1, 5);
904 hr = IEnumMediaTypes_Skip(enum1, 1);
907 hr = IEnumMediaTypes_Reset(enum1);
910 hr = IEnumMediaTypes_Skip(enum1, 4);
913 hr = IEnumMediaTypes_Skip(enum1, 1);
916 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
919 hr = IEnumMediaTypes_Next(enum2, 1, mts,
NULL);
923 IEnumMediaTypes_Release(enum1);
924 IEnumMediaTypes_Release(enum2);
927 IBaseFilter_FindPin(
filter,
L"Audio", &pin);
929 hr = IPin_EnumMediaTypes(pin, &enum1);
932 for (
i = 0;
i < 3; ++
i)
934 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
940 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
943 hr = IEnumMediaTypes_Reset(enum1);
946 for (
i = 0;
i < 3; ++
i)
948 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
955 hr = IEnumMediaTypes_Next(enum1, 1, mts, &
count);
959 hr = IEnumMediaTypes_Reset(enum1);
962 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
970 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
976 hr = IEnumMediaTypes_Next(enum1, 2, mts, &
count);
980 hr = IEnumMediaTypes_Reset(enum1);
983 hr = IEnumMediaTypes_Clone(enum1, &enum2);
986 hr = IEnumMediaTypes_Skip(enum1, 4);
989 hr = IEnumMediaTypes_Skip(enum1, 1);
992 hr = IEnumMediaTypes_Reset(enum1);
995 hr = IEnumMediaTypes_Skip(enum1, 3);
998 hr = IEnumMediaTypes_Skip(enum1, 1);
1001 hr = IEnumMediaTypes_Next(enum1, 1, mts,
NULL);
1004 hr = IEnumMediaTypes_Next(enum2, 1, mts,
NULL);
1009 IEnumMediaTypes_Release(enum1);
1010 IEnumMediaTypes_Release(enum2);
1013 IFilterGraph2_Release(
graph);
1015 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1074 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1099 return &
filter->source.pin;
1100 else if (
index == 1)
1101 return &
filter->sink.pin;
1118 filter->new_segment_count = 0;
1120 filter->sample_count = 0;
1149 iface->
pin.peer = peer;
1153 if (
FAILED(
hr = IPin_ReceiveConnection(peer, &iface->
pin.IPin_iface,
mt)))
1175 *
out = &
filter->sink.IMemInputPin_iface;
1215 ok(
filter->new_segment_count,
"Expected NewSegment() before Receive().\n");
1217 IPin_QueryInterface(iface->
pin.peer, &IID_IMediaSeeking, (
void **)&seeking);
1218 hr = IMediaSeeking_GetPositions(seeking, &
start, &
end);
1221 ok(
end ==
filter->seek_end,
"Expected end position %I64u, got %I64u.\n",
filter->seek_end,
end);
1222 IMediaSeeking_Release(seeking);
1226 filter->byte_count += IMediaSample_GetActualDataLength(
sample);
1253 ++
filter->new_segment_count;
1255 IPin_QueryInterface(iface->
pin.peer, &IID_IMediaSeeking, (
void **)&seeking);
1256 hr = IMediaSeeking_GetPositions(seeking, &
filter->seek_start, &
filter->seek_end);
1258 IMediaSeeking_Release(seeking);
1262 "Expected end %I64d to %I64d, got %I64d.\n",
filter->segment_end_min,
filter->segment_end_max,
end);
1366 filter->segment_end_min = 5000000;
1367 filter->segment_end_max = 5500000;
1374 .majortype = MEDIATYPE_Stream,
1375 .subtype = MEDIASUBTYPE_MPEG1Audio,
1376 .formattype = FORMAT_WaveFormatEx,
1393 &IID_IFilterGraph2, (
void **)&
graph);
1397 IFilterGraph2_AddFilter(
graph, &testsource.
filter.IBaseFilter_iface,
L"source");
1400 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
1404 IBaseFilter_QueryInterface(
reader, &IID_IFileSourceFilter, (
void **)&filesource);
1406 IFileSourceFilter_Release(filesource);
1413 peer = (
IPin *)0xdeadbeef;
1414 hr = IPin_ConnectedTo(
sink, &peer);
1416 ok(!peer,
"Got peer %p.\n", peer);
1418 hr = IPin_ConnectionMediaType(
sink, &
mt);
1423 hr = IFilterGraph2_ConnectDirect(
graph, &testsource.
source.pin.IPin_iface,
sink, &req_mt);
1428 req_mt.majortype = MEDIATYPE_Video;
1429 hr = IFilterGraph2_ConnectDirect(
graph, &testsource.
source.pin.IPin_iface,
sink, &req_mt);
1431 req_mt.majortype = MEDIATYPE_Stream;
1433 req_mt.subtype = MEDIASUBTYPE_RGB8;
1434 hr = IFilterGraph2_ConnectDirect(
graph, &testsource.
source.pin.IPin_iface,
sink, &req_mt);
1436 req_mt.subtype = MEDIASUBTYPE_MPEG1Audio;
1438 hr = IFilterGraph2_ConnectDirect(
graph, &testsource.
source.pin.IPin_iface,
sink, &req_mt);
1441 hr = IPin_ConnectedTo(
sink, &peer);
1443 ok(peer == &testsource.
source.pin.IPin_iface,
"Got peer %p.\n", peer);
1446 hr = IPin_ConnectionMediaType(
sink, &
mt);
1462 peer = (
IPin *)0xdeadbeef;
1463 hr = IPin_ConnectedTo(
source, &peer);
1465 ok(!peer,
"Got peer %p.\n", peer);
1472 IPin_EnumMediaTypes(
source, &enummt);
1474 IEnumMediaTypes_Release(enummt);
1487 hr = IPin_ConnectedTo(
source, &peer);
1489 ok(peer == &
testsink.sink.
pin.IPin_iface,
"Got peer %p.\n", peer);
1511 req_mt.lSampleSize = 999;
1512 req_mt.bTemporalCompression = req_mt.bFixedSizeSamples =
TRUE;
1519 req_mt.majortype = MEDIATYPE_Stream;
1522 req_mt.majortype = MEDIATYPE_Audio;
1524 req_mt.subtype = MEDIASUBTYPE_PCM;
1530 req_mt.subtype = MEDIASUBTYPE_MPEG1AudioPayload;
1548 req_mt.subtype = MEDIASUBTYPE_PCM;
1559 req_mt.formattype = FORMAT_None;
1563 req_mt.majortype = MEDIATYPE_Audio;
1564 req_mt.subtype = MEDIASUBTYPE_MPEG1AudioPayload;
1573 req_mt.subtype = MEDIASUBTYPE_PCM;
1584 req_mt.majortype = MEDIATYPE_Stream;
1594 req_mt.majortype = MEDIATYPE_Audio;
1595 req_mt.subtype = MEDIASUBTYPE_MPEG1AudioPayload;
1596 req_mt.formattype = FORMAT_WaveFormatEx;
1597 req_mt.lSampleSize = 444;
1607 ok(testsource.
source.pin.peer ==
sink,
"Got peer %p.\n", testsource.
source.pin.peer);
1608 IFilterGraph2_Disconnect(
graph, &testsource.
source.pin.IPin_iface);
1614 IAsyncReader_Release(testsource.
reader);
1616 IMediaControl_Release(
control);
1617 ref = IFilterGraph2_Release(
graph);
1618 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1620 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1622 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1623 ref = IBaseFilter_Release(&testsource.
filter.IBaseFilter_iface);
1624 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1626 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1654 {&TIME_FORMAT_MEDIA_TIME,
S_OK},
1656 {&TIME_FORMAT_SAMPLE,
S_FALSE},
1659 {&TIME_FORMAT_FRAME,
S_FALSE},
1660 {&TIME_FORMAT_FIELD,
S_FALSE},
1664 IBaseFilter_FindPin(
filter,
L"Audio", &pin);
1665 IPin_QueryInterface(pin, &IID_IMediaSeeking, (
void **)&seeking);
1667 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
1674 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
1679 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
1684 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
1686 ok(!caps,
"Got caps %#lx.\n", caps);
1689 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
1691 ok(!caps,
"Got caps %#lx.\n", caps);
1695 hr = IMediaSeeking_IsFormatSupported(seeking, format_tests[
i].
guid);
1696 ok(
hr == format_tests[
i].
hr,
"Got hr %#lx for format %s.\n",
1700 hr = IMediaSeeking_QueryPreferredFormat(seeking, &
format);
1704 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
1708 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
1710 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_SAMPLE);
1713 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_FRAME);
1715 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
1719 hr = IMediaSeeking_GetDuration(seeking, &duration);
1721 ok(duration >= 5000000 && duration <= 5500000,
"Got duration %I64d.\n", duration);
1724 hr = IMediaSeeking_GetStopPosition(seeking, &stop);
1726 ok(stop == duration,
"Expected time %s, got %s.\n",
1728 hr = IMediaSeeking_GetCurrentPosition(seeking, &
current);
1732 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
1735 ok(stop == duration,
"Expected time %s, got %s.\n",
1739 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_MEDIA_TIME, 0x123456789a,
NULL);
1743 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time,
NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
1747 earliest = latest = 0xdeadbeef;
1748 hr = IMediaSeeking_GetAvailable(seeking, &earliest, &latest);
1751 ok(latest == duration,
"Expected time %s, got %s.\n",
1755 hr = IMediaSeeking_GetRate(seeking, &
rate);
1759 hr = IMediaSeeking_SetRate(seeking, 200.0);
1762 hr = IMediaSeeking_GetRate(seeking, &
rate);
1766 hr = IMediaSeeking_SetRate(seeking, -1.0);
1769 hr = IMediaSeeking_GetPreroll(seeking, &
time);
1781 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
1808 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
1813 IMediaSeeking_Release(seeking);
1815 IFilterGraph2_Release(
graph);
1817 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1838 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
1840 IPin_QueryInterface(
source, &IID_IMediaSeeking, (
void **)&seeking);
1852 ok(
testsink.sample_count,
"Expected at least one sample.\n");
1861 ok(
testsink.sample_count,
"Expected at least one sample.\n");
1864 testsink.segment_start = 100 * 10000;
1865 testsink.segment_end_min = 300 * 10000;
1866 testsink.segment_end_max = 300 * 10000;
1873 ok(
testsink.sample_count,
"Expected at least one sample.\n");
1876 hr = IMediaSeeking_GetPositions(seeking, &
start, &
end);
1888 ok(
testsink.sample_count,
"Expected at least one sample.\n");
1891 hr = IMediaSeeking_GetPositions(seeking, &
start, &
end);
1896 IMediaSeeking_Release(seeking);
1898 IMediaControl_Release(
control);
1899 ref = IFilterGraph2_Release(
graph);
1900 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1902 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1904 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1911 static const BYTE frame[96] = {0xff, 0xfb, 0x14, 0xc4};
1930 for (
i = 0;
i < 1000; ++
i)
1933 for (
i = 0;
i < 100; ++
i)
1940 IPin_QueryInterface(
source, &IID_IMediaSeeking, (
void **)&seeking);
1942 duration = 0xdeadbeef;
1943 hr = IMediaSeeking_GetDuration(seeking, &duration);
1945 ok(duration == 2400 * 10000000ull,
"Got duration %I64d.\n", duration);
1947 IMediaSeeking_Release(seeking);
1949 ref = IFilterGraph2_Release(
graph);
1950 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1952 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
1975 IBaseFilter_FindPin(
filter,
L"Video", &pin_video);
1976 IBaseFilter_FindPin(
filter,
L"Audio", &pin_audio);
1977 IPin_QueryInterface(pin_video, &
IID_IUnknown, (
void **)&unk_video);
1978 IPin_QueryInterface(pin_audio, &
IID_IUnknown, (
void **)&unk_audio);
1980 hr = IAMStreamSelect_Count(sel, &stream_count);
1982 ok(stream_count == 2,
"Got %lu streams.\n", stream_count);
1986 IPin_ConnectionMediaType(pin_video, &mt_pin);
1993 todo_wine ok(
object == unk_video,
"Got object %p, expected %p.\n",
object, unk_video);
1994 ok(unk ==
NULL,
"Got unknown %p.\n", unk);
1999 IUnknown_Release(
object);
2003 IPin_ConnectionMediaType(pin_audio, &mt_pin);
2010 todo_wine ok(
object == unk_audio,
"Got object %p, expected %p.\n",
object, unk_audio);
2011 ok(unk ==
NULL,
"Got unknown %p.\n", unk);
2016 IUnknown_Release(
object);
2021 IBaseFilter_Release(
filter);
2022 IUnknown_Release(pin_video);
2023 IUnknown_Release(pin_audio);
2024 IUnknown_Release(unk_video);
2025 IUnknown_Release(unk_audio);
2044 IBaseFilter_QueryInterface(
filter, &IID_IAMStreamSelect, (
void **)&sel);
2045 hr = IAMStreamSelect_Count(sel, &stream_count);
2047 ok(stream_count == 0,
"Got %lu streams.\n", stream_count);
2050 hr = IBaseFilter_FindPin(
filter,
L"Video", &source_video);
2051 ok(source_video !=
NULL,
"No video pin, hr %#lx.\n",
hr);
2052 hr = IBaseFilter_FindPin(
filter,
L"Audio", &source_audio);
2053 ok(source_audio !=
NULL,
"No audio pin, hr %#lx.\n",
hr);
2062 hr = IFilterGraph2_AddFilter(
graph, &testsink_video.
filter.IBaseFilter_iface,
L"sink_video");
2064 hr = IFilterGraph2_AddFilter(
graph, &testsink_audio.
filter.IBaseFilter_iface,
L"sink_audio");
2067 hr = IFilterGraph2_ConnectDirect(
graph, source_video, &testsink_video.
sink.pin.IPin_iface,
NULL);
2069 hr = IFilterGraph2_ConnectDirect(
graph, source_audio, &testsink_audio.
sink.pin.IPin_iface,
NULL);
2074 ok(
IsEqualGUID(&testsink_video.
sink.pin.mt.majortype, &MEDIATYPE_Video),
"Media types didn't match.\n");
2075 ok(
IsEqualGUID(&testsink_video.
sink.pin.mt.subtype, &MEDIASUBTYPE_MPEG1Payload),
"Media types didn't match.\n");
2076 ok(
IsEqualGUID(&testsink_video.
sink.pin.mt.formattype, &FORMAT_MPEGVideo),
"Media types didn't match.\n");
2078 ok(
IsEqualGUID(&testsink_audio.
sink.pin.mt.majortype, &MEDIATYPE_Audio),
"Media types didn't match.\n");
2079 ok(
IsEqualGUID(&testsink_audio.
sink.pin.mt.subtype, &MEDIASUBTYPE_MPEG1AudioPayload),
"Media types didn't match.\n");
2080 ok(
IsEqualGUID(&testsink_audio.
sink.pin.mt.formattype, &FORMAT_WaveFormatEx),
"Media types didn't match.\n");
2084 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
2099 IAMStreamSelect_Release(sel);
2100 IPin_Release(source_video);
2101 IPin_Release(source_audio);
2102 IMediaControl_Release(
control);
2103 ref = IFilterGraph2_Release(
graph);
2104 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2106 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2124 hr = IBaseFilter_QueryInterface(
reader, &IID_IFileSourceFilter, (
void **)&filesource);
2130 &IID_IFilterGraph2, (
void **)&
graph);
2134 hr = IFilterGraph2_AddFilter(
graph, splitter,
NULL);
2137 hr = IBaseFilter_FindPin(splitter,
L"Input", &
sink);
2147 IBaseFilter_Release(
reader);
2148 IBaseFilter_Release(splitter);
2149 IFileSourceFilter_Release(filesource);
2150 IFilterGraph2_Release(
graph);
2167 &IID_IFilterGraph2, (
void **)&
graph);
2169 IFilterGraph2_AddFilter(
graph, &testsource.
filter.IBaseFilter_iface,
L"source");
2176 IBaseFilter_QueryInterface(
reader, &IID_IFileSourceFilter, (
void **)&filesource);
2178 IFileSourceFilter_Release(filesource);
2188 IAsyncReader_Release(testsource.
reader);
2190 IFilterGraph2_Release(
graph);
2191 IBaseFilter_Release(
reader);
2192 IBaseFilter_Release(
filter);
2193 IBaseFilter_Release(&testsource.
filter.IBaseFilter_iface);
2207 skip(
"Failed to create MPEG-1 splitter.\n");
2210 IBaseFilter_Release(
filter);
#define InterlockedIncrement
#define InterlockedDecrement
@ AM_SEEKING_CanGetDuration
@ AM_SEEKING_CanGetCurrentPos
@ AM_SEEKING_CanSeekBackwards
@ AM_SEEKING_CanSeekForwards
@ AM_SEEKING_CanSeekAbsolute
@ AM_SEEKING_CanGetStopPos
@ AM_SEEKING_NoPositioning
@ AM_SEEKING_AbsolutePositioning
@ AMSTREAMSELECTINFO_ENABLED
enum _PinDirection PIN_DIRECTION
const GUID IID_IKsPropertySet
const GUID IID_IBaseFilter
const GUID IID_IAsyncReader
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 available[MAX_STRING_RESOURCE_LEN]
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)
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)
int CDECL fclose(FILE *file)
FILE *CDECL _wfopen(const wchar_t *path, const wchar_t *mode)
size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE *file)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
GLuint GLuint GLsizei count
GLboolean GLboolean GLboolean b
GLuint GLsizei GLsizei * length
GLsizei GLenum GLboolean sink
GLboolean GLboolean GLboolean GLboolean a
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 todo_wine_if(is_todo)
#define memcpy(s1, s2, n)
#define MPEGLAYER3_FLAG_PADDING_OFF
#define MPEGLAYER3_FLAG_PADDING_ISO
#define ACM_MPEG_PROTECTIONBIT
#define MPEGLAYER3_ID_MPEG
#define WAVE_FORMAT_MPEGLAYER3
#define ACM_MPEG_SINGLECHANNEL
struct mpeglayer3waveformat_tag MPEGLAYER3WAVEFORMAT
struct mpeg1waveformat_tag MPEG1WAVEFORMAT
#define ACM_MPEG_ID_MPEG1
#define ACM_MPEG_ORIGINALHOME
struct task_struct * current
#define load_resource(a, b, c)
static const WCHAR pathW[]
static void test_video_file(void)
static void test_no_acceptable_type(void)
static IBaseFilter * create_mpeg_splitter(void)
static HRESULT WINAPI async_reader_WaitForNext(IAsyncReader *iface, DWORD timeout, IMediaSample **sample, DWORD_PTR *cookie)
static void test_video_read_position(void)
static HRESULT WINAPI async_reader_SyncRead(IAsyncReader *iface, LONGLONG position, LONG length, BYTE *buffer)
static BOOL compare_media_types(const AM_MEDIA_TYPE *a, const AM_MEDIA_TYPE *b)
static HRESULT testsink_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static void testfilter_destroy(struct strmbase_filter *iface)
static const IUnknownVtbl outer_vtbl
static HRESULT WINAPI async_reader_SyncReadAligned(IAsyncReader *iface, IMediaSample *sample)
static const struct strmbase_sink_ops testsink_ops
static const GUID MEDIASUBTYPE_mp3
static void test_aggregation(void)
static HRESULT testsink_connect(struct strmbase_sink *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
static ULONG WINAPI outer_AddRef(IUnknown *iface)
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
static HRESULT WINAPI async_reader_Length(IAsyncReader *iface, LONGLONG *total, LONGLONG *available)
static struct testfilter * impl_from_strmbase_filter(struct strmbase_filter *iface)
static ULONG get_refcount(void *iface)
static const struct IAsyncReaderVtbl async_reader_vtbl
static HRESULT WINAPI async_reader_BeginFlush(IAsyncReader *iface)
static void test_large_file(void)
static void test_pin_info(void)
static HRESULT WINAPI async_reader_EndFlush(IAsyncReader *iface)
static HRESULT testsource_query_interface(struct strmbase_pin *iface, REFIID iid, void **out)
static IUnknown test_outer
static HRESULT WINAPI async_reader_RequestAllocator(IAsyncReader *iface, IMemAllocator *preferred, ALLOCATOR_PROPERTIES *props, IMemAllocator **allocator)
static void test_find_pin(void)
static IFilterGraph2 * connect_input(IBaseFilter *splitter, const WCHAR *filename)
static HRESULT testsink_new_segment(struct strmbase_sink *iface, REFERENCE_TIME start, REFERENCE_TIME end, double rate)
static ULONG WINAPI async_reader_Release(IAsyncReader *iface)
static HRESULT testsink_eos(struct strmbase_sink *iface)
static const struct strmbase_source_ops testsource_ops
static void test_enum_media_types(void)
static HRESULT WINAPI async_reader_Request(IAsyncReader *iface, IMediaSample *sample, DWORD_PTR cookie)
static void test_interfaces(void)
static void test_connect_pin(void)
static void test_media_types(void)
static HRESULT WINAPI testsource_AttemptConnection(struct strmbase_source *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static struct strmbase_pin * testfilter_get_pin(struct strmbase_filter *iface, unsigned int index)
static void test_enum_pins(void)
static HRESULT testfilter_init_stream(struct strmbase_filter *iface)
static HRESULT WINAPI testsink_Receive(struct strmbase_sink *iface, IMediaSample *sample)
static ULONG WINAPI async_reader_AddRef(IAsyncReader *iface)
static void test_seeking(void)
static void test_streamselect(IAMStreamSelect *sel)
static HRESULT WINAPI async_reader_QueryInterface(IAsyncReader *iface, REFIID iid, void **out)
static const GUID testguid
static void test_streaming(void)
#define check_interface(a, b, c)
static const struct strmbase_filter_ops testfilter_ops
static void test_unconnected_filter_state(void)
static const GUID test_iid
static struct testfilter * impl_from_IAsyncReader(IAsyncReader *iface)
static HRESULT testsink_get_media_type(struct strmbase_pin *iface, unsigned int index, AM_MEDIA_TYPE *mt)
static void testfilter_init(struct testfilter *filter)
static ULONG WINAPI outer_Release(IUnknown *iface)
const GUID IID_IPersistPropertyBag
#define IsEqualGUID(rguid1, rguid2)
#define offsetof(TYPE, MEMBER)
static __inline const char * wine_dbgstr_guid(const GUID *id)
HRESULT WINAPI CopyMediaType(AM_MEDIA_TYPE *pDest, const AM_MEDIA_TYPE *pSrc)
void WINAPI FreeMediaType(AM_MEDIA_TYPE *pMediaType)
void strmbase_source_init(struct strmbase_source *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_source_ops *func_table)
void strmbase_sink_cleanup(struct strmbase_sink *pin)
void strmbase_sink_init(struct strmbase_sink *pin, struct strmbase_filter *filter, const WCHAR *name, const struct strmbase_sink_ops *ops, IMemAllocator *allocator)
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)
void WINAPI DeleteMediaType(AM_MEDIA_TYPE *pMediaType)
struct strmbase_filter * filter
IAsyncReader IAsyncReader_iface
struct strmbase_sink sink
REFERENCE_TIME seek_start
REFERENCE_TIME segment_start
REFERENCE_TIME segment_end_max
unsigned int new_segment_count
struct strmbase_source source
REFERENCE_TIME segment_end_min
struct strmbase_filter filter
unsigned int sample_count
struct strmbase_filter filter
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, 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)
#define CONTAINING_RECORD(address, type, field)
#define VFW_E_SAMPLE_TIME_NOT_SET
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_NOT_STOPPED
#define VFW_E_NO_ACCEPTABLE_TYPES
#define VFW_S_NO_MORE_ITEMS
#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)
DWORD WINAPI GetCurrentThreadId(void)