qcap: Search downstream pins regardless of whether the category and major type match.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48766
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-04-08 15:58:56 -05:00 committed by Alexandre Julliard
parent 1371838deb
commit d9003a0464
2 changed files with 23 additions and 13 deletions

View File

@ -505,28 +505,38 @@ static HRESULT find_unconnected_source_from_filter(CaptureGraphImpl *capture_gra
static HRESULT find_unconnected_source_from_pin(CaptureGraphImpl *capture_graph,
const GUID *category, const GUID *majortype, IPin *pin, IPin **ret)
{
PIN_DIRECTION dir;
PIN_INFO info;
HRESULT hr;
IPin *peer;
IPin_QueryDirection(pin, &dir);
if (dir != PINDIR_OUTPUT)
return VFW_E_INVALID_DIRECTION;
if (category && (IsEqualGUID(category, &PIN_CATEGORY_CAPTURE)
|| IsEqualGUID(category, &PIN_CATEGORY_PREVIEW)))
{
if (FAILED(hr = match_smart_tee_pin(capture_graph, category, majortype, (IUnknown *)pin, &pin)))
return hr;
}
else if (pin_matches(pin, PINDIR_OUTPUT, category, majortype, FALSE))
{
IPin_AddRef(pin);
hr = S_OK;
if (FAILED(IPin_ConnectedTo(pin, &peer)))
{
*ret = pin;
return S_OK;
}
}
else
return E_FAIL;
if (FAILED(IPin_ConnectedTo(pin, &peer)))
{
*ret = pin;
return hr;
if (FAILED(IPin_ConnectedTo(pin, &peer)))
{
if (!pin_matches(pin, PINDIR_OUTPUT, category, majortype, FALSE))
return E_FAIL;
IPin_AddRef(*ret = pin);
return S_OK;
}
IPin_AddRef(pin);
}
IPin_QueryPinInfo(peer, &info);

View File

@ -874,15 +874,15 @@ static void test_render_stream(void)
hr = ICaptureGraphBuilder2_RenderStream(capture_graph, NULL, &sink1_type,
(IUnknown *)&source.filter.IBaseFilter_iface, NULL, &sink.filter.IBaseFilter_iface);
todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(source.source1.pin.pin.peer == &transform.sink1.pin.pin.IPin_iface, "Got wrong connection.\n");
ok(transform.source1.pin.pin.peer == &sink.sink1.pin.pin.IPin_iface, "Got wrong connection.\n");
todo_wine ok(transform.source2.pin.pin.peer == &sink.sink2.pin.pin.IPin_iface, "Got wrong connection.\n");
ok(transform.source2.pin.pin.peer == &sink.sink2.pin.pin.IPin_iface, "Got wrong connection.\n");
ok(!source.source2.pin.pin.peer, "Pin should not be connected.\n");
disconnect_pins(graph, &source.source1);
disconnect_pins(graph, &transform.source1);
todo_wine disconnect_pins(graph, &transform.source2);
disconnect_pins(graph, &transform.source2);
/* Test categories. */