camera预览概率死机
系统平台:wince6.0
硬件平台:marvell pxa303 + gt2005(2M Sensor)
调试camera驱动,发现概率死机的情况,查log发现是卡在Pindevice.cpp中
HandlePinIO -〉RemoveBufferFromList:
while(( dwCounter < m_ulMaxNumOfBuffers ) && ( *ppCsStreamDesc == NULL )) //For "camera and DShow integration test" sub-case 603
{
if( m_pStreamDescriptorList[ dwCounter ].pCsStreamDescriptorExternal != NULL )[b][/b] {
//REVIEW: All buffers accessed here should have been marshalled, check if try/except is needed
__try
{
// We found one registered buffer. Let's return it.
*ppCsStreamDesc = m_pStreamDescriptorList[ dwCounter ].pCsStreamDescriptorExternal;
*ppMappedData = m_pStreamDescriptorList[ dwCounter ].csStreamDescriptorShadow.CsStreamHeader.Data;
*ppUnmappedData = m_pStreamDescriptorList[ dwCounter ].pCsStreamDescriptorExternal->CsStreamHeader.Data;
m_pStreamDescriptorList[ dwCounter ].pCsStreamDescriptorExternal = NULL;
m_pStreamDescriptorList[ dwCounter ].csStreamDescriptorShadow.CsStreamHeader.Data = *ppUnmappedData;
break;
}
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
{
DEBUGMSG(ZONE_IOCTL|ZONE_ERROR, (_T("PIN_IOControl: RemoveBufferFromList - Access Violation.\r\n"))) ;
RetVal = false;
}
}
dwCounter++;
}
其中红色条件语句不满足,返回出错,此后一直在这边循环。。。
本来在HandlePinIO中调用WriteMsgQueue,通知应用提取数据,也即应该调用EnqueueDescriptor,同时会在EnqueueDescriptor中对m_pStreamDescriptorList进行赋值,这样RemoveBufferFromList才不会出错!但是不知为何EnqueueDescriptor一直得不到触发,这个是微软上层封装的,无从查起,不知有哪位高人碰到过类似的问题,请提点一两,感激不尽,哈哈!!!!!
[解决办法]