mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Kill "Rainbow lights" when v4l grabber has no signal (#334)
* on v4l screenshot, print out nosignal threshold values * separate fractional parameters for no signal detection * fully implement handling for "rainbow grabber"
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
// Qt includes
|
||||
#include <QObject>
|
||||
#include <QSocketNotifier>
|
||||
#include <QRectF>
|
||||
|
||||
// util includes
|
||||
#include <utils/Image.h>
|
||||
@@ -35,9 +36,12 @@ public:
|
||||
int height,
|
||||
int frameDecimation,
|
||||
int horizontalPixelDecimation,
|
||||
int verticalPixelDecimation);
|
||||
int verticalPixelDecimation
|
||||
);
|
||||
virtual ~V4L2Grabber();
|
||||
|
||||
QRectF getSignalDetectionOffset();
|
||||
|
||||
public slots:
|
||||
void setCropping(int cropLeft,
|
||||
int cropRight,
|
||||
@@ -46,11 +50,18 @@ public slots:
|
||||
|
||||
void set3D(VideoMode mode);
|
||||
|
||||
void setSignalThreshold(double redSignalThreshold,
|
||||
void setSignalThreshold(
|
||||
double redSignalThreshold,
|
||||
double greenSignalThreshold,
|
||||
double blueSignalThreshold,
|
||||
int noSignalCounterThreshold);
|
||||
|
||||
void setSignalDetectionOffset(
|
||||
double verticalMin,
|
||||
double horizontalMin,
|
||||
double verticalMax,
|
||||
double horizontalMax);
|
||||
|
||||
bool start();
|
||||
|
||||
void stop();
|
||||
@@ -137,4 +148,11 @@ private:
|
||||
Logger * _log;
|
||||
bool _initialized;
|
||||
bool _deviceAutoDiscoverEnabled;
|
||||
|
||||
bool _noSignalDetected;
|
||||
double _x_frac_min;
|
||||
double _y_frac_min;
|
||||
double _x_frac_max;
|
||||
double _y_frac_max;
|
||||
|
||||
};
|
||||
|
@@ -29,11 +29,10 @@ public:
|
||||
|
||||
public slots:
|
||||
bool start();
|
||||
|
||||
void stop();
|
||||
|
||||
void setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom);
|
||||
|
||||
void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax);
|
||||
void set3D(VideoMode mode);
|
||||
|
||||
// signals:
|
||||
|
@@ -61,3 +61,16 @@ inline bool operator<=(const ColorRgb & lhs, const ColorRgb & rhs)
|
||||
{
|
||||
return (lhs.red <= rhs.red) && (lhs.green <= rhs.green) && (lhs.blue <= rhs.blue);
|
||||
}
|
||||
|
||||
/// Compare operator to check if a color is 'greater' to another color
|
||||
inline bool operator>(const ColorRgb & lhs, const ColorRgb & rhs)
|
||||
{
|
||||
return (lhs.red > rhs.red) && (lhs.green > rhs.green) && (lhs.blue > rhs.blue);
|
||||
}
|
||||
|
||||
/// Compare operator to check if a color is 'greater' than or 'equal' to another color
|
||||
inline bool operator>=(const ColorRgb & lhs, const ColorRgb & rhs)
|
||||
{
|
||||
return (lhs.red >= rhs.red) && (lhs.green >= rhs.green) && (lhs.blue >= rhs.blue);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user