我有一个基于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帮助