From bea7c94cae05f474a34a930ac89826eac639b039 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 10 Jan 2020 11:00:46 +1100 Subject: [PATCH] [client/c-host] updated to use new LGMP naming conventions --- VERSION | 2 +- c-host/src/app.c | 36 ++++++++++++++++++------------------ client/src/main.c | 6 +++--- client/src/main.h | 4 ++-- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/VERSION b/VERSION index 57cd0bbd..a2aa94b4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-62-g2d755a45e0+1 \ No newline at end of file +B1-63-g6f551c770c+1 \ No newline at end of file diff --git a/c-host/src/app.c b/c-host/src/app.c index 5b885e6b..54d6c30d 100644 --- a/c-host/src/app.c +++ b/c-host/src/app.c @@ -48,16 +48,16 @@ struct app { PLGMPHost lgmp; - PLGMPHQueue pointerQueue; - PLGMPMemory pointerMemory[LGMP_Q_POINTER_LEN]; - PLGMPMemory pointerShape; - bool pointerShapeValid; - unsigned int pointerIndex; + PLGMPHostQueue pointerQueue; + PLGMPMemory pointerMemory[LGMP_Q_POINTER_LEN]; + PLGMPMemory pointerShape; + bool pointerShapeValid; + unsigned int pointerIndex; - size_t maxFrameSize; - PLGMPHQueue frameQueue; - PLGMPMemory frameMemory[LGMP_Q_FRAME_LEN]; - unsigned int frameIndex; + size_t maxFrameSize; + PLGMPHostQueue frameQueue; + PLGMPMemory frameMemory[LGMP_Q_FRAME_LEN]; + unsigned int frameIndex; CaptureInterface * iface; @@ -121,7 +121,7 @@ static int frameThread(void * opaque) case CAPTURE_RESULT_TIMEOUT: { - if (frameValid && lgmpHostNewSubCount(app.frameQueue) > 0) + if (frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0) { // resend the last frame repeatFrame = true; @@ -142,7 +142,7 @@ static int frameThread(void * opaque) // if we are repeating a frame just send the last frame again if (repeatFrame) { - lgmpHostPost(app.frameQueue, 0, app.frameMemory[app.frameIndex]); + lgmpHostQueuePost(app.frameQueue, 0, app.frameMemory[app.frameIndex]); continue; } @@ -173,7 +173,7 @@ static int frameThread(void * opaque) framebuffer_prepare(fb); /* we post and then get the frame, this is intentional! */ - lgmpHostPost(app.frameQueue, 0, app.frameMemory[app.frameIndex]); + lgmpHostQueuePost(app.frameQueue, 0, app.frameMemory[app.frameIndex]); app.iface->getFrame(fb); } DEBUG_INFO("Frame thread stopped"); @@ -275,7 +275,7 @@ bool captureGetPointerBuffer(void ** data, uint32_t * size) void capturePostPointerBuffer(CapturePointer pointer) { PLGMPMemory mem; - const bool newClient = lgmpHostNewSubCount(app.pointerQueue) > 0; + const bool newClient = lgmpHostQueueNewSubs(app.pointerQueue) > 0; if (pointer.shapeUpdate || newClient) { @@ -326,12 +326,12 @@ void capturePostPointerBuffer(CapturePointer pointer) ((pointer.shapeUpdate || newClient) && app.pointerShapeValid) ? 1 : 0; LGMP_STATUS status; - while ((status = lgmpHostPost(app.pointerQueue, sendShape, mem)) != LGMP_OK) + while ((status = lgmpHostQueuePost(app.pointerQueue, sendShape, mem)) != LGMP_OK) { if (status == LGMP_ERR_QUEUE_FULL) continue; - DEBUG_ERROR("lgmpHostPost Failed (Pointer): %s", lgmpStatusString(status)); + DEBUG_ERROR("lgmpHostQueuePost Failed (Pointer): %s", lgmpStatusString(status)); return; } } @@ -390,15 +390,15 @@ int app_main(int argc, char * argv[]) goto fail; } - if ((status = lgmpHostAddQueue(app.lgmp, LGMP_Q_FRAME, LGMP_Q_FRAME_LEN, &app.frameQueue)) != LGMP_OK) + if ((status = lgmpHostQueueNew(app.lgmp, LGMP_Q_FRAME, LGMP_Q_FRAME_LEN, &app.frameQueue)) != LGMP_OK) { DEBUG_ERROR("lgmpHostQueueCreate Failed (Frame): %s", lgmpStatusString(status)); goto fail; } - if ((status = lgmpHostAddQueue(app.lgmp, LGMP_Q_POINTER, LGMP_Q_POINTER_LEN, &app.pointerQueue)) != LGMP_OK) + if ((status = lgmpHostQueueNew(app.lgmp, LGMP_Q_POINTER, LGMP_Q_POINTER_LEN, &app.pointerQueue)) != LGMP_OK) { - DEBUG_ERROR("lgmpHostAddQueue Failed (Pointer): %s", lgmpStatusString(status)); + DEBUG_ERROR("lgmpHostQueueNew Failed (Pointer): %s", lgmpStatusString(status)); goto fail; } diff --git a/client/src/main.c b/client/src/main.c index ef744c4a..d7c2398b 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -237,7 +237,7 @@ static int renderThread(void * unused) static int cursorThread(void * unused) { LGMP_STATUS status; - PLGMPCQueue queue; + PLGMPClientQueue queue; LG_RendererCursor cursorType = LG_CURSOR_COLOR; lgWaitEvent(e_startup, TIMEOUT_INFINITE); @@ -328,8 +328,8 @@ static int cursorThread(void * unused) static int frameThread(void * unused) { - LGMP_STATUS status; - PLGMPCQueue queue; + LGMP_STATUS status; + PLGMPClientQueue queue; SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH); lgWaitEvent(e_startup, TIMEOUT_INFINITE); diff --git a/client/src/main.h b/client/src/main.h index cfd7f33f..e535662b 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -60,8 +60,8 @@ struct AppState struct IVSHMEM shm; PLGMPClient lgmp; - PLGMPCQueue frameQueue; - PLGMPCQueue pointerQueue; + PLGMPClientQueue frameQueue; + PLGMPClientQueue pointerQueue; uint64_t frameTime; uint64_t lastFrameTime;