mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
remove kodiVideoChecker (#475)
This commit is contained in:
@@ -101,7 +101,7 @@ public:
|
||||
///
|
||||
/// Enable/Disable components during runtime
|
||||
///
|
||||
/// @param component The component [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER]
|
||||
/// @param component The component [SMOOTHING, BLACKBORDER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER]
|
||||
/// @param state The state of the component [true | false]
|
||||
///
|
||||
void setComponentState(const QString & component, const bool state);
|
||||
|
@@ -73,8 +73,8 @@ int main(int argc, char * argv[])
|
||||
BooleanOption & argSysInfo = parser.add<BooleanOption>('s', "sysinfo" , "show system info");
|
||||
BooleanOption & argClear = parser.add<BooleanOption>('x', "clear" , "Clear data for the priority channel provided by the -p option");
|
||||
BooleanOption & argClearAll = parser.add<BooleanOption>(0x0, "clearall" , "Clear data for all active priority channels");
|
||||
Option & argEnableComponent = parser.add<Option> ('E', "enable" , "Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L, LEDDEVICE]");
|
||||
Option & argDisableComponent = parser.add<Option> ('D', "disable" , "Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L, LEDDEVICE]");
|
||||
Option & argEnableComponent = parser.add<Option> ('E', "enable" , "Enable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L, LEDDEVICE]");
|
||||
Option & argDisableComponent = parser.add<Option> ('D', "disable" , "Disable the Component with the given name. Available Components are [SMOOTHING, BLACKBORDER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L, LEDDEVICE]");
|
||||
Option & argId = parser.add<Option> ('q', "qualifier" , "Identifier(qualifier) of the adjustment to set");
|
||||
IntOption & argBrightness = parser.add<IntOption> ('L', "brightness" , "Set the brightness gain of the leds");
|
||||
IntOption & argBrightnessC = parser.add<IntOption> (0x0, "brightnessCompensation" , "Set the brightness compensation");
|
||||
@@ -114,9 +114,9 @@ int main(int argc, char * argv[])
|
||||
bool colorAdjust = parser.isSet(argRAdjust) || parser.isSet(argGAdjust) || parser.isSet(argBAdjust) || parser.isSet(argCAdjust) || parser.isSet(argMAdjust)
|
||||
|| parser.isSet(argYAdjust) || parser.isSet(argWAdjust) || parser.isSet(argbAdjust) || parser.isSet(argGamma)|| parser.isSet(argBrightness)|| parser.isSet(argBrightnessC)
|
||||
|| parser.isSet(argBacklightThreshold) || parser.isSet(argBacklightColored);
|
||||
|
||||
|
||||
// check that exactly one command was given
|
||||
int commandCount = count({ parser.isSet(argColor), parser.isSet(argImage), parser.isSet(argEffect), parser.isSet(argCreateEffect), parser.isSet(argDeleteEffect),
|
||||
int commandCount = count({ parser.isSet(argColor), parser.isSet(argImage), parser.isSet(argEffect), parser.isSet(argCreateEffect), parser.isSet(argDeleteEffect),
|
||||
parser.isSet(argServerInfo), parser.isSet(argSysInfo),parser.isSet(argClear), parser.isSet(argClearAll), parser.isSet(argEnableComponent), parser.isSet(argDisableComponent), colorAdjust,
|
||||
parser.isSet(argSource), parser.isSet(argSourceAuto), parser.isSet(argOff), parser.isSet(argOn), parser.isSet(argConfigGet), parser.isSet(argSchemaGet), parser.isSet(argConfigSet),
|
||||
parser.isSet(argMapping),parser.isSet(argVideoMode) });
|
||||
|
@@ -40,25 +40,6 @@ void X11Wrapper::capture()
|
||||
emit sig_screenshot(_screenshot);
|
||||
}
|
||||
|
||||
void X11Wrapper::setGrabbingMode(const GrabbingMode mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case GRABBINGMODE_VIDEO:
|
||||
case GRABBINGMODE_PAUSE:
|
||||
case GRABBINGMODE_AUDIO:
|
||||
case GRABBINGMODE_PHOTO:
|
||||
case GRABBINGMODE_MENU:
|
||||
case GRABBINGMODE_SCREENSAVER:
|
||||
case GRABBINGMODE_INVALID:
|
||||
start();
|
||||
break;
|
||||
case GRABBINGMODE_OFF:
|
||||
stop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void X11Wrapper::setVideoMode(const VideoMode mode)
|
||||
{
|
||||
_grabber.setVideoMode(mode);
|
||||
|
@@ -6,7 +6,6 @@
|
||||
#include <grabber/X11Grabber.h>
|
||||
|
||||
//Utils includes
|
||||
#include <utils/GrabbingMode.h>
|
||||
#include <utils/VideoMode.h>
|
||||
|
||||
class X11Wrapper : public QObject
|
||||
@@ -23,19 +22,13 @@ public:
|
||||
void start();
|
||||
|
||||
void stop();
|
||||
|
||||
|
||||
bool displayInit();
|
||||
|
||||
signals:
|
||||
void sig_screenshot(const Image<ColorRgb> & screenshot);
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Set the grabbing mode
|
||||
/// @param[in] mode The new grabbing mode
|
||||
///
|
||||
void setGrabbingMode(const GrabbingMode mode);
|
||||
|
||||
///
|
||||
/// Set the video mode (2D/3D)
|
||||
/// @param[in] mode The new video mode
|
||||
@@ -55,6 +48,6 @@ private:
|
||||
|
||||
/// The grabber for creating screenshots
|
||||
X11Grabber _grabber;
|
||||
|
||||
|
||||
Image<ColorRgb> _screenshot;
|
||||
};
|
||||
|
@@ -66,7 +66,7 @@ int main(int argc, char ** argv)
|
||||
parser.isSet(argCropBottom) ? argCropBottom.getInt(parser) : argCropHeight.getInt(parser),
|
||||
argSizeDecimation.getInt(parser), // horizontal decimation
|
||||
argSizeDecimation.getInt(parser)); // vertical decimation
|
||||
|
||||
|
||||
if (!x11Wrapper.displayInit())
|
||||
return -1;
|
||||
|
||||
@@ -83,9 +83,8 @@ int main(int argc, char ** argv)
|
||||
|
||||
// Connect the screen capturing to the proto processing
|
||||
QObject::connect(&x11Wrapper, SIGNAL(sig_screenshot(const Image<ColorRgb> &)), &protoWrapper, SLOT(receiveImage(Image<ColorRgb>)));
|
||||
|
||||
// Connect the KODI Video Checker to the proto processing
|
||||
QObject::connect(&protoWrapper, SIGNAL(setGrabbingMode(GrabbingMode)), &x11Wrapper, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
|
||||
// Connect the vodeMode to the proto processing
|
||||
QObject::connect(&protoWrapper, SIGNAL(setVideoMode(VideoMode)), &x11Wrapper, SLOT(setVideoMode(VideoMode)));
|
||||
|
||||
// Start the capturing
|
||||
|
@@ -10,7 +10,6 @@ add_executable(hyperiond
|
||||
target_link_libraries(hyperiond
|
||||
commandline
|
||||
hyperion
|
||||
kodivideochecker
|
||||
effectengine
|
||||
jsonserver
|
||||
boblightserver
|
||||
|
@@ -39,7 +39,6 @@
|
||||
HyperionDaemon::HyperionDaemon(QString configFile, const QString rootPath, QObject *parent)
|
||||
: QObject(parent)
|
||||
, _log(Logger::getInstance("MAIN"))
|
||||
, _kodiVideoChecker(nullptr)
|
||||
, _jsonServer(nullptr)
|
||||
, _protoServer(nullptr)
|
||||
, _boblightServer(nullptr)
|
||||
@@ -99,7 +98,6 @@ void HyperionDaemon::freeObjects()
|
||||
{
|
||||
delete grabber;
|
||||
}
|
||||
delete _kodiVideoChecker;
|
||||
delete _jsonServer;
|
||||
delete _protoServer;
|
||||
delete _boblightServer;
|
||||
@@ -111,7 +109,6 @@ void HyperionDaemon::freeObjects()
|
||||
_dispmanx = nullptr;
|
||||
_fbGrabber = nullptr;
|
||||
_osxGrabber = nullptr;
|
||||
_kodiVideoChecker = nullptr;
|
||||
_jsonServer = nullptr;
|
||||
_protoServer = nullptr;
|
||||
_boblightServer = nullptr;
|
||||
@@ -121,8 +118,6 @@ void HyperionDaemon::freeObjects()
|
||||
|
||||
void HyperionDaemon::run()
|
||||
{
|
||||
createKODIVideoChecker();
|
||||
|
||||
// ---- network services -----
|
||||
startNetworkServices();
|
||||
|
||||
@@ -266,39 +261,8 @@ void HyperionDaemon::startInitialEffect()
|
||||
#undef BGCONFIG_ARRAY
|
||||
}
|
||||
|
||||
|
||||
// create KODI video checker if the _configuration is present
|
||||
void HyperionDaemon::createKODIVideoChecker()
|
||||
{
|
||||
bool kodiCheckerConfigured = _qconfig.contains("kodiVideoChecker");
|
||||
|
||||
const QJsonObject & videoCheckerConfig = _qconfig["kodiVideoChecker"].toObject();
|
||||
_kodiVideoChecker = KODIVideoChecker::initInstance(
|
||||
videoCheckerConfig["kodiAddress"].toString("127.0.0.1"),
|
||||
videoCheckerConfig["kodiTcpPort"].toInt(9090),
|
||||
videoCheckerConfig["grabVideo"].toBool(true),
|
||||
videoCheckerConfig["grabPictures"].toBool(true),
|
||||
videoCheckerConfig["grabAudio"].toBool(true),
|
||||
videoCheckerConfig["grabMenu"].toBool(false),
|
||||
videoCheckerConfig["grabPause"].toBool(true),
|
||||
videoCheckerConfig["grabScreensaver"].toBool(false),
|
||||
videoCheckerConfig["enable3DDetection"].toBool(true));
|
||||
Debug(_log, "KODI checker created ");
|
||||
|
||||
if( kodiCheckerConfigured && videoCheckerConfig["enable"].toBool(true))
|
||||
{
|
||||
_kodiVideoChecker->start();
|
||||
}
|
||||
_hyperion->getComponentRegister().componentStateChanged(hyperion::COMP_KODICHECKER, _kodiVideoChecker->componentState());
|
||||
QObject::connect( _hyperion, SIGNAL(componentStateChanged(hyperion::Components,bool)), _kodiVideoChecker, SLOT(componentStateChanged(hyperion::Components,bool)));
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(videoMode(VideoMode)), _hyperion, SLOT(setVideoMode(VideoMode)));
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _hyperion, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
}
|
||||
|
||||
void HyperionDaemon::startNetworkServices()
|
||||
{
|
||||
KODIVideoChecker* kodiVideoChecker = KODIVideoChecker::getInstance();
|
||||
|
||||
// Create Stats
|
||||
_stats = new Stats();
|
||||
|
||||
@@ -324,11 +288,7 @@ void HyperionDaemon::startNetworkServices()
|
||||
}
|
||||
|
||||
_protoServer = new ProtoServer(protoPort);
|
||||
if (kodiVideoChecker != nullptr)
|
||||
{
|
||||
QObject::connect(kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _protoServer, SIGNAL(grabbingMode(GrabbingMode)));
|
||||
QObject::connect(kodiVideoChecker, SIGNAL(videoMode(VideoMode)), _protoServer, SIGNAL(videoMode(VideoMode)));
|
||||
}
|
||||
QObject::connect(_hyperion, SIGNAL(videoMode(VideoMode)), _protoServer, SLOT(setVideoMode(VideoMode)));
|
||||
Info(_log, "Proto server created and started on port %d", _protoServer->getPort());
|
||||
|
||||
// Create Boblight server if configuration is present
|
||||
@@ -473,7 +433,6 @@ void HyperionDaemon::createGrabberDispmanx()
|
||||
_dispmanx = new DispmanxWrapper(_grabber_width, _grabber_height, _grabber_frequency, _grabber_priority);
|
||||
_dispmanx->setCropping(_grabber_cropLeft, _grabber_cropRight, _grabber_cropTop, _grabber_cropBottom);
|
||||
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _dispmanx, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_hyperion, SIGNAL(videoMode(VideoMode)), _dispmanx, SLOT(setVideoMode(VideoMode)));
|
||||
QObject::connect(_dispmanx, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
|
||||
QObject::connect(_dispmanx, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _hyperion, SLOT(setImage(int, const Image<ColorRgb>&, const int)) );
|
||||
@@ -590,8 +549,7 @@ void HyperionDaemon::createGrabberV4L2()
|
||||
grabberConfig["redSignalThreshold"].toDouble(0.0)/100.0,
|
||||
grabberConfig["greenSignalThreshold"].toDouble(0.0)/100.0,
|
||||
grabberConfig["blueSignalThreshold"].toDouble(0.0)/100.0,
|
||||
grabberConfig["priority"].toInt(890),
|
||||
grabberConfig["useKodiChecker"].toBool(false));
|
||||
grabberConfig["priority"].toInt(890));
|
||||
grabber->setCropping(
|
||||
grabberConfig["cropLeft"].toInt(0),
|
||||
grabberConfig["cropRight"].toInt(0),
|
||||
|
@@ -41,7 +41,6 @@
|
||||
|
||||
#include <utils/Logger.h>
|
||||
|
||||
#include <kodivideochecker/KODIVideoChecker.h>
|
||||
#include <jsonserver/JsonServer.h>
|
||||
#include <protoserver/ProtoServer.h>
|
||||
#include <boblightserver/BoblightServer.h>
|
||||
@@ -65,7 +64,6 @@ public:
|
||||
void run();
|
||||
|
||||
void startInitialEffect();
|
||||
void createKODIVideoChecker();
|
||||
void startNetworkServices();
|
||||
|
||||
// grabber creators
|
||||
@@ -84,7 +82,6 @@ private:
|
||||
|
||||
Logger* _log;
|
||||
QJsonObject _qconfig;
|
||||
KODIVideoChecker* _kodiVideoChecker;
|
||||
JsonServer* _jsonServer;
|
||||
ProtoServer* _protoServer;
|
||||
BoblightServer* _boblightServer;
|
||||
|
Reference in New Issue
Block a user