Skip to content

Commit 223e5fc

Browse files
committed
filtering transitional frames should be optional
1 parent 2c41495 commit 223e5fc

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

include/DMDUtil/Config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ class DMDUTILAPI Config
5353
int GetMaximumUnknownFramesToSkip() { return m_framesToSkip; }
5454
bool IsDumpNotColorizedFrames() const { return m_dumpNotColorizedFrames; }
5555
void SetDumpNotColorizedFrames(bool dumpNotColorizedFrames) { m_dumpNotColorizedFrames = dumpNotColorizedFrames; }
56+
bool IsFilterTransitionalFrames() const { return m_filterTransitionalFrames; }
57+
void SetFilterTransitionalFrames(bool filterTransitionalFrames)
58+
{
59+
m_filterTransitionalFrames = filterTransitionalFrames;
60+
}
5661
bool IsZeDMD() const { return m_zedmd; }
5762
void SetZeDMD(bool zedmd) { m_zedmd = zedmd; }
5863
const char* GetZeDMDDevice() const { return m_zedmdDevice.c_str(); }
@@ -99,6 +104,7 @@ class DMDUTILAPI Config
99104
int m_framesTimeout;
100105
int m_framesToSkip;
101106
bool m_dumpNotColorizedFrames;
107+
bool m_filterTransitionalFrames;
102108
bool m_zedmd;
103109
std::string m_zedmdDevice;
104110
bool m_zedmdDebug;

src/Config.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Config::Config()
2424
m_framesTimeout = 0;
2525
m_framesToSkip = 0;
2626
m_dumpNotColorizedFrames = false;
27+
m_filterTransitionalFrames = false;
2728
m_zedmd = true;
2829
m_zedmdDevice.clear();
2930
m_zedmdDebug = false;

src/DMD.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ void DMD::DumpDMDTxtThread()
14651465

14661466
Config* const pConfig = Config::GetInstance();
14671467
bool dumpNotColorizedFrames = pConfig->IsDumpNotColorizedFrames();
1468+
bool filterTransitionalFrames = pConfig->IsFilterTransitionalFrames();
14681469

14691470
while (true)
14701471
{
@@ -1493,8 +1494,6 @@ void DMD::DumpDMDTxtThread()
14931494
((m_pUpdateBufferQueue[bufferPosition]->mode == Mode::Data && !dumpNotColorizedFrames) ||
14941495
(m_pUpdateBufferQueue[bufferPosition]->mode == Mode::NotColorized && dumpNotColorizedFrames)))
14951496
{
1496-
Log(DMDUtil_LogLevel_DEBUG, "DumpDMDTxt: handle frame, mode %d", m_pUpdateBufferQueue[bufferPosition]->mode);
1497-
14981497
bool update = false;
14991498
if (strcmp(m_romName, name) != 0)
15001499
{
@@ -1521,15 +1520,14 @@ void DMD::DumpDMDTxtThread()
15211520
if (name[0] != '\0')
15221521
{
15231522
int length = (int)m_pUpdateBufferQueue[bufferPosition]->width * m_pUpdateBufferQueue[bufferPosition]->height;
1524-
Log(DMDUtil_LogLevel_DEBUG, "DumpDMDTxt: handle frame, length %d", length);
15251523
if (update || (memcmp(renderBuffer[1], m_pUpdateBufferQueue[bufferPosition]->data, length) != 0))
15261524
{
15271525
passed[2] = (uint32_t)(std::chrono::duration_cast<std::chrono::milliseconds>(
15281526
std::chrono::steady_clock::now() - start)
15291527
.count());
15301528
memcpy(renderBuffer[2], m_pUpdateBufferQueue[bufferPosition]->data, length);
15311529

1532-
if (m_pUpdateBufferQueue[bufferPosition]->depth == 2 &&
1530+
if (filterTransitionalFrames && m_pUpdateBufferQueue[bufferPosition]->depth == 2 &&
15331531
(passed[2] - passed[1]) < DMDUTIL_MAX_TRANSITIONAL_FRAME_DURATION)
15341532
{
15351533
int i = 0;

0 commit comments

Comments
 (0)