mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Kodi checker rework (+enable option) (#96)
* big kodichecker rework - use new logger - 'enable' flag in config - startable on runtime (atm not stoppable and no reconfigure) - rename xbmc to kodi * remove unnecceasry checks for kodi * make kodichecker stoppable and add reconfigure * tune config
This commit is contained in:
@@ -104,7 +104,7 @@ 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 XBMC Video Checker to the proto processing
|
||||
// Connect the KODI Video Checker to the proto processing
|
||||
QObject::connect(&protoWrapper, SIGNAL(setGrabbingMode(GrabbingMode)), &x11Wrapper, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(&protoWrapper, SIGNAL(setVideoMode(VideoMode)), &x11Wrapper, SLOT(setVideoMode(VideoMode)));
|
||||
|
||||
|
@@ -5,7 +5,7 @@ add_executable(hyperiond
|
||||
target_link_libraries(hyperiond
|
||||
getoptPlusPlus
|
||||
hyperion
|
||||
xbmcvideochecker
|
||||
kodivideochecker
|
||||
effectengine
|
||||
jsonserver
|
||||
boblightserver
|
||||
|
@@ -29,7 +29,7 @@
|
||||
HyperionDaemon::HyperionDaemon(std::string configFile, QObject *parent)
|
||||
: QObject(parent)
|
||||
, _log(Logger::getInstance("MAIN"))
|
||||
, _xbmcVideoChecker(nullptr)
|
||||
, _kodiVideoChecker(nullptr)
|
||||
, _jsonServer(nullptr)
|
||||
, _protoServer(nullptr)
|
||||
, _boblightServer(nullptr)
|
||||
@@ -73,7 +73,7 @@ HyperionDaemon::~HyperionDaemon()
|
||||
delete _fbGrabber;
|
||||
delete _osxGrabber;
|
||||
delete _v4l2Grabber;
|
||||
delete _xbmcVideoChecker;
|
||||
delete _kodiVideoChecker;
|
||||
delete _jsonServer;
|
||||
delete _protoServer;
|
||||
delete _boblightServer;
|
||||
@@ -85,7 +85,7 @@ HyperionDaemon::~HyperionDaemon()
|
||||
void HyperionDaemon::run()
|
||||
{
|
||||
startInitialEffect();
|
||||
createXBMCVideoChecker();
|
||||
createKODIVideoChecker();
|
||||
|
||||
// ---- network services -----
|
||||
startNetworkServices();
|
||||
@@ -193,31 +193,33 @@ void HyperionDaemon::startInitialEffect()
|
||||
}
|
||||
|
||||
|
||||
// create XBMC video checker if the _configuration is present
|
||||
void HyperionDaemon::createXBMCVideoChecker()
|
||||
// create KODI video checker if the _configuration is present
|
||||
void HyperionDaemon::createKODIVideoChecker()
|
||||
{
|
||||
if (_config.isMember("xbmcVideoChecker"))
|
||||
{
|
||||
const Json::Value & videoCheckerConfig = _config["xbmcVideoChecker"];
|
||||
_xbmcVideoChecker = XBMCVideoChecker::initInstance(
|
||||
videoCheckerConfig["xbmcAddress"].asString(),
|
||||
videoCheckerConfig["xbmcTcpPort"].asUInt(),
|
||||
videoCheckerConfig["grabVideo"].asBool(),
|
||||
videoCheckerConfig["grabPictures"].asBool(),
|
||||
videoCheckerConfig["grabAudio"].asBool(),
|
||||
videoCheckerConfig["grabMenu"].asBool(),
|
||||
videoCheckerConfig.get("grabPause", true).asBool(),
|
||||
videoCheckerConfig.get("grabScreensaver", true).asBool(),
|
||||
videoCheckerConfig.get("enable3DDetection", true).asBool());
|
||||
bool kodiCheckerConfigured = _config.isMember("kodiVideoChecker");
|
||||
|
||||
_xbmcVideoChecker->start();
|
||||
Info(_log, "Kodi checker created and started");
|
||||
const Json::Value & videoCheckerConfig = _config["kodiVideoChecker"];
|
||||
_kodiVideoChecker = KODIVideoChecker::initInstance(
|
||||
videoCheckerConfig.get("kodiAddress","127.0.0.1").asString(),
|
||||
videoCheckerConfig.get("kodiTcpPort",9090).asUInt(),
|
||||
videoCheckerConfig.get("grabVideo",true).asBool(),
|
||||
videoCheckerConfig.get("grabPictures",true).asBool(),
|
||||
videoCheckerConfig.get("grabAudio",true).asBool(),
|
||||
videoCheckerConfig.get("grabMenu",false).asBool(),
|
||||
videoCheckerConfig.get("grabPause", true).asBool(),
|
||||
videoCheckerConfig.get("grabScreensaver", false).asBool(),
|
||||
videoCheckerConfig.get("enable3DDetection", true).asBool());
|
||||
Debug(_log, "KODI checker created ");
|
||||
|
||||
if( kodiCheckerConfigured && videoCheckerConfig.get("enable", true).asBool() )
|
||||
{
|
||||
_kodiVideoChecker->start();
|
||||
}
|
||||
}
|
||||
|
||||
void HyperionDaemon::startNetworkServices()
|
||||
{
|
||||
XBMCVideoChecker* xbmcVideoChecker = XBMCVideoChecker::getInstance();
|
||||
KODIVideoChecker* kodiVideoChecker = KODIVideoChecker::getInstance();
|
||||
|
||||
// Create Json server if configuration is present
|
||||
unsigned int jsonPort = 19444;
|
||||
@@ -241,10 +243,10 @@ void HyperionDaemon::startNetworkServices()
|
||||
}
|
||||
|
||||
_protoServer = new ProtoServer(protoPort );
|
||||
if (xbmcVideoChecker != nullptr)
|
||||
if (kodiVideoChecker != nullptr)
|
||||
{
|
||||
QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _protoServer, SIGNAL(grabbingMode(GrabbingMode)));
|
||||
QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), _protoServer, SIGNAL(videoMode(VideoMode)));
|
||||
QObject::connect(kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _protoServer, SIGNAL(grabbingMode(GrabbingMode)));
|
||||
QObject::connect(kodiVideoChecker, SIGNAL(videoMode(VideoMode)), _protoServer, SIGNAL(videoMode(VideoMode)));
|
||||
}
|
||||
Info(_log, "Proto server created and started on port %d", _protoServer->getPort());
|
||||
|
||||
@@ -335,12 +337,8 @@ void HyperionDaemon::createGrabberDispmanx()
|
||||
frameGrabberConfig.get("cropTop", 0).asInt(),
|
||||
frameGrabberConfig.get("cropBottom", 0).asInt());
|
||||
|
||||
if (_xbmcVideoChecker != nullptr)
|
||||
{
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _dispmanx, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), _dispmanx, SLOT(setVideoMode(VideoMode)));
|
||||
}
|
||||
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _dispmanx, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_kodiVideoChecker, 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)) );
|
||||
|
||||
_dispmanx->start();
|
||||
@@ -405,12 +403,8 @@ void HyperionDaemon::createGrabberAmlogic()
|
||||
grabberConfig["frequency_Hz"].asUInt(),
|
||||
grabberConfig.get("priority",900).asInt());
|
||||
|
||||
if (_xbmcVideoChecker != nullptr)
|
||||
{
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _amlGrabber, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), _amlGrabber, SLOT(setVideoMode(VideoMode)));
|
||||
}
|
||||
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _amlGrabber, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(videoMode(VideoMode)), _amlGrabber, SLOT(setVideoMode(VideoMode)));
|
||||
QObject::connect(_amlGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
|
||||
|
||||
_amlGrabber->start();
|
||||
@@ -436,12 +430,8 @@ void HyperionDaemon::createGrabberFramebuffer()
|
||||
grabberConfig["frequency_Hz"].asUInt(),
|
||||
grabberConfig.get("priority",900).asInt());
|
||||
|
||||
if (_xbmcVideoChecker != nullptr)
|
||||
{
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _fbGrabber, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), _fbGrabber, SLOT(setVideoMode(VideoMode)));
|
||||
}
|
||||
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _fbGrabber, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(videoMode(VideoMode)), _fbGrabber, SLOT(setVideoMode(VideoMode)));
|
||||
QObject::connect(_fbGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
|
||||
|
||||
_fbGrabber->start();
|
||||
@@ -467,12 +457,8 @@ void HyperionDaemon::createGrabberOsx()
|
||||
grabberConfig["frequency_Hz"].asUInt(),
|
||||
grabberConfig.get("priority",900).asInt());
|
||||
|
||||
if (_xbmcVideoChecker != nullptr)
|
||||
{
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _osxGrabber, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), _osxGrabber, SLOT(setVideoMode(VideoMode)));
|
||||
}
|
||||
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), _osxGrabber, SLOT(setGrabbingMode(GrabbingMode)));
|
||||
QObject::connect(_kodiVideoChecker, SIGNAL(videoMode(VideoMode)), _osxGrabber, SLOT(setVideoMode(VideoMode)));
|
||||
QObject::connect(_osxGrabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
|
||||
|
||||
_osxGrabber->start();
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
#include <utils/Logger.h>
|
||||
|
||||
#include <xbmcvideochecker/XBMCVideoChecker.h>
|
||||
#include <kodivideochecker/KODIVideoChecker.h>
|
||||
#include <jsonserver/JsonServer.h>
|
||||
#include <protoserver/ProtoServer.h>
|
||||
#include <boblightserver/BoblightServer.h>
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
void run();
|
||||
|
||||
void startInitialEffect();
|
||||
void createXBMCVideoChecker();
|
||||
void createKODIVideoChecker();
|
||||
void startNetworkServices();
|
||||
|
||||
// grabber creators
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
private:
|
||||
Logger* _log;
|
||||
Json::Value _config;
|
||||
XBMCVideoChecker* _xbmcVideoChecker;
|
||||
KODIVideoChecker* _kodiVideoChecker;
|
||||
JsonServer* _jsonServer;
|
||||
ProtoServer* _protoServer;
|
||||
BoblightServer* _boblightServer;
|
||||
|
Reference in New Issue
Block a user