34 return diff <= max_diff;
79 return IUnknown_Release(
unknown);
82#define check_interface(a, b, c) check_interface_(__LINE__, a, b, c)
91 hr = IUnknown_QueryInterface(iface, iid, (
void **)&unk);
94 IUnknown_Release(unk);
127 IFilterGraph2_Release(
graph);
133 LONG video_width, video_height, window_width;
137 hr = IFilterGraph2_QueryInterface(
graph, &IID_IBasicVideo, (
void **)&pbv);
141 hr = IBasicVideo_GetVideoSize(pbv,
NULL,
NULL);
143 hr = IBasicVideo_GetVideoSize(pbv, &video_width,
NULL);
145 hr = IBasicVideo_GetVideoSize(pbv,
NULL, &video_height);
147 hr = IBasicVideo_GetVideoSize(pbv, &video_width, &video_height);
160 ok(
top == 0,
"Got top %ld.\n",
top);
161 ok(
width == video_width,
"Expected width %ld, got %ld.\n", video_width,
width);
162 ok(
height == video_height,
"Expected height %ld, got %ld.\n", video_height,
height);
164 hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, 0, 0);
166 hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, video_width*2, video_height*2);
168 hr = IBasicVideo_put_SourceTop(pbv, -1);
170 hr = IBasicVideo_put_SourceTop(pbv, 0);
172 hr = IBasicVideo_put_SourceTop(pbv, 1);
175 hr = IBasicVideo_SetSourcePosition(pbv, video_width, 0, video_width, video_height);
177 hr = IBasicVideo_SetSourcePosition(pbv, 0, video_height, video_width, video_height);
179 hr = IBasicVideo_SetSourcePosition(pbv, -1, 0, video_width, video_height);
181 hr = IBasicVideo_SetSourcePosition(pbv, 0, -1, video_width, video_height);
183 hr = IBasicVideo_SetSourcePosition(pbv, video_width/2, video_height/2, video_width, video_height);
185 hr = IBasicVideo_SetSourcePosition(pbv, video_width/2, video_height/2, video_width, video_height);
188 hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, video_width, video_height+1);
190 hr = IBasicVideo_SetSourcePosition(pbv, 0, 0, video_width+1, video_height);
193 hr = IBasicVideo_SetSourcePosition(pbv, video_width/2, video_height/2, video_width/3+1, video_height/3+1);
196 hr = IBasicVideo_get_SourceLeft(pbv, &
left);
198 ok(
left == video_width / 2,
"Expected left %ld, got %ld.\n", video_width / 2,
left);
199 hr = IBasicVideo_get_SourceTop(pbv, &
top);
201 ok(
top == video_height / 2,
"Expected top %ld, got %ld.\n", video_height / 2,
top);
202 hr = IBasicVideo_get_SourceWidth(pbv, &
width);
204 ok(
width == video_width / 3 + 1,
"Expected width %ld, got %ld.\n", video_width / 3 + 1,
width);
205 hr = IBasicVideo_get_SourceHeight(pbv, &
height);
207 ok(
height == video_height / 3 + 1,
"Expected height %ld, got %ld.\n", video_height / 3 + 1,
height);
209 hr = IBasicVideo_put_SourceLeft(pbv, video_width/3);
213 ok(
left == video_width / 3,
"Expected left %ld, got %ld.\n", video_width / 3,
left);
214 ok(
width == video_width / 3 + 1,
"Expected width %ld, got %ld.\n", video_width / 3 + 1,
width);
216 hr = IBasicVideo_put_SourceTop(pbv, video_height/3);
220 ok(
top == video_height / 3,
"Expected top %ld, got %ld.\n", video_height / 3,
top);
221 ok(
height == video_height / 3 + 1,
"Expected height %ld, got %ld.\n", video_height / 3 + 1,
height);
223 hr = IBasicVideo_put_SourceWidth(pbv, video_width/4+1);
227 ok(
left == video_width / 3,
"Expected left %ld, got %ld.\n", video_width / 3,
left);
228 ok(
width == video_width / 4 + 1,
"Expected width %ld, got %ld.\n", video_width / 4 + 1,
width);
230 hr = IBasicVideo_put_SourceHeight(pbv, video_height/4+1);
234 ok(
top == video_height / 3,
"Expected top %ld, got %ld.\n", video_height / 3,
top);
235 ok(
height == video_height / 4 + 1,
"Expected height %ld, got %ld.\n", video_height / 4 + 1,
height);
249 ok(
top == 0,
"Got top %ld.\n",
top);
250 ok(
width == window_width,
"Expected width %ld, got %ld.\n", window_width,
width);
251 ok(
height == video_height,
"Expected height %ld, got %ld.\n", video_height,
height);
253 hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, 0, 0);
255 hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, video_width*2, video_height*2);
258 hr = IBasicVideo_put_DestinationLeft(pbv, -1);
260 hr = IBasicVideo_put_DestinationLeft(pbv, 0);
262 hr = IBasicVideo_put_DestinationLeft(pbv, 1);
265 hr = IBasicVideo_SetDestinationPosition(pbv, video_width, 0, video_width, video_height);
267 hr = IBasicVideo_SetDestinationPosition(pbv, 0, video_height, video_width, video_height);
269 hr = IBasicVideo_SetDestinationPosition(pbv, -1, 0, video_width, video_height);
271 hr = IBasicVideo_SetDestinationPosition(pbv, 0, -1, video_width, video_height);
273 hr = IBasicVideo_SetDestinationPosition(pbv, video_width/2, video_height/2, video_width, video_height);
275 hr = IBasicVideo_SetDestinationPosition(pbv, video_width/2, video_height/2, video_width, video_height);
278 hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, video_width, video_height+1);
280 hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, video_width+1, video_height);
283 hr = IBasicVideo_SetDestinationPosition(pbv, video_width/2, video_height/2, video_width/3+1, video_height/3+1);
286 hr = IBasicVideo_get_DestinationLeft(pbv, &
left);
288 ok(
left == video_width / 2,
"Expected left %ld, got %ld.\n", video_width / 2,
left);
289 hr = IBasicVideo_get_DestinationTop(pbv, &
top);
291 ok(
top == video_height / 2,
"Expected top %ld, got %ld.\n", video_height / 2,
top);
292 hr = IBasicVideo_get_DestinationWidth(pbv, &
width);
294 ok(
width == video_width / 3 + 1,
"Expected width %ld, got %ld.\n", video_width / 3 + 1,
width);
295 hr = IBasicVideo_get_DestinationHeight(pbv, &
height);
297 ok(
height == video_height / 3 + 1,
"Expected height %ld, got %ld.\n", video_height / 3 + 1,
height);
299 hr = IBasicVideo_put_DestinationLeft(pbv, video_width/3);
303 ok(
left == video_width / 3,
"Expected left %ld, got %ld.\n", video_width / 3,
left);
304 ok(
width == video_width / 3 + 1,
"Expected width %ld, got %ld.\n", video_width / 3 + 1,
width);
306 hr = IBasicVideo_put_DestinationTop(pbv, video_height/3);
310 ok(
top == video_height / 3,
"Expected top %ld, got %ld.\n", video_height / 3,
top);
311 ok(
height == video_height / 3 + 1,
"Expected height %ld, got %ld.\n", video_height / 3 + 1,
height);
313 hr = IBasicVideo_put_DestinationWidth(pbv, video_width/4+1);
317 ok(
left == video_width / 3,
"Expected left %ld, got %ld.\n", video_width / 3,
left);
318 ok(
width == video_width / 4 + 1,
"Expected width %ld, got %ld.\n", video_width / 4 + 1,
width);
320 hr = IBasicVideo_put_DestinationHeight(pbv, video_height/4+1);
324 ok(
top == video_height / 3,
"Expected top %ld, got %ld.\n", video_height / 3,
top);
325 ok(
height == video_height / 4 + 1,
"Expected height %ld, got %ld.\n", video_height / 4 + 1,
height);
328 hr = IBasicVideo_SetDefaultSourcePosition(pbv);
332 hr = IBasicVideo_SetDestinationPosition(pbv, 0, 0, video_width, video_height);
335 IBasicVideo_Release(pbv);
346 IFilterGraph2_SetDefaultSyncSource(
graph);
347 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaSeeking, (
void **)&seeking);
350 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
354 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
359 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
pos,
NULL, 0x123456789a,
NULL);
364 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
pos, &TIME_FORMAT_MEDIA_TIME, 0x123456789a,
NULL);
369 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
pos,
NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
373 hr = IMediaSeeking_GetCurrentPosition(seeking, &
pos);
377 hr = IMediaSeeking_GetDuration(seeking, &duration);
381 hr = IMediaSeeking_GetStopPosition(seeking, &stop);
383 ok(stop == duration || stop == duration + 1,
"expected %s, got %s\n",
397 hr = IMediaSeeking_GetCurrentPosition(seeking, &
pos);
400 IFilterGraph2_SetDefaultSyncSource(
graph);
402 IMediaSeeking_Release(seeking);
403 IMediaFilter_Release(
filter);
412 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
456 IMediaControl_Release(
control);
473 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
476 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
482 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaSeeking, (
void **)&seeking);
488 ok(
hr ==
S_OK,
"GetState() timed out\n");
490 hr = IMediaSeeking_GetDuration(seeking, &stop);
525 ok(got_eos,
"didn't get EOS\n");
527 hr = IMediaSeeking_GetCurrentPosition(seeking, &
current);
535 ok(
hr ==
S_OK,
"GetState() timed out\n");
537 hr = IFilterGraph2_SetDefaultSyncSource(
graph);
540 IMediaSeeking_Release(seeking);
542 IMediaControl_Release(
control);
543 IMediaFilter_Release(
filter);
558 IPin *pin_in, *pin_out;
575 IBaseFilter_EnumPins(renderer, &enumpins);
576 IEnumPins_Next(enumpins, 1, &pin_in,
NULL);
577 IEnumPins_Release(enumpins);
582 hr = IFilterGraph2_AddFilter(
graph, renderer,
NULL);
585 hr = IBaseFilter_FindPin(source_filter,
L"Output", &pin_out);
587 hr = IFilterGraph2_Connect(
graph, pin_out, pin_in);
592 IPin_Release(pin_in);
593 IPin_Release(pin_out);
594 IBaseFilter_Release(source_filter);
595 IBaseFilter_Release(renderer);
596 IFilterGraph2_Release(
graph);
627 ok(!
refs,
"Got outsanding refcount %ld.\n",
refs);
641 ok(!
refs,
"Got outsanding refcount %ld.\n",
refs);
671 hr = IFilterGraph2_EnumFilters(
graph, &enum1);
674 hr = IEnumFilters_Next(enum1, 1, filters,
NULL);
677 hr = IEnumFilters_Skip(enum1, 0);
680 hr = IEnumFilters_Skip(enum1, 1);
683 IFilterGraph2_AddFilter(
graph, filter1,
NULL);
684 IFilterGraph2_AddFilter(
graph, filter2,
NULL);
686 hr = IEnumFilters_Next(enum1, 1, filters,
NULL);
689 hr = IEnumFilters_Skip(enum1, 1);
692 hr = IEnumFilters_Reset(enum1);
695 hr = IEnumFilters_Skip(enum1, 0);
698 hr = IEnumFilters_Skip(enum1, 1);
701 hr = IEnumFilters_Skip(enum1, 2);
704 hr = IEnumFilters_Skip(enum1, 1);
707 hr = IEnumFilters_Reset(enum1);
710 hr = IEnumFilters_Skip(enum1, 2);
713 hr = IEnumFilters_Skip(enum1, 1);
716 hr = IEnumFilters_Reset(enum1);
719 hr = IEnumFilters_Next(enum1, 1, filters,
NULL);
721 ok(filters[0] == filter2,
"Got filter %p.\n", filters[0]);
722 IBaseFilter_Release(filters[0]);
724 hr = IEnumFilters_Next(enum1, 1, filters, &
count);
727 ok(filters[0] == filter1,
"Got filter %p.\n", filters[0]);
728 IBaseFilter_Release(filters[0]);
730 hr = IEnumFilters_Next(enum1, 1, filters, &
count);
734 hr = IEnumFilters_Reset(enum1);
737 hr = IEnumFilters_Next(enum1, 2, filters, &
count);
740 ok(filters[0] == filter2,
"Got filter %p.\n", filters[0]);
741 ok(filters[1] == filter1,
"Got filter %p.\n", filters[1]);
742 IBaseFilter_Release(filters[0]);
743 IBaseFilter_Release(filters[1]);
745 IFilterGraph2_RemoveFilter(
graph, filter1);
746 IFilterGraph2_AddFilter(
graph, filter1,
NULL);
748 hr = IEnumFilters_Next(enum1, 2, filters, &
count);
751 hr = IEnumFilters_Reset(enum1);
754 hr = IEnumFilters_Next(enum1, 2, filters, &
count);
757 ok(filters[0] == filter1,
"Got filter %p.\n", filters[0]);
758 ok(filters[1] == filter2,
"Got filter %p.\n", filters[1]);
759 IBaseFilter_Release(filters[0]);
760 IBaseFilter_Release(filters[1]);
762 hr = IEnumFilters_Reset(enum1);
765 hr = IEnumFilters_Clone(enum1, &enum2);
768 hr = IEnumFilters_Skip(enum2, 1);
771 hr = IEnumFilters_Next(enum2, 2, filters, &
count);
774 ok(filters[0] == filter2,
"Got filter %p.\n", filters[0]);
775 IBaseFilter_Release(filters[0]);
777 hr = IEnumFilters_Skip(enum1, 3);
780 IEnumFilters_Release(enum2);
781 IEnumFilters_Release(enum1);
783 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
812 IFilterGraph2_Release(
graph);
929 ok(0,
"Unexpected call.\n");
942 ok(0,
"Unexpected call.\n");
981 IMemInputPin_AddRef(*
out);
1012 IPin_Release(pin->
peer);
1033 ok(0,
"Unexpected call.\n");
1042 info->pFilter = &pin->
filter->IBaseFilter_iface;
1043 IBaseFilter_AddRef(
info->pFilter);
1070 ok(0,
"Unexpected call.\n");
1083 IEnumMediaTypes_AddRef(*
out);
1099 ok(0,
"Unexpected call.\n");
1105 ok(0,
"Unexpected call.\n");
1111 ok(0,
"Unexpected call.\n");
1117 ok(0,
"Unexpected call.\n");
1123 ok(0,
"Unexpected call.\n");
1129 ok(0,
"Unexpected call.\n");
1135 ok(0,
"Unexpected call.\n");
1179 memset(pin, 0,
sizeof(*pin));
1208 ok(!
mt,
"Got media type %p.\n",
mt);
1282 IPin_AddRef(
out[
i]);
1294 ok(0,
"Unexpected call.\n");
1307 ok(0,
"Unexpected call.\n");
1339 else if (
IsEqualGUID(iid, &IID_IAMFilterMiscFlags) &&
filter->IAMFilterMiscFlags_iface.lpVtbl)
1341 *
out = &
filter->IAMFilterMiscFlags_iface;
1347 else if (
IsEqualGUID(iid, &IID_IMediaPosition) &&
filter->IMediaPosition_iface.lpVtbl)
1351 else if (
IsEqualGUID(iid, &IID_IReferenceClock) &&
filter->IReferenceClock_iface.lpVtbl)
1355 else if (
IsEqualGUID(iid, &IID_IFileSourceFilter) &&
filter->IFileSourceFilter_iface.lpVtbl)
1357 *
out = &
filter->IFileSourceFilter_iface;
1402 IBaseFilter_GetState(
info.pFilter, 0, &
state);
1404 ok(
state ==
expect,
"Expected state %d for downstream filter %p, got %d.\n",
1409 IBaseFilter_Release(
info.pFilter);
1461 return filter->GetState_hr;
1472 IReferenceClock_AddRef(
clock);
1479 ok(0,
"Unexpected call.\n");
1489 IEnumPins_AddRef(*
out);
1504 *pin = &
filter->pins[
i].IPin_iface;
1523 info->achName[0] = 0;
1570 return IBaseFilter_QueryInterface(&
filter->IBaseFilter_iface, iid,
out);
1589 return filter->misc_flags;
1608 return IBaseFilter_QueryInterface(&
filter->IBaseFilter_iface, iid,
out);
1629 *caps =
filter->seek_caps;
1635 ok(0,
"Unexpected call.\n");
1683 *duration =
filter->seek_duration;
1691 *stop =
filter->seek_stop;
1699 ok(!
filter->
clock,
"GetCurrentPosition() should only be called if there is no sync source.\n");
1707 ok(0,
"Unexpected call.\n");
1717 ok(
filter->
state != State_Running,
"Filter should be paused or stopped while seeking.\n");
1719 filter->seek_stop = *stop;
1727 ok(0,
"Unexpected call.\n");
1733 ok(0,
"Unexpected call.\n");
1747 ok(0,
"Unexpected call.\n");
1789 return IBaseFilter_QueryInterface(&
filter->IBaseFilter_iface, iid,
out);
1795 return IBaseFilter_AddRef(&
filter->IBaseFilter_iface);
1801 return IBaseFilter_Release(&
filter->IBaseFilter_iface);
1806 ok(0,
"Unexpected call.\n");
1812 ok(0,
"Unexpected call.\n");
1818 ok(0,
"Unexpected call.\n");
1824 ok(0,
"Unexpected call.\n");
1842 ok(0,
"Unexpected call.\n");
1854 ok(0,
"Unexpected call.\n");
1866 ok(0,
"Unexpected call.\n");
1872 ok(0,
"Unexpected call.\n");
1884 ok(0,
"Unexpected call.\n");
1890 ok(0,
"Unexpected call.\n");
1924 return IBaseFilter_QueryInterface(&
filter->IBaseFilter_iface, iid,
out);
1941 ok(0,
"Unexpected call.\n");
1948 ok(0,
"Unexpected call.\n");
1955 ok(0,
"Unexpected call.\n");
1961 ok(0,
"Unexpected call.\n");
1984 return IBaseFilter_QueryInterface(&
filter->IBaseFilter_iface, iid,
out);
2009 ok(0,
"Unexpected call.\n");
2042 filter->expect_stop_prev =
filter->expect_run_prev = State_Paused;
2044 filter->time_format = TIME_FORMAT_MEDIA_TIME;
2073 return IBaseFilter_QueryInterface(&
factory->filter->IBaseFilter_iface, iid,
out);
2092 static const GUID sink1_clsid = {0x12345678};
2093 static const GUID sink2_clsid = {0x87654321};
2095 struct testpin source_pin, sink1_pin, sink2_pin, parser_pins[2];
2105 DWORD cookie1, cookie2;
2109 memset(&source_type.majortype, 0xcc,
sizeof(
GUID));
2127 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2147 ok(parser_pins[1].peer == &sink1_pin.
IPin_iface,
"Got peer %p.\n", parser_pins[1].
peer);
2148 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2150 IFilterGraph2_Disconnect(
graph, parser_pins[0].peer);
2151 IFilterGraph2_Disconnect(
graph, &parser_pins[0].IPin_iface);
2159 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2165 IFilterGraph2_RemoveFilter(
graph, &
parser.IBaseFilter_iface);
2168 parser_pins[1].
name[0] =
'~';
2172 ok(!parser_pins[1].peer,
"Got peer %p.\n", parser_pins[1].peer);
2173 ok(!sink1_pin.
peer,
"Got peer %p.\n", sink1_pin.
peer);
2174 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2177 parser_pins[1].
name[0] = 0;
2178 parser_pins[1].
id[0] =
'~';
2182 ok(parser_pins[1].peer == &sink1_pin.
IPin_iface,
"Got peer %p.\n", parser_pins[1].
peer);
2183 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2186 ref = IFilterGraph2_Release(
graph);
2187 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2197 &IID_IFilterMapper2, (
void **)&mapper);
2200 regfilter.
dwMerit = MERIT_UNLIKELY;
2207 regtypes.clsMajorType = &source_type.majortype;
2209 hr = IFilterMapper2_RegisterFilter(mapper, &sink1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2212 skip(
"Not enough permission to register filters.\n");
2221 IFilterMapper2_RegisterFilter(mapper, &sink2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2226 "Got peer %p.\n", source_pin.
peer);
2228 ref = IFilterGraph2_Release(
graph);
2229 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2241 ref = IFilterGraph2_Release(
graph);
2242 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2249 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink1_clsid);
2250 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink2_clsid);
2252 IFilterMapper2_RegisterFilter(mapper, &sink1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2254 IFilterMapper2_RegisterFilter(mapper, &sink2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2259 "Got peer %p.\n", source_pin.
peer);
2261 ref = IFilterGraph2_Release(
graph);
2262 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2269 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink1_clsid);
2270 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink2_clsid);
2272 regfilter.
dwMerit = MERIT_UNLIKELY;
2273 IFilterMapper2_RegisterFilter(mapper, &sink1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2274 regfilter.
dwMerit = MERIT_PREFERRED;
2275 IFilterMapper2_RegisterFilter(mapper, &sink2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2281 ref = IFilterGraph2_Release(
graph);
2282 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2287 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink1_clsid);
2288 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink2_clsid);
2290 regfilter.
dwMerit = MERIT_PREFERRED;
2291 IFilterMapper2_RegisterFilter(mapper, &sink1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2292 regfilter.
dwMerit = MERIT_UNLIKELY;
2293 IFilterMapper2_RegisterFilter(mapper, &sink2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2299 ref = IFilterGraph2_Release(
graph);
2300 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2316 ref = IFilterGraph2_Release(
graph);
2317 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2319 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink1_clsid);
2320 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &sink2_clsid);
2325 IFilterMapper2_Release(mapper);
2326 ok(
source.ref == 1,
"Got outstanding refcount %ld.\n",
source.ref);
2327 ok(source_pin.
ref == 1,
"Got outstanding refcount %ld.\n", source_pin.
ref);
2328 ok(sink1.
ref == 1,
"Got outstanding refcount %ld.\n", sink1.
ref);
2329 ok(sink1_pin.
ref == 1,
"Got outstanding refcount %ld.\n", sink1_pin.
ref);
2330 ok(sink2.
ref == 1,
"Got outstanding refcount %ld.\n", sink2.
ref);
2331 ok(sink2_pin.
ref == 1,
"Got outstanding refcount %ld.\n", sink2_pin.
ref);
2332 ok(
parser.ref == 1,
"Got outstanding refcount %ld.\n",
parser.ref);
2333 ok(parser_pins[0].
ref == 1,
"Got outstanding refcount %ld.\n", parser_pins[0].
ref);
2334 ok(parser_pins[1].
ref == 1,
"Got outstanding refcount %ld.\n", parser_pins[1].
ref);
2339 static const GUID parser1_clsid = {0x12345678};
2340 static const GUID parser2_clsid = {0x87654321};
2341 AM_MEDIA_TYPE source_types[2] = {{{0}}}, sink_type = {{0}}, parser3_type = {{0}};
2342 struct testpin source_pin, sink_pin, sink2_pin, parser1_pins[3], parser2_pins[2], parser3_pins[2];
2352 DWORD cookie1, cookie2;
2356 memset(&source_types[0].majortype, 0xcc,
sizeof(
GUID));
2357 memset(&source_types[1].majortype, 0xdd,
sizeof(
GUID));
2358 memset(&sink_type.majortype, 0x66,
sizeof(
GUID));
2386 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
2391 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2398 ok(
hr == source_pin.
Connect_hr,
"Got hr %#lx for Connect() hr %#lx.\n",
2401 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2409 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
2417 ok(
hr == source_pin.
Connect_hr,
"Got hr %#lx for Connect() hr %#lx.\n",
2422 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
2423 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
2433 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
2434 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
2448 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2456 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2458 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2468 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2470 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2482 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2484 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2493 ok(parser3_pins[1].peer == &parser1_pins[0].IPin_iface,
"Got peer %p.\n", parser3_pins[1].peer);
2495 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2497 IFilterGraph2_Disconnect(
graph, parser3_pins[0].peer);
2498 IFilterGraph2_Disconnect(
graph, &parser3_pins[0].IPin_iface);
2499 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2516 ok(!parser1_pins[2].peer,
"Got peer %p.\n", parser1_pins[2].peer);
2517 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2519 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2530 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2532 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2538 parser1_pins[1].
name[0] =
'~';
2541 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
2548 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2550 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2554 parser1_pins[1].
name[0] = 0;
2555 parser1_pins[1].
id[0] =
'~';
2560 IFilterGraph2_Disconnect(
graph, source_pin.
peer);
2562 IFilterGraph2_Disconnect(
graph, sink_pin.
peer);
2565 hr = IFilterGraph2_Connect(
graph, &parser1_pins[1].IPin_iface, &parser1_pins[0].IPin_iface);
2569 hr = IFilterGraph2_Connect(
graph, &parser1_pins[1].IPin_iface, &parser1_pins[0].IPin_iface);
2573 ref = IFilterGraph2_Release(
graph);
2574 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2579 IFilterGraph2_AddFilter(
graph, &
source.IBaseFilter_iface,
L"source");
2581 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
L"sink");
2587 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
2588 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
2600 ref = IFilterGraph2_Release(
graph);
2601 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2607 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
2615 &IID_IFilterMapper2, (
void **)&mapper);
2618 regfilter.
dwMerit = MERIT_UNLIKELY;
2629 regtypes.clsMajorType = &source_types[1].majortype;
2631 hr = IFilterMapper2_RegisterFilter(mapper, &parser1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2634 skip(
"Not enough permission to register filters.\n");
2639 IFilterMapper2_RegisterFilter(mapper, &parser2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2644 || source_pin.
peer == &parser2_pins[1].
IPin_iface,
"Got peer %p.\n", source_pin.
peer);
2648 ref = IFilterGraph2_Release(
graph);
2649 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2655 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
2663 ref = IFilterGraph2_Release(
graph);
2664 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2670 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
2672 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &parser1_clsid);
2673 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &parser2_clsid);
2675 regfilter.
dwMerit = MERIT_UNLIKELY;
2676 IFilterMapper2_RegisterFilter(mapper, &parser1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2677 regfilter.
dwMerit = MERIT_PREFERRED;
2678 IFilterMapper2_RegisterFilter(mapper, &parser2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2685 ref = IFilterGraph2_Release(
graph);
2686 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2690 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
2692 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &parser1_clsid);
2693 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &parser2_clsid);
2695 regfilter.
dwMerit = MERIT_PREFERRED;
2696 IFilterMapper2_RegisterFilter(mapper, &parser1_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2697 regfilter.
dwMerit = MERIT_UNLIKELY;
2698 IFilterMapper2_RegisterFilter(mapper, &parser2_clsid,
L"test",
NULL,
NULL,
NULL, ®filter);
2705 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &parser1_clsid);
2706 IFilterMapper2_UnregisterFilter(mapper,
NULL,
NULL, &parser2_clsid);
2711 IFilterMapper2_Release(mapper);
2712 ref = IFilterGraph2_Release(
graph);
2713 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
2714 ok(
source.ref == 1,
"Got outstanding refcount %ld.\n",
source.ref);
2715 ok(source_pin.
ref == 1,
"Got outstanding refcount %ld.\n", source_pin.
ref);
2716 ok(
sink.ref == 1,
"Got outstanding refcount %ld.\n",
sink.ref);
2717 ok(sink_pin.
ref == 1,
"Got outstanding refcount %ld.\n", sink_pin.
ref);
2718 ok(parser1.
ref == 1,
"Got outstanding refcount %ld.\n", parser1.
ref);
2719 ok(parser1_pins[0].
ref == 1,
"Got outstanding refcount %ld.\n", parser1_pins[0].
ref);
2720 ok(parser1_pins[1].
ref == 1,
"Got outstanding refcount %ld.\n", parser1_pins[1].
ref);
2721 ok(parser1_pins[2].
ref == 1,
"Got outstanding refcount %ld.\n", parser1_pins[2].
ref);
2722 ok(parser2.
ref == 1,
"Got outstanding refcount %ld.\n", parser2.
ref);
2723 ok(parser2_pins[0].
ref == 1,
"Got outstanding refcount %ld.\n", parser2_pins[0].
ref);
2724 ok(parser2_pins[1].
ref == 1,
"Got outstanding refcount %ld.\n", parser2_pins[1].
ref);
2725 ok(parser3.
ref == 1,
"Got outstanding refcount %ld.\n", parser3.
ref);
2726 ok(parser3_pins[0].
ref == 1,
"Got outstanding refcount %ld.\n", parser3_pins[0].
ref);
2727 ok(parser3_pins[1].
ref == 1,
"Got outstanding refcount %ld.\n", parser3_pins[1].
ref);
2775 &IID_IFilterGraph2, (
void **)&
graph);
2783 ok(unk != &
test_outer,
"Returned IUnknown should not be outer IUnknown.\n");
2785 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
2787 ref = IUnknown_AddRef(unk);
2788 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
2791 ref = IUnknown_Release(unk);
2792 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
2795 hr = IUnknown_QueryInterface(unk, &
IID_IUnknown, (
void **)&unk2);
2797 ok(unk2 == unk,
"Got unexpected IUnknown %p.\n", unk2);
2798 IUnknown_Release(unk2);
2800 hr = IUnknown_QueryInterface(unk, &IID_IFilterGraph2, (
void **)&
graph);
2805 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
2807 hr = IFilterGraph2_QueryInterface(
graph, &IID_IFilterGraph2, (
void **)&graph2);
2809 ok(graph2 == (
IFilterGraph2 *)0xdeadbeef,
"Got unexpected IFilterGraph2 %p.\n", graph2);
2811 hr = IUnknown_QueryInterface(unk, &
test_iid, (
void **)&unk2);
2813 ok(!unk2,
"Got unexpected IUnknown %p.\n", unk2);
2817 ok(unk2 == (
IUnknown *)0xdeadbeef,
"Got unexpected IUnknown %p.\n", unk2);
2819 IFilterGraph2_Release(
graph);
2820 ref = IUnknown_Release(unk);
2821 ok(!
ref,
"Got unexpected refcount %ld.\n",
ref);
2829 ok(
ref == 1,
"Got unexpected refcount %ld.\n",
ref);
2831 hr = IFilterGraph2_QueryInterface(
graph, &IID_IFilterMapper2, (
void **)&mapper);
2835 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
2837 ok(
ref == 2,
"Got unexpected refcount %ld.\n",
ref);
2839 hr = IFilterMapper2_QueryInterface(mapper, &IID_IFilterGraph2, (
void **)&graph2);
2841 ok(graph2 ==
graph,
"Got unexpected IFilterGraph2 %p.\n", graph2);
2842 IFilterGraph2_Release(graph2);
2844 IFilterMapper2_Release(mapper);
2845 ref = IFilterGraph2_Release(
graph);
2846 ok(!
ref,
"Got unexpected refcount %ld.\n",
ref);
2854 IBasicAudio *audio, *filter_audio;
2857 IBasicVideo2 *video;
2866 hr = IFilterGraph2_QueryInterface(
graph, &IID_IBasicAudio, (
void **)&audio);
2869 hr = IBasicAudio_GetTypeInfoCount(audio, &
count);
2873 hr = IBasicAudio_put_Volume(audio, -10);
2875 hr = IBasicAudio_get_Volume(audio, &
val);
2877 hr = IBasicAudio_put_Balance(audio, 10);
2879 hr = IBasicAudio_get_Balance(audio, &
val);
2887 hr = IFilterGraph2_AddFilter(
graph, renderer,
NULL);
2890 hr = IBasicAudio_put_Volume(audio, -10);
2892 hr = IBasicAudio_get_Volume(audio, &
val);
2895 hr = IBasicAudio_put_Balance(audio, 10);
2897 hr = IBasicAudio_get_Balance(audio, &
val);
2900 ok(
val == 10,
"got balance %ld\n",
val);
2902 hr = IBaseFilter_QueryInterface(renderer, &IID_IBasicAudio, (
void **)&filter_audio);
2905 hr = IBasicAudio_get_Volume(filter_audio, &
val);
2907 ok(
val == -10,
"got volume %ld\n",
val);
2909 hr = IFilterGraph2_RemoveFilter(
graph, renderer);
2912 IBaseFilter_Release(renderer);
2913 IBasicAudio_Release(filter_audio);
2916 hr = IBasicAudio_put_Volume(audio, -10);
2918 hr = IBasicAudio_get_Volume(audio, &
val);
2920 hr = IBasicAudio_put_Balance(audio, 10);
2922 hr = IBasicAudio_get_Balance(audio, &
val);
2925 IBasicAudio_Release(audio);
2929 hr = IFilterGraph2_QueryInterface(
graph, &IID_IBasicVideo2, (
void **)&video);
2931 hr = IFilterGraph2_QueryInterface(
graph, &IID_IVideoWindow, (
void **)&
window);
2935 hr = IBasicVideo2_get_BitRate(video, &
val);
2938 hr = IBasicVideo2_GetTypeInfoCount(video, &
count);
2942 hr = IBasicVideo2_GetTypeInfo(video, 0, 0, &
typeinfo);
2944 hr = ITypeInfo_GetTypeAttr(
typeinfo, &typeattr);
2946 ok(typeattr->typekind ==
TKIND_DISPATCH,
"Got kind %u.\n", typeattr->typekind);
2948 ITypeInfo_ReleaseTypeAttr(
typeinfo, typeattr);
2961 hr = IFilterGraph2_AddFilter(
graph, renderer,
NULL);
2964 hr = IBasicVideo2_get_BitRate(video, &
val);
2970 hr = IVideoWindow_get_FullScreenMode(
window, &
val);
2977 hr = IFilterGraph2_RemoveFilter(
graph, renderer);
2980 hr = IBasicVideo2_get_BitRate(video, &
val);
2985 IBaseFilter_Release(renderer);
2986 IBasicVideo2_Release(video);
2987 IVideoWindow_Release(
window);
2988 IFilterGraph2_Release(
graph);
3002 hr = IFilterGraph2_FindFilterByName(
graph,
L"testid", &ret_filter);
3004 ok(!ret_filter,
"Got filter %p.\n", ret_filter);
3006 hr = IFilterGraph2_AddFilter(
graph, &
filter.IBaseFilter_iface,
L"testid");
3011 hr = IFilterGraph2_FindFilterByName(
graph,
L"testid", &ret_filter);
3013 ok(ret_filter == &
filter.IBaseFilter_iface,
"Got filter %p.\n", ret_filter);
3014 IBaseFilter_Release(ret_filter);
3016 hr = IFilterGraph2_RemoveFilter(
graph, &
filter.IBaseFilter_iface);
3021 ok(
filter.ref == 1,
"Got outstanding refcount %ld.\n",
filter.ref);
3023 hr = IFilterGraph2_FindFilterByName(
graph,
L"testid", &ret_filter);
3025 ok(!ret_filter,
"Got filter %p.\n", ret_filter);
3032 hr = IFilterGraph2_FindFilterByName(
graph,
L"0001", &ret_filter);
3034 ok(ret_filter == &
filter.IBaseFilter_iface,
"Got filter %p.\n", ret_filter);
3035 IBaseFilter_Release(ret_filter);
3038 ref = IFilterGraph2_Release(
graph);
3039 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3043 ok(
filter.ref == 1,
"Got outstanding refcount %ld.\n",
filter.ref);
3086 struct testpin source_pin, sink_pin, parser1_pins[2], parser2_pins[2];
3114 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3121 ok(!source_pin.
mt,
"Got mt %p.\n", source_pin.
mt);
3122 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3127 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3131 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
3132 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3137 ok(!source_pin.
mt,
"Got mt %p.\n", source_pin.
mt);
3138 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3143 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3147 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
3148 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3154 ok(!sink_pin.
mt,
"Got mt %p.\n", sink_pin.
mt);
3160 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3165 ok(!sink_pin.
mt,
"Got mt %p.\n", sink_pin.
mt);
3171 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3177 ok(!source_pin.
mt,
"Got mt %p.\n", source_pin.
mt);
3178 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3181 IPin_AddRef(sink_pin.
peer);
3186 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3190 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
3191 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3197 ok(source_pin.
mt == &
mt,
"Got mt %p.\n", source_pin.
mt);
3198 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3222 ok(!source_pin.
mt,
"Got mt %p.\n", source_pin.
mt);
3223 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3230 IPin_AddRef(sink_pin.
peer);
3234 ok(!source_pin.
mt,
"Got mt %p.\n", source_pin.
mt);
3235 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3249 ok(!source_pin.
mt,
"Got mt %p.\n", source_pin.
mt);
3250 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3259 ok(source_pin.
mt == &
mt,
"Got mt %p.\n", source_pin.
mt);
3260 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3270 hr = IFilterGraph2_ConnectDirect(
graph, &parser1_pins[1].IPin_iface, &parser1_pins[0].IPin_iface,
NULL);
3273 hr = IFilterGraph2_ConnectDirect(
graph, &parser1_pins[1].IPin_iface, &parser2_pins[0].IPin_iface,
NULL);
3275 hr = IFilterGraph2_ConnectDirect(
graph, &parser2_pins[1].IPin_iface, &parser1_pins[0].IPin_iface,
NULL);
3277 IFilterGraph2_Disconnect(
graph, &parser1_pins[1].IPin_iface);
3278 IFilterGraph2_Disconnect(
graph, &parser2_pins[0].IPin_iface);
3281 hr = IFilterGraph2_ConnectDirect(
graph, &parser1_pins[1].IPin_iface, &parser1_pins[0].IPin_iface,
NULL);
3283 ok(!parser1_pins[0].peer,
"Got peer %p.\n", parser1_pins[0].peer);
3284 todo_wine ok(parser1_pins[1].peer == &parser1_pins[0].IPin_iface,
"Got peer %p.\n", parser1_pins[1].peer);
3285 IFilterGraph2_Disconnect(
graph, &parser1_pins[0].IPin_iface);
3286 IFilterGraph2_Disconnect(
graph, &parser1_pins[1].IPin_iface);
3288 hr = IFilterGraph2_ConnectDirect(
graph, &parser1_pins[1].IPin_iface, &parser2_pins[0].IPin_iface,
NULL);
3290 hr = IFilterGraph2_ConnectDirect(
graph, &parser2_pins[1].IPin_iface, &parser1_pins[0].IPin_iface,
NULL);
3292 IFilterGraph2_Disconnect(
graph, &parser1_pins[1].IPin_iface);
3293 IFilterGraph2_Disconnect(
graph, &parser2_pins[0].IPin_iface);
3304 IPin_AddRef(sink_pin.
peer);
3305 hr = IFilterGraph2_RemoveFilter(
graph, &
source.IBaseFilter_iface);
3307 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
3308 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3317 IPin_AddRef(sink_pin.
peer);
3322 hr = IFilterGraph2_RemoveFilter(
graph, &
source.IBaseFilter_iface);
3325 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3328 IPin_AddRef(sink_pin.
peer);
3331 hr = IFilterGraph2_RemoveFilter(
graph, &
source.IBaseFilter_iface);
3338 IMediaControl_Release(
control);
3339 ref = IFilterGraph2_Release(
graph);
3340 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3341 ok(
source.ref == 1,
"Got outstanding refcount %ld.\n",
source.ref);
3342 ok(
sink.ref == 1,
"Got outstanding refcount %ld.\n",
sink.ref);
3343 ok(source_pin.
ref == 1,
"Got outstanding refcount %ld.\n", source_pin.
ref);
3344 todo_wine ok(sink_pin.
ref == 1,
"Got outstanding refcount %ld.\n", sink_pin.
ref);
3345 ok(!source_pin.
peer,
"Got peer %p.\n", source_pin.
peer);
3346 ok(!sink_pin.
peer,
"Got peer %p.\n", sink_pin.
peer);
3359 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
3372 &IID_IReferenceClock, (
void **)&systemclock);
3374 hr = IMediaFilter_SetSyncSource(
filter, systemclock);
3376 ok(filter1.
clock == systemclock,
"Got clock %p.\n", filter1.
clock);
3377 ok(filter2.
clock == systemclock,
"Got clock %p.\n", filter2.
clock);
3382 IReferenceClock_Release(
clock);
3385 ok(filter3.
clock == systemclock,
"Got clock %p.\n", filter3.
clock);
3397 IReferenceClock_Release(systemclock);
3398 IMediaFilter_Release(
filter);
3399 ref = IFilterGraph2_Release(
graph);
3400 ok(!
ref,
"Got outstanding refcount %ld\n",
ref);
3401 ok(filter1.
ref == 1,
"Got outstanding refcount %ld.\n", filter1.
ref);
3402 ok(filter2.
ref == 1,
"Got outstanding refcount %ld.\n", filter2.
ref);
3403 ok(filter3.
ref == 1,
"Got outstanding refcount %ld.\n", filter3.
ref);
3406#define check_filter_state(a, b) check_filter_state_(__LINE__, a, b)
3412 OAFilterState oastate;
3417 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&mediafilter);
3418 hr = IMediaFilter_GetState(mediafilter, 1000, &
state);
3419 ok_(__FILE__,
line)(
hr ==
S_OK,
"IMediaFilter_GetState() returned %#lx.\n",
hr);
3421 IMediaFilter_Release(mediafilter);
3423 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3424 hr = IMediaControl_GetState(
control, 1000, &oastate);
3425 ok_(__FILE__,
line)(
hr ==
S_OK,
"IMediaControl_GetState() returned %#lx.\n",
hr);
3427 IMediaControl_Release(
control);
3429 IFilterGraph2_EnumFilters(
graph, &filterenum);
3433 ok_(__FILE__,
line)(
hr ==
S_OK,
"IBaseFilter_GetState() returned %#lx.\n",
hr);
3435 IBaseFilter_Release(
filter);
3437 IEnumFilters_Release(filterenum);
3444 struct testpin source_pin, sink_pin;
3451 FILTER_STATE mf_state;
3453 OAFilterState
state;
3464 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
3465 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3468 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
3484 ok(!!
clock,
"Reference clock not set.\n");
3488 hr = IReferenceClock_GetTime(
clock, &start_time);
3494 ok(
source.start_time >= start_time &&
source.start_time < start_time + 500 * 10000,
3495 "Expected time near %s, got %s.\n",
3497 ok(
sink.start_time ==
source.start_time,
"Expected time %s, got %s.\n",
3504 sink.state = State_Stopped;
3509 sink.state = State_Running;
3514 sink.state = State_Paused;
3527 sink.state = State_Stopped;
3532 sink.state = State_Paused;
3537 sink.state = State_Running;
3546 sink.state = State_Running;
3551 sink.state = State_Paused;
3556 sink.state = State_Stopped;
3565 hr = IMediaControl_StopWhenReady(
control);
3573 hr = IMediaControl_StopWhenReady(
control);
3577 hr = IMediaControl_StopWhenReady(
control);
3581 IReferenceClock_Release(
clock);
3582 IMediaFilter_Release(
filter);
3583 IMediaControl_Release(
control);
3584 IFilterGraph2_Release(
graph);
3589 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
3590 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3591 IFilterGraph2_QueryInterface(
graph, &IID_IMediaSeeking, (
void **)&seeking);
3594 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
3606 ok(!!
clock,
"Reference clock not set.\n");
3610 hr = IMediaFilter_Run(
filter, 0xdeadbeef);
3620 hr = IMediaFilter_Run(
filter, 0xdeadf00d);
3634 source.expect_run_prev =
sink.expect_run_prev = State_Stopped;
3635 hr = IReferenceClock_GetTime(
clock, &start_time);
3641 ok(
source.start_time >= start_time &&
source.start_time < start_time + 500 * 10000,
3642 "Expected time near %s, got %s.\n",
3644 ok(
sink.start_time ==
source.start_time,
"Expected time %s, got %s.\n",
3652 source.expect_run_prev =
sink.expect_run_prev = State_Paused;
3657 ok(
source.start_time >= start_time &&
source.start_time < start_time + 500 * 10000,
3658 "Expected time near %s, got %s.\n",
3660 ok(
sink.start_time ==
source.start_time,
"Expected time %s, got %s.\n",
3668 start_time += 550 * 10000;
3673 ok(
source.start_time >= start_time &&
source.start_time < start_time + 500 * 10000,
3674 "Expected time near %s, got %s.\n",
3676 ok(
sink.start_time ==
source.start_time,
"Expected time %s, got %s.\n",
3685 IReferenceClock_Release(
clock);
3693 ok(
sink.start_time ==
source.start_time,
"Expected time %s, got %s.\n",
3749 ok(
sink.state == State_Paused,
"Got state %u.\n",
sink.state);
3750 ok(
source.state == State_Paused,
"Got state %u.\n",
source.state);
3765 ok(
sink.state == State_Paused,
"Got state %u.\n",
sink.state);
3766 ok(
source.state == State_Paused,
"Got state %u.\n",
source.state);
3773 ok(
sink.state == State_Paused,
"Got state %u.\n",
sink.state);
3774 ok(
source.state == State_Paused,
"Got state %u.\n",
source.state);
3779 ok(
sink.state == State_Running,
"Got state %u.\n",
sink.state);
3780 ok(
source.state == State_Running,
"Got state %u.\n",
source.state);
3791 ok(
sink.state == State_Stopped,
"Got state %u.\n",
sink.state);
3792 ok(
source.state == State_Stopped,
"Got state %u.\n",
source.state);
3821 ok(
sink.state == State_Paused,
"Got state %u.\n",
sink.state);
3822 ok(
source.state == State_Paused,
"Got state %u.\n",
source.state);
3834 ok(
sink.state == State_Stopped,
"Got state %u.\n",
sink.state);
3835 ok(
source.state == State_Stopped,
"Got state %u.\n",
source.state);
3841 ok(
sink.state == State_Stopped,
"Got state %u.\n",
sink.state);
3842 ok(
source.state == State_Stopped,
"Got state %u.\n",
source.state);
3851 IMediaFilter_Release(
filter);
3852 IMediaControl_Release(
control);
3853 IMediaSeeking_Release(seeking);
3854 ref = IFilterGraph2_Release(
graph);
3855 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3858 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
3859 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3860 IFilterGraph2_QueryInterface(
graph, &IID_IMediaSeeking, (
void **)&seeking);
3861 IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
NULL);
3867 source.expect_run_prev =
sink.expect_run_prev = State_Stopped;
3873 hr = IMediaFilter_GetState(
filter, 0, &mf_state);
3875 ok(mf_state == State_Running,
"Got state %u.\n", mf_state);
3876 ok(
sink.state == State_Running,
"Got state %u.\n",
sink.state);
3877 ok(
source.state == State_Running,
"Got state %u.\n",
source.state);
3880 hr = IMediaFilter_GetState(
filter, 0, &mf_state);
3882 ok(mf_state == State_Running,
"Got state %u.\n", mf_state);
3883 ok(
sink.state == State_Running,
"Got state %u.\n",
sink.state);
3884 ok(
source.state == State_Running,
"Got state %u.\n",
source.state);
3888 ok(
sink.state == State_Stopped,
"Got state %u.\n",
sink.state);
3889 ok(
source.state == State_Stopped,
"Got state %u.\n",
source.state);
3891 source.expect_run_prev =
sink.expect_run_prev = State_Paused;
3925 ok(
sink.state == State_Running,
"Got state %u.\n",
sink.state);
3926 ok(
source.state == State_Running,
"Got state %u.\n",
source.state);
3931 ok(
sink.state == State_Running,
"Got state %u.\n",
sink.state);
3932 ok(
source.state == State_Running,
"Got state %u.\n",
source.state);
3941 hr = IFilterGraph2_AddFilter(
graph, &
dummy.IBaseFilter_iface,
L"dummy");
3943 ok(
dummy.state == State_Stopped,
"Got state %#x.\n",
dummy.state);
3948 ok(
dummy.state == State_Paused,
"Got state %#x.\n",
dummy.state);
3950 hr = IFilterGraph2_RemoveFilter(
graph, &
dummy.IBaseFilter_iface);
3952 ok(
dummy.state == State_Paused,
"Got state %#x.\n",
dummy.state);
3954 hr = IFilterGraph2_AddFilter(
graph, &
dummy.IBaseFilter_iface,
L"dummy");
3956 ok(
dummy.state == State_Paused,
"Got state %#x.\n",
dummy.state);
3962 hr = IFilterGraph2_RemoveFilter(
graph, &
dummy.IBaseFilter_iface);
3964 ok(
dummy.state == State_Stopped,
"Got state %#x.\n",
dummy.state);
3972 source.expect_stop_prev =
sink.expect_stop_prev = State_Running;
3973 IMediaFilter_Release(
filter);
3974 IMediaControl_Release(
control);
3975 IMediaSeeking_Release(seeking);
3976 ref = IFilterGraph2_Release(
graph);
3977 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
3978 ok(
source.ref == 1,
"Got outstanding refcount %ld.\n",
source.ref);
3979 ok(
sink.ref == 1,
"Got outstanding refcount %ld.\n",
sink.ref);
3980 ok(source_pin.
ref == 1,
"Got outstanding refcount %ld.\n", source_pin.
ref);
3981 ok(sink_pin.
ref == 1,
"Got outstanding refcount %ld.\n", sink_pin.
ref);
3982 ok(
source.state == State_Stopped,
"Got state %u.\n",
source.state);
3983 ok(
sink.state == State_Stopped,
"Got state %u.\n",
sink.state);
3993 IMediaEvent *eventsrc;
3997 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
3998 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEvent, (
void **)&eventsrc);
3999 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEventSink, (
void **)&eventsink);
4003 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0);
4009 ret_hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0);
4013 ok(param1 ==
S_OK,
"Got param1 %#Ix.\n", param1);
4014 ok(!param2,
"Got param2 %#Ix.\n", param2);
4015 hr = IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
4018 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0);
4024 IMediaControl_Release(
control);
4025 IMediaEvent_Release(eventsrc);
4026 IMediaEventSink_Release(eventsink);
4032 struct testpin filter1_pin, filter2_pin, filter3_pin;
4039 IMediaEvent *eventsrc;
4050 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
4051 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEvent, (
void **)&eventsrc);
4052 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEventSink, (
void **)&eventsink);
4069 while ((
hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0)) ==
S_OK)
4072 IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
4079 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 50);
4085 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0);
4088 ok(param1 ==
S_OK,
"Got param1 %#Ix.\n", param1);
4089 ok(!param2,
"Got param2 %#Ix.\n", param2);
4090 hr = IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
4093 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 50);
4099 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 50);
4108 hr = IMediaEvent_CancelDefaultHandling(eventsrc,
EC_COMPLETE);
4111 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 50);
4117 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0);
4120 ok(param1 ==
S_OK,
"Got param1 %#Ix.\n", param1);
4122 hr = IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
4125 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 50);
4131 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 0);
4134 ok(param1 ==
S_OK,
"Got param1 %#Ix.\n", param1);
4136 hr = IMediaEvent_FreeEventParams(eventsrc,
code, param1, param2);
4139 hr = IMediaEvent_GetEvent(eventsrc, &
code, ¶m1, ¶m2, 50);
4143 hr = IMediaEvent_RestoreDefaultHandling(eventsrc,
EC_COMPLETE);
4219 IMediaControl_Release(
control);
4220 IMediaEvent_Release(eventsrc);
4221 IMediaEventSink_Release(eventsink);
4222 ref = IFilterGraph2_Release(
graph);
4223 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4224 ok(filter1.
ref == 1,
"Got outstanding refcount %ld.\n", filter1.
ref);
4225 ok(filter2.
ref == 1,
"Got outstanding refcount %ld.\n", filter2.
ref);
4226 ok(filter3.
ref == 1,
"Got outstanding refcount %ld.\n", filter3.
ref);
4322 len = IMediaSample_GetActualDataLength(
sample);
4342 *n_samples_processed = 1;
4343 return IMemInputPin_Receive(iface,
samples[0]);
4377 hr = IFilterGraph2_AddFilter(
graph, &
sink.IBaseFilter_iface,
L"sink");
4383 ok(sink_pin.
peer !=
NULL,
"Expected connection.\n");
4387 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
4395 ok(sink_pin.
input[0] == 0x00,
"Expected MPEG sequence header.\n");
4396 ok(sink_pin.
input[1] == 0x00,
"Expected MPEG sequence header.\n");
4397 ok(sink_pin.
input[2] == 0x01,
"Expected MPEG sequence header.\n");
4398 ok(sink_pin.
input[3] == 0xB3,
"Expected MPEG sequence header.\n");
4401 IFilterGraph2_Release(
graph);
4407 static const char bogus_data[20] = {0xde, 0xad, 0xbe, 0xef};
4430 hr = IFilterGraph2_EnumFilters(
graph, &filterenum);
4440 IEnumFilters_Release(filterenum);
4442 ref = IFilterGraph2_Release(
graph);
4443 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
4453 IFilterGraph2_RemoveFilter(
graph, &
filter->IBaseFilter_iface);
4476 static const GUID *
const all_formats[] =
4481 &TIME_FORMAT_SAMPLE,
4484 &TIME_FORMAT_MEDIA_TIME,
4488 static const GUID *
const unsupported_formats[] =
4491 &TIME_FORMAT_SAMPLE,
4500 IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&
control);
4501 IFilterGraph2_QueryInterface(
graph, &IID_IMediaSeeking, (
void **)&seeking);
4502 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
4503 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEventSink, (
void **)&eventsink);
4505 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
4510 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
4512 ok(!caps,
"Got caps %#lx.\n", caps);
4515 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
4519 hr = IMediaSeeking_IsFormatSupported(seeking,
NULL);
4524 hr = IMediaSeeking_IsFormatSupported(seeking, all_formats[
i]);
4528 hr = IMediaSeeking_QueryPreferredFormat(seeking,
NULL);
4530 hr = IMediaSeeking_QueryPreferredFormat(seeking, &
format);
4534 hr = IMediaSeeking_GetTimeFormat(seeking,
NULL);
4536 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4540 hr = IMediaSeeking_IsUsingTimeFormat(seeking,
NULL);
4542 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
4544 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_NONE);
4547 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_NONE);
4550 hr = IMediaSeeking_QueryPreferredFormat(seeking, &
format);
4554 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
4556 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_NONE);
4559 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4563 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
4568 hr = IMediaSeeking_SetTimeFormat(seeking, unsupported_formats[
i]);
4573 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time,
NULL, 0x123456789a,
NULL);
4578 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_MEDIA_TIME, 0x123456789a,
NULL);
4583 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time,
NULL, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
4588 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_MEDIA_TIME, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
4592 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_NONE, 0x123456789a, &TIME_FORMAT_MEDIA_TIME);
4594 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_NONE, 0x123456789a,
NULL);
4596 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_MEDIA_TIME, 0x123456789a, &TIME_FORMAT_NONE);
4598 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time,
NULL, 0x123456789a, &TIME_FORMAT_NONE);
4602 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &TIME_FORMAT_NONE, 0x123456789a, &TIME_FORMAT_NONE);
4611 hr = IMediaSeeking_GetDuration(seeking,
NULL);
4613 hr = IMediaSeeking_GetDuration(seeking, &
time);
4616 hr = IMediaSeeking_GetStopPosition(seeking,
NULL);
4618 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4621 hr = IMediaSeeking_SetPositions(seeking, &
current, 0, &stop, 0);
4624 hr = IMediaSeeking_GetPositions(seeking,
NULL,
NULL);
4626 hr = IMediaSeeking_GetPositions(seeking,
NULL, &stop);
4628 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
4635 hr = IMediaSeeking_GetCurrentPosition(seeking,
NULL);
4638 hr = IMediaSeeking_GetCurrentPosition(seeking, &
current);
4642 hr = IMediaSeeking_GetAvailable(seeking, &earliest, &latest);
4645 hr = IMediaSeeking_SetRate(seeking, 1.0);
4647 hr = IMediaSeeking_SetRate(seeking, 2.0);
4650 hr = IMediaSeeking_GetRate(seeking, &
rate);
4654 hr = IMediaSeeking_GetPreroll(seeking, &
time);
4666 hr = IMediaSeeking_GetDuration(seeking, &
time);
4669 hr = IMediaSeeking_SetTimeFormat(seeking, &
testguid);
4683 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
4693 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
4698 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
4703 hr = IMediaSeeking_CheckCapabilities(seeking, &caps);
4705 ok(!caps,
"Got caps %#lx.\n", caps);
4710 hr = IMediaSeeking_IsFormatSupported(seeking, &
testguid);
4714 hr = IMediaSeeking_IsFormatSupported(seeking, &
testguid);
4719 hr = IMediaSeeking_IsFormatSupported(seeking, &
testguid);
4723 hr = IMediaSeeking_QueryPreferredFormat(seeking, &
format);
4727 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4732 hr = IMediaSeeking_SetTimeFormat(seeking, &
testguid);
4735 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4740 hr = IMediaSeeking_SetTimeFormat(seeking, &
testguid);
4747 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4751 hr = IMediaSeeking_QueryPreferredFormat(seeking, &
format);
4755 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
4757 hr = IMediaSeeking_IsUsingTimeFormat(seeking, &
testguid);
4760 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
4767 hr = IMediaSeeking_SetTimeFormat(seeking, &
testguid);
4777 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
4787 hr = IMediaSeeking_GetCapabilities(seeking, &caps);
4797 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4801 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_NONE);
4804 hr = IMediaSeeking_GetTimeFormat(seeking, &
format);
4813 hr = IMediaSeeking_ConvertTimeFormat(seeking, &
time, &
testguid, 0x123456789a, &TIME_FORMAT_NONE);
4821 hr = IMediaSeeking_GetDuration(seeking, &
time);
4827 hr = IMediaSeeking_GetDuration(seeking, &
time);
4832 hr = IMediaSeeking_GetDuration(seeking, &
time);
4838 hr = IMediaSeeking_GetDuration(seeking, &
time);
4843 hr = IMediaSeeking_GetDuration(seeking, &
time);
4844 ok(
hr == 0xdeadbeef,
"Got hr %#lx.\n",
hr);
4847 hr = IMediaSeeking_GetDuration(seeking, &
time);
4856 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4862 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4867 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4873 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4878 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4879 ok(
hr == 0xdeadbeef,
"Got hr %#lx.\n",
hr);
4882 hr = IMediaSeeking_GetStopPosition(seeking, &
time);
4889 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
4897 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
4931 ok(
hr == 0xdeadbeef,
"Got hr %#lx.\n",
hr);
4939 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
4944 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
4976 hr = IMediaSeeking_SetRate(seeking, 2.0);
4981 hr = IMediaSeeking_SetRate(seeking, 1.0);
4986 hr = IMediaSeeking_SetRate(seeking, -1.0);
4994 hr = IMediaSeeking_GetRate(seeking, &
rate);
4998 hr = IMediaSeeking_SetRate(seeking, 1.0);
5010 stop = 9000 * 10000;
5015 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5021 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
5030 stop = 8000 * 10000;
5031 hr = IMediaSeeking_SetPositions(seeking, &
current,
5038 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5044 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
5058 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5064 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
5073 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5084 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5088 hr = IMediaSeeking_GetPositions(seeking, &
current, &stop);
5099 hr = IFilterGraph2_SetDefaultSyncSource(
graph);
5108 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5115 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5122 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5135 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5145 hr = IMediaSeeking_GetCurrentPosition(seeking, &
time);
5149 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_MEDIA_TIME);
5152 hr = IMediaSeeking_SetTimeFormat(seeking, &TIME_FORMAT_NONE);
5158 IMediaFilter_Release(
filter);
5159 IMediaControl_Release(
control);
5160 IMediaSeeking_Release(seeking);
5161 IMediaEventSink_Release(eventsink);
5166 ref = IFilterGraph2_Release(
graph);
5167 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5168 ok(filter1.
ref == 1,
"Got outstanding refcount %ld.\n", filter1.
ref);
5169 ok(filter2.
ref == 1,
"Got outstanding refcount %ld.\n", filter2.
ref);
5176 struct testpin source_pin, sink1_pin, sink2_pin;
5197 IFilterGraph2_QueryInterface(
graph, &IID_IMediaFilter, (
void **)&
filter);
5199 hr = IFilterGraph2_SetDefaultSyncSource(
graph);
5204 ok(!!
clock,
"Reference clock not set.\n");
5205 IReferenceClock_Release(
clock);
5209 hr = IFilterGraph2_SetDefaultSyncSource(
graph);
5214 ok(
clock == &
source.IReferenceClock_iface,
"Got unexpected clock.\n");
5215 IReferenceClock_Release(
clock);
5222 hr = IFilterGraph2_SetDefaultSyncSource(
graph);
5228 IReferenceClock_Release(
clock);
5232 hr = IFilterGraph2_SetDefaultSyncSource(
graph);
5238 IReferenceClock_Release(
clock);
5240 IMediaFilter_Release(
filter);
5241 ref = IFilterGraph2_Release(
graph);
5242 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5243 ok(sink1.
ref == 1,
"Got outstanding refcount %ld.\n", sink1.
ref);
5244 ok(sink2.
ref == 1,
"Got outstanding refcount %ld.\n", sink2.
ref);
5245 ok(
source.ref == 1,
"Got outstanding refcount %ld.\n",
source.ref);
5250 static const char bogus_data[20] = {0xde, 0xad, 0xbe, 0xef};
5251 static const char midi_data[20] = {
'M',
'T',
'h',
'd'};
5256 FILTER_INFO filter_info;
5258 WCHAR *ret_filename;
5275 hr = IBaseFilter_QueryFilterInfo(
filter, &filter_info);
5277 ok(!
wcscmp(filter_info.achName,
L"test"),
"Got unexpected name %s.\n",
wine_dbgstr_w(filter_info.achName));
5278 IFilterGraph_Release(filter_info.pGraph);
5280 hr = IBaseFilter_QueryInterface(
filter, &IID_IFileSourceFilter, (
void **)&filesource);
5282 hr = IFileSourceFilter_GetCurFile(filesource, &ret_filename, &
mt);
5288 IFileSourceFilter_Release(filesource);
5294 ok(filter2 !=
filter,
"Filters shouldn't match.\n");
5295 hr = IFilterGraph2_RemoveFilter(
graph, filter2);
5297 ref = IBaseFilter_Release(filter2);
5298 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5303 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5316 hr = IBaseFilter_QueryFilterInfo(
filter, &filter_info);
5319 IFilterGraph_Release(filter_info.pGraph);
5321 hr = IBaseFilter_QueryInterface(
filter, &IID_IFileSourceFilter, (
void **)&filesource);
5323 hr = IFileSourceFilter_GetCurFile(filesource, &ret_filename, &
mt);
5329 IFileSourceFilter_Release(filesource);
5336 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5341 "\\{bccddeef-0000-0000-0000-000000000000}", &
key))
5343 static const GUID testfilter_clsid = {0x12345678};
5344 struct testpin testfilter_pin;
5365 IBaseFilter_Release(
filter);
5367 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5371 "\\{bccddeef-0000-0000-0000-000000000000}");
5376 skip(
"Not enough permission to register media types.\n");
5391 ref = IFilterGraph2_Release(
graph);
5392 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5416 if (
SUCCEEDED(IPin_QueryInterface(pin, &IID_IOverlay, (
void **)&overlay)))
5418 hr = IOverlay_GetWindowHandle(overlay, &
hwnd);
5420 IOverlay_Release(overlay);
5424 IBaseFilter_Release(
filter);
5445 .lpszClassName =
"quartz_test_parent",
5461 ok(!!
parent,
"Failed to create parent window.\n");
5466 skip(
"Cannot render test file, hr %#lx.\n",
hr);
5467 IFilterGraph2_Release(
graph);
5484 hr = IFilterGraph2_QueryInterface(
graph, &IID_IVideoWindow, (
void **)&
window);
5488 IVideoWindow_Release(
window);
5495 ok(!!hwnd2,
"Failed to get renderer window.\n");
5497 ok(tid2 ==
tid,
"Expected thread to be shared.\n");
5499 ref = IFilterGraph2_Release(graph2);
5500 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5503 skip(
"Could not find renderer window.\n");
5507 ref = IFilterGraph2_Release(
graph);
5508 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5515 &IID_IFilterGraph2, (
void **)&
graph);
5527 skip(
"Could not find renderer window.\n");
5529 ref = IFilterGraph2_Release(
graph);
5530 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5544 .bmiHeader.biWidth = 600,
5545 .bmiHeader.biHeight = 400,
5546 .bmiHeader.biCompression =
mmioFOURCC(
'U',
'Y',
'V',
'Y'),
5547 .bmiHeader.biBitCount = 16,
5551 .majortype = MEDIATYPE_Video,
5552 .subtype = MEDIASUBTYPE_UYVY,
5553 .formattype = FORMAT_VideoInfo,
5554 .cbFormat =
sizeof(source_format),
5555 .pbFormat = (
BYTE *)&source_format,
5568 IFilterGraph2_AddFilter(
graph, &
source.IBaseFilter_iface,
L"source");
5576 ref = IFilterGraph2_Release(
graph);
5577 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5578 ok(
source.ref == 1,
"Got outstanding refcount %ld.\n",
source.ref);
5579 ok(source_pin.
ref == 1,
"Got outstanding refcount %ld.\n", source_pin.
ref);
5586 IMediaControl *media_control;
5600 ok(!!
window,
"Failed to create window.\n");
5603 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&media_control);
5607 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaEventSink, (
void **)&media_event_sink);
5623 hr = IMediaControl_Run(media_control);
5670 hr = IMediaControl_Stop(media_control);
5675 hr = IMediaControl_Pause(media_control);
5680 hr = IMediaControl_Run(media_control);
5704 hr = IMediaControl_Stop(media_control);
5706 hr = IMediaControl_Run(media_control);
5718 hr = IMediaControl_Stop(media_control);
5721 IMediaControl_Release(media_control);
5723 IMediaEventSink_Release(media_event_sink);
5724 ref = IFilterGraph2_Release(
graph);
5725 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5726 ok(
filter.ref == 1,
"Got outstanding refcount %ld.\n",
filter.ref);
5732#define check_events(a, b, c) check_events_(__LINE__, a, b, c)
5734 int expected_ec_complete_count,
int expected_ec_status_count)
5736 int ec_complete_count = 0;
5737 int ec_status_count = 0;
5747 ++ec_complete_count;
5754 ok_(__FILE__,
line)(ec_complete_count == expected_ec_complete_count,
5755 "Expected %d EC_COMPLETE events.\n", expected_ec_complete_count);
5756 ok_(__FILE__,
line)(ec_status_count == expected_ec_status_count,
5757 "Expected %d EC_STATUS events.\n", expected_ec_status_count);
5764 IMediaControl *media_control;
5776 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaControl, (
void **)&media_control);
5780 hr = IFilterGraph2_QueryInterface(
graph, &IID_IMediaEventSink, (
void **)&media_event_sink);
5794 param1 = 0xdeadbeef;
5795 param2 = 0xdeadbeef;
5799 todo_wine ok(!param1,
"Got param1 %#Ix.\n", param1);
5800 todo_wine ok(!param2,
"Got param2 %#Ix.\n", param2);
5814 hr = IMediaControl_Pause(media_control);
5827 hr = IMediaControl_Run(media_control);
5846 hr = IMediaControl_Stop(media_control);
5851 hr = IMediaControl_Run(media_control);
5862 hr = IMediaControl_Stop(media_control);
5864 hr = IMediaControl_Run(media_control);
5877 hr = IMediaControl_Stop(media_control);
5879 hr = IMediaControl_Pause(media_control);
5884 hr = IMediaControl_Run(media_control);
5894 hr = IMediaControl_Pause(media_control);
5896 hr = IMediaControl_Run(media_control);
5910 hr = IMediaControl_Stop(media_control);
5913 IMediaControl_Release(media_control);
5915 IMediaEventSink_Release(media_event_sink);
5916 ref = IFilterGraph2_Release(
graph);
5917 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
5918 ok(
filter.ref == 1,
"Got outstanding refcount %ld.\n",
filter.ref);
5926 IMediaEventEx *event_ex;
5934 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEvent, (
void **)&
event);
5935 IFilterGraph2_QueryInterface(
graph, &IID_IMediaEventEx, (
void **)&event_ex);
5936 ok((
void *)
event == event_ex,
"Interface pointers didn't match.\n");
5937 IMediaEventEx_Release(event_ex);
5945 hr = ITypeInfo_GetTypeAttr(
typeinfo, &typeattr);
5947 ok(typeattr->typekind ==
TKIND_DISPATCH,
"Got kind %u.\n", typeattr->typekind);
5949 ITypeInfo_ReleaseTypeAttr(
typeinfo, typeattr);
5952 IMediaEvent_Release(
event);
5953 ref = IFilterGraph2_Release(
graph);
5954 ok(!
ref,
"Got outstanding refcount %ld.\n",
ref);
#define InterlockedIncrement
#define InterlockedDecrement
@ AM_SEEKING_CanGetDuration
@ AM_SEEKING_CanGetCurrentPos
@ AM_SEEKING_CanDoSegments
@ AM_SEEKING_CanSeekAbsolute
@ AM_SEEKING_NoPositioning
@ AM_SEEKING_AbsolutePositioning
enum _PinDirection PIN_DIRECTION
@ AM_FILTER_MISC_FLAGS_IS_RENDERER
@ AM_RENDEREX_RENDERTOEXISTINGRENDERERS
const GUID IID_IClassFactory
#define STDMETHODCALLTYPE
const GUID IID_IBaseFilter
static struct filter_graph * impl_from_IMediaPosition(IMediaPosition *iface)
static struct filter_graph * impl_from_IMediaSeeking(IMediaSeeking *iface)
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueExA(HKEY hKey, LPCSTR lpValueName, DWORD Reserved, DWORD dwType, CONST BYTE *lpData, DWORD cbData)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject(DWORD cookie)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(void *reserved, DWORD model)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, IUnknown *object, DWORD clscontext, DWORD flags, DWORD *cookie)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
void *WINAPI CoTaskMemAlloc(SIZE_T size)
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)
static wchar_t * wcsdup(const wchar_t *str)
_ACRTIMP clock_t __cdecl clock(void)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLdouble GLdouble GLdouble GLdouble top
GLuint GLsizei GLsizei * length
GLsizei GLenum GLboolean sink
GLenum const GLfloat * params
GLenum GLenum GLenum input
GLfloat GLfloat GLfloat GLfloat h
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 mmioFOURCC(c0, c1, c2, c3)
struct task_struct * current
#define ERROR_FILE_NOT_FOUND
const IID IID_IObjectWithSite
#define create_file(name, size)
#define load_resource(a, b, c)
static const WCHAR pathW[]
static IHTMLWindow2 * window
static EXCEPINFO excepinfo
static const IPinVtbl test_connect_direct_vtbl
static HRESULT WINAPI testfilesource_Load(IFileSourceFilter *iface, const WCHAR *filename, const AM_MEDIA_TYPE *mt)
static HRESULT WINAPI no_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static BOOL compare_time(ULONGLONG x, ULONGLONG y, unsigned int max_diff)
static HRESULT WINAPI testpos_QueryInterface(IMediaPosition *iface, REFIID iid, void **out)
static HRESULT WINAPI testpos_Invoke(IMediaPosition *iface, DISPID id, REFIID iid, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *result, EXCEPINFO *excepinfo, UINT *error_arg)
static HRESULT WINAPI testseek_CheckCapabilities(IMediaSeeking *iface, DWORD *caps)
static HRESULT WINAPI testpin_Disconnect(IPin *iface)
static HRESULT WINAPI testpos_CanSeekBackward(IMediaPosition *iface, LONG *can_seek_backward)
static void test_graph_builder_render(void)
static HRESULT WINAPI testpin_QueryAccept(IPin *iface, const AM_MEDIA_TYPE *mt)
static const IPinVtbl testsink_vtbl
static HRESULT WINAPI testclock_AdvisePeriodic(IReferenceClock *iface, REFERENCE_TIME start, REFERENCE_TIME period, HSEMAPHORE semaphore, DWORD_PTR *cookie)
static HRESULT WINAPI testenummt_Skip(IEnumMediaTypes *iface, ULONG count)
static ULONG WINAPI testclock_Release(IReferenceClock *iface)
static void check_filter_state_(unsigned int line, IFilterGraph2 *graph, FILTER_STATE expect)
static HRESULT WINAPI testfilesource_GetCurFile(IFileSourceFilter *iface, WCHAR **filename, AM_MEDIA_TYPE *mt)
static HRESULT WINAPI mpegtestsink_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static ULONG WINAPI testfilter_cf_AddRef(IClassFactory *iface)
static HRESULT WINAPI no_EnumMediaTypes(IPin *iface, IEnumMediaTypes **out)
static const IEnumPinsVtbl testenumpins_vtbl
static HRESULT WINAPI testmiscflags_QueryInterface(IAMFilterMiscFlags *iface, REFIID iid, void **out)
static struct testpin * impl_from_IEnumMediaTypes(IEnumMediaTypes *iface)
static HRESULT WINAPI testfilter_cf_LockServer(IClassFactory *iface, BOOL lock)
#define check_filter_state(a, b)
static void test_add_source_filter(void)
static HRESULT WINAPI testsink_ReceiveConnection(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static ULONG WINAPI testfilesource_AddRef(IFileSourceFilter *iface)
static const IUnknownVtbl outer_vtbl
static const IMediaPositionVtbl testpos_vtbl
static HRESULT WINAPI testfilter_GetState(IBaseFilter *iface, DWORD timeout, FILTER_STATE *state)
static ULONG WINAPI testseek_Release(IMediaSeeking *iface)
static HRESULT WINAPI no_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static void test_media_event(IFilterGraph2 *graph)
static IClassFactoryVtbl testfilter_cf_vtbl
static struct testfilter * impl_from_IReferenceClock(IReferenceClock *iface)
static HRESULT WINAPI testpin_ConnectionMediaType(IPin *iface, AM_MEDIA_TYPE *mt)
static const IBaseFilterVtbl testfilter_vtbl
static HRESULT WINAPI testpos_get_StopTime(IMediaPosition *iface, REFTIME *time)
static ULONG WINAPI testseek_AddRef(IMediaSeeking *iface)
static HRESULT WINAPI testseek_QueryInterface(IMediaSeeking *iface, REFIID iid, void **out)
static void test_set_notify_flags(void)
static LRESULT CALLBACK parent_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
static HRESULT WINAPI testpos_put_CurrentPosition(IMediaPosition *iface, REFTIME time)
static HRESULT WINAPI testenummt_Next(IEnumMediaTypes *iface, ULONG count, AM_MEDIA_TYPE **out, ULONG *fetched)
static HRESULT WINAPI testseek_GetStopPosition(IMediaSeeking *iface, LONGLONG *stop)
static HRESULT WINAPI testfilter_Run(IBaseFilter *iface, REFERENCE_TIME start)
static void test_aggregation(void)
static struct testfilter * impl_from_IFileSourceFilter(IFileSourceFilter *iface)
static void check_interface_(unsigned int line, void *iface_ptr, REFIID iid, BOOL supported)
static HRESULT WINAPI testfilter_GetClassID(IBaseFilter *iface, CLSID *clsid)
static ULONG WINAPI outer_AddRef(IUnknown *iface)
static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID iid, void **out)
static HRESULT WINAPI testpin_QueryPinInfo(IPin *iface, PIN_INFO *info)
static HRESULT WINAPI testfilter_cf_QueryInterface(IClassFactory *iface, REFIID iid, void **out)
static void test_add_remove_filter(void)
static ULONG WINAPI testpos_Release(IMediaPosition *iface)
static HRESULT STDMETHODCALLTYPE meminput_Receive(IMemInputPin *iface, IMediaSample *sample)
static HRESULT WINAPI testenumpins_Next(IEnumPins *iface, ULONG count, IPin **out, ULONG *fetched)
static HRESULT WINAPI testpos_get_CurrentPosition(IMediaPosition *iface, REFTIME *time)
static HRESULT WINAPI testseek_IsFormatSupported(IMediaSeeking *iface, const GUID *format)
static struct testfilter * impl_from_IBaseFilter(IBaseFilter *iface)
static ULONG WINAPI testpin_AddRef(IPin *iface)
static void test_renderfile_compressed(void)
static ULONG get_refcount(void *iface)
static void test_renderfile_failure(void)
static HRESULT WINAPI testseek_SetRate(IMediaSeeking *iface, double rate)
static void test_graph_builder_connect(void)
static HRESULT WINAPI testpos_GetTypeInfo(IMediaPosition *iface, UINT index, LCID lcid, ITypeInfo **typeinfo)
static BOOL expect_parent_message
static HRESULT WINAPI testpin_EnumMediaTypes(IPin *iface, IEnumMediaTypes **out)
static const IMediaSeekingVtbl testseek_vtbl
static HRESULT WINAPI testfilter_FindPin(IBaseFilter *iface, const WCHAR *id, IPin **pin)
static IUnknown test_outer
static ULONG WINAPI testenummt_AddRef(IEnumMediaTypes *iface)
static ULONG WINAPI testfilter_Release(IBaseFilter *iface)
static DWORD WINAPI call_RenderFile_multithread(LPVOID lParam)
static HRESULT WINAPI testfilter_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *info)
static HRESULT STDMETHODCALLTYPE meminput_ReceiveCanBlock(IMemInputPin *iface)
static void test_default_sync_source(void)
static HRESULT WINAPI testfilter_Pause(IBaseFilter *iface)
static ULONG WINAPI testclock_AddRef(IReferenceClock *iface)
static HRESULT WINAPI testenumpins_Clone(IEnumPins *iface, IEnumPins **out)
static HRESULT WINAPI testpin_QueryId(IPin *iface, WCHAR **id)
static void testfilter_init(struct testfilter *filter, struct testpin *pins, int pin_count)
static HRESULT WINAPI mpegtestpin_EndOfStream(IPin *iface)
static HRESULT WINAPI testseek_GetDuration(IMediaSeeking *iface, LONGLONG *duration)
static void test_connect_direct_init(struct testpin *pin, PIN_DIRECTION dir)
static void testsource_init(struct testpin *pin, const AM_MEDIA_TYPE *types, int type_count)
static ULONG WINAPI testfilter_AddRef(IBaseFilter *iface)
static HRESULT WINAPI testfilter_Stop(IBaseFilter *iface)
static void flush_cached_seeking(IFilterGraph2 *graph, struct testfilter *filter)
static HRESULT WINAPI testpos_get_Duration(IMediaPosition *iface, REFTIME *length)
static HRESULT WINAPI testpos_GetTypeInfoCount(IMediaPosition *iface, UINT *count)
static void test_interfaces(void)
static HRESULT WINAPI testenumpins_Skip(IEnumPins *iface, ULONG count)
static struct testpin * impl_from_IMemInputPin(IMemInputPin *iface)
static HRESULT WINAPI testclock_GetTime(IReferenceClock *iface, REFERENCE_TIME *time)
static void check_events_(unsigned int line, IMediaEventEx *media_event, int expected_ec_complete_count, int expected_ec_status_count)
static const IAMFilterMiscFlagsVtbl testmiscflags_vtbl
static HRESULT WINAPI meminput_QueryInterface(IMemInputPin *iface, REFIID iid, void **out)
static HRESULT STDMETHODCALLTYPE meminput_GetAllocator(IMemInputPin *iface, IMemAllocator **allocator)
static const IMemInputPinVtbl mpegtestsink_meminput_vtbl
static HRESULT WINAPI testenummt_QueryInterface(IEnumMediaTypes *iface, REFIID iid, void **out)
static HRESULT WINAPI testpos_get_PrerollTime(IMediaPosition *iface, REFTIME *time)
static ULONG WINAPI testenummt_Release(IEnumMediaTypes *iface)
static HRESULT check_ec_complete(IFilterGraph2 *graph, IBaseFilter *filter)
static const IEnumMediaTypesVtbl testenummt_vtbl
static HRESULT STDMETHODCALLTYPE meminput_NotifyAllocator(IMemInputPin *iface, IMemAllocator *allocator, BOOL readonly)
#define check_events(a, b, c)
static HRESULT WINAPI testfilter_GetSyncSource(IBaseFilter *iface, IReferenceClock **clock)
static ULONG WINAPI testmiscflags_Release(IAMFilterMiscFlags *iface)
static HRESULT WINAPI testpos_CanSeekForward(IMediaPosition *iface, LONG *can_seek_forward)
static HRESULT WINAPI testclock_Unadvise(IReferenceClock *iface, DWORD_PTR cookie)
static HRESULT WINAPI testenumpins_Reset(IEnumPins *iface)
static HWND get_renderer_hwnd(IFilterGraph2 *graph)
static void test_sync_source(void)
static HRESULT WINAPI testseek_SetPositions(IMediaSeeking *iface, LONGLONG *current, DWORD current_flags, LONGLONG *stop, DWORD stop_flags)
static HRESULT WINAPI testseek_ConvertTimeFormat(IMediaSeeking *iface, LONGLONG *target, const GUID *target_format, LONGLONG source, const GUID *source_format)
static HRESULT WINAPI testseek_IsUsingTimeFormat(IMediaSeeking *iface, const GUID *format)
static void testsink_init(struct testpin *pin)
static HRESULT WINAPI testfilter_cf_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **out)
static HRESULT WINAPI testpin_QueryInterface(IPin *iface, REFIID iid, void **out)
static HRESULT WINAPI testenummt_Clone(IEnumMediaTypes *iface, IEnumMediaTypes **out)
static IFilterGraph2 * create_graph(void)
static HRESULT WINAPI testenumpins_QueryInterface(IEnumPins *iface, REFIID iid, void **out)
static HRESULT WINAPI testfilter_EnumPins(IBaseFilter *iface, IEnumPins **out)
static ULONG WINAPI testenumpins_Release(IEnumPins *iface)
static void test_state_change(IFilterGraph2 *graph)
static ULONG WINAPI testfilter_cf_Release(IClassFactory *iface)
static void test_autoplug_uyvy(void)
static HRESULT WINAPI testfilter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *graph, const WCHAR *name)
static HRESULT WINAPI testpin_EndOfStream(IPin *iface)
static const IPinVtbl testsource_vtbl
static HRESULT WINAPI testseek_QueryPreferredFormat(IMediaSeeking *iface, GUID *format)
static HRESULT WINAPI testpin_QueryInternalConnections(IPin *iface, IPin **out, ULONG *count)
static HRESULT WINAPI testseek_GetCapabilities(IMediaSeeking *iface, DWORD *caps)
static void testpin_init(struct testpin *pin, const IPinVtbl *vtbl, PIN_DIRECTION dir)
static void rungraph(IFilterGraph2 *graph, BOOL video)
static HRESULT WINAPI testfilter_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
static void check_state_transition(struct testfilter *filter, FILTER_STATE expect)
static HRESULT WINAPI testpin_QueryDirection(IPin *iface, PIN_DIRECTION *dir)
static void test_ec_complete(void)
static ULONG WINAPI testmiscflags_AddRef(IAMFilterMiscFlags *iface)
static ULONG WINAPI testenumpins_AddRef(IEnumPins *iface)
static void test_event_dispatch(void)
static HRESULT WINAPI testclock_QueryInterface(IReferenceClock *iface, REFIID iid, void **out)
static HRESULT WINAPI testseek_GetAvailable(IMediaSeeking *iface, LONGLONG *earliest, LONGLONG *latest)
static const GUID testguid
static void test_events(void)
#define check_interface(a, b, c)
static HRESULT WINAPI testseek_GetCurrentPosition(IMediaSeeking *iface, LONGLONG *current)
static HRESULT WINAPI testseek_SetTimeFormat(IMediaSeeking *iface, const GUID *format)
static HRESULT WINAPI testenummt_Reset(IEnumMediaTypes *iface)
static HRESULT WINAPI testpin_BeginFlush(IPin *iface)
static void test_control_delegation(void)
static ULONG WINAPI testfilesource_Release(IFileSourceFilter *iface)
static HRESULT STDMETHODCALLTYPE meminput_GetAllocatorRequirements(IMemInputPin *iface, ALLOCATOR_PROPERTIES *props)
static void test_window_threading(void)
static HRESULT WINAPI testpin_EndFlush(IPin *iface)
static HRESULT WINAPI testpos_put_PrerollTime(IMediaPosition *iface, REFTIME time)
static HRESULT WINAPI testseek_GetTimeFormat(IMediaSeeking *iface, GUID *format)
static const IFileSourceFilterVtbl testfilesource_vtbl
static HRESULT WINAPI testpos_get_Rate(IMediaPosition *iface, double *rate)
static void test_connect_direct(void)
static ULONG WINAPI testmiscflags_GetMiscFlags(IAMFilterMiscFlags *iface)
static HRESULT WINAPI testpos_GetIDsOfNames(IMediaPosition *iface, REFIID riid, LPOLESTR *names, UINT count, LCID lcid, DISPID *ids)
static HRESULT WINAPI mpegtestpin_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
static HRESULT WINAPI testseek_GetPreroll(IMediaSeeking *iface, LONGLONG *preroll)
static void test_render_with_multithread(void)
static struct testpin * impl_from_IPin(IPin *iface)
static ULONG WINAPI testpos_AddRef(IMediaPosition *iface)
static ULONG WINAPI meminput_Release(IMemInputPin *iface)
static HRESULT WINAPI testclock_AdviseTime(IReferenceClock *iface, REFERENCE_TIME base, REFERENCE_TIME offset, HEVENT event, DWORD_PTR *cookie)
static struct testfilter * impl_from_IEnumPins(IEnumPins *iface)
static HRESULT test_graph_builder_connect_file(WCHAR *filename, BOOL audio, BOOL video)
static HRESULT WINAPI testseek_GetRate(IMediaSeeking *iface, double *rate)
static HRESULT WINAPI testsource_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static void test_enum_filters(void)
static void test_media_seeking(IFilterGraph2 *graph)
static void test_render_run(const WCHAR *file, BOOL audio, BOOL video)
static HRESULT WINAPI testpos_put_Rate(IMediaPosition *iface, double rate)
static HRESULT WINAPI testpin_ConnectedTo(IPin *iface, IPin **peer)
static ULONG WINAPI meminput_AddRef(IMemInputPin *iface)
static const IPinVtbl mpegtestsink_vtbl
static HRESULT WINAPI testseek_GetPositions(IMediaSeeking *iface, LONGLONG *current, LONGLONG *stop)
static HRESULT WINAPI test_connect_direct_Connect(IPin *iface, IPin *peer, const AM_MEDIA_TYPE *mt)
static struct testfilter * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
static HRESULT STDMETHODCALLTYPE meminput_ReceiveMultiple(IMemInputPin *iface, IMediaSample **samples, LONG n_samples, LONG *n_samples_processed)
static const GUID test_iid
static HRESULT WINAPI testpin_NewSegment(IPin *iface, REFERENCE_TIME start, REFERENCE_TIME stop, double rate)
static const IReferenceClockVtbl testclock_vtbl
static void test_filter_state(void)
static void test_graph_seeking(void)
static HRESULT WINAPI testfilter_QueryVendorInfo(IBaseFilter *iface, WCHAR **info)
static HRESULT WINAPI testpos_put_StopTime(IMediaPosition *iface, REFTIME time)
static HRESULT WINAPI testfilesource_QueryInterface(IFileSourceFilter *iface, REFIID iid, void **out)
static ULONG WINAPI testpin_Release(IPin *iface)
static ULONG WINAPI outer_Release(IUnknown *iface)
static HRESULT WINAPI testfilter_QueryInterface(IBaseFilter *iface, REFIID iid, void **out)
static void test_basic_video(void)
static VARIANTARG static DISPID
@ COINIT_APARTMENTTHREADED
BSTR WINAPI SysAllocString(LPCOLESTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
#define WS_OVERLAPPEDWINDOW
#define WS_EX_NOPARENTNOTIFY
#define IsEqualGUID(rguid1, rguid2)
HWND WINAPI GetActiveWindow(void)
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
HWND WINAPI SetActiveWindow(_In_ HWND)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
static __inline const char * wine_dbgstr_guid(const GUID *id)
void WINAPI FreeMediaType(AM_MEDIA_TYPE *pMediaType)
const REGFILTERPINS2 * rgPins2
const REGPINTYPES * lpMediaType
IClassFactory IClassFactory_iface
REFERENCE_TIME start_time
IMediaSeeking IMediaSeeking_iface
IClassFactory IClassFactory_iface
struct testfilter * filter
FILTER_STATE expect_stop_prev
IReferenceClock IReferenceClock_iface
IEnumPins IEnumPins_iface
IMediaSeeking IMediaSeeking_iface
IMediaPosition IMediaPosition_iface
IBaseFilter IBaseFilter_iface
FILTER_STATE expect_run_prev
struct strmbase_filter filter
IAMFilterMiscFlags IAMFilterMiscFlags_iface
REFERENCE_TIME start_time
IFileSourceFilter IFileSourceFilter_iface
AM_MEDIA_TYPE * accept_mt
const struct testpin * require_connected_pin
IMemInputPin IMemInputPin_iface
HRESULT QueryInternalConnections_hr
BOOL require_stopped_disconnect
IEnumMediaTypes IEnumMediaTypes_iface
struct testfilter * filter
HRESULT EnumMediaTypes_hr
AM_MEDIA_TYPE * request_mt
const AM_MEDIA_TYPE * types
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)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
#define CONTAINING_RECORD(address, type, field)
#define MEDIASUBTYPE_NULL
#define VFW_E_TYPE_NOT_ACCEPTED
#define VFW_E_UNSUPPORTED_STREAM
#define VFW_E_MONO_AUDIO_HW
#define VFW_E_NOT_STOPPED
#define VFW_E_CIRCULAR_GRAPH
#define VFW_E_NO_ACCEPTABLE_TYPES
#define VFW_E_WRONG_STATE
#define VFW_S_PARTIAL_RENDER
#define VFW_S_STATE_INTERMEDIATE
#define VFW_E_NO_ALLOCATOR
#define VFW_E_ENUM_OUT_OF_SYNC
#define VFW_E_NO_AUDIO_HARDWARE
#define VFW_E_CANNOT_CONNECT
#define VFW_S_AUDIO_NOT_RENDERED
#define VFW_E_NOT_CONNECTED
#define VFW_E_CANNOT_RENDER
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)
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define HKEY_CLASSES_ROOT