From 21987cb4234e055854a839cc0879822e444699d6 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 17 May 2020 12:04:41 +1000 Subject: [PATCH] [obs] update to use new LGMP interface --- VERSION | 2 +- obs/lg.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1873aba9..6a130c38 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-191-gfc0dbd8782+1 \ No newline at end of file +B1-192-g18cc8d7cab+1 \ No newline at end of file diff --git a/obs/lg.c b/obs/lg.c index 346f1281..febedc9a 100644 --- a/obs/lg.c +++ b/obs/lg.c @@ -165,9 +165,23 @@ static void lgUpdate(void * data, obs_data_t * settings) this->state = STATE_OPEN; - if (lgmpClientInit(this->shmDev.mem, this->shmDev.size, &this->lgmp) != LGMP_OK) + uint32_t udataSize; + KVMFR * udata; + + if (lgmpClientInit(this->shmDev.mem, this->shmDev.size, &this->lgmp, + &udataSize, (uint8_t **)&udata) != LGMP_OK) return; + if (udataSize != sizeof(KVMFR) || + memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 || + udata->version != KVMFR_VERSION) + { + printf("The host application is not compatible with this client\n"); + printf("Expected KVMFR version %d\n", KVMFR_VERSION); + printf("This is not a Looking Glass error, do not report this\n"); + return; + } + this->state = STATE_STARTING; pthread_create(&this->frameThread, NULL, frameThread, this); }