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:
redPanther 2016-07-10 22:04:31 +02:00 committed by brindosch
parent d4635bba4e
commit 3ac0781c1f
19 changed files with 385 additions and 338 deletions

View File

@ -29,13 +29,13 @@
/// The configuration contains a list of color-transforms. Each transform contains the
/// following fields:
/// * 'channelAdjustment'
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
/// * 'leds' : The indices (or index ranges) of the leds to which this channel adjustment applies
/// (eg '0-5, 9, 11, 12-17'). The indices are zero based.
/// * 'pureRed'/'pureGreen'/'pureBlue' : The manipulation in the Red-Green-Blue color domain with the
/// following tuning parameters for each channel:
/// * 'temperature'
/// * 'id' : The unique identifier of the temperature (eg 'device_1')
/// * 'id' : The unique identifier of the temperature (eg 'device_1')
/// * 'leds' : The indices (or index ranges) of the leds to which this temperature applies
/// (eg '0-5, 9, 11, 12-17'). The indices are zero based.
/// * 'red'/'green'/'blue' : The temperature manipulation in the Red-Green-Blue color domain with the
@ -141,7 +141,7 @@
},
/// Configuration for the embedded V4L2 grabber
/// * enable : Enable or disable the v4lgrabber (true/false)
/// * enable : Enable or disable the v4lgrabber (true/false)
/// * device : V4L2 Device to use [default="/dev/video0"]
/// * input : V4L2 input to use [default=0]
/// * standard : Video standard (no-change/PAL/NTSC) [default="no-change"]
@ -185,12 +185,12 @@
/// * frequency_Hz : The frequency of the frame grab [Hz]
/// * priority : The priority of the frame-gabber (Default=890) HINT: lower value result in HIGHER priority!
/// * ATTENTION : Power-of-Two resolution is not supported and leads to unexpected behaviour!
"framegrabber" :
"framegrabber" :
{
"width" : 64,
"height" : 64,
"width" : 64,
"height" : 64,
"frequency_Hz" : 10.0,
"priority" : 890
"priority" : 890
},
/// The black border configuration, contains the following items:
@ -203,18 +203,19 @@
/// * mode : Border detection mode (values=default,classic,osd)
"blackborderdetector" :
{
"enable" : true,
"threshold" : 0.0,
"unknownFrameCnt" : 600,
"borderFrameCnt" : 50,
"enable" : true,
"threshold" : 0.0,
"unknownFrameCnt" : 600,
"borderFrameCnt" : 50,
"maxInconsistentCnt" : 10,
"blurRemoveCnt" : 1,
"mode" : "default"
"blurRemoveCnt" : 1,
"mode" : "default"
},
/// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields:
/// * xbmcAddress : The IP address of the Kodi-host
/// * xbmcTcpPort : The TCP-port of the Kodi-server
/// * enable : enable/disable Kodi-Checker
/// * kodiAddress : The IP address of the Kodi-host
/// * kodiTcpPort : The TCP-port of the Kodi-server
/// * grabVideo : Flag indicating that the frame-grabber is on(true) during video playback
/// * grabPictures : Flag indicating that the frame-grabber is on(true) during picture show
/// * grabAudio : Flag indicating that the frame-grabber is on(true) during audio playback
@ -222,49 +223,50 @@
/// * grabPause : Flag indicating that the frame-grabber is on(true) at player state "pause"
/// * grabScreensaver : Flag indicating that the frame-grabber is on(true) when Kodi is on screensaver
/// * enable3DDetection : Flag indicating that the frame-grabber should switch to a 3D compatible modus if a 3D video is playing
"xbmcVideoChecker" :
{
"xbmcAddress" : "127.0.0.1",
"xbmcTcpPort" : 9090,
"grabVideo" : true,
"grabPictures" : true,
"grabAudio" : true,
"grabMenu" : false,
"grabPause" : false,
"grabScreensaver" : true,
"enable3DDetection" : true
},
"kodiVideoChecker" :
{
"enable" : true,
"kodiAddress" : "127.0.0.1",
"kodiTcpPort" : 9090,
"grabVideo" : true,
"grabPictures" : true,
"grabAudio" : true,
"grabMenu" : false,
"grabPause" : false,
"grabScreensaver" : true,
"enable3DDetection" : true
},
/// Initial Effect sets a "booteffect" or "color" (foreground-effect) and optional set a "effect" or "color" during inactive grabbers and network receivers (background-effect)
/// * background-effect : 2 options: set a effect (example: "Rainbow swirl fast") or set a color (RGB) (example: [255,134,0])
/// * background-effect-args : Set optional effect arguments (Have a look at the select effect to get the possible values)
/// * foreground-effect : 2 options: set a effect (example: "Rainbow swirl fast") or set a color (RGB) (example: [255,134,0])
/// * foreground-effect-args : Set optional effect arguments (Have a look at the select effect to get the possible values)
/// * foreground-duration_ms : The duration of the selected foreground-effect or color (0=endless)
/// HINT: "foreground-effect" starts always with priority 0, so it blocks all remotes and grabbers if the loop is endless
/// HINT: Set a empty value if you want to disable a component (example: "")
"initialEffect" :
{
"background-effect" : "Full color mood blobs",
"background-effect-args" : {},
"foreground-effect" : "Rainbow swirl fast",
"foreground-effect-args" : {},
"foreground-duration_ms" : 3000
},
/// * background-effect : 2 options: set a effect (example: "Rainbow swirl fast") or set a color (RGB) (example: [255,134,0])
/// * background-effect-args : Set optional effect arguments (Have a look at the select effect to get the possible values)
/// * foreground-effect : 2 options: set a effect (example: "Rainbow swirl fast") or set a color (RGB) (example: [255,134,0])
/// * foreground-effect-args : Set optional effect arguments (Have a look at the select effect to get the possible values)
/// * foreground-duration_ms : The duration of the selected foreground-effect or color (0=endless)
/// HINT: "foreground-effect" starts always with priority 0, so it blocks all remotes and grabbers if the loop is endless
/// HINT: Set a empty value if you want to disable a component (example: "")
"initialEffect" :
{
"background-effect" : "Full color mood blobs",
"background-effect-args" : {},
"foreground-effect" : "Rainbow swirl fast",
"foreground-effect-args" : {},
"foreground-duration_ms" : 3000
},
/// The configuration of the Json/Proto forwarder. Forward messages to multiple instances of Hyperion on same and/or other hosts
/// 'proto' is mostly used for video streams and 'json' for effects
/// * enable : Enable or disable the forwarder (true/false)
/// * enable : Enable or disable the forwarder (true/false)
/// * proto : Proto server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19447"] or more instances to forward ["127.0.0.1:19447","192.168.0.24:19449"]
/// * json : Json server adress and port of your target. Syntax:[IP:PORT] -> ["127.0.0.1:19446"] or more instances to forward ["127.0.0.1:19446","192.168.0.24:19448"]
/// HINT:If you redirect to "127.0.0.1" (localhost) you could start a second hyperion with another device/led config!
/// Be sure your client(s) is/are listening on the configured ports. The second Hyperion (if used) also needs to be configured! (HyperCon -> External -> Json Server/Proto Server)
"forwarder" :
{
"forwarder" :
{
"enable" : false,
"proto" : ["127.0.0.1:19447"],
"json" : ["127.0.0.1:19446"]
},
"proto" : ["127.0.0.1:19447"],
"json" : ["127.0.0.1:19446"]
},
/// The configuration of the Json server which enables the json remote interface
/// * port : Port at which the json server is started
@ -281,31 +283,31 @@
},
/// The configuration of the boblight server which enables the boblight remote interface
/// * enable : Enable or disable the boblight server (true/false)
/// * enable : Enable or disable the boblight server (true/false)
/// * port : Port at which the boblight server is started
/// * priority : Priority of the boblight server (Default=800) HINT: lower value result in HIGHER priority!
"boblightServer" :
{
"enable" : false,
"port" : 19333,
"enable" : false,
"port" : 19333,
"priority" : 800
},
/// The configuration of the udp listener
/// * enable : Enable or disable the udp listener (true/false)
/// * address : The listener address, pre configured is multicast which listen also to unicast ip addresses at the same time. If emtpy, multicast is disabled and it also accepts unicast from all IPs
/// * port : Port at which the udp listener starts
/// * priority : Priority of the udp lstener server (Default=800)
/// * timeout : The timeout sets the timelimit for a "soft" off of the udp listener, if no packages are received (for example to switch to a gabber or InitialEffect - background-effect)
/// * shared : If true, the udp listener is shared across all hyperion instances (if using more than one (forwarder))
/// * enable : Enable or disable the udp listener (true/false)
/// * address : The listener address, pre configured is multicast which listen also to unicast ip addresses at the same time. If emtpy, multicast is disabled and it also accepts unicast from all IPs
/// * port : Port at which the udp listener starts
/// * priority : Priority of the udp lstener server (Default=800)
/// * timeout : The timeout sets the timelimit for a "soft" off of the udp listener, if no packages are received (for example to switch to a gabber or InitialEffect - background-effect)
/// * shared : If true, the udp listener is shared across all hyperion instances (if using more than one (forwarder))
"udpListener" :
{
"enable" : false,
"address" : "239.255.28.01",
"port" : 2801,
"enable" : false,
"address" : "239.255.28.01",
"port" : 2801,
"priority" : 800,
"timeout" : 10000,
"shared" : false
"timeout" : 10000,
"shared" : false
},
/// Configuration of the Hyperion webserver
@ -314,9 +316,9 @@
/// * port : the port where hyperion webapp is accasible
"webConfig" :
{
"enable" : true,
"enable" : true,
"document_root" : "/usr/share/hyperion/webconfig",
"port" : 8099
"port" : 8099
},
/// The configuration of the effect engine, contains the following items:

