mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client/c-host] updated to use new LGMP naming conventions
This commit is contained in:
parent
e7239c53fd
commit
bea7c94cae
@ -48,16 +48,16 @@ struct app
|
|||||||
{
|
{
|
||||||
PLGMPHost lgmp;
|
PLGMPHost lgmp;
|
||||||
|
|
||||||
PLGMPHQueue pointerQueue;
|
PLGMPHostQueue pointerQueue;
|
||||||
PLGMPMemory pointerMemory[LGMP_Q_POINTER_LEN];
|
PLGMPMemory pointerMemory[LGMP_Q_POINTER_LEN];
|
||||||
PLGMPMemory pointerShape;
|
PLGMPMemory pointerShape;
|
||||||
bool pointerShapeValid;
|
bool pointerShapeValid;
|
||||||
unsigned int pointerIndex;
|
unsigned int pointerIndex;
|
||||||
|
|
||||||
size_t maxFrameSize;
|
size_t maxFrameSize;
|
||||||
PLGMPHQueue frameQueue;
|
PLGMPHostQueue frameQueue;
|
||||||
PLGMPMemory frameMemory[LGMP_Q_FRAME_LEN];
|
PLGMPMemory frameMemory[LGMP_Q_FRAME_LEN];
|
||||||
unsigned int frameIndex;
|
unsigned int frameIndex;
|
||||||
|
|
||||||
CaptureInterface * iface;
|
CaptureInterface * iface;
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ static int frameThread(void * opaque)
|
|||||||
|
|
||||||
case CAPTURE_RESULT_TIMEOUT:
|
case CAPTURE_RESULT_TIMEOUT:
|
||||||
{
|
{
|
||||||
if (frameValid && lgmpHostNewSubCount(app.frameQueue) > 0)
|
if (frameValid && lgmpHostQueueNewSubs(app.frameQueue) > 0)
|
||||||
{
|
{
|
||||||
// resend the last frame
|
// resend the last frame
|
||||||
repeatFrame = true;
|
repeatFrame = true;
|
||||||
@ -142,7 +142,7 @@ static int frameThread(void * opaque)
|
|||||||
// 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)
|
||||||
{
|
{
|
||||||
lgmpHostPost(app.frameQueue, 0, app.frameMemory[app.frameIndex]);
|
lgmpHostQueuePost(app.frameQueue, 0, app.frameMemory[app.frameIndex]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ static int frameThread(void * opaque)
|
|||||||
framebuffer_prepare(fb);
|
framebuffer_prepare(fb);
|
||||||
|
|
||||||
/* we post and then get the frame, this is intentional! */
|
/* 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);
|
app.iface->getFrame(fb);
|
||||||
}
|
}
|
||||||
DEBUG_INFO("Frame thread stopped");
|
DEBUG_INFO("Frame thread stopped");
|
||||||
@ -275,7 +275,7 @@ bool captureGetPointerBuffer(void ** data, uint32_t * size)
|
|||||||
void capturePostPointerBuffer(CapturePointer pointer)
|
void capturePostPointerBuffer(CapturePointer pointer)
|
||||||
{
|
{
|
||||||
PLGMPMemory mem;
|
PLGMPMemory mem;
|
||||||
const bool newClient = lgmpHostNewSubCount(app.pointerQueue) > 0;
|
const bool newClient = lgmpHostQueueNewSubs(app.pointerQueue) > 0;
|
||||||
|
|
||||||
if (pointer.shapeUpdate || newClient)
|
if (pointer.shapeUpdate || newClient)
|
||||||
{
|
{
|
||||||
@ -326,12 +326,12 @@ void capturePostPointerBuffer(CapturePointer pointer)
|
|||||||
((pointer.shapeUpdate || newClient) && app.pointerShapeValid) ? 1 : 0;
|
((pointer.shapeUpdate || newClient) && app.pointerShapeValid) ? 1 : 0;
|
||||||
|
|
||||||
LGMP_STATUS status;
|
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)
|
if (status == LGMP_ERR_QUEUE_FULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
DEBUG_ERROR("lgmpHostPost Failed (Pointer): %s", lgmpStatusString(status));
|
DEBUG_ERROR("lgmpHostQueuePost Failed (Pointer): %s", lgmpStatusString(status));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,15 +390,15 @@ int app_main(int argc, char * argv[])
|
|||||||
goto fail;
|
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));
|
DEBUG_ERROR("lgmpHostQueueCreate Failed (Frame): %s", lgmpStatusString(status));
|
||||||
goto fail;
|
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;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ static int renderThread(void * unused)
|
|||||||
static int cursorThread(void * unused)
|
static int cursorThread(void * unused)
|
||||||
{
|
{
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
PLGMPCQueue queue;
|
PLGMPClientQueue queue;
|
||||||
LG_RendererCursor cursorType = LG_CURSOR_COLOR;
|
LG_RendererCursor cursorType = LG_CURSOR_COLOR;
|
||||||
|
|
||||||
lgWaitEvent(e_startup, TIMEOUT_INFINITE);
|
lgWaitEvent(e_startup, TIMEOUT_INFINITE);
|
||||||
@ -328,8 +328,8 @@ static int cursorThread(void * unused)
|
|||||||
|
|
||||||
static int frameThread(void * unused)
|
static int frameThread(void * unused)
|
||||||
{
|
{
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
PLGMPCQueue queue;
|
PLGMPClientQueue queue;
|
||||||
|
|
||||||
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
|
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
|
||||||
lgWaitEvent(e_startup, TIMEOUT_INFINITE);
|
lgWaitEvent(e_startup, TIMEOUT_INFINITE);
|
||||||
|
@ -60,8 +60,8 @@ struct AppState
|
|||||||
|
|
||||||
struct IVSHMEM shm;
|
struct IVSHMEM shm;
|
||||||
PLGMPClient lgmp;
|
PLGMPClient lgmp;
|
||||||
PLGMPCQueue frameQueue;
|
PLGMPClientQueue frameQueue;
|
||||||
PLGMPCQueue pointerQueue;
|
PLGMPClientQueue pointerQueue;
|
||||||
|
|
||||||
uint64_t frameTime;
|
uint64_t frameTime;
|
||||||
uint64_t lastFrameTime;
|
uint64_t lastFrameTime;
|
||||||
|
Loading…
Reference in New Issue
Block a user