Hyperion "Light", Build improvements and minor fixes (#1400)

* Allow build, if no grabbers are enabled

* Align available functions to right Qt version

* Update to next development version

* Align available functions to right Qt version

* fix workflows (apt/nightly)

* Disable QNetworkConfigurationManager deprecation warnings

* Initial go on Smart Pointers

* Add Deallocation

* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)

* Cluster Build Variables

* Hyperion Light

* Address build warnings

* Hyperion Light - UI

* Update Protobuf to latest master

* Removed compiler warnings

* Added restart ability to systray

* Correct Protobuf

* Ignore 'no-return' warning on protobuf build

* hyperion-remote: Fix auto discovery of hyperion server

* Fix Qt version override

* Update changelog

* Remove Grabber Components, if no Grabber exists

* Standalone Grabber - Fix fps default

* Remote Control - Have Source Selction accrosswhole screen

* Enable Blackborder detection only, if relevant input sources available

* Enable Blackborder detection only, if relevant input sources available

* Remote UI - rearrange containers

* - QT5/6 path for arm64 added
- Remove ZLib Dependency
- Fix macOS bundle info details
- Cleanup

Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
This commit is contained in:
LordGrey
2022-01-07 14:47:51 +01:00
committed by GitHub
parent c38ec60208
commit 2f573a117f
83 changed files with 1785 additions and 1284 deletions

View File

@@ -0,0 +1,15 @@
#ifndef GRABBERTYPE_H
#define GRABBERTYPE_H
enum class GrabberType {
SCREEN,
VIDEO,
};
enum class GrabberTypeFilter {
ALL,
SCREEN,
VIDEO,
};
#endif // GRABBERTYPE_H

View File

@@ -16,6 +16,8 @@
#include <utils/settings.h>
#include <utils/VideoStandard.h>
#include <grabber/GrabberType.h>
class Grabber;
class GlobalSignals;
class QTimer;
@@ -67,16 +69,17 @@ public:
///
/// @brief Get active grabber name
/// @param hyperionInd The instance index
/// @param type Filter for a given grabber type
/// @return Active grabbers
///
virtual QStringList getActive(int inst) const;
virtual QStringList getActive(int inst, GrabberTypeFilter type = GrabberTypeFilter::ALL) const;
bool getSysGrabberState() const { return GLOBAL_GRABBER_SYS_ENABLE; }
void setSysGrabberState(bool sysGrabberState){ GLOBAL_GRABBER_SYS_ENABLE = sysGrabberState; }
bool getV4lGrabberState() const { return GLOBAL_GRABBER_V4L_ENABLE; }
void setV4lGrabberState(bool v4lGrabberState){ GLOBAL_GRABBER_V4L_ENABLE = v4lGrabberState; }
static QStringList availableGrabbers();
static QStringList availableGrabbers(GrabberTypeFilter type = GrabberTypeFilter::ALL);
public:
template <typename Grabber_T>

View File

@@ -38,7 +38,9 @@
// Forward class declaration
class HyperionDaemon;
class ImageProcessor;
#if defined(ENABLE_FORWARDER)
class MessageForwarder;
#endif
class LinearColorSmoothing;
class EffectEngine;
class MultiColorAdjustment;
@@ -46,7 +48,7 @@ class ColorAdjustment;
class SettingsManager;
class BGEffectHandler;
class CaptureCont;
#if defined(ENABLE_BOBLIGHT)
#if defined(ENABLE_BOBLIGHT_SERVER)
class BoblightServer;
#endif
class LedDeviceWrapper;
@@ -534,8 +536,10 @@ private:
/// Effect engine
EffectEngine * _effectEngine;
#if defined(ENABLE_FORWARDER)
// Message forwarder
MessageForwarder * _messageForwarder;
#endif
/// Logger instance
Logger * _log;
@@ -555,7 +559,7 @@ private:
VideoMode _currVideoMode = VideoMode::VIDEO_2D;
#if defined(ENABLE_BOBLIGHT)
#if defined(ENABLE_BOBLIGHT_SERVER)
/// Boblight instance
BoblightServer* _boblightServer;
#endif

View File

@@ -6,7 +6,7 @@
#include <utils/ColorRgb.h>
#include <utils/Components.h>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
#include <QRecursiveMutex>
#else
#include <QMutex>
@@ -129,7 +129,7 @@ protected:
/// contains all available led device constructors
static LedDeviceRegistry _ledDeviceMap;
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
static QRecursiveMutex _ledDeviceMapLock;
#else
static QMutex _ledDeviceMapLock;

View File

@@ -2,7 +2,7 @@
#undef slots
#include <Python.h>
#define slots
#define slots Q_SLOTS
// decl
extern PyThreadState* mainThreadState;

View File

@@ -22,7 +22,7 @@ class SSDPHandler : public SSDPServer
{
Q_OBJECT
public:
SSDPHandler(WebServer* webserver, quint16 flatBufPort, quint16 protoBufPort, quint16 jsonServerPort, quint16 sslPort, const QString &name, QObject * parent = nullptr);
SSDPHandler(WebServer* webserver, quint16 flatBufPort, quint16 protoBufPort, quint16 jsonServerPort, quint16 sslPort, const QString& name, QObject* parent = nullptr);
~SSDPHandler() override;
///
@@ -87,21 +87,37 @@ private slots:
///
void handleMSearchRequest(const QString& target, const QString& mx, const QString address, quint16 port);
///
/// @brief Handle changes in the network configuration
/// @param conig New config
///
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
void handleNetworkConfigurationChanged(const QNetworkConfiguration &config);
#endif
private:
WebServer* _webserver;
QString _localAddress;
QString _uuid;
/// Targets for announcement
std::vector<QString> _deviceList;
//Handle elements deprecated from Qt 6.x and reported as deprecatedsince 5.15.x
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
#endif
private slots:
///
/// @brief Handle changes in the network configuration
/// @param conig New config
///
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
void handleNetworkConfigurationChanged(const QNetworkConfiguration& config);
#endif
private:
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QNetworkConfigurationManager* _NCA;
#endif
QString _uuid;
/// Targets for announcement
std::vector<QString> _deviceList;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
QT_WARNING_POP
#endif
};

