Skip to content

Commit 6749c25

Browse files
committed
fixed dump of not colorized frames
1 parent b89a40d commit 6749c25

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

include/DMDUtil/DMD.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class DMDUTILAPI DMD
8989
SerumV2_32_64, // int 7
9090
SerumV2_64, // int 8
9191
SerumV2_64_32, // int 9
92+
NotColorized, // int 10
9293
};
9394

9495
bool IsSerumMode(Mode mode)

src/DMD.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,9 @@ void DMD::SerumThread()
781781
m_dmdFrameReady.load(std::memory_order_acquire);
782782
m_stopFlag.load(std::memory_order_acquire);
783783

784+
Config* const pConfig = Config::GetInstance();
785+
bool dumpNotColorizedFrames = pConfig->IsDumpNotColorizedFrames();
786+
784787
while (true)
785788
{
786789
std::shared_lock<std::shared_mutex> sl(m_dmdSharedMutex);
@@ -864,6 +867,19 @@ void DMD::SerumThread()
864867
prevTriggerId = m_pSerum->triggerID;
865868
}
866869
}
870+
else if (dumpNotColorizedFrames)
871+
{
872+
auto noSerumUpdate = std::make_shared<Update>();
873+
noSerumUpdate->mode = Mode::NotColorized;
874+
noSerumUpdate->depth = m_pUpdateBufferQueue[bufferPosition]->depth;
875+
noSerumUpdate->width = m_pUpdateBufferQueue[bufferPosition]->width;
876+
noSerumUpdate->height = m_pUpdateBufferQueue[bufferPosition]->height;
877+
memcpy(
878+
noSerumUpdate->data, m_pUpdateBufferQueue[bufferPosition]->data,
879+
(size_t)m_pUpdateBufferQueue[bufferPosition]->width * m_pUpdateBufferQueue[bufferPosition]->height);
880+
881+
QueueUpdate(noSerumUpdate, false);
882+
}
867883
}
868884
}
869885
}
@@ -1468,8 +1484,9 @@ void DMD::DumpDMDTxtThread()
14681484
// Don't use GetNextBufferPosition() here, we need all frames!
14691485
if (++bufferPosition >= DMDUTIL_FRAME_BUFFER_SIZE) bufferPosition = 0;
14701486

1471-
if (m_pUpdateBufferQueue[bufferPosition]->depth <= 4 &&
1472-
m_pUpdateBufferQueue[bufferPosition]->mode == Mode::Data && m_pUpdateBufferQueue[bufferPosition]->hasData)
1487+
if (m_pUpdateBufferQueue[bufferPosition]->depth <= 4 && m_pUpdateBufferQueue[bufferPosition]->hasData &&
1488+
(m_pUpdateBufferQueue[bufferPosition]->mode == Mode::Data ||
1489+
(m_pUpdateBufferQueue[bufferPosition]->mode == Mode::NotColorized && dumpNotColorizedFrames)))
14731490
{
14741491
bool update = false;
14751492
if (strcmp(m_romName, name) != 0)
@@ -1526,7 +1543,7 @@ void DMD::DumpDMDTxtThread()
15261543
if (f)
15271544
{
15281545
if (passed[0] > 0 &&
1529-
(!dumpNotColorizedFrames || (m_pSerum && (!IsSerumMode(m_pUpdateBufferQueue[bufferPosition]->mode)))))
1546+
(!dumpNotColorizedFrames || m_pUpdateBufferQueue[bufferPosition]->mode == Mode::NotColorized))
15301547
{
15311548
bool dump = true;
15321549

0 commit comments

Comments
 (0)