2016-06-17 01:25:40 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
2017-08-12 07:55:32 +02:00
|
|
|
#include <QJsonObject>
|
2016-06-17 01:25:40 +02:00
|
|
|
|
|
|
|
#ifdef ENABLE_DISPMANX
|
|
|
|
#include <grabber/DispmanxWrapper.h>
|
|
|
|
#else
|
|
|
|
typedef QObject DispmanxWrapper;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_V4L2
|
|
|
|
#include <grabber/V4L2Wrapper.h>
|
|
|
|
#else
|
|
|
|
typedef QObject V4L2Wrapper;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_FB
|
|
|
|
#include <grabber/FramebufferWrapper.h>
|
|
|
|
#else
|
|
|
|
typedef QObject FramebufferWrapper;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_AMLOGIC
|
|
|
|
#include <grabber/AmlogicWrapper.h>
|
|
|
|
#else
|
|
|
|
typedef QObject AmlogicWrapper;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef ENABLE_OSX
|
|
|
|
#include <grabber/OsxWrapper.h>
|
|
|
|
#else
|
|
|
|
typedef QObject OsxWrapper;
|
|
|
|
#endif
|
|
|
|
|
2016-07-24 15:18:34 +02:00
|
|
|
#ifdef ENABLE_X11
|
|
|
|
#include <grabber/X11Wrapper.h>
|
|
|
|
#else
|
|
|
|
typedef QObject X11Wrapper;
|
|
|
|
#endif
|
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
#include <utils/Logger.h>
|
|
|
|
|
2016-07-10 22:04:31 +02:00
|
|
|
#include <kodivideochecker/KODIVideoChecker.h>
|
2016-06-17 01:25:40 +02:00
|
|
|
#include <jsonserver/JsonServer.h>
|
|
|
|
#include <protoserver/ProtoServer.h>
|
|
|
|
#include <boblightserver/BoblightServer.h>
|
2016-06-20 08:38:12 +02:00
|
|
|
#include <udplistener/UDPListener.h>
|
2017-05-29 15:59:11 +02:00
|
|
|
#include <utils/Stats.h>
|
2017-08-12 07:55:32 +02:00
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
|
2017-08-01 17:29:47 +02:00
|
|
|
class SysTray;
|
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
class HyperionDaemon : public QObject
|
|
|
|
{
|
2017-01-22 14:31:11 +01:00
|
|
|
Q_OBJECT
|
2017-09-02 22:26:22 +02:00
|
|
|
|
2017-08-01 17:29:47 +02:00
|
|
|
friend SysTray;
|
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
public:
|
2016-08-06 08:28:42 +02:00
|
|
|
HyperionDaemon(QString configFile, QObject *parent=nullptr);
|
2016-06-19 00:56:47 +02:00
|
|
|
~HyperionDaemon();
|
2017-07-30 13:32:10 +02:00
|
|
|
|
|
|
|
void loadConfig(const QString & configFile);
|
2016-06-19 00:56:47 +02:00
|
|
|
void run();
|
|
|
|
|
2016-06-20 23:41:07 +02:00
|
|
|
void startInitialEffect();
|
2016-07-10 22:04:31 +02:00
|
|
|
void createKODIVideoChecker();
|
2016-06-19 00:56:47 +02:00
|
|
|
void startNetworkServices();
|
2016-06-17 01:25:40 +02:00
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
// grabber creators
|
|
|
|
void createGrabberV4L2();
|
2016-07-24 15:18:34 +02:00
|
|
|
void createSystemFrameGrabber();
|
2016-06-17 01:25:40 +02:00
|
|
|
|
2017-01-22 14:31:11 +01:00
|
|
|
public slots:
|
|
|
|
void freeObjects();
|
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
private:
|
2016-07-27 22:52:59 +02:00
|
|
|
void createGrabberDispmanx();
|
|
|
|
void createGrabberAmlogic();
|
2016-08-04 10:53:26 +02:00
|
|
|
void createGrabberFramebuffer(const QJsonObject & grabberConfig);
|
|
|
|
void createGrabberOsx(const QJsonObject & grabberConfig);
|
|
|
|
void createGrabberX11(const QJsonObject & grabberConfig);
|
2016-07-24 15:18:34 +02:00
|
|
|
|
2016-06-19 00:56:47 +02:00
|
|
|
Logger* _log;
|
2016-08-04 10:53:26 +02:00
|
|
|
QJsonObject _qconfig;
|
2016-07-10 22:04:31 +02:00
|
|
|
KODIVideoChecker* _kodiVideoChecker;
|
2016-06-19 00:56:47 +02:00
|
|
|
JsonServer* _jsonServer;
|
|
|
|
ProtoServer* _protoServer;
|
|
|
|
BoblightServer* _boblightServer;
|
2016-06-20 08:38:12 +02:00
|
|
|
UDPListener* _udpListener;
|
2016-08-30 22:28:13 +02:00
|
|
|
std::vector<V4L2Wrapper*> _v4l2Grabbers;
|
2016-06-19 00:56:47 +02:00
|
|
|
DispmanxWrapper* _dispmanx;
|
2016-08-28 15:10:43 +02:00
|
|
|
#ifdef ENABLE_X11
|
2016-07-24 15:18:34 +02:00
|
|
|
X11Wrapper* _x11Grabber;
|
2016-08-28 15:10:43 +02:00
|
|
|
#endif
|
2016-06-19 00:56:47 +02:00
|
|
|
AmlogicWrapper* _amlGrabber;
|
|
|
|
FramebufferWrapper* _fbGrabber;
|
|
|
|
OsxWrapper* _osxGrabber;
|
2016-06-27 23:56:21 +02:00
|
|
|
Hyperion* _hyperion;
|
2017-05-29 15:59:11 +02:00
|
|
|
Stats* _stats;
|
2016-07-27 22:52:59 +02:00
|
|
|
|
|
|
|
unsigned _grabber_width;
|
|
|
|
unsigned _grabber_height;
|
|
|
|
unsigned _grabber_frequency;
|
|
|
|
int _grabber_priority;
|
|
|
|
unsigned _grabber_cropLeft;
|
|
|
|
unsigned _grabber_cropRight;
|
|
|
|
unsigned _grabber_cropTop;
|
|
|
|
unsigned _grabber_cropBottom;
|
2016-06-19 00:56:47 +02:00
|
|
|
};
|