From 34b84bb2849abf43f857824f49ffb766fd6bb731 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 6 Jun 2019 21:44:48 +0200 Subject: [PATCH] Add frame image index to frame data. --- server/TracyEvent.hpp | 1 + server/TracyWorker.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 843838ee..189f00fa 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -324,6 +324,7 @@ struct FrameEvent { int64_t start; int64_t end; + int32_t frameImage; }; struct FrameData diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 34596453..60dd80df 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1729,8 +1729,8 @@ void Worker::Exec() } m_timerMul = welcome.timerMul; const auto initEnd = TscTime( welcome.initEnd ); - m_data.framesBase->frames.push_back( FrameEvent{ TscTime( welcome.initBegin ), -1 } ); - m_data.framesBase->frames.push_back( FrameEvent{ initEnd, -1 } ); + m_data.framesBase->frames.push_back( FrameEvent{ TscTime( welcome.initBegin ), -1, -1 } ); + m_data.framesBase->frames.push_back( FrameEvent{ initEnd, -1, -1 } ); m_data.lastTime = initEnd; m_delay = TscTime( welcome.delay ); m_resolution = TscTime( welcome.resolution ); @@ -2826,7 +2826,7 @@ void Worker::ProcessFrameMark( const QueueFrameMark& ev ) assert( fd->continuous == 1 ); const auto time = TscTime( ev.time ); assert( fd->frames.empty() || fd->frames.back().start <= time ); - fd->frames.push_back( FrameEvent{ time, -1 } ); + fd->frames.push_back( FrameEvent{ time, -1, -1 } ); m_data.lastTime = std::max( m_data.lastTime, time ); } @@ -2844,7 +2844,7 @@ void Worker::ProcessFrameMarkStart( const QueueFrameMark& ev ) assert( fd->continuous == 0 ); const auto time = TscTime( ev.time ); assert( fd->frames.empty() || ( fd->frames.back().end <= time && fd->frames.back().end != -1 ) ); - fd->frames.push_back( FrameEvent{ time, -1 } ); + fd->frames.push_back( FrameEvent{ time, -1, -1 } ); m_data.lastTime = std::max( m_data.lastTime, time ); } @@ -2880,9 +2880,10 @@ void Worker::ProcessFrameImage( const QueueFrameImage& ev ) fi->ptr = (const char*)it->second; fi->w = ev.w; fi->h = ev.h; + m_data.frameImage.push_back( fi ); const auto idx = m_data.frameImage.size(); - m_data.frameImage.push_back( fi ); + m_data.framesBase->frames.back().frameImage = idx; m_pendingFrameImageData.erase( it ); }