[host] app: when running in sync mode send frame repeats as needed

This commit is contained in:
Geoffrey McRae 2021-07-25 17:10:06 +10:00
parent d9cdc8d26c
commit dafd7e7b42

View File

@ -182,7 +182,7 @@ static bool sendFrame(void)
if (app.frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0) if (app.frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0)
{ {
// resend the last frame // resend the last frame
repeatFrame = true; repeatFrame = app.iface->asyncCapture;
break; break;
} }
@ -195,7 +195,8 @@ static bool sendFrame(void)
// if we are repeating a frame just send the last frame again // if we are repeating a frame just send the last frame again
if (repeatFrame) if (repeatFrame)
{ {
if ((status = lgmpHostQueuePost(app.frameQueue, 0, app.frameMemory[app.frameIndex])) != LGMP_OK) if ((status = lgmpHostQueuePost(app.frameQueue, 0,
app.frameMemory[app.frameIndex])) != LGMP_OK)
DEBUG_ERROR("%s", lgmpStatusString(status)); DEBUG_ERROR("%s", lgmpStatusString(status));
return true; return true;
} }
@ -726,6 +727,14 @@ int app_main(int argc, char * argv[])
break; break;
case CAPTURE_RESULT_TIMEOUT: case CAPTURE_RESULT_TIMEOUT:
if (!iface->asyncCapture)
if (app.frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0)
{
if ((status = lgmpHostQueuePost(app.frameQueue, 0,
app.frameMemory[app.frameIndex])) != LGMP_OK)
DEBUG_ERROR("%s", lgmpStatusString(status));
}
continue; continue;
case CAPTURE_RESULT_REINIT: case CAPTURE_RESULT_REINIT: