Skip to content

Commit

Permalink
Change confusing logic (#1731)
Browse files Browse the repository at this point in the history
* Change confusing logic

* Change confusing logic #2

* revert indent

---------

Co-authored-by: Thinner77 <none>
  • Loading branch information
Thinner77 authored May 13, 2024
1 parent 0a93af9 commit f6cc926
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/grabber/video/mediafoundation/MFGrabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public slots:
QAtomicInt _currentFrame;
ColorRgb _noSignalThresholdColor;
bool _signalDetectionEnabled,
_noSignalDetected,
_signalDetected,
_initialized,
_reload;
double _x_frac_min,
Expand Down
2 changes: 1 addition & 1 deletion include/grabber/video/v4l2/V4L2Grabber.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private slots:
// signal detection
int _noSignalCounterThreshold;
ColorRgb _noSignalThresholdColor;
bool _standbyActivated, _signalDetectionEnabled, _noSignalDetected;
bool _standbyActivated, _signalDetectionEnabled, _signalDetected;
int _noSignalCounter;
int _brightness, _contrast, _saturation, _hue;
double _x_frac_min;
Expand Down
6 changes: 3 additions & 3 deletions libsrc/grabber/video/mediafoundation/MFGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ MFGrabber::MFGrabber()
, _currentFrame(0)
, _noSignalThresholdColor(ColorRgb{0,0,0})
, _signalDetectionEnabled(true)
, _noSignalDetected(false)
, _signalDetected(false)
, _initialized(false)
, _reload(false)
, _x_frac_min(0.25)
Expand Down Expand Up @@ -580,7 +580,7 @@ void MFGrabber::newThreadFrame(Image<ColorRgb> image)
{
if (_noSignalCounter >= _noSignalCounterThreshold)
{
_noSignalDetected = true;
_signalDetected = true;
Info(_log, "Signal detected");
}

Expand All @@ -593,7 +593,7 @@ void MFGrabber::newThreadFrame(Image<ColorRgb> image)
}
else if (_noSignalCounter == _noSignalCounterThreshold)
{
_noSignalDetected = false;
_signalDetected = false;
Info(_log, "Signal lost");
}
}
Expand Down
6 changes: 3 additions & 3 deletions libsrc/grabber/video/v4l2/V4L2Grabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ V4L2Grabber::V4L2Grabber()
, _noSignalThresholdColor(ColorRgb{0,0,0})
, _standbyActivated(false)
, _signalDetectionEnabled(true)
, _noSignalDetected(false)
, _signalDetected(false)
, _noSignalCounter(0)
, _brightness(0)
, _contrast(0)
Expand Down Expand Up @@ -1060,7 +1060,7 @@ void V4L2Grabber::newThreadFrame(Image<ColorRgb> image)
{
if (_noSignalCounter >= _noSignalCounterThreshold)
{
_noSignalDetected = true;
_signalDetected = true;
Info(_log, "Signal detected");
}

Expand All @@ -1073,7 +1073,7 @@ void V4L2Grabber::newThreadFrame(Image<ColorRgb> image)
}
else if (_noSignalCounter == _noSignalCounterThreshold)
{
_noSignalDetected = false;
_signalDetected = false;
Info(_log, "Signal lost");
}
}
Expand Down

0 comments on commit f6cc926

Please sign in to comment.