Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 3 +-- dlls/quartz/tests/filtergraph.c | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 03d4091..8516dbf 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1093,8 +1093,7 @@ static HRESULT connect_output_pin(IFilterGraphImpl *graph, IBaseFilter *filter, { TRACE("Skipping non-rendered pin %s.\n", debugstr_w(info.achName)); IPin_Release(pin); - IEnumPins_Release(enumpins); - return E_FAIL; + continue; }
if (SUCCEEDED(IFilterGraph2_Connect(&graph->IFilterGraph2_iface, pin, sink))) diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 9ef229f..30bf0cc 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -1783,11 +1783,9 @@ todo_wine
parser1.pin_count = 3; hr = IFilterGraph2_Connect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface); -todo_wine { ok(hr == S_OK, "Got hr %#x.\n", hr); ok(source_pin.peer == &parser1_pins[0].IPin_iface, "Got peer %p.\n", source_pin.peer); ok(sink_pin.peer == &parser1_pins[2].IPin_iface, "Got peer %p.\n", sink_pin.peer); -} IFilterGraph2_Disconnect(graph, source_pin.peer); IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface); IFilterGraph2_Disconnect(graph, sink_pin.peer);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 8516dbf..8d52177 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1394,47 +1394,37 @@ out: return SUCCEEDED(hr) ? S_OK : hr; }
-static HRESULT FilterGraph2_RenderRecurse(IFilterGraphImpl *This, IPin *ppinOut) +/* Render all output pins of the given filter. Helper for FilterGraph2_Render(). */ +static HRESULT render_output_pins(IFilterGraphImpl *graph, IBaseFilter *filter) { - /* This pin has been connected now, try to call render on all pins that aren't connected */ - IPin *to = NULL; - PIN_INFO info; - IEnumPins *enumpins = NULL; BOOL renderany = FALSE; BOOL renderall = TRUE; + IEnumPins *enumpins; + IPin *pin, *peer;
- IPin_QueryPinInfo(ppinOut, &info); - - IBaseFilter_EnumPins(info.pFilter, &enumpins); - /* Don't need to hold a reference, IEnumPins does */ - IBaseFilter_Release(info.pFilter); - - IEnumPins_Reset(enumpins); - while (IEnumPins_Next(enumpins, 1, &to, NULL) == S_OK) + IBaseFilter_EnumPins(filter, &enumpins); + while (IEnumPins_Next(enumpins, 1, &pin, NULL) == S_OK) { PIN_DIRECTION dir = PINDIR_INPUT;
- IPin_QueryDirection(to, &dir); + IPin_QueryDirection(pin, &dir);
if (dir == PINDIR_OUTPUT) { - IPin *out = NULL; - - IPin_ConnectedTo(to, &out); - if (!out) + if (IPin_ConnectedTo(pin, &peer) == VFW_E_NOT_CONNECTED) { HRESULT hr; - hr = IFilterGraph2_Render(&This->IFilterGraph2_iface, to); + hr = IFilterGraph2_Render(&graph->IFilterGraph2_iface, pin); if (SUCCEEDED(hr)) renderany = TRUE; else renderall = FALSE; } else - IPin_Release(out); + IPin_Release(peer); }
- IPin_Release(to); + IPin_Release(pin); }
IEnumPins_Release(enumpins); @@ -1530,7 +1520,7 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut) TRACE("Connected successfully %p/%p, %08x look if we should render more!\n", ppinOut, pin, hr); IPin_Release(pin);
- hr = FilterGraph2_RenderRecurse(This, pin); + hr = render_output_pins(This, filter->filter); if (FAILED(hr)) { IPin_Disconnect(ppinOut); @@ -1680,7 +1670,7 @@ static HRESULT WINAPI FilterGraph2_Render(IFilterGraph2 *iface, IPin *ppinOut)
VariantClear(&var);
- hr = FilterGraph2_RenderRecurse(This, ppinfilter); + hr = render_output_pins(This, pfilter); if (FAILED(hr)) { WARN("Unable to connect recursively (%x)\n", hr); goto error;
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 16 +++++++++++----- dlls/quartz/tests/filtergraph.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 8d52177..0468cb5 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1401,16 +1401,22 @@ static HRESULT render_output_pins(IFilterGraphImpl *graph, IBaseFilter *filter) BOOL renderall = TRUE; IEnumPins *enumpins; IPin *pin, *peer; + PIN_INFO info;
IBaseFilter_EnumPins(filter, &enumpins); while (IEnumPins_Next(enumpins, 1, &pin, NULL) == S_OK) { - PIN_DIRECTION dir = PINDIR_INPUT; - - IPin_QueryDirection(pin, &dir); - - if (dir == PINDIR_OUTPUT) + IPin_QueryPinInfo(pin, &info); + IBaseFilter_Release(info.pFilter); + if (info.dir == PINDIR_OUTPUT) { + if (info.achName[0] == '~') + { + TRACE("Skipping non-rendered pin %s.\n", debugstr_w(info.achName)); + IPin_Release(pin); + continue; + } + if (IPin_ConnectedTo(pin, &peer) == VFW_E_NOT_CONNECTED) { HRESULT hr; diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 30bf0cc..6c8b9fa 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -1485,6 +1485,8 @@ static void test_graph_builder_render(void) ok(parser_pins[1].peer == &sink1_pin.IPin_iface, "Got peer %p.\n", parser_pins[1].peer); IFilterGraph2_Disconnect(graph, source_pin.peer); IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface); + IFilterGraph2_Disconnect(graph, parser_pins[0].peer); + IFilterGraph2_Disconnect(graph, &parser_pins[0].IPin_iface);
IFilterGraph2_RemoveFilter(graph, &sink1.IBaseFilter_iface); IFilterGraph2_AddFilter(graph, &sink1.IBaseFilter_iface, NULL); @@ -1492,6 +1494,32 @@ static void test_graph_builder_render(void) hr = IFilterGraph2_Render(graph, &source_pin.IPin_iface); ok(hr == S_OK, "Got hr %#x.\n", hr); ok(source_pin.peer == &sink1_pin.IPin_iface, "Got peer %p.\n", source_pin.peer); + IFilterGraph2_Disconnect(graph, source_pin.peer); + IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface); + + /* A pin whose name (not ID) begins with a tilde is not rendered. */ + + IFilterGraph2_RemoveFilter(graph, &sink2.IBaseFilter_iface); + IFilterGraph2_RemoveFilter(graph, &parser.IBaseFilter_iface); + IFilterGraph2_AddFilter(graph, &parser.IBaseFilter_iface, NULL); + + parser_pins[1].name[0] = '~'; + hr = IFilterGraph2_Render(graph, &source_pin.IPin_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(source_pin.peer == &parser_pins[0].IPin_iface, "Got peer %p.\n", source_pin.peer); + ok(!parser_pins[1].peer, "Got peer %p.\n", parser_pins[1].peer); + ok(!sink1_pin.peer, "Got peer %p.\n", sink1_pin.peer); + IFilterGraph2_Disconnect(graph, source_pin.peer); + IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface); + + parser_pins[1].name[0] = 0; + parser_pins[1].id[0] = '~'; + hr = IFilterGraph2_Render(graph, &source_pin.IPin_iface); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(source_pin.peer == &parser_pins[0].IPin_iface, "Got peer %p.\n", source_pin.peer); + ok(parser_pins[1].peer == &sink1_pin.IPin_iface, "Got peer %p.\n", parser_pins[1].peer); + IFilterGraph2_Disconnect(graph, source_pin.peer); + IFilterGraph2_Disconnect(graph, &source_pin.IPin_iface);
ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/filtergraph.c | 2 +- dlls/quartz/tests/filtergraph.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 0468cb5..8451e0d 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -1391,7 +1391,7 @@ out: --This->recursioncount; LeaveCriticalSection(&This->cs); TRACE("--> %08x\n", hr); - return SUCCEEDED(hr) ? S_OK : hr; + return SUCCEEDED(hr) ? S_OK : VFW_E_CANNOT_CONNECT; }
/* Render all output pins of the given filter. Helper for FilterGraph2_Render(). */ diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 6c8b9fa..db62ded 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -609,7 +609,6 @@ static void test_render_run(const WCHAR *file) ok(!refs, "Graph has %u references\n", refs);
hr = test_graph_builder_connect_file(filename); -todo_wine ok(hr == VFW_E_CANNOT_CONNECT, "got %#x\n", hr); } else @@ -1713,7 +1712,6 @@ static void test_graph_builder_connect(void)
sink_pin.accept_mt = &sink_type; hr = IFilterGraph2_Connect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface); -todo_wine ok(hr == VFW_E_CANNOT_CONNECT, "Got hr %#x.\n", hr); ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
@@ -1805,7 +1803,6 @@ todo_wine
parser1_pins[1].name[0] = '~'; hr = IFilterGraph2_Connect(graph, &source_pin.IPin_iface, &sink_pin.IPin_iface); -todo_wine ok(hr == VFW_E_CANNOT_CONNECT, "Got hr %#x.\n", hr); ok(!source_pin.peer, "Got peer %p.\n", source_pin.peer);
Zebediah Figura z.figura12@gmail.com writes:
Signed-off-by: Zebediah Figura z.figura12@gmail.com
dlls/quartz/filtergraph.c | 2 +- dlls/quartz/tests/filtergraph.c | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-)
It breaks the tests:
../../../tools/runtest -q -P wine -T ../../.. -M qcap.dll -p qcap_test.exe.so smartteefilter && touch smartteefilter.ok smartteefilter.c:1570: Test failed: connecting Capture pin without first connecting Input pin returned 0x80040217 smartteefilter.c:1572: Test failed: connecting Preview pin without first connecting Input pin returned 0x80040217 make: *** [Makefile:227: smartteefilter.ok] Error 2