我想實現IPinFlowControl
接口,它有一個Block方法。如何在Directshow中實現IPinFlowControl接口
i相下面的代碼曾試圖,
Mux::NonDelegatingQueryInterface(REFIID iid, void** ppv)
{
if(iid==IID_IPinFlowControl)
{
return GetInterface((IPinFlowControl*) this, ppv);
}
return CBaseFilter::NonDelegatingQueryInterface(iid, ppv);
}
STDMETHODIMP Mux::Block(DWORD dwBlockFlags,HANDLE hEvent)
{
return S_OK;
}
和登記上述過濾器。
現在在代碼中,我創建上述過濾器的情況下,連接它的輸出引腳,然後嘗試
IPin *pMuxOut2 = NULL;
hr = FindUnconnectedPin(mux,PINDIR_OUTPUT,&pMuxOut2);
IPinFlowControl *pinFlowControl=NULL;
hr=pMuxOut2->QueryInterface(IID_IPinFlowControl,(void**)&pinFlowControl);
但我pinFlowControl得到E_NonInterface,
還請大家幫我正確地實現塊的方法來阻止和Unblock輸出。
謝謝@Wimmel,我會看出來,並會回你:) – meghana