处理主对话框的WM_TIMER消息,判断某一路是否有视频信号。代码如下:
void CCaptureDlg::OnTimer(UINT nIDEvent)
{
//判断某一路是否有信号
eFieldFrequency frequency;
for (int i=0;i<m_DevNum;i++)
{
VCAGetVidFieldFrq(i,frequency); //获得视频源输入频率
if(frequency == FIELD_FREQ_0HZ) //无信号
{
if (m_Frame.m_pList[i].m_ShowImage == TRUE)
{
m_Frame.m_pList[i].m_ShowImage = FALSE;
m_Frame.m_pList[i].Invalidate(); //更新预览窗口
}
}
else
{
if(m_Frame.m_pList[i].m_ShowImage == FALSE) //判断是否显示图片
{
m_Frame.m_pList[i].m_ShowImage = TRUE;
m_Frame.m_pList[i].Invalidate(); //更新预览窗口
if(m_Frame.m_pList[i].m_Stop == psPreview)
{
//更新视频预览窗口
VCAUpdateOverlayWnd(m_Frame.m_hWnd);
VCAUpdateVideoPreview(i,m_Frame.m_pList[i].m_hWnd);
}
}
}
}
CDialog::OnTimer(nIDEvent);
}