View File

@ -9,7 +9,7 @@
"name" : "DefaultHyperionConfig",
"type" : "file",
"output" : "/dev/null",
"rate" : 1000000,
"rate" : 1000000,
"colorOrder" : "rgb"
},
@ -22,21 +22,21 @@
"leds" : "*",
"pureRed" :
{
"redChannel" : 255,
"greenChannel" : 0,
"blueChannel" : 0
"redChannel" : 255,
"greenChannel" : 0,
"blueChannel" : 0
},
"pureGreen" :
{
"redChannel" : 0,
"greenChannel" : 255,
"blueChannel" : 0
"redChannel" : 0,
"greenChannel" : 255,
"blueChannel" : 0
},
"pureBlue" :
{
"redChannel" : 0,
"greenChannel" : 0,
"blueChannel" : 255
"redChannel" : 0,
"greenChannel" : 0,
"blueChannel" : 255
}
}
],
@ -47,9 +47,9 @@
"leds" : "*",
"correctionValues" :
{
"red" : 255,
"green" : 255,
"blue" : 255
"red" : 255,
"green" : 255,
"blue" : 255
}
}
],
@ -60,24 +60,24 @@
"leds" : "*",
"hsl" :
{
"saturationGain" : 1.0000,
"luminanceGain" : 1.0000,
"luminanceMinimum" : 0.0000
"saturationGain" : 1.0000,
"luminanceGain" : 1.0000,
"luminanceMinimum" : 0.0000
},
"red" :
{
"threshold" : 0.0000,
"gamma" : 2.5000
"threshold" : 0.0000,
"gamma" : 2.5000
},
"green" :
{
"threshold" : 0.0000,
"gamma" : 2.5000
"threshold" : 0.0000,
"gamma" : 2.5000
},
"blue" :
{
"threshold" : 0.0000,
"gamma" : 2.5000
"threshold" : 0.0000,
"gamma" : 2.5000
}
}
],
@ -90,28 +90,28 @@
}
},
"grabber-v4l2" :
"grabber-v4l2" :
{
"enable" : false,
"device" : "/dev/video0",
"input" : 0,
"enable" : false,
"device" : "/dev/video0",
"input" : 0,
"standard" : "PAL",
"width" : -1,
"height" : -1,
"width" : -1,
"height" : -1,
"frameDecimation" : 2,
"sizeDecimation" : 8,
"priority" : 900,
"mode" : "2D",
"cropLeft" : 15,
"cropRight" : 12,
"cropTop" : 5,
"cropBottom" : 5,
"redSignalThreshold" : 0.0,
"sizeDecimation" : 8,
"priority" : 900,
"mode" : "2D",
"cropLeft" : 15,
"cropRight" : 12,
"cropTop" : 5,
"cropBottom" : 5,
"redSignalThreshold" : 0.0,
"greenSignalThreshold" : 0.0,
"blueSignalThreshold" : 0.0
"blueSignalThreshold" : 0.0
},
"framegrabber" :
"framegrabber" :
{
"width" : 128,
"height" : 128,
@ -119,86 +119,87 @@
"priority" : 890
},
"blackborderdetector" :
"blackborderdetector" :
{
"enable" : true,
"threshold" : 0.0,
"mode" : "default"
},
"xbmcVideoChecker" :
"kodiVideoChecker" :
{
"xbmcAddress" : "localhost",
"xbmcTcpPort" : 9090,
"grabVideo" : true,
"grabPictures" : true,
"grabAudio" : true,
"grabMenu" : false,
"grabPause" : false,
"grabScreensaver" : true,
"enable" : true,
"kodiAddress" : "localhost",
"kodiTcpPort" : 9090,
"grabVideo" : true,
"grabPictures" : true,
"grabAudio" : true,
"grabMenu" : false,
"grabPause" : false,
"grabScreensaver" : true,
"enable3DDetection" : true
},
"initialEffect" :
"initialEffect" :
{
"background-effect" : "Full color mood blobs",
"background-effect-args" : {},
"foreground-effect" : "Rainbow swirl fast",
"foreground-effect-args" : {},
"foreground-duration_ms" : 3000
"background-effect" : "Full color mood blobs",
"background-effect-args" : {},
"foreground-effect" : "Rainbow swirl fast",
"foreground-effect-args" : {},
"foreground-duration_ms" : 3000
},
"forwarder" :
"forwarder" :
{
"enable" : false,
"json" : ["127.0.0.1:19446"],
"proto" : ["127.0.0.1:19447"]
"json" : ["127.0.0.1:19446"],
"proto" : ["127.0.0.1:19447"]
},
"jsonServer" :
"jsonServer" :
{
"port" : 19444
},
"protoServer" :
"protoServer" :
{
"port" : 19445
},
"boblightServer" :
{
"enable" : false,
"port" : 19333,
"enable" : false,
"port" : 19333,
"priority" : 800
},
"udpListener" :
{
"enable" : false,
"address" : "239.255.28.01",
"port" : 2801,
"enable" : false,
"address" : "239.255.28.01",
"port" : 2801,
"priority" : 800,
"timeout" : 10000,
"shared" : false
"timeout" : 10000,
"shared" : false
},
"webConfig" :
{
"enable" : true,
"document_root" : "/usr/share/hyperion/webconfig",
"port" : 8099
"enable" : true,
"document_root" : "/usr/share/hyperion/webconfig",
"port" : 8099
},
"effects" :
"effects" :
{
"paths" :
"paths" :
[
"/storage/hyperion/effects",
"/usr/share/hyperion/effects"
]
},
"leds" :
"leds" :
[
{
"index" : 0,

View File

@ -17,26 +17,36 @@
// Utils includes
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
#include <utils/Logger.h>
///
/// This class will check if XBMC is playing something. When it does not, this class will send all black data to Hyperion.
/// This allows grabbed screen data to be overriden while in the XBMC menus.
/// This class will check if KODI is playing something. When it does not, this class will send all black data to Hyperion.
/// This allows grabbed screen data to be overriden while in the KODI menus.
///
/// Note: The json TCP server needs to be enabled manually in XBMC in System/Settings/Network/Services
/// Note: The json TCP server needs to be enabled manually in KODI in System/Settings/Network/Services
///
class XBMCVideoChecker : public QObject
class KODIVideoChecker : public QObject
{
Q_OBJECT
public:
static XBMCVideoChecker* initInstance(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
static XBMCVideoChecker* getInstance();
static KODIVideoChecker* initInstance(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
static KODIVideoChecker* getInstance();
~KODIVideoChecker();
void setConfig(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
public slots:
///
/// Start polling XBMC
/// Start polling KODI
///
void start();
///
/// Stop polling KODI
///
void stop();
signals:
/// Signal emitted when the grabbing mode changes
void grabbingMode(GrabbingMode grabbingMode);
@ -45,16 +55,16 @@ signals:
void videoMode(VideoMode videoMode);
private slots:
/// Receive a reply from XBMC
/// Receive a reply from KODI
void receiveReply();
/// Called when connected to XBMC
/// Called when connected to KODI
void connected();
/// Called when disconnected from XBMC
/// Called when disconnected from KODI
void disconnected();
/// reconnect to XBMC
/// reconnect to KODI
void reconnect();
/// Called when a connection error was encountered
@ -64,16 +74,16 @@ private:
///
/// Constructor
///
/// @param address Network address of the XBMC instance
/// @param port Port number to use (XBMC default = 9090)
/// @param grabVideo Whether or not to grab when the XBMC video player is playing
/// @param grabPhoto Whether or not to grab when the XBMC photo player is playing
/// @param grabAudio Whether or not to grab when the XBMC audio player is playing
/// @param grabMenu Whether or not to grab when nothing is playing (in XBMC menu)
/// @param grabScreensaver Whether or not to grab when the XBMC screensaver is activated
/// @param address Network address of the KODI instance
/// @param port Port number to use (KODI default = 9090)
/// @param grabVideo Whether or not to grab when the KODI video player is playing
/// @param grabPhoto Whether or not to grab when the KODI photo player is playing
/// @param grabAudio Whether or not to grab when the KODI audio player is playing
/// @param grabMenu Whether or not to grab when nothing is playing (in KODI menu)
/// @param grabScreensaver Whether or not to grab when the KODI screensaver is activated
/// @param enable3DDetection Wheter or not to enable the detection of 3D movies playing
///
XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
KODIVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
/// Set the grabbing mode
void setGrabbingMode(GrabbingMode grabbingMode);
@ -84,11 +94,11 @@ private:
void setVideoMode(VideoMode videoMode);
private:
/// The network address of the XBMC instance
const QString _address;
/// The network address of the KODI instance
QString _address;
/// The port number of XBMC
const uint16_t _port;
/// The port number of KODI
uint16_t _port;
/// The JSON-RPC message to check the active player
const QString _activePlayerRequest;
@ -102,34 +112,34 @@ private:
/// The JSON-RPC message to check the active stereoscopicmode
const QString _getStereoscopicMode;
/// The JSON-RPC message to check the xbmc version
const QString _getXbmcVersion;
/// The JSON-RPC message to check the kodi version
QString _getKodiVersion;
/// The QT TCP Socket with connection to XBMC
/// The QT TCP Socket with connection to KODI
QTcpSocket _socket;
/// Flag indicating whether or not to grab when the XBMC video player is playing
const bool _grabVideo;
/// Flag indicating whether or not to grab when the KODI video player is playing
bool _grabVideo;
/// Flag indicating whether or not to grab when the XBMC photo player is playing
const bool _grabPhoto;
/// Flag indicating whether or not to grab when the KODI photo player is playing
bool _grabPhoto;
/// Flag indicating whether or not to grab when the XBMC audio player is playing
const bool _grabAudio;
/// Flag indicating whether or not to grab when the KODI audio player is playing
bool _grabAudio;
/// Flag indicating whether or not to grab when XBMC is playing nothing (in menu)
const bool _grabMenu;
/// Flag indicating whether or not to grab when KODI is playing nothing (in menu)
bool _grabMenu;
/// Flag indicating whether or not to grab when the XBMC videoplayer is at pause state
const bool _grabPause;
/// Flag indicating whether or not to grab when the KODI videoplayer is at pause state
bool _grabPause;
/// Flag indicating whether or not to grab when the XBMC screensaver is activated
const bool _grabScreensaver;
/// Flag indicating whether or not to grab when the KODI screensaver is activated
bool _grabScreensaver;
/// Flag indicating wheter or not to enable the detection of 3D movies playing
const bool _enable3DDetection;
bool _enable3DDetection;
/// Flag indicating if XBMC is on screensaver
/// Flag indicating if KODI is on screensaver
bool _previousScreensaverMode;
/// Previous emitted grab mode
@ -138,8 +148,14 @@ private:
/// Previous emitted video mode
VideoMode _previousVideoMode;
/// XBMC version number
int _xbmcVersion;
/// KODI version number
int _kodiVersion;
/// Logger Instance
Logger * _log;
static XBMCVideoChecker* _kodichecker;
/// flag indicating state
bool _active;
static KODIVideoChecker* _kodichecker;
};

View File

@ -92,7 +92,7 @@ private slots:
signals:
///
/// XBMC Video Checker Message
/// KODI Video Checker Message
///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode);

View File

@ -21,7 +21,7 @@ public:
signals:
///
/// Forwarding XBMC Video Checker Message
/// Forwarding KODI Video Checker Message
///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode);

View File

@ -54,7 +54,7 @@ public slots:
signals:
///
/// Forwarding XBMC Checker
/// Forwarding KODI Checker
///
void grabbingMode(const GrabbingMode mode);
void videoMode(const VideoMode VideoMode);

View File

@ -12,7 +12,7 @@ add_subdirectory(boblightserver)
add_subdirectory(udplistener)
add_subdirectory(leddevice)
add_subdirectory(utils)
add_subdirectory(xbmcvideochecker)
add_subdirectory(kodivideochecker)
add_subdirectory(effectengine)
add_subdirectory(grabber)
add_subdirectory(webconfig)

View File

@ -227,16 +227,16 @@
},
"additionalProperties" : false
},
"xbmcVideoChecker" :
"kodiVideoChecker" :
{
"type" : "object",
"required" : false,
"properties" : {
"xbmcAddress" : {
"kodiAddress" : {
"type" : "string",
"required" : true
},
"xbmcTcpPort" : {
"kodiTcpPort" : {
"type" : "integer",
"required" : true
},

View File

@ -259,16 +259,16 @@
},
"additionalProperties" : false
},
"xbmcVideoChecker" :
"kodiVideoChecker" :
{
"type" : "object",
"required" : false,
"properties" : {
"xbmcAddress" : {
"kodiAddress" : {
"type" : "string",
"required" : true
},
"xbmcTcpPort" : {
"kodiTcpPort" : {
"type" : "integer",
"required" : true
},

View File

@ -0,0 +1,29 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/kodivideochecker)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/kodivideochecker)
# Group the headers that go through the MOC compiler
SET(KODIVideoChecker_QT_HEADERS
${CURRENT_HEADER_DIR}/KODIVideoChecker.h
)
SET(KODIVideoChecker_HEADERS
)
SET(KODIVideoChecker_SOURCES
${CURRENT_SOURCE_DIR}/KODIVideoChecker.cpp
)
QT5_WRAP_CPP(KODIVideoChecker_HEADERS_MOC ${KODIVideoChecker_QT_HEADERS})
add_library(kodivideochecker
${KODIVideoChecker_HEADERS}
${KODIVideoChecker_QT_HEADERS}
${KODIVideoChecker_HEADERS_MOC}
${KODIVideoChecker_SOURCES}
)
target_link_libraries(kodivideochecker
hyperion
${QT_LIBRARIES})

View File

@ -3,23 +3,23 @@
#include <QRegExp>
#include <QStringRef>
#include <xbmcvideochecker/XBMCVideoChecker.h>
#include <kodivideochecker/KODIVideoChecker.h>
XBMCVideoChecker* XBMCVideoChecker::_kodichecker = nullptr;
KODIVideoChecker* KODIVideoChecker::_kodichecker = nullptr;
XBMCVideoChecker* XBMCVideoChecker::initInstance(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection)
KODIVideoChecker* KODIVideoChecker::initInstance(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection)
{
if ( XBMCVideoChecker::_kodichecker != nullptr )
throw std::runtime_error("XBMCVideoChecker::initInstance can be called only one time");
XBMCVideoChecker::_kodichecker = new XBMCVideoChecker(address, port, grabVideo, grabPhoto, grabAudio, grabMenu, grabPause, grabScreensaver, enable3DDetection);
if ( KODIVideoChecker::_kodichecker != nullptr )
throw std::runtime_error("KODIVideoChecker::initInstance can be called only one time");
KODIVideoChecker::_kodichecker = new KODIVideoChecker(address, port, grabVideo, grabPhoto, grabAudio, grabMenu, grabPause, grabScreensaver, enable3DDetection);
return XBMCVideoChecker::_kodichecker;
return KODIVideoChecker::_kodichecker;
}
XBMCVideoChecker* XBMCVideoChecker::getInstance()
KODIVideoChecker* KODIVideoChecker::getInstance()
{
return XBMCVideoChecker::_kodichecker;
return KODIVideoChecker::_kodichecker;
}
@ -39,27 +39,29 @@ XBMCVideoChecker* XBMCVideoChecker::getInstance()
// {"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669}
// {"id":669,"jsonrpc":"2.0","result":{"stereoscopicmode":{"label":"Nebeneinander","mode":"split_vertical"}}}
XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection) :
QObject(),
_address(QString::fromStdString(address)),
_port(port),
_activePlayerRequest(R"({"jsonrpc":"2.0","method":"Player.GetActivePlayers", "id":666})"),
_currentPlayingItemRequest(R"({"id":667,"jsonrpc":"2.0","method":"Player.GetItem","params":{"playerid":%1,"properties":["file"]}})"),
_checkScreensaverRequest(R"({"id":668,"jsonrpc":"2.0","method":"XBMC.GetInfoBooleans","params":{"booleans":["System.ScreenSaverActive"]}})"),
_getStereoscopicMode(R"({"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669})"),
_getXbmcVersion(R"({"jsonrpc":"2.0","method":"Application.GetProperties","params":{"properties":["version"]},"id":670})"),
_socket(),
_grabVideo(grabVideo),
_grabPhoto(grabPhoto),
_grabAudio(grabAudio),
_grabMenu(grabMenu),
_grabPause(grabPause),
_grabScreensaver(grabScreensaver),
_enable3DDetection(enable3DDetection),
_previousScreensaverMode(false),
_previousGrabbingMode(GRABBINGMODE_INVALID),
_previousVideoMode(VIDEO_2D),
_xbmcVersion(0)
KODIVideoChecker::KODIVideoChecker(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection)
: QObject()
, _address(QString::fromStdString(address))
, _port(port)
, _activePlayerRequest(R"({"jsonrpc":"2.0","method":"Player.GetActivePlayers", "id":666})")
, _currentPlayingItemRequest(R"({"id":667,"jsonrpc":"2.0","method":"Player.GetItem","params":{"playerid":%1,"properties":["file"]}})")
, _checkScreensaverRequest(R"({"id":668,"jsonrpc":"2.0","method":"XBMC.GetInfoBooleans","params":{"booleans":["System.ScreenSaverActive"]}})")
, _getStereoscopicMode(R"({"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669})")
, _getKodiVersion(R"({"jsonrpc":"2.0","method":"Application.GetProperties","params":{"properties":["version"]},"id":670})")
, _socket()
, _grabVideo(grabVideo)
, _grabPhoto(grabPhoto)
, _grabAudio(grabAudio)
, _grabMenu(grabMenu)
, _grabPause(grabPause)
, _grabScreensaver(grabScreensaver)
, _enable3DDetection(enable3DDetection)
, _previousScreensaverMode(false)
, _previousGrabbingMode(GRABBINGMODE_INVALID)
, _previousVideoMode(VIDEO_2D)
, _kodiVersion(0)
, _log(Logger::getInstance("KODI"))
, _active(false)
{
// setup socket
connect(&_socket, SIGNAL(readyRead()), this, SLOT(receiveReply()));
@ -68,17 +70,56 @@ XBMCVideoChecker::XBMCVideoChecker(const std::string & address, uint16_t port, b
connect(&_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionError(QAbstractSocket::SocketError)));
}
void XBMCVideoChecker::start()
KODIVideoChecker::~KODIVideoChecker()
{
stop();
}
void KODIVideoChecker::setConfig(const std::string & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection)
{
_address = QString::fromStdString(address);
_port = port;
_grabVideo = grabVideo;
_grabPhoto = grabPhoto;
_grabAudio = grabAudio;
_grabMenu = grabMenu;
_grabPause = grabPause;
_grabScreensaver = grabScreensaver;
_enable3DDetection = enable3DDetection;
_previousScreensaverMode = false;
_previousGrabbingMode = GRABBINGMODE_INVALID;
_previousVideoMode = VIDEO_2D;
_kodiVersion = 0;
// restart if active
if (_active)
{
stop();
QTimer::singleShot(2000, this, SLOT(()));
}
}
void KODIVideoChecker::start()
{
Info(_log, "started");
_active = true;
reconnect();
}
void XBMCVideoChecker::receiveReply()
void KODIVideoChecker::stop()
{
Info(_log, "stopped");
_active = false;
_socket.close();
}
void KODIVideoChecker::receiveReply()
{
// expect that the reply is received as a single message. Probably oke considering the size of the expected reply
QString reply(_socket.readAll());
// silence - no "debug" code should be at the log
// std::cout << "KODICHECK INFO: Kodi Message: " << reply.toStdString() << std::endl;
Debug(_log, "message: %s", reply.toStdString().c_str());
if (reply.contains("\"method\":\"Player.OnPlay\""))
{
@ -147,7 +188,7 @@ void XBMCVideoChecker::receiveReply()
}
else if (reply.contains("\"id\":667"))
{
if (_xbmcVersion >= 13)
if (_kodiVersion >= 13)
{
// check of active stereoscopicmode
_socket.write(_getStereoscopicMode.toUtf8());
@ -182,12 +223,12 @@ void XBMCVideoChecker::receiveReply()
bool active = reply.contains("\"System.ScreenSaverActive\":true");
setScreensaverMode(!_grabScreensaver && active);
// check here xbmc version
// check here kodi version
if (_socket.state() == QTcpSocket::ConnectedState)
{
if (_xbmcVersion == 0)
if (_kodiVersion == 0)
{
_socket.write(_getXbmcVersion.toUtf8());
_socket.write(_getKodiVersion.toUtf8());
}
}
}
@ -214,7 +255,7 @@ void XBMCVideoChecker::receiveReply()
int pos = regex.indexIn(reply);
if (pos > 0)
{
_xbmcVersion = regex.cap(1).toInt();
_kodiVersion = regex.cap(1).toInt();
}
}
else if (reply.contains("picture") && reply.contains("\"method\":\"Playlist.OnAdd\""))
@ -224,33 +265,34 @@ void XBMCVideoChecker::receiveReply()
}
}
void XBMCVideoChecker::connected()
void KODIVideoChecker::connected()
{
std::cout << "KODICHECK INFO: Kodi Connected" << std::endl;
Info(_log, "Connected");
// send a request for the current player state
_socket.write(_activePlayerRequest.toUtf8());
_socket.write(_checkScreensaverRequest.toUtf8());
}
void XBMCVideoChecker::disconnected()
void KODIVideoChecker::disconnected()
{
std::cout << "KODICHECK INFO: Kodi Disconnected" << std::endl;
Info(_log, "Disconnected");
reconnect();
}
void XBMCVideoChecker::reconnect()
void KODIVideoChecker::reconnect()
{
if (_socket.state() == QTcpSocket::ConnectedState)
if (_socket.state() == QTcpSocket::ConnectedState || ! _active )
{
return;
}
Debug(_log, "try reconnect");
// try to connect
switch (_socket.state())
{
case QTcpSocket::ConnectingState:
// Somehow when XBMC restarts we get stuck in connecting state
// Somehow when KODI restarts we get stuck in connecting state
// If we get here we tried to connect already for 5 seconds. abort and try again in 1 second.
_socket.reset();
_socket.waitForDisconnected(50);
@ -266,15 +308,15 @@ void XBMCVideoChecker::reconnect()
}
}
void XBMCVideoChecker::connectionError(QAbstractSocket::SocketError error)
void KODIVideoChecker::connectionError(QAbstractSocket::SocketError error)
{
std::cout << "KODICHECK ERROR: Kodi Connection error (" << error << ")" << std::endl;
Error(_log,"Connection error (%s)", error);
// close the socket
_socket.close();
}
void XBMCVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
void KODIVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
{
if (newGrabbingMode == _previousGrabbingMode)
{
@ -285,25 +327,25 @@ void XBMCVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
switch (newGrabbingMode)
{
case GRABBINGMODE_VIDEO:
std::cout << "KODICHECK INFO: switching to VIDEO mode" << std::endl;
Info(_log, "switching to VIDEO mode");
break;
case GRABBINGMODE_PHOTO:
std::cout << "KODICHECK INFO: switching to PHOTO mode" << std::endl;
Info(_log, "switching to PHOTO mode");
break;
case GRABBINGMODE_AUDIO:
std::cout << "KODICHECK INFO: switching to AUDIO mode" << std::endl;
Info(_log, "switching to AUDIO mode");
break;
case GRABBINGMODE_MENU:
std::cout << "KODICHECK INFO: switching to MENU mode" << std::endl;
Info(_log, "switching to MENU mode");
break;
case GRABBINGMODE_PAUSE:
std::cout << "KODICHECK INFO: switching to PAUSE mode" << std::endl;
Info(_log, "switching to PAUSE mode");
break;
case GRABBINGMODE_OFF:
std::cout << "KODICHECK INFO: switching to OFF mode" << std::endl;
Info(_log, "switching to OFF mode");
break;
case GRABBINGMODE_INVALID:
std::cout << "KODICHECK INFO: switching to INVALID mode" << std::endl;
default:
Warning(_log, "switching to INVALID mode");
break;
}
@ -315,7 +357,7 @@ void XBMCVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
_previousGrabbingMode = newGrabbingMode;
}
void XBMCVideoChecker::setScreensaverMode(bool isOnScreensaver)
void KODIVideoChecker::setScreensaverMode(bool isOnScreensaver)
{
if (isOnScreensaver == _previousScreensaverMode)
{
@ -327,7 +369,7 @@ void XBMCVideoChecker::setScreensaverMode(bool isOnScreensaver)
_previousScreensaverMode = isOnScreensaver;
}
void XBMCVideoChecker::setVideoMode(VideoMode newVideoMode)
void KODIVideoChecker::setVideoMode(VideoMode newVideoMode)
{
if (newVideoMode == _previousVideoMode)
{
@ -338,13 +380,13 @@ void XBMCVideoChecker::setVideoMode(VideoMode newVideoMode)
switch (newVideoMode)
{
case VIDEO_2D:
std::cout << "KODICHECK INFO: switching to 2D mode" << std::endl;
Info(_log, "KODICHECK INFO: switching to 2D mode");
break;
case VIDEO_3DSBS:
std::cout << "KODICHECK INFO: switching to 3D SBS mode" << std::endl;
Info(_log, "KODICHECK INFO: switching to 3D SBS mode");
break;
case VIDEO_3DTAB:
std::cout << "KODICHECK INFO: switching to 3D TAB mode" << std::endl;
Info(_log, "KODICHECK INFO: switching to 3D TAB mode");
break;
}

View File

@ -43,7 +43,7 @@ public:
public slots:
///
/// Send XBMC Video Checker message to connected client
/// Send KODI Video Checker message to connected client
///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode);

View File

@ -65,7 +65,7 @@ void ProtoServer::newConnection()
connect(connection, SIGNAL(connectionClosed(ProtoClientConnection*)), this, SLOT(closedConnection(ProtoClientConnection*)));
connect(connection, SIGNAL(newMessage(const proto::HyperionRequest*)), this, SLOT(newMessage(const proto::HyperionRequest*)));
// register forward signal for xbmc checker
// register forward signal for kodi checker
connect(this, SIGNAL(grabbingMode(GrabbingMode)), connection, SLOT(setGrabbingMode(GrabbingMode)));
connect(this, SIGNAL(videoMode(VideoMode)), connection, SLOT(setVideoMode(VideoMode)));

View File

@ -76,9 +76,9 @@ message HyperionReply {
// string indicating the reason for failure (if applicable)
optional string error = 3;
// XBMC Video Checker Proto Messages for Grabbing mode
// KODI Video Checker Proto Messages for Grabbing mode
optional int32 grabbing = 4;
// XBMC Video Checker Proto Messages for Video mode
// KODI Video Checker Proto Messages for Video mode
optional int32 video = 5;
}

View File

@ -1,29 +0,0 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/xbmcvideochecker)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/xbmcvideochecker)
# Group the headers that go through the MOC compiler
SET(XBMCVideoChecker_QT_HEADERS
${CURRENT_HEADER_DIR}/XBMCVideoChecker.h
)
SET(XBMCVideoChecker_HEADERS
)
SET(XBMCVideoChecker_SOURCES
${CURRENT_SOURCE_DIR}/XBMCVideoChecker.cpp
)
QT5_WRAP_CPP(XBMCVideoChecker_HEADERS_MOC ${XBMCVideoChecker_QT_HEADERS})
add_library(xbmcvideochecker
${XBMCVideoChecker_HEADERS}
${XBMCVideoChecker_QT_HEADERS}
${XBMCVideoChecker_HEADERS_MOC}
${XBMCVideoChecker_SOURCES}
)
target_link_libraries(xbmcvideochecker
hyperion
${QT_LIBRARIES})

View File

@ -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)));

View File

@ -5,7 +5,7 @@ add_executable(hyperiond
target_link_libraries(hyperiond
getoptPlusPlus
hyperion
xbmcvideochecker
kodivideochecker
effectengine
jsonserver
boblightserver

View File

@ -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();

View File

@ -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;