Skip to content

Commit

Permalink
Add flatbuffers logging
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev committed Aug 9, 2024
1 parent 28e12d2 commit 1b4a076
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions sources/flatbuffers/server/FlatBuffersServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,8 @@ void FlatBuffersServer::handlerImportFromProto(int priority, int duration, const

void FlatBuffersServer::handlerImageReceived(int priority, FlatBuffersParser::FlatbuffersTransientImage* flatImage, int timeout_ms, hyperhdr::Components origin, QString clientDescription)
{
static unsigned int logger = 0;

if (QThread::currentThread() != this->thread())
{
Error(_log, "Sanity check. FlatBuffersServer::handlerImageReceived uses the wrong thread affiliation.");
Expand All @@ -296,8 +298,16 @@ void FlatBuffersServer::handlerImageReceived(int priority, FlatBuffersParser::Fl
{
_currentLutPixelFormat = PixelFormat::RGB24;
loadLutFile();
logger = 0;
}

if (logger++ < 10)
{
Debug(_log, "RGB flatbuffers frame (%i)", logger);
}



if (flatImage->size != flatImage->width * flatImage->height * 3)
{
Error(_log, "The RGB image data size does not match the width and height");
Expand All @@ -324,8 +334,15 @@ void FlatBuffersServer::handlerImageReceived(int priority, FlatBuffersParser::Fl
flatImage->firstPlane.size, flatImage->firstPlane.stride,
flatImage->secondPlane.size, flatImage->secondPlane.stride,
flatImage->size, flatImage->width, flatImage->height);
logger = 0;
}

if (logger++ < 10)
{
Debug(_log, "NV12 flatbuffers frame (%i)", logger);
}


if (!_lutBufferInit)
{
Error(_log, "The LUT file is not loaded");
Expand Down

0 comments on commit 1b4a076

Please sign in to comment.