我有一個基於Directshow的mediaplayer應用程序。它在正常的playabck中沒有任何問題,效果很好。但偶爾我會遇到一個問題,當Mediaplayer剛開始系統啓動後。DIrectshow功能在系統啓動時被阻止
HRESULT CSDirectShow::RenderOutputPins (IBaseFilter* pFilter)
{
const char* funcName = "CSDirectShow::RenderOutputPins()";
HRESULT hr = S_OK;
// Enumerate all pins on the source filter,
// looking for the output pins so that I can call Render() on them
//
CComPtr<IEnumPins> pEnumPin;
if (!FAILED (pFilter->EnumPins (&pEnumPin)))
{
while (true)
{
// get the next pin
//
CComPtr<IPin> pPin;
if (pEnumPin->Next (1L, &pPin, NULL) != S_OK) break;
// I'm not interested in connected pins
// if this pin is an unconnected output pin, then render it.
//
CComPtr<IPin> pConnectedPin;
if (pPin->ConnectedTo (&pConnectedPin) == VFW_E_NOT_CONNECTED)
{
PIN_DIRECTION pinDirection;
PIN_INFO pinInfo;
//Get the information of the pin
if (pPin->QueryDirection (&pinDirection) == S_OK
&& pinDirection == PINDIR_OUTPUT
&& pPin->QueryPinInfo(&pinInfo) == S_OK
&& strstr((char*)pinInfo.achName,"~")==NULL)
{
if (FAILED (hr = m_pGB->Render (pPin)))
{
SafeRelease(&pinInfo.pFilter);
return hr;
}
}
SafeRelease(&pinInfo.pFilter);
}
}
}
TraceMsg ("%s: exit",funcName);
return S_OK;
}
當m_pGB->渲染(PPIN)被調用時,這個函數永遠不會返回它被阻止使用日誌。這裏面的問題。我確認只發生時,我立即開始我的應用程序啓動後。當問題occures如果我關閉並重新啓動我的應用程序它就像一個魅力。自從應用程序被設計爲自動啓動系統啓動後,這種行爲已經成爲一個更大的擔憂.Kindly幫助