suc=capCaptureSequence(dlg->hWndCap);
dlg->isRecording = true;
// don't exit the thread until the record button is pressed again
::ResetEvent(dlg->threadEndEvent);
while(WaitForSingleObject(dlg->threadEndEvent,1000)!=WAIT_OBJECT_0)
{
;
}
这段代码为什么一执行,它会丢掉帧数呢》???并且会跳出来
dlg->isRecording = true;
// don't exit the thread until the record button is pressed again
::ResetEvent(dlg->threadEndEvent);
while(WaitForSingleObject(dlg->threadEndEvent,1000)!=WAIT_OBJECT_0)
{
;
}
这段代码为什么一执行,它会丢掉帧数呢》???并且会跳出来
while(WaitForSingleObject(dlg->threadEndEvent,1000)!=WAIT_OBJECT_0)
{
;
}
是什么目的?
如果是为了等待dlg->threadEndEvent的信号产生,应该用:
while(WaitForSingleObject(dlg->threadEndEvent, INFINITE)!=WAIT_OBJECT_0);
SetWindowText(dlg->m_recordbtn.GetSafeHwnd(), "停止");
// capture the video
suc=capCaptureSequence(dlg->hWndCap);
dlg->isRecording = true;
// don't exit the thread until the record button is pressed again
::ResetEvent(dlg->threadEndEvent);
while(WaitForSingleObject(dlg->threadEndEvent,1000)!=WAIT_OBJECT_0)
{
;
}