Added reconnect function for filtergraph.

This commit is contained in:
Maarten Lankhorst 2005-05-18 13:25:49 +00:00 committed by Alexandre Julliard
parent 0caae47658
commit 05d658d012
1 changed files with 20 additions and 3 deletions

View File

@ -473,10 +473,27 @@ static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
IPin *ppin) {
ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
IPin *pConnectedTo = NULL;
HRESULT hr;
PIN_DIRECTION pindir;
TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppin);
return S_OK;
IPin_QueryDirection(ppin, &pindir);
hr = IPin_ConnectedTo(ppin, &pConnectedTo);
if (FAILED(hr)) {
TRACE("Querying connected to failed: %lx\n", hr);
return hr;
}
IPin_Disconnect(ppin);
IPin_Disconnect(pConnectedTo);
if (pindir == PINDIR_INPUT)
hr = IPin_Connect(pConnectedTo, ppin, NULL);
else
hr = IPin_Connect(ppin, pConnectedTo, NULL);
IPin_Release(pConnectedTo);
if (FAILED(hr))
ERR("Reconnecting pins failed, pins are not connected now..\n");
TRACE("(%p->%p) -- %p %p -> %lx\n", iface, This, ppin, pConnectedTo, hr);
return hr;
}
static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,