View File

@@ -15,8 +15,10 @@ enum Components
COMP_ALL,
COMP_SMOOTHING,
COMP_BLACKBORDER,
#if defined(ENABLE_FORWARDER)
COMP_FORWARDER,
#if defined(ENABLE_BOBLIGHT)
#endif
#if defined(ENABLE_BOBLIGHT_SERVER)
COMP_BOBLIGHTSERVER,
#endif
COMP_GRABBER,
@@ -25,8 +27,12 @@ enum Components
COMP_IMAGE,
COMP_EFFECT,
COMP_LEDDEVICE,
#if defined(ENABLE_FLATBUF_SERVER)
COMP_FLATBUFSERVER,
#endif
#if defined(ENABLE_PROTOBUF_SERVER)
COMP_PROTOSERVER
#endif
};
inline const char* componentToString(Components c)
@@ -36,8 +42,10 @@ inline const char* componentToString(Components c)
case COMP_ALL: return "Hyperion";
case COMP_SMOOTHING: return "Smoothing";
case COMP_BLACKBORDER: return "Blackborder detector";
#if defined(ENABLE_FORWARDER)
case COMP_FORWARDER: return "Json/Proto forwarder";
#if defined(ENABLE_BOBLIGHT)
#endif
#if defined(ENABLE_BOBLIGHT_SERVER)
case COMP_BOBLIGHTSERVER:return "Boblight server";
#endif
case COMP_GRABBER: return "Framegrabber";
@@ -46,8 +54,12 @@ inline const char* componentToString(Components c)
case COMP_EFFECT: return "Effect";
case COMP_IMAGE: return "Image";
case COMP_LEDDEVICE: return "LED device";
#if defined(ENABLE_FLATBUF_SERVER)
case COMP_FLATBUFSERVER: return "Image Receiver";
#endif
#if defined(ENABLE_PROTOBUF_SERVER)
case COMP_PROTOSERVER: return "Proto Server";
#endif
default: return "";
}
}
@@ -59,8 +71,10 @@ inline const char* componentToIdString(Components c)
case COMP_ALL: return "ALL";
case COMP_SMOOTHING: return "SMOOTHING";
case COMP_BLACKBORDER: return "BLACKBORDER";
#if defined(ENABLE_FORWARDER)
case COMP_FORWARDER: return "FORWARDER";
#if defined(ENABLE_BOBLIGHT)
#endif
#if defined(ENABLE_BOBLIGHT_SERVER)
case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER";
#endif
case COMP_GRABBER: return "GRABBER";
@@ -69,8 +83,12 @@ inline const char* componentToIdString(Components c)
case COMP_EFFECT: return "EFFECT";
case COMP_IMAGE: return "IMAGE";
case COMP_LEDDEVICE: return "LEDDEVICE";
#if defined(ENABLE_FLATBUF_SERVER)
case COMP_FLATBUFSERVER: return "FLATBUFSERVER";
#endif
#if defined(ENABLE_PROTOBUF_SERVER)
case COMP_PROTOSERVER: return "PROTOSERVER";
#endif
default: return "";
}
}
@@ -81,8 +99,10 @@ inline Components stringToComponent(const QString& component)
if (cmp == "ALL") return COMP_ALL;
if (cmp == "SMOOTHING") return COMP_SMOOTHING;
if (cmp == "BLACKBORDER") return COMP_BLACKBORDER;
#if defined(ENABLE_FORWARDER)
if (cmp == "FORWARDER") return COMP_FORWARDER;
#if defined(ENABLE_BOBLIGHT)
#endif
#if defined(ENABLE_BOBLIGHT_SERVER)
if (cmp == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;
#endif
if (cmp == "GRABBER") return COMP_GRABBER;
@@ -91,8 +111,12 @@ inline Components stringToComponent(const QString& component)
if (cmp == "EFFECT") return COMP_EFFECT;
if (cmp == "IMAGE") return COMP_IMAGE;
if (cmp == "LEDDEVICE") return COMP_LEDDEVICE;
#if defined(ENABLE_FLATBUF_SERVER)
if (cmp == "FLATBUFSERVER") return COMP_FLATBUFSERVER;
#endif
#if defined(ENABLE_PROTOBUF_SERVER)
if (cmp == "PROTOSERVER") return COMP_PROTOSERVER;
#endif
return COMP_INVALID;
}

View File

@@ -7,7 +7,7 @@
#include <QAtomicInteger>
#include <QList>
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
#include <QRecursiveMutex>
#else
#include <QMutex>
@@ -86,7 +86,7 @@ protected:
private:
void write(const Logger::T_LOG_MESSAGE & message);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
static QRecursiveMutex MapLock;
#else
static QMutex MapLock;

View File

@@ -1,4 +1,5 @@
#pragma once
#include <memory>
#include <QObject>
#include <QString>
@@ -35,7 +36,7 @@ private:
SysInfo();
void getCPUInfo();
static SysInfo* _instance;
static std::unique_ptr <SysInfo> _instance;
HyperionSysInfo _sysinfo;
};