From dafd7e7b4238ab6eb0af6095964cd9bd246eaad7 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 25 Jul 2021 17:10:06 +1000 Subject: [PATCH] [host] app: when running in sync mode send frame repeats as needed --- host/src/app.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/host/src/app.c b/host/src/app.c index cc3e6688..ed935aa6 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -182,7 +182,7 @@ static bool sendFrame(void) if (app.frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0) { // resend the last frame - repeatFrame = true; + repeatFrame = app.iface->asyncCapture; break; } @@ -195,7 +195,8 @@ static bool sendFrame(void) // if we are repeating a frame just send the last frame again 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)); return true; } @@ -726,6 +727,14 @@ int app_main(int argc, char * argv[]) break; 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; case CAPTURE_RESULT_REINIT: