mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[profiler] client: updated to use new lgmp API and path
This commit is contained in:
parent
007122df43
commit
aff19e13c7
@ -53,7 +53,7 @@ set(SOURCES
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common")
|
add_subdirectory("${PROJECT_TOP}/common" "${CMAKE_BINARY_DIR}/common")
|
||||||
add_subdirectory("${PROJECT_TOP}/LGMP/lgmp" "${CMAKE_BINARY_DIR}/lgmp" )
|
add_subdirectory("${PROJECT_TOP}/repos/LGMP/lgmp" "${CMAKE_BINARY_DIR}/lgmp" )
|
||||||
|
|
||||||
add_executable(profiler-client ${SOURCES})
|
add_executable(profiler-client ${SOURCES})
|
||||||
target_compile_options(profiler-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER})
|
target_compile_options(profiler-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER})
|
||||||
|
@ -104,25 +104,33 @@ static bool config_load(int argc, char * argv[])
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline uint64_t nanotime()
|
|
||||||
{
|
|
||||||
struct timespec time;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC_RAW, &time);
|
|
||||||
return ((uint64_t)time.tv_sec * 1e9) + time.tv_nsec;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int run()
|
static int run()
|
||||||
{
|
{
|
||||||
PLGMPClient lgmp;
|
PLGMPClient lgmp;
|
||||||
PLGMPClientQueue frameQueue;
|
PLGMPClientQueue frameQueue;
|
||||||
|
|
||||||
|
uint32_t udataSize;
|
||||||
|
KVMFR *udata;
|
||||||
|
|
||||||
LGMP_STATUS status;
|
LGMP_STATUS status;
|
||||||
if ((status = lgmpClientInit(state.shmDev.mem, state.shmDev.size, &lgmp)) != LGMP_OK)
|
if ((status = lgmpClientInit(state.shmDev.mem, state.shmDev.size, &lgmp,
|
||||||
|
&udataSize, (uint8_t **)&udata)) != LGMP_OK)
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("lgmpClientInit: %s", lgmpStatusString(status));
|
DEBUG_ERROR("lgmpClientInit: %s", lgmpStatusString(status));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (udataSize != sizeof(KVMFR) ||
|
||||||
|
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
|
||||||
|
udata->version != KVMFR_VERSION)
|
||||||
|
{
|
||||||
|
DEBUG_BREAK();
|
||||||
|
DEBUG_ERROR("The host application is not compatible with this client");
|
||||||
|
DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION);
|
||||||
|
DEBUG_BREAK();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((status = lgmpClientSubscribe(lgmp, LGMP_Q_FRAME, &frameQueue) != LGMP_OK))
|
if ((status = lgmpClientSubscribe(lgmp, LGMP_Q_FRAME, &frameQueue) != LGMP_OK))
|
||||||
{
|
{
|
||||||
DEBUG_ERROR("lgmpClientSubscribe: %s", lgmpStatusString(status));
|
DEBUG_ERROR("lgmpClientSubscribe: %s", lgmpStatusString(status));
|
||||||
|
Loading…
Reference in New Issue
Block a user