Commit d9003a04 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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

parent 1371838d
...@@ -505,28 +505,38 @@ static HRESULT find_unconnected_source_from_filter(CaptureGraphImpl *capture_gra ...@@ -505,28 +505,38 @@ static HRESULT find_unconnected_source_from_filter(CaptureGraphImpl *capture_gra
static HRESULT find_unconnected_source_from_pin(CaptureGraphImpl *capture_graph, static HRESULT find_unconnected_source_from_pin(CaptureGraphImpl *capture_graph,
const GUID *category, const GUID *majortype, IPin *pin, IPin **ret) const GUID *category, const GUID *majortype, IPin *pin, IPin **ret)
{ {
PIN_DIRECTION dir;
PIN_INFO info; PIN_INFO info;
HRESULT hr; HRESULT hr;
IPin *peer; IPin *peer;
IPin_QueryDirection(pin, &dir);
if (dir != PINDIR_OUTPUT)
return VFW_E_INVALID_DIRECTION;
if (category && (IsEqualGUID(category, &PIN_CATEGORY_CAPTURE) if (category && (IsEqualGUID(category, &PIN_CATEGORY_CAPTURE)
|| IsEqualGUID(category, &PIN_CATEGORY_PREVIEW))) || IsEqualGUID(category, &PIN_CATEGORY_PREVIEW)))
{ {
if (FAILED(hr = match_smart_tee_pin(capture_graph, category, majortype, (IUnknown *)pin, &pin))) if (FAILED(hr = match_smart_tee_pin(capture_graph, category, majortype, (IUnknown *)pin, &pin)))
return hr; return hr;
}
else if (pin_matches(pin, PINDIR_OUTPUT, category, majortype, FALSE)) if (FAILED(IPin_ConnectedTo(pin, &peer)))
{ {
IPin_AddRef(pin); *ret = pin;
hr = S_OK; return S_OK;
}
} }
else else
return E_FAIL;
if (FAILED(IPin_ConnectedTo(pin, &peer)))
{ {
*ret = pin; if (FAILED(IPin_ConnectedTo(pin, &peer)))
return hr; {
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); IPin_QueryPinInfo(peer, &info);
......
...@@ -874,15 +874,15 @@ static void test_render_stream(void) ...@@ -874,15 +874,15 @@ static void test_render_stream(void)
hr = ICaptureGraphBuilder2_RenderStream(capture_graph, NULL, &sink1_type, hr = ICaptureGraphBuilder2_RenderStream(capture_graph, NULL, &sink1_type,
(IUnknown *)&source.filter.IBaseFilter_iface, NULL, &sink.filter.IBaseFilter_iface); (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(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"); 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"); ok(!source.source2.pin.pin.peer, "Pin should not be connected.\n");
disconnect_pins(graph, &source.source1); disconnect_pins(graph, &source.source1);
disconnect_pins(graph, &transform.source1); disconnect_pins(graph, &transform.source1);
todo_wine disconnect_pins(graph, &transform.source2); disconnect_pins(graph, &transform.source2);
/* Test categories. */ /* Test categories. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment