remove kodiVideoChecker (#475)

This commit is contained in:
brindosch 2017-11-22 00:52:55 +01:00 committed by GitHub
parent 0f9f3a17e7
commit fa75143dbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 79 additions and 1198 deletions

View File

@ -22,7 +22,6 @@ The main features of Hyperion are:
* Json interface which allows easy integration into scripts * Json interface which allows easy integration into scripts
* A command line utility to for testing and integration in automated environment * A command line utility to for testing and integration in automated environment
* Priority channels are not coupled to a specific led data provider which means that a provider can post led data and leave without the need to maintain a connection to Hyperion. This is ideal for a remote application (like our Android app). * Priority channels are not coupled to a specific led data provider which means that a provider can post led data and leave without the need to maintain a connection to Hyperion. This is ideal for a remote application (like our Android app).
* Kodi-checker which checks the playing status of Kodi and decides whether or not to capture the screen.
* Black border detector. * Black border detector.
* A scriptable (Python) effect engine * A scriptable (Python) effect engine
* A web ui to configure and remote control hyperion * A web ui to configure and remote control hyperion

View File

@ -1,14 +0,0 @@
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h3 class="page-header"><i class="fa fa-play-circle-o fa-fw"></i><span data-i18n="conf_kodi_label_title">Kodi Watch</span></h3>
<div class="alert alert-info" role="alert">
<strong>HINT 1:</strong> In any case you need to enable the remote control for Kodi. Please checkout Wiki for instructions. LINK<br>
<strong>HINT 2:</strong> If you just use a USB-Grabber you could enable the Kodi Watch for this separately at the USB-Grabber page.
</div>
<div class="row" id="conf_cont"></div>
</div>
</div>
</div>
<script src="/js/content_kodi.js"></script>

View File

@ -17,7 +17,6 @@
"general_access_expert" : "Experte", "general_access_expert" : "Experte",
"general_comp_SMOOTHING" : "Glättung", "general_comp_SMOOTHING" : "Glättung",
"general_comp_BLACKBORDER" : "Schwarze Balken Erkennung", "general_comp_BLACKBORDER" : "Schwarze Balken Erkennung",
"general_comp_KODICHECKER" : "Kodi Überwachung",
"general_comp_FORWARDER" : "Weiterleitung", "general_comp_FORWARDER" : "Weiterleitung",
"general_comp_UDPLISTENER" : "UDP Listener", "general_comp_UDPLISTENER" : "UDP Listener",
"general_comp_BOBLIGHTSERVER" : "Boblight Server", "general_comp_BOBLIGHTSERVER" : "Boblight Server",
@ -72,7 +71,6 @@
"main_menu_grabber_conf_token" : "Aufnahme Hardware", "main_menu_grabber_conf_token" : "Aufnahme Hardware",
"main_menu_effect_conf_token" : "Effekte", "main_menu_effect_conf_token" : "Effekte",
"main_menu_colors_conf_token" : "Bildverarbeitung", "main_menu_colors_conf_token" : "Bildverarbeitung",
"main_menu_kodiwatch_token" : "Kodi Überwachung",
"main_menu_network_conf_token" : "Netzwerk", "main_menu_network_conf_token" : "Netzwerk",
"main_menu_remotecontrol_token" : "Fernbedienung", "main_menu_remotecontrol_token" : "Fernbedienung",
"main_menu_effectsconfigurator_token" : "Effekt Konfigurator", "main_menu_effectsconfigurator_token" : "Effekt Konfigurator",
@ -168,8 +166,6 @@
"conf_network_bobl_intro" : "Boblight Empfänger", "conf_network_bobl_intro" : "Boblight Empfänger",
"conf_network_udpl_intro" : "UDP Empfänger", "conf_network_udpl_intro" : "UDP Empfänger",
"conf_network_forw_intro" : "Leite alles an eine zweite Hyperion Instanz weiter, diese kann dann mit einer anderen LED Steuerung genutzt werden", "conf_network_forw_intro" : "Leite alles an eine zweite Hyperion Instanz weiter, diese kann dann mit einer anderen LED Steuerung genutzt werden",
"conf_kodi_label_title" : "Kodi Überwachung",
"conf_kodi_intro" : "Die Kodi Überwachung ermöglicht es dir abhängig vom Kodi Status dein ambient light an oder abzuschalten. Dies ist nicht limitiert auf das selbe Gerät. Du kannst jedes Kodi in deinem lokalen Netzwerk überwachen lassen.",
"conf_logging_label_intro" : "Überprüfe die Meldungen im Prokotoll um zu erfahren was Hyperion gerade beschäftigt. Je nach eingestellter Protokoll-Stufe siehst du mehr oder weniger Informationen.", "conf_logging_label_intro" : "Überprüfe die Meldungen im Prokotoll um zu erfahren was Hyperion gerade beschäftigt. Je nach eingestellter Protokoll-Stufe siehst du mehr oder weniger Informationen.",
"conf_logging_btn_pbupload" : "Bericht für Supportanfrage hochladen", "conf_logging_btn_pbupload" : "Bericht für Supportanfrage hochladen",
"conf_logging_btn_autoscroll" : "Automatisch scrollen", "conf_logging_btn_autoscroll" : "Automatisch scrollen",
@ -497,8 +493,6 @@
"edt_conf_v4l2_frameDecimation_expl" : "Der Faktor der Bildverkleinerung", "edt_conf_v4l2_frameDecimation_expl" : "Der Faktor der Bildverkleinerung",
"edt_conf_v4l2_sizeDecimation_title" : "Größenänderung", "edt_conf_v4l2_sizeDecimation_title" : "Größenänderung",
"edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der Größenänderung", "edt_conf_v4l2_sizeDecimation_expl" : "Der Faktor der Größenänderung",
"edt_conf_v4l2_useKodiChecker_title" : "Nutze Kodi Überwachung",
"edt_conf_v4l2_useKodiChecker_expl" : "Starte/Stoppe Aufnahme mithilfe der Kodi Überwachung.",
"edt_conf_v4l2_cropLeft_title" : "Entferne links", "edt_conf_v4l2_cropLeft_title" : "Entferne links",
"edt_conf_v4l2_cropLeft_expl" : "Anzahl der Pixel auf der linken Seite die vom Bild entfernt werden.", "edt_conf_v4l2_cropLeft_expl" : "Anzahl der Pixel auf der linken Seite die vom Bild entfernt werden.",
"edt_conf_v4l2_cropRight_title" : "Entferne rechts", "edt_conf_v4l2_cropRight_title" : "Entferne rechts",
@ -554,25 +548,6 @@
"edt_conf_bb_blurRemoveCnt_expl" : "Anzahl an Pixeln, die zusätzlich vom Rand abgeschnitten werden.", "edt_conf_bb_blurRemoveCnt_expl" : "Anzahl an Pixeln, die zusätzlich vom Rand abgeschnitten werden.",
"edt_conf_bb_mode_title" : "Modus", "edt_conf_bb_mode_title" : "Modus",
"edt_conf_bb_mode_expl" : "Algorithmus zur Auswertung. (siehe Wiki)", "edt_conf_bb_mode_expl" : "Algorithmus zur Auswertung. (siehe Wiki)",
"edt_conf_kodic_heading_title" : "Kodi Überwachung",
"edt_conf_kodic_kodiAddress_title" : "Kodi IP Adresse",
"edt_conf_kodic_kodiAddress_expl" : "Die IP Adresse von Kodi.",
"edt_conf_kodic_kodiTcpPort_title" : "Kodi TCP Port",
"edt_conf_kodic_kodiTcpPort_expl" : "Der Kodi TCP Port. Nutze nicht den Webserver Port!",
"edt_conf_kodic_grabVideo_title" : "Video",
"edt_conf_kodic_grabVideo_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während ein Video abgespielt werden.",
"edt_conf_kodic_grabPictures_title" : "Bilder",
"edt_conf_kodic_grabPictures_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während Bilder angezeigt werden.",
"edt_conf_kodic_grabAudio_title" : "Audio",
"edt_conf_kodic_grabAudio_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während Musik abgespielt wird.",
"edt_conf_kodic_grabMenu_title" : "Menü",
"edt_conf_kodic_grabMenu_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während du dich im Kodi Menü oder Nutzerauswahl befindest.",
"edt_conf_kodic_grabPause_title" : "Pause",
"edt_conf_kodic_grabPause_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während Kodi pausiert (Video, Musik, Diashow).",
"edt_conf_kodic_grabScreensaver_title" : "Bildschirmschoner",
"edt_conf_kodic_grabScreensaver_expl" : "Wenn aktiviert, ist die Aufnahme aktiv während Kodi pausiert (Video, Musik, Diashow).",
"edt_conf_kodic_enable3DDetection_title" : "Erkenne 3D",
"edt_conf_kodic_enable3DDetection_expl" : "Wenn aktiviert, erkenne und wende den passenden 3D Modus an. (kein MVC und nicht für USB Aufnahme)",
"edt_conf_fge_heading_title" : "Start Effekt/Farbe", "edt_conf_fge_heading_title" : "Start Effekt/Farbe",
"edt_conf_fge_type_title" : "Typ", "edt_conf_fge_type_title" : "Typ",
"edt_conf_fge_type_expl" : "Wähle zwischen einem Effekt oder einer Farbe.", "edt_conf_fge_type_expl" : "Wähle zwischen einem Effekt oder einer Farbe.",

View File

@ -17,7 +17,6 @@
"general_access_expert" : "Expert", "general_access_expert" : "Expert",
"general_comp_SMOOTHING" : "Smoothing", "general_comp_SMOOTHING" : "Smoothing",
"general_comp_BLACKBORDER" : "Blackbar Detection", "general_comp_BLACKBORDER" : "Blackbar Detection",
"general_comp_KODICHECKER" : "Kodi Watch",
"general_comp_FORWARDER" : "Forwarder", "general_comp_FORWARDER" : "Forwarder",
"general_comp_UDPLISTENER" : "UDP Listener", "general_comp_UDPLISTENER" : "UDP Listener",
"general_comp_BOBLIGHTSERVER" : "Boblight Server", "general_comp_BOBLIGHTSERVER" : "Boblight Server",
@ -72,7 +71,6 @@
"main_menu_grabber_conf_token" : "Capturing Hardware", "main_menu_grabber_conf_token" : "Capturing Hardware",
"main_menu_effect_conf_token" : "Effects", "main_menu_effect_conf_token" : "Effects",
"main_menu_colors_conf_token" : "Image Processing", "main_menu_colors_conf_token" : "Image Processing",
"main_menu_kodiwatch_token" : "Kodi Watch",
"main_menu_network_conf_token" : "Network Services", "main_menu_network_conf_token" : "Network Services",
"main_menu_remotecontrol_token" : "Remote Control", "main_menu_remotecontrol_token" : "Remote Control",
"main_menu_effectsconfigurator_token" : "Effects Configurator", "main_menu_effectsconfigurator_token" : "Effects Configurator",
@ -168,8 +166,6 @@
"conf_network_bobl_intro" : "Receiver for Boblight", "conf_network_bobl_intro" : "Receiver for Boblight",
"conf_network_udpl_intro" : "Receiver for UDP", "conf_network_udpl_intro" : "Receiver for UDP",
"conf_network_forw_intro" : "Forward all input to a second Hyperion instance which could be driven with another led controller", "conf_network_forw_intro" : "Forward all input to a second Hyperion instance which could be driven with another led controller",
"conf_kodi_label_title" : "Kodi Watch",
"conf_kodi_intro" : "The Kodi Watcher enables you to enable and disable the screencapture depending on Kodi state. This is not limited to the same machine, you could observe also a Kodi on any other device at your network.",
"conf_logging_label_intro" : "Area to check log messages, depending on loglevel setting you see more or less information.", "conf_logging_label_intro" : "Area to check log messages, depending on loglevel setting you see more or less information.",
"conf_logging_btn_pbupload" : "Upload report for support request", "conf_logging_btn_pbupload" : "Upload report for support request",
"conf_logging_btn_autoscroll" : "Auto scrolling", "conf_logging_btn_autoscroll" : "Auto scrolling",
@ -498,8 +494,6 @@
"edt_conf_v4l2_frameDecimation_expl" : "The factor of frame decimation", "edt_conf_v4l2_frameDecimation_expl" : "The factor of frame decimation",
"edt_conf_v4l2_sizeDecimation_title" : "Size decimation", "edt_conf_v4l2_sizeDecimation_title" : "Size decimation",
"edt_conf_v4l2_sizeDecimation_expl" : "The factor of size decimation", "edt_conf_v4l2_sizeDecimation_expl" : "The factor of size decimation",
"edt_conf_v4l2_useKodiChecker_title" : "Use Kodi Watch",
"edt_conf_v4l2_useKodiChecker_expl" : "Start/stop capturing with Kodi Watch results.",
"edt_conf_v4l2_cropLeft_title" : "Crop left", "edt_conf_v4l2_cropLeft_title" : "Crop left",
"edt_conf_v4l2_cropLeft_expl" : "Count of pixels on the left side that are removed from the picture.", "edt_conf_v4l2_cropLeft_expl" : "Count of pixels on the left side that are removed from the picture.",
"edt_conf_v4l2_cropRight_title" : "Crop right", "edt_conf_v4l2_cropRight_title" : "Crop right",
@ -555,25 +549,6 @@
"edt_conf_bb_blurRemoveCnt_expl" : "Number of pixels that get removed from the detected border to cut away blur.", "edt_conf_bb_blurRemoveCnt_expl" : "Number of pixels that get removed from the detected border to cut away blur.",
"edt_conf_bb_mode_title" : "Mode", "edt_conf_bb_mode_title" : "Mode",
"edt_conf_bb_mode_expl" : "Algorithm for processing. (see Wiki)", "edt_conf_bb_mode_expl" : "Algorithm for processing. (see Wiki)",
"edt_conf_kodic_heading_title" : "Kodi Watch",
"edt_conf_kodic_kodiAddress_title" : "Kodi IP address",
"edt_conf_kodic_kodiAddress_expl" : "The IP address of Kodi.",
"edt_conf_kodic_kodiTcpPort_title" : "Kodi TCP port",
"edt_conf_kodic_kodiTcpPort_expl" : "The TCP port of Kodi. Don't use the webserver port!",
"edt_conf_kodic_grabVideo_title" : "Video",
"edt_conf_kodic_grabVideo_expl" : "If checked, the capturing is enabled during video playback, else it's disabled.",
"edt_conf_kodic_grabPictures_title" : "Pictures",
"edt_conf_kodic_grabPictures_expl" : "If checked, the capturing is enabled on picture playback, else it's disabled.",
"edt_conf_kodic_grabAudio_title" : "Audio",
"edt_conf_kodic_grabAudio_expl" : "If checked, the capturing is enabled during audio playback, else it's disabled.",
"edt_conf_kodic_grabMenu_title" : "Menu",
"edt_conf_kodic_grabMenu_expl" : "If checked, the capturing is enabled in menu and login screen, else it's disabled.",
"edt_conf_kodic_grabPause_title" : "Pause",
"edt_conf_kodic_grabPause_expl" : "If checked, the capturing is enabled in pause mode (Music, Video, Diashow), else it's disabled.",
"edt_conf_kodic_grabScreensaver_title" : "Screensaver",
"edt_conf_kodic_grabScreensaver_expl" : "If checked, the capturing is enabled during screensaver, else it's disabled.",
"edt_conf_kodic_enable3DDetection_title" : "Detect 3D",
"edt_conf_kodic_enable3DDetection_expl" : "Detect which 3D mode Kodi is running. (no MVC and not for USB capture)",
"edt_conf_fge_heading_title" : "Boot Effect/Color", "edt_conf_fge_heading_title" : "Boot Effect/Color",
"edt_conf_fge_type_title" : "Type", "edt_conf_fge_type_title" : "Type",
"edt_conf_fge_type_expl" : "Choose between a color or effect.", "edt_conf_fge_type_expl" : "Choose between a color or effect.",

View File

@ -165,7 +165,6 @@
<li> <a class="inactive mnava" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li> <li> <a class="inactive mnava" href="#conf_grabber"><i class="fa fa-camera fa-fw"></i><span data-i18n="main_menu_grabber_conf_token">Capturing Hardware</span></a> </li>
<li> <a class="inactive mnava" href="#conf_effect"><i class="fa fa-spinner fa-fw"></i><span data-i18n="main_menu_effect_conf_token">Effects</span></a> </li> <li> <a class="inactive mnava" href="#conf_effect"><i class="fa fa-spinner fa-fw"></i><span data-i18n="main_menu_effect_conf_token">Effects</span></a> </li>
<li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li> <li> <a class="inactive mnava" href="#conf_colors"><i class="fa fa-photo fa-fw"></i><span data-i18n="main_menu_colors_conf_token">Image Processing</span></a> </li>
<li> <a class="inactive mnava" href="#conf_kodi"><i class="fa fa-play-circle-o fa-fw"></i><span data-i18n="main_menu_kodiwatch_token">Kodi Watch</span></a> </li>
<li> <a class="inactive mnava" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li> <li> <a class="inactive mnava" href="#conf_network"><i class="fa fa-sitemap fa-fw"></i><span data-i18n="main_menu_network_conf_token">Network</span></a> </li>
</ul> </ul>
</li> </li>

View File

@ -1,29 +0,0 @@
$(document).ready( function() {
var conf_editor = null;
performTranslation();
$('#conf_cont').append(createOptPanel('fa-play-circle-o', $.i18n("conf_kodi_label_title"), 'editor_container', 'btn_submit'));
if(showOptHelp)
{
$('#conf_cont').append(createHelpTable(schema.kodiVideoChecker.properties, $.i18n("conf_kodi_label_title")));
}
conf_editor = createJsonEditor('editor_container', {
kodiVideoChecker: schema.kodiVideoChecker
}, true, true);
conf_editor.on('change',function() {
conf_editor.validate().length ? $('#btn_submit').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
});
$('#btn_submit').off().on('click',function() {
requestWriteConfig(conf_editor.getValue());
});
//create introduction
if(showOptHelp)
createHint("intro", $.i18n('conf_kodi_intro'), "editor_container");
removeOverlay();
});

View File

@ -108,7 +108,6 @@
/// * frameDecimation : Frame decimation factor [default=2] /// * frameDecimation : Frame decimation factor [default=2]
/// * sizeDecimation : Size decimation factor [default=8] /// * sizeDecimation : Size decimation factor [default=8]
/// * priority : Hyperion priority channel [default=900] /// * priority : Hyperion priority channel [default=900]
/// * useKodiChecker : Enable/disable V4L2 according kodichecker sate if set to true [default=false]
/// * cropLeft : Cropping from the left [default=0] /// * cropLeft : Cropping from the left [default=0]
/// * cropRight : Cropping from the right [default=0] /// * cropRight : Cropping from the right [default=0]
/// * cropTop : Cropping from the top [default=0] /// * cropTop : Cropping from the top [default=0]
@ -133,7 +132,6 @@
"frameDecimation" : 2, "frameDecimation" : 2,
"sizeDecimation" : 8, "sizeDecimation" : 8,
"priority" : 240, "priority" : 240,
"useKodiChecker" : false,
"cropLeft" : 0, "cropLeft" : 0,
"cropRight" : 0, "cropRight" : 0,
"cropTop" : 0, "cropTop" : 0,
@ -201,31 +199,6 @@
"mode" : "default" "mode" : "default"
}, },
/// The configuration of the Kodi connection used to enable and disable the frame-grabber. Contains the following fields:
/// * 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
/// * grabMenu : Flag indicating that the frame-grabber is on(true) at the Kodi menu
/// * 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
"kodiVideoChecker" :
{
"enable" : true,
"kodiAddress" : "127.0.0.1",
"kodiTcpPort" : 9090,
"grabVideo" : true,
"grabPictures" : true,
"grabAudio" : true,
"grabMenu" : false,
"grabPause" : false,
"grabScreensaver" : false,
"enable3DDetection" : false
},
/// foregroundEffect sets a "booteffect" or "bootcolor" during startup for a given period in ms (duration_ms) /// foregroundEffect sets a "booteffect" or "bootcolor" during startup for a given period in ms (duration_ms)
/// * enable : if true, foreground effect is enabled /// * enable : if true, foreground effect is enabled
/// * type : choose between "color" or "effect" /// * type : choose between "color" or "effect"
@ -242,7 +215,7 @@
"duration_ms" : 3000 "duration_ms" : 3000
}, },
/// backgroundEffect sets a background effect or color. It is used when all capture devices are stopped (with the help of the kodiVideChecker or manual via remote). Could be also selected via priorities selection. /// backgroundEffect sets a background effect or color. It is used when all capture devices are stopped (manual via remote). Could be also selected via priorities selection.
/// * enable : if true, background effect is enabled /// * enable : if true, background effect is enabled
/// * type : choose between "color" or "effect" /// * type : choose between "color" or "effect"
/// * color : if type is color, a color is used (RGB) (example: [255,134,0]) /// * color : if type is color, a color is used (RGB) (example: [255,134,0])

View File

@ -67,7 +67,6 @@
"frameDecimation" : 2, "frameDecimation" : 2,
"sizeDecimation" : 8, "sizeDecimation" : 8,
"priority" : 240, "priority" : 240,
"useKodiChecker" : false,
"cropLeft" : 0, "cropLeft" : 0,
"cropRight" : 0, "cropRight" : 0,
"cropTop" : 0, "cropTop" : 0,
@ -112,20 +111,6 @@
"mode" : "default" "mode" : "default"
}, },
"kodiVideoChecker" :
{
"enable" : false,
"kodiAddress" : "localhost",
"kodiTcpPort" : 9090,
"grabVideo" : true,
"grabPictures" : true,
"grabAudio" : true,
"grabMenu" : false,
"grabPause" : false,
"grabScreensaver" : false,
"enable3DDetection" : false
},
"foregroundEffect" : "foregroundEffect" :
{ {
"enable" : true, "enable" : true,

View File

@ -19,8 +19,7 @@ public:
double redSignalThreshold, double redSignalThreshold,
double greenSignalThreshold, double greenSignalThreshold,
double blueSignalThreshold, double blueSignalThreshold,
const int priority, const int priority);
bool useGrabbingMode);
virtual ~V4L2Wrapper() {}; virtual ~V4L2Wrapper() {};
bool getSignalDetectionEnable(); bool getSignalDetectionEnable();

View File

@ -6,7 +6,6 @@
#include <utils/ColorRgb.h> #include <utils/ColorRgb.h>
#include <utils/Image.h> #include <utils/Image.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
#include <utils/GrabbingMode.h>
#include <utils/ImageResampler.h> #include <utils/ImageResampler.h>
#include <utils/Logger.h> #include <utils/Logger.h>

View File

@ -7,7 +7,6 @@
#include <utils/Logger.h> #include <utils/Logger.h>
#include <utils/Components.h> #include <utils/Components.h>
#include <utils/GrabbingMode.h>
#include <hyperion/Hyperion.h> #include <hyperion/Hyperion.h>
#include <hyperion/ImageProcessor.h> #include <hyperion/ImageProcessor.h>
#include <utils/Image.h> #include <utils/Image.h>
@ -74,12 +73,6 @@ public slots:
void actionWrapper(); void actionWrapper();
///
/// Set the grabbing mode
/// @param[in] mode The new grabbing mode
///
void setGrabbingMode(const GrabbingMode mode);
/// ///
/// Set the video mode (2D/3D) /// Set the video mode (2D/3D)
/// @param[in] mode The new video mode /// @param[in] mode The new video mode
@ -133,4 +126,3 @@ protected:
bool _imageProcessorEnabled; bool _imageProcessorEnabled;
}; };

View File

@ -22,7 +22,6 @@
#include <utils/Logger.h> #include <utils/Logger.h>
#include <utils/Components.h> #include <utils/Components.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
#include <utils/GrabbingMode.h>
// Hyperion includes // Hyperion includes
#include <hyperion/LedString.h> #include <hyperion/LedString.h>
@ -36,8 +35,7 @@
#include <effectengine/ActiveEffectDefinition.h> #include <effectengine/ActiveEffectDefinition.h>
#include <effectengine/EffectSchema.h> #include <effectengine/EffectSchema.h>
// KodiVideoChecker includes // bonjour includes
#include <kodivideochecker/KODIVideoChecker.h>
#include <bonjour/bonjourservicebrowser.h> #include <bonjour/bonjourservicebrowser.h>
#include <bonjour/bonjourserviceresolver.h> #include <bonjour/bonjourserviceresolver.h>
@ -48,7 +46,6 @@ class RgbTransform;
class EffectEngine; class EffectEngine;
class RgbChannelAdjustment; class RgbChannelAdjustment;
class MultiColorAdjustment; class MultiColorAdjustment;
class KODIVideoChecker;
/// ///
/// The main class of Hyperion. This gives other 'users' access to the attached LedDevice through /// The main class of Hyperion. This gives other 'users' access to the attached LedDevice through
@ -186,7 +183,7 @@ public:
/// ///
/// Enable/Disable components during runtime /// 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] /// @param state The state of the component [true | false]
/// ///
void setComponentState(const hyperion::Components component, const bool state); void setComponentState(const hyperion::Components component, const bool state);
@ -215,7 +212,6 @@ public:
unsigned addSmoothingConfig(int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0); unsigned addSmoothingConfig(int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0);
VideoMode getCurrentVideoMode() { return _videoMode; }; VideoMode getCurrentVideoMode() { return _videoMode; };
GrabbingMode getCurrentGrabbingMode() { return _grabbingMode; };
public slots: public slots:
/// ///
@ -311,13 +307,6 @@ public slots:
/// ///
void setVideoMode(VideoMode mode); void setVideoMode(VideoMode mode);
///
/// Set the grabbing mode
/// @param[in] mode The new grabbing mode
///
void setGrabbingMode(const GrabbingMode mode);
public: public:
static Hyperion *_hyperion; static Hyperion *_hyperion;
@ -365,8 +354,6 @@ signals:
/// Signal emitted when a 3D movie is detected /// Signal emitted when a 3D movie is detected
void videoMode(VideoMode mode); void videoMode(VideoMode mode);
void grabbingMode(GrabbingMode mode);
private slots: private slots:
/// ///
/// Updates the priority muxer with the current time and (re)writes the led color with applied /// Updates the priority muxer with the current time and (re)writes the led color with applied
@ -478,5 +465,4 @@ private:
QTimer _fsi_blockTimer; QTimer _fsi_blockTimer;
VideoMode _videoMode; VideoMode _videoMode;
GrabbingMode _grabbingMode;
}; };

View File

@ -1,172 +0,0 @@
#pragma once
// system includes
#include <cstdint>
// QT includes
#include <QTimer>
#include <QString>
#include <QTcpSocket>
#include <QByteArray>
// Hyperion includes
#include <hyperion/Hyperion.h>
// Utils includes
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
#include <utils/Logger.h>
#include <utils/Components.h>
///
/// 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 KODI in System/Settings/Network/Services
///
class KODIVideoChecker : public QObject
{
Q_OBJECT
public:
static KODIVideoChecker* initInstance(const QString & 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 QString & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection);
bool componentState() { return _active; }
public slots:
///
/// Start polling KODI
///
void start();
///
/// Stop polling KODI
///
void stop();
void componentStateChanged(const hyperion::Components component, bool enable);
signals:
/// Signal emitted when the grabbing mode changes
void grabbingMode(GrabbingMode grabbingMode);
/// Signal emitted when a 3D movie is detected
void videoMode(VideoMode videoMode);
private slots:
/// Receive a reply from KODI
void receiveReply();
/// Called when connected to KODI
void connected();
/// Called when disconnected from KODI
void disconnected();
/// reconnect to KODI
void reconnect();
/// Called when a connection error was encountered
void connectionError(QAbstractSocket::SocketError error);
private:
///
/// Constructor
///
/// @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
///
KODIVideoChecker(const QString & 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);
/// Set the video mode
void setVideoMode(VideoMode videoMode);
private:
/// The network address of the KODI instance
QString _address;
/// The port number of KODI
uint16_t _port;
/// The JSON-RPC message to check the active player
const QString _activePlayerRequest;
/// The JSON-RPC message to check the currently playing file
const QString _currentPlayingItemRequest;
/// The JSON-RPC message to check the screensaver
const QString _checkScreensaverRequest;
/// The JSON-RPC message to check the active stereoscopicmode
const QString _getStereoscopicMode;
/// The JSON-RPC message to check the kodi version
QString _getKodiVersion;
/// The JSON-RPC message to check the current Playback State
const QString _getCurrentPlaybackState;
/// The QT TCP Socket with connection to KODI
QTcpSocket _socket;
/// 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 KODI photo player is playing
bool _grabPhoto;
/// Flag indicating whether or not to grab when the KODI audio player is playing
bool _grabAudio;
/// 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 KODI videoplayer is at pause state
bool _grabPause;
/// 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
bool _enable3DDetection;
/// Previous emitted grab mode
GrabbingMode _previousGrabbingMode;
/// Previous emitted video mode
VideoMode _previousVideoMode;
/// Current Playback State
bool _currentPlaybackState;
/// Current Kodi PlayerID
int _currentPlayerID;
/// KODI version number
int _kodiVersion;
/// Logger Instance
Logger * _log;
/// flag indicating state
bool _active;
/// flag indicates if playbackState is valid
bool _getCurrentPlaybackStateInitialized;
static KODIVideoChecker* _kodichecker;
};

View File

@ -11,7 +11,6 @@
// hyperion util // hyperion util
#include <utils/Image.h> #include <utils/Image.h>
#include <utils/ColorRgb.h> #include <utils/ColorRgb.h>
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
#include <utils/Logger.h> #include <utils/Logger.h>
@ -90,9 +89,8 @@ private slots:
signals: signals:
/// ///
/// KODI Video Checker Message /// emits when a new videoMode was requested from proto client
/// ///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode); void setVideoMode(const VideoMode videoMode);
private: private:

View File

@ -4,7 +4,6 @@
// hyperion includes // hyperion includes
#include <utils/Image.h> #include <utils/Image.h>
#include <utils/ColorRgb.h> #include <utils/ColorRgb.h>
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
// hyperion proto includes // hyperion proto includes
@ -21,9 +20,8 @@ public:
signals: signals:
/// ///
/// Forwarding KODI Video Checker Message /// Forwarding new videoMode
/// ///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode); void setVideoMode(const VideoMode videoMode);
public slots: public slots:

View File

@ -15,7 +15,6 @@
// hyperion includes // hyperion includes
#include <utils/Image.h> #include <utils/Image.h>
#include <utils/ColorRgb.h> #include <utils/ColorRgb.h>
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
#include <utils/Logger.h> #include <utils/Logger.h>
@ -56,9 +55,8 @@ public slots:
signals: signals:
/// ///
/// Forwarding KODI Checker /// Forwarding videoMode
/// ///
void grabbingMode(const GrabbingMode mode);
void videoMode(const VideoMode VideoMode); void videoMode(const VideoMode VideoMode);
private slots: private slots:

View File

@ -11,7 +11,6 @@ enum Components
COMP_INVALID, COMP_INVALID,
COMP_SMOOTHING, COMP_SMOOTHING,
COMP_BLACKBORDER, COMP_BLACKBORDER,
COMP_KODICHECKER,
COMP_FORWARDER, COMP_FORWARDER,
COMP_UDPLISTENER, COMP_UDPLISTENER,
COMP_BOBLIGHTSERVER, COMP_BOBLIGHTSERVER,
@ -29,7 +28,6 @@ inline const char* componentToString(Components c)
{ {
case COMP_SMOOTHING: return "Smoothing"; case COMP_SMOOTHING: return "Smoothing";
case COMP_BLACKBORDER: return "Blackborder detector"; case COMP_BLACKBORDER: return "Blackborder detector";
case COMP_KODICHECKER: return "KodiVideoChecker";
case COMP_FORWARDER: return "Json/Proto forwarder"; case COMP_FORWARDER: return "Json/Proto forwarder";
case COMP_UDPLISTENER: return "UDP listener"; case COMP_UDPLISTENER: return "UDP listener";
case COMP_BOBLIGHTSERVER:return "Boblight server"; case COMP_BOBLIGHTSERVER:return "Boblight server";
@ -49,7 +47,6 @@ inline const char* componentToIdString(Components c)
{ {
case COMP_SMOOTHING: return "SMOOTHING"; case COMP_SMOOTHING: return "SMOOTHING";
case COMP_BLACKBORDER: return "BLACKBORDER"; case COMP_BLACKBORDER: return "BLACKBORDER";
case COMP_KODICHECKER: return "KODICHECKER";
case COMP_FORWARDER: return "FORWARDER"; case COMP_FORWARDER: return "FORWARDER";
case COMP_UDPLISTENER: return "UDPLISTENER"; case COMP_UDPLISTENER: return "UDPLISTENER";
case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER"; case COMP_BOBLIGHTSERVER:return "BOBLIGHTSERVER";
@ -68,7 +65,6 @@ inline Components stringToComponent(QString component)
component = component.toUpper(); component = component.toUpper();
if (component == "SMOOTHING") return COMP_SMOOTHING; if (component == "SMOOTHING") return COMP_SMOOTHING;
if (component == "BLACKBORDER") return COMP_BLACKBORDER; if (component == "BLACKBORDER") return COMP_BLACKBORDER;
if (component == "KODICHECKER") return COMP_KODICHECKER;
if (component == "FORWARDER") return COMP_FORWARDER; if (component == "FORWARDER") return COMP_FORWARDER;
if (component == "UDPLISTENER") return COMP_UDPLISTENER; if (component == "UDPLISTENER") return COMP_UDPLISTENER;
if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER; if (component == "BOBLIGHTSERVER")return COMP_BOBLIGHTSERVER;

View File

@ -1,35 +0,0 @@
#pragma once
#include <QString>
/**
* Enumeration of the possible modes in which frame-grabbing is performed.
*/
enum GrabbingMode
{
/** Frame grabbing is switched off */
GRABBINGMODE_OFF,
/** Frame grabbing during video */
GRABBINGMODE_VIDEO,
GRABBINGMODE_PAUSE,
GRABBINGMODE_PHOTO,
GRABBINGMODE_AUDIO,
GRABBINGMODE_MENU,
GRABBINGMODE_SCREENSAVER,
GRABBINGMODE_INVALID
};
inline QString grabbingMode2String(GrabbingMode mode)
{
switch(mode)
{
case GRABBINGMODE_OFF: return "OFF";
case GRABBINGMODE_VIDEO: return "VIDEO";
case GRABBINGMODE_PAUSE: return "PAUSE";
case GRABBINGMODE_PHOTO: return "PHOTO";
case GRABBINGMODE_AUDIO: return "AUDIO";
case GRABBINGMODE_MENU: return "MENU";
case GRABBINGMODE_SCREENSAVER: return "SCREENSAVER";
default: return "INVALID";
}
}

View File

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

View File

@ -15,8 +15,7 @@ V4L2Wrapper::V4L2Wrapper(const QString &device,
double redSignalThreshold, double redSignalThreshold,
double greenSignalThreshold, double greenSignalThreshold,
double blueSignalThreshold, double blueSignalThreshold,
const int priority, const int priority)
bool useGrabbingMode)
: GrabberWrapper("V4L2:"+device, &_grabber, width, height, 8, priority, hyperion::COMP_V4L) : GrabberWrapper("V4L2:"+device, &_grabber, width, height, 8, priority, hyperion::COMP_V4L)
, _grabber(device, , _grabber(device,
input, input,
@ -41,10 +40,6 @@ V4L2Wrapper::V4L2Wrapper(const QString &device,
QObject::connect(&_grabber, SIGNAL(newFrame(Image<ColorRgb>)), this, SLOT(newFrame(Image<ColorRgb>)), Qt::DirectConnection); QObject::connect(&_grabber, SIGNAL(newFrame(Image<ColorRgb>)), this, SLOT(newFrame(Image<ColorRgb>)), Qt::DirectConnection);
QObject::connect(&_grabber, SIGNAL(readError(const char*)), this, SLOT(readError(const char*)), Qt::DirectConnection); QObject::connect(&_grabber, SIGNAL(readError(const char*)), this, SLOT(readError(const char*)), Qt::DirectConnection);
if (!useGrabbingMode)
{
disconnect(_hyperion, SIGNAL(grabbingMode(GrabbingMode)), this, 0);
}
_timer.setInterval(500); _timer.setInterval(500);
} }

View File

@ -34,7 +34,6 @@ GrabberWrapper::GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned
connect(_hyperion, SIGNAL(imageToLedsMappingChanged(int)), _processor, SLOT(setLedMappingType(int))); connect(_hyperion, SIGNAL(imageToLedsMappingChanged(int)), _processor, SLOT(setLedMappingType(int)));
connect(_hyperion, SIGNAL(componentStateChanged(hyperion::Components,bool)), this, SLOT(componentStateChanged(hyperion::Components,bool))); connect(_hyperion, SIGNAL(componentStateChanged(hyperion::Components,bool)), this, SLOT(componentStateChanged(hyperion::Components,bool)));
connect(_hyperion, SIGNAL(grabbingMode(GrabbingMode)), this, SLOT(setGrabbingMode(GrabbingMode)));
connect(_hyperion, SIGNAL(videoMode(VideoMode)), this, SLOT(setVideoMode(VideoMode))); connect(_hyperion, SIGNAL(videoMode(VideoMode)), this, SLOT(setVideoMode(VideoMode)));
connect(this, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _hyperion, SLOT(setImage(int, const Image<ColorRgb>&, const int)) ); connect(this, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _hyperion, SLOT(setImage(int, const Image<ColorRgb>&, const int)) );
connect(&_timer, SIGNAL(timeout()), this, SLOT(actionWrapper())); connect(&_timer, SIGNAL(timeout()), this, SLOT(actionWrapper()));
@ -104,18 +103,6 @@ void GrabberWrapper::componentStateChanged(const hyperion::Components component,
} }
} }
void GrabberWrapper::setGrabbingMode(const GrabbingMode mode)
{
if (mode == GRABBINGMODE_OFF)
{
stop();
}
else
{
start();
}
}
void GrabberWrapper::setColors(const std::vector<ColorRgb> &ledColors, const int timeout_ms) void GrabberWrapper::setColors(const std::vector<ColorRgb> &ledColors, const int timeout_ms)
{ {
_hyperion->setColors(_priority, ledColors, timeout_ms, true, _grabberComponentId); _hyperion->setColors(_priority, ledColors, timeout_ms, true, _grabberComponentId);
@ -171,4 +158,3 @@ void GrabberWrapper::setImageProcessorEnabled(bool enable)
{ {
_imageProcessorEnabled = enable; _imageProcessorEnabled = enable;
} }

View File

@ -402,7 +402,6 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile, con
, _bonjourBrowser(this) , _bonjourBrowser(this)
, _bonjourResolver(this) , _bonjourResolver(this)
, _videoMode(VIDEO_2D) , _videoMode(VIDEO_2D)
, _grabbingMode(GRABBINGMODE_INVALID)
{ {
if (!_raw2ledAdjustment->verifyAdjustments()) if (!_raw2ledAdjustment->verifyAdjustments())
@ -814,12 +813,6 @@ void Hyperion::setVideoMode(VideoMode mode)
emit videoMode(mode); emit videoMode(mode);
} }
void Hyperion::setGrabbingMode(GrabbingMode mode)
{
_grabbingMode = mode;
emit grabbingMode(mode);
}
void Hyperion::hyperionStateChanged() void Hyperion::hyperionStateChanged()
{ {

View File

@ -35,10 +35,6 @@
{ {
"$ref": "schema-blackborderdetector.json" "$ref": "schema-blackborderdetector.json"
}, },
"kodiVideoChecker" :
{
"$ref": "schema-kodiVideoChecker.json"
},
"foregroundEffect" : "foregroundEffect" :
{ {
"$ref": "schema-foregroundEffect.json" "$ref": "schema-foregroundEffect.json"

View File

@ -11,7 +11,6 @@
<file alias="schema-grabberV4L2.json">schema/schema-grabberV4L2.json</file> <file alias="schema-grabberV4L2.json">schema/schema-grabberV4L2.json</file>
<file alias="schema-framegrabber.json">schema/schema-framegrabber.json</file> <file alias="schema-framegrabber.json">schema/schema-framegrabber.json</file>
<file alias="schema-blackborderdetector.json">schema/schema-blackborderdetector.json</file> <file alias="schema-blackborderdetector.json">schema/schema-blackborderdetector.json</file>
<file alias="schema-kodiVideoChecker.json">schema/schema-kodiVideoChecker.json</file>
<file alias="schema-foregroundEffect.json">schema/schema-foregroundEffect.json</file> <file alias="schema-foregroundEffect.json">schema/schema-foregroundEffect.json</file>
<file alias="schema-backgroundEffect.json">schema/schema-backgroundEffect.json</file> <file alias="schema-backgroundEffect.json">schema/schema-backgroundEffect.json</file>
<file alias="schema-forwarder.json">schema/schema-forwarder.json</file> <file alias="schema-forwarder.json">schema/schema-forwarder.json</file>

View File

@ -96,14 +96,6 @@
"required" : true, "required" : true,
"propertyOrder" : 9 "propertyOrder" : 9
}, },
"useKodiChecker" :
{
"type" : "boolean",
"title" : "edt_conf_v4l2_useKodiChecker_title",
"default" : false,
"required" : true,
"propertyOrder" : 10
},
"cropLeft" : "cropLeft" :
{ {
"type" : "integer", "type" : "integer",

View File

@ -1,80 +0,0 @@
{
"type" : "object",
"title" : "edt_conf_kodic_heading_title",
"properties" :
{
"enable" :
{
"type" : "boolean",
"title" : "edt_conf_general_enable_title",
"default" : false,
"propertyOrder" : 1
},
"kodiAddress" :
{
"type" : "string",
"title" : "edt_conf_kodic_kodiAddress_title",
"default" : "127.0.0.1",
"propertyOrder" : 2
},
"kodiTcpPort" :
{
"type" : "integer",
"title" : "edt_conf_kodic_kodiTcpPort_title",
"minimum" : 0,
"maximum" : 65535,
"default" : 9090,
"propertyOrder" : 3
},
"grabVideo" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_grabVideo_title",
"default" : true,
"propertyOrder" : 4
},
"grabPictures" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_grabPictures_title",
"default" : true,
"propertyOrder" : 5
},
"grabAudio" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_grabAudio_title",
"default" : true,
"propertyOrder" : 6
},
"grabMenu" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_grabMenu_title",
"default" : false,
"propertyOrder" : 7
},
"grabPause" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_grabPause_title",
"default" : false,
"propertyOrder" : 8
},
"grabScreensaver" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_grabScreensaver_title",
"default" : false,
"propertyOrder" : 9
},
"enable3DDetection" :
{
"type" : "boolean",
"title" : "edt_conf_kodic_enable3DDetection_title",
"default" : false,
"propertyOrder" : 10
}
},
"additionalProperties" : false
}

View File

@ -1,12 +0,0 @@
# Define the current source locations
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/kodivideochecker)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/kodivideochecker)
FILE ( GLOB KODIVideoChecker_SOURCES "${CURRENT_HEADER_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*.cpp" )
add_library(kodivideochecker ${KODIVideoChecker_SOURCES} )
target_link_libraries(kodivideochecker
hyperion
${QT_LIBRARIES})

View File

@ -1,507 +0,0 @@
// Qt includes
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <kodivideochecker/KODIVideoChecker.h>
#include <hyperion/Hyperion.h>
using namespace hyperion;
KODIVideoChecker* KODIVideoChecker::_kodichecker = nullptr;
KODIVideoChecker* KODIVideoChecker::initInstance(const QString & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool 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 KODIVideoChecker::_kodichecker;
}
KODIVideoChecker* KODIVideoChecker::getInstance()
{
return KODIVideoChecker::_kodichecker;
}
// Request player example:
// {"jsonrpc":"2.0","method":"Player.GetActivePlayers", "id":666}
// {"id":666,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}
// Request playing item example:
// {"id":667,"jsonrpc":"2.0","method":"Player.GetItem","params":{"playerid":1,"properties":["file"]}}
// {"id":667,"jsonrpc":"2.0","result":{"item":{"file":"smb://xbmc:xbmc@192.168.53.12/video/Movies/Avatar (2009)/Avatar.mkv","label":"Avatar","type":"unknown"}}}
// Request if screensaver is on
// {"id":668,"jsonrpc":"2.0","method":"XBMC.GetInfoBooleans","params":{"booleans":["System.ScreenSaverActive"]}}
// {"id":668,"jsonrpc":"2.0","result":{"System.ScreenSaverActive":false}}
// Request stereoscopicmode example:
// {"jsonrpc":"2.0","method":"GUI.GetProperties","params":{"properties":["stereoscopicmode"]},"id":669}
// {"id":669,"jsonrpc":"2.0","result":{"stereoscopicmode":{"label":"Nebeneinander","mode":"split_vertical"}}}
KODIVideoChecker::KODIVideoChecker(const QString & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection)
: QObject()
, _address(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})")
, _getCurrentPlaybackState(R"({"id":671,"jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":%1,"properties":["speed"]}})")
, _socket()
, _grabVideo(grabVideo)
, _grabPhoto(grabPhoto)
, _grabAudio(grabAudio)
, _grabMenu(grabMenu)
, _grabPause(grabPause)
, _grabScreensaver(grabScreensaver)
, _enable3DDetection(enable3DDetection)
, _previousGrabbingMode(GRABBINGMODE_INVALID)
, _previousVideoMode(VIDEO_2D)
, _currentPlaybackState(false)
, _currentPlayerID(0)
, _kodiVersion(0)
, _log(Logger::getInstance("KODI"))
, _active(false)
, _getCurrentPlaybackStateInitialized(false)
{
// setup socket
connect(&_socket, SIGNAL(readyRead()), this, SLOT(receiveReply()));
connect(&_socket, SIGNAL(disconnected()), this, SLOT(disconnected()));
connect(&_socket, SIGNAL(connected()), this, SLOT(connected()));
connect(&_socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectionError(QAbstractSocket::SocketError)));
}
KODIVideoChecker::~KODIVideoChecker()
{
stop();
}
void KODIVideoChecker::setConfig(const QString & address, uint16_t port, bool grabVideo, bool grabPhoto, bool grabAudio, bool grabMenu, bool grabPause, bool grabScreensaver, bool enable3DDetection)
{
_address = address;
_port = port;
_grabVideo = grabVideo;
_grabPhoto = grabPhoto;
_grabAudio = grabAudio;
_grabMenu = grabMenu;
_grabPause = grabPause;
_grabScreensaver = grabScreensaver;
_enable3DDetection = enable3DDetection;
_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 KODIVideoChecker::stop()
{
Info(_log, "stopped");
_active = false;
_socket.close();
}
void KODIVideoChecker::componentStateChanged(const hyperion::Components component, bool enable)
{
if (component == COMP_KODICHECKER)
{
if (_active != enable)
{
if (enable) start();
else stop();
Info(_log, "change state to %s", (_active ? "enabled" : "disabled") );
}
Hyperion::getInstance()->getComponentRegister().componentStateChanged(component, _active);
}
}
void KODIVideoChecker::receiveReply()
{
QJsonParseError error;
QByteArray qtreply = _socket.readAll();
QJsonDocument doc = QJsonDocument::fromJson(qtreply, &error);
if (error.error == QJsonParseError::NoError)
{
if (doc.isObject())
{
Debug(_log, "message: %s", doc.toJson(QJsonDocument::Compact).constData());
// Reply
if (doc.object().contains("id"))
{
int id = doc.object()["id"].toInt();
switch (id)
{
case 666:
{
if (doc.object()["result"].isArray())
{
QJsonArray resultArray = doc.object()["result"].toArray();
if (!resultArray.isEmpty())
{
// always start a new video in 2D mode
emit videoMode(VIDEO_2D);
QString type = resultArray[0].toObject()["type"].toString();
int prevCurrentPlayerID = _currentPlayerID;
_currentPlayerID = resultArray[0].toObject()["playerid"].toInt();
// set initial player state
if (! _getCurrentPlaybackStateInitialized && prevCurrentPlayerID == 0 && _currentPlayerID != 0)
{
_socket.write(_getCurrentPlaybackState.arg(_currentPlayerID).toUtf8());
_getCurrentPlaybackStateInitialized = true;
return;
}
if (type == "video")
{
if (_currentPlaybackState)
{
// video is playing
setGrabbingMode(_grabVideo ? GRABBINGMODE_VIDEO : GRABBINGMODE_OFF);
}
else
{
setGrabbingMode(_grabPause ? GRABBINGMODE_PAUSE : GRABBINGMODE_OFF);
}
// request info of the playing item
_socket.write(_currentPlayingItemRequest.arg(_currentPlayerID).toUtf8());
}
else if (type == "picture")
{
if (_currentPlaybackState)
{
// picture is playing
setGrabbingMode(_grabPhoto ? GRABBINGMODE_PHOTO : GRABBINGMODE_OFF);
}
else
{
setGrabbingMode(_grabPause ? GRABBINGMODE_PAUSE : GRABBINGMODE_OFF);
}
}
else if (type == "audio")
{
// audio is playing
if (_currentPlaybackState)
{
// audio is playing
setGrabbingMode(_grabAudio ? GRABBINGMODE_AUDIO : GRABBINGMODE_OFF);
}
else
{
setGrabbingMode(_grabPause ? GRABBINGMODE_PAUSE : GRABBINGMODE_OFF);
}
}
}
else
{
// Nothing is playing.
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
}
else
{
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
break;
}
case 667:
{
if (_kodiVersion >= 13)
{
// check of active stereoscopicmode
_socket.write(_getStereoscopicMode.toUtf8());
}
else
{
if (doc.object()["result"].toObject()["item"].toObject().contains("file"))
{
QString filename = doc.object()["result"].toObject()["item"].toObject()["file"].toString();
if (filename.contains("3DSBS", Qt::CaseInsensitive) || filename.contains("HSBS", Qt::CaseInsensitive))
setVideoMode(VIDEO_3DSBS);
else if (filename.contains("3DTAB", Qt::CaseInsensitive) || filename.contains("HTAB", Qt::CaseInsensitive))
setVideoMode(VIDEO_3DTAB);
else
setVideoMode(VIDEO_2D);
}
else
{
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
}
break;
}
case 668:
{
if (doc.object()["result"].toObject().contains("System.ScreenSaverActive"))
{
// result of System.ScreenSaverActive
if (doc.object()["result"].toObject()["System.ScreenSaverActive"].toBool())
setGrabbingMode(_grabScreensaver ? GRABBINGMODE_SCREENSAVER : GRABBINGMODE_OFF);
else
_socket.write(_activePlayerRequest.toUtf8());
// check here kodi version
if (_socket.state() == QTcpSocket::ConnectedState)
{
if (_kodiVersion == 0)
{
_socket.write(_getKodiVersion.toUtf8());
}
}
}
else
{
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
break;
}
case 669:
{
if (doc.object()["result"].toObject()["stereoscopicmode"].toObject().contains("mode"))
{
// result of stereoscopicmode
QString mode = doc.object()["result"].toObject()["stereoscopicmode"].toObject()["mode"].toString();
if (mode == "split_vertical")
setVideoMode(VIDEO_3DSBS);
else if (mode == "split_horizontal")
setVideoMode(VIDEO_3DTAB);
}
else
{
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
break;
}
case 670:
{
if (doc.object()["result"].toObject()["version"].toObject().contains("major"))
{
// kodi major version
_kodiVersion = doc.object()["result"].toObject()["version"].toObject()["major"].toInt();
}
else
{
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
break;
}
case 671:
{
if (doc.object()["result"].toObject().contains("speed"))
{
// result of Player.PlayPause
_currentPlaybackState = static_cast<bool>(doc.object()["result"].toObject()["speed"].toInt());
}
else
{
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
}
break;
}
}
}
// Notification
else if (doc.object().contains("method"))
{
QString method = doc.object()["method"].toString();
if (method == "Player.OnPlay")
{
if (doc.object()["params"].toObject()["data"].toObject()["player"].toObject().contains("speed"))
{
_getCurrentPlaybackStateInitialized = true;
_currentPlaybackState = static_cast<bool>(doc.object()["params"].toObject()["data"].toObject()["player"].toObject()["speed"].toInt());
}
// send a request for the current player state
_socket.write(_activePlayerRequest.toUtf8());
return;
}
else if (method == "Player.OnStop")
{
// the player has stopped
setGrabbingMode(_grabMenu ? GRABBINGMODE_MENU : GRABBINGMODE_OFF);
setVideoMode(VIDEO_2D);
}
else if (method == "Player.OnPause")
{
if (doc.object()["params"].toObject()["data"].toObject()["player"].toObject().contains("speed"))
{
_getCurrentPlaybackStateInitialized = true;
_currentPlaybackState = static_cast<bool>(doc.object()["params"].toObject()["data"].toObject()["player"].toObject()["speed"].toInt());
}
// player at pause
setGrabbingMode(_grabPause ? GRABBINGMODE_PAUSE : GRABBINGMODE_OFF);
}
else if (method == "GUI.OnScreensaverActivated")
setGrabbingMode(_grabScreensaver ? GRABBINGMODE_SCREENSAVER : GRABBINGMODE_OFF);
else if (method == "GUI.OnScreensaverDeactivated")
_socket.write(_activePlayerRequest.toUtf8());
else if (method == "Playlist.OnAdd" &&
(doc.object()["params"]
.toObject()["data"]
.toObject()["item"]
.toObject()["type"]) == QString("picture"))
{
// picture viewer is playing
setGrabbingMode(_grabPhoto ? GRABBINGMODE_PHOTO : GRABBINGMODE_OFF);
}
else if (method == "Input.OnInputFinished")
{
// This Event is fired when Kodi Login
_socket.write(_activePlayerRequest.toUtf8());
_socket.write(_checkScreensaverRequest.toUtf8());
if (_currentPlayerID != 0)
_socket.write(_getCurrentPlaybackState.arg(_currentPlayerID).toUtf8());
}
}
}
else
{
Debug(_log, "Incomplete data");
}
}
}
void KODIVideoChecker::connected()
{
Info(_log, "Connected");
_getCurrentPlaybackStateInitialized = false;
// send a request for the current player state
_socket.write(_activePlayerRequest.toUtf8());
_socket.write(_checkScreensaverRequest.toUtf8());
}
void KODIVideoChecker::disconnected()
{
Info(_log, "Disconnected");
_previousGrabbingMode = GRABBINGMODE_INVALID;
_previousVideoMode = VIDEO_2D;
_kodiVersion = 0;
reconnect();
}
void KODIVideoChecker::reconnect()
{
if (_socket.state() == QTcpSocket::ConnectedState || ! _active )
{
return;
}
Debug(_log, "try reconnect");
// try to connect
switch (_socket.state())
{
case QTcpSocket::ConnectingState:
// 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);
QTimer::singleShot(1000, this, SLOT(reconnect()));
break;
case QTcpSocket::UnconnectedState:
_socket.connectToHost(_address, _port);
QTimer::singleShot(10000, this, SLOT(reconnect()));
break;
default:
QTimer::singleShot(10000, this, SLOT(reconnect()));
break;
}
}
void KODIVideoChecker::connectionError(QAbstractSocket::SocketError error)
{
Error(_log,"Connection error (%s)", _socket.errorString().toStdString().c_str());
// close the socket
_socket.close();
}
void KODIVideoChecker::setGrabbingMode(GrabbingMode newGrabbingMode)
{
if (newGrabbingMode == _previousGrabbingMode)
{
// no change
return;
}
switch (newGrabbingMode)
{
case GRABBINGMODE_VIDEO:
Info(_log, "switching to VIDEO mode");
break;
case GRABBINGMODE_PHOTO:
Info(_log, "switching to PHOTO mode");
break;
case GRABBINGMODE_AUDIO:
Info(_log, "switching to AUDIO mode");
break;
case GRABBINGMODE_MENU:
Info(_log, "switching to MENU mode");
break;
case GRABBINGMODE_PAUSE:
Info(_log, "switching to PAUSE mode");
break;
case GRABBINGMODE_OFF:
Info(_log, "switching to OFF mode");
break;
case GRABBINGMODE_SCREENSAVER:
Info(_log, "switching to SCREENSAVER mode");
break;
default:
Warning(_log, "switching to INVALID mode");
break;
}
emit grabbingMode(newGrabbingMode);
_previousGrabbingMode = newGrabbingMode;
}
void KODIVideoChecker::setVideoMode(VideoMode newVideoMode)
{
if (newVideoMode == _previousVideoMode)
{
// no change
return;
}
switch (newVideoMode)
{
case VIDEO_2D:
Info(_log, "switching to 2D mode");
break;
case VIDEO_3DSBS:
Info(_log, "switching to 3D SBS mode");
break;
case VIDEO_3DTAB:
Info(_log, "switching to 3D TAB mode");
break;
}
emit videoMode(newVideoMode);
_previousVideoMode = newVideoMode;
}

View File

@ -85,19 +85,6 @@ void ProtoClientConnection::socketClosed()
emit connectionClosed(this); emit connectionClosed(this);
} }
void ProtoClientConnection::setGrabbingMode(const GrabbingMode mode)
{
int grabbing_mode = (int)mode;
proto::HyperionReply gMode;
// create proto message
gMode.set_type(proto::HyperionReply::GRABBING);
gMode.set_grabbing(grabbing_mode);
// send message
sendMessage(gMode);
}
void ProtoClientConnection::setVideoMode(const VideoMode videoMode) void ProtoClientConnection::setVideoMode(const VideoMode videoMode)
{ {
int video_Mode = (int)videoMode; int video_Mode = (int)videoMode;
@ -105,7 +92,7 @@ void ProtoClientConnection::setVideoMode(const VideoMode videoMode)
// create proto message // create proto message
vMode.set_type(proto::HyperionReply::VIDEO); vMode.set_type(proto::HyperionReply::VIDEO);
vMode.set_grabbing(video_Mode); vMode.set_video(video_Mode);
// send message // send message
sendMessage(vMode); sendMessage(vMode);

View File

@ -13,7 +13,6 @@
#include <hyperion/Hyperion.h> #include <hyperion/Hyperion.h>
//Utils includes //Utils includes
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
// proto includes // proto includes
@ -44,9 +43,8 @@ public:
public slots: public slots:
/// ///
/// Send KODI Video Checker message to connected client /// Send video mode message to connected client
/// ///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode); void setVideoMode(const VideoMode videoMode);
signals: signals:

View File

@ -226,13 +226,6 @@ bool ProtoConnection::parseReply(const proto::HyperionReply &reply)
} }
break; break;
} }
case proto::HyperionReply::GRABBING:
{
int grabbing = reply.has_grabbing() ? reply.grabbing() : 7;
GrabbingMode gMode = (GrabbingMode)grabbing;
emit setGrabbingMode(gMode);
break;
}
case proto::HyperionReply::VIDEO: case proto::HyperionReply::VIDEO:
{ {
int video = reply.has_video() ? reply.video() : 0; int video = reply.has_video() ? reply.video() : 0;

View File

@ -10,7 +10,6 @@ ProtoConnectionWrapper::ProtoConnectionWrapper(const QString &address,
, _connection(address) , _connection(address)
{ {
_connection.setSkipReply(skipProtoReply); _connection.setSkipReply(skipProtoReply);
connect(&_connection, SIGNAL(setGrabbingMode(GrabbingMode)), this, SIGNAL(setGrabbingMode(GrabbingMode)));
connect(&_connection, SIGNAL(setVideoMode(VideoMode)), this, SIGNAL(setVideoMode(VideoMode))); connect(&_connection, SIGNAL(setVideoMode(VideoMode)), this, SIGNAL(setVideoMode(VideoMode)));
} }

View File

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

View File

@ -63,8 +63,7 @@ message ClearRequest {
message HyperionReply { message HyperionReply {
enum Type { enum Type {
REPLY = 1; REPLY = 1;
GRABBING = 2; VIDEO = 2;
VIDEO = 3;
} }
// Identifies which field is filled in. // Identifies which field is filled in.
@ -76,9 +75,6 @@ message HyperionReply {
// string indicating the reason for failure (if applicable) // string indicating the reason for failure (if applicable)
optional string error = 3; optional string error = 3;
// KODI Video Checker Proto Messages for Grabbing mode // Proto Messages for video mode
optional int32 grabbing = 4; optional int32 video = 4;
// KODI Video Checker Proto Messages for Video mode
optional int32 video = 5;
} }

View File

@ -21,7 +21,7 @@
"component": "component":
{ {
"type" : "string", "type" : "string",
"enum" : ["ALL", "SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER", "V4L", "LEDDEVICE"], "enum" : ["ALL", "SMOOTHING", "BLACKBORDER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER", "V4L", "LEDDEVICE"],
"required": true "required": true
}, },
"state": "state":

View File

@ -101,7 +101,7 @@ public:
/// ///
/// Enable/Disable components during runtime /// 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] /// @param state The state of the component [true | false]
/// ///
void setComponentState(const QString & component, const bool state); void setComponentState(const QString & component, const bool state);

View File

@ -73,8 +73,8 @@ int main(int argc, char * argv[])
BooleanOption & argSysInfo = parser.add<BooleanOption>('s', "sysinfo" , "show system info"); 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 & 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"); 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 & 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, 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, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER, V4L, LEDDEVICE]");
Option & argId = parser.add<Option> ('q', "qualifier" , "Identifier(qualifier) of the adjustment to set"); 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 & argBrightness = parser.add<IntOption> ('L', "brightness" , "Set the brightness gain of the leds");
IntOption & argBrightnessC = parser.add<IntOption> (0x0, "brightnessCompensation" , "Set the brightness compensation"); IntOption & argBrightnessC = parser.add<IntOption> (0x0, "brightnessCompensation" , "Set the brightness compensation");

View File

@ -40,25 +40,6 @@ void X11Wrapper::capture()
emit sig_screenshot(_screenshot); 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) void X11Wrapper::setVideoMode(const VideoMode mode)
{ {
_grabber.setVideoMode(mode); _grabber.setVideoMode(mode);

View File

@ -6,7 +6,6 @@
#include <grabber/X11Grabber.h> #include <grabber/X11Grabber.h>
//Utils includes //Utils includes
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h> #include <utils/VideoMode.h>
class X11Wrapper : public QObject class X11Wrapper : public QObject
@ -30,12 +29,6 @@ signals:
void sig_screenshot(const Image<ColorRgb> & screenshot); void sig_screenshot(const Image<ColorRgb> & screenshot);
public slots: public slots:
///
/// Set the grabbing mode
/// @param[in] mode The new grabbing mode
///
void setGrabbingMode(const GrabbingMode mode);
/// ///
/// Set the video mode (2D/3D) /// Set the video mode (2D/3D)
/// @param[in] mode The new video mode /// @param[in] mode The new video mode

View File

@ -84,8 +84,7 @@ int main(int argc, char ** argv)
// Connect the screen capturing to the proto processing // Connect the screen capturing to the proto processing
QObject::connect(&x11Wrapper, SIGNAL(sig_screenshot(const Image<ColorRgb> &)), &protoWrapper, SLOT(receiveImage(Image<ColorRgb>))); QObject::connect(&x11Wrapper, SIGNAL(sig_screenshot(const Image<ColorRgb> &)), &protoWrapper, SLOT(receiveImage(Image<ColorRgb>)));
// Connect the KODI Video Checker to the proto processing // Connect the vodeMode to the proto processing
QObject::connect(&protoWrapper, SIGNAL(setGrabbingMode(GrabbingMode)), &x11Wrapper, SLOT(setGrabbingMode(GrabbingMode)));
QObject::connect(&protoWrapper, SIGNAL(setVideoMode(VideoMode)), &x11Wrapper, SLOT(setVideoMode(VideoMode))); QObject::connect(&protoWrapper, SIGNAL(setVideoMode(VideoMode)), &x11Wrapper, SLOT(setVideoMode(VideoMode)));
// Start the capturing // Start the capturing

View File

@ -10,7 +10,6 @@ add_executable(hyperiond
target_link_libraries(hyperiond target_link_libraries(hyperiond
commandline commandline
hyperion hyperion
kodivideochecker
effectengine effectengine
jsonserver jsonserver
boblightserver boblightserver

View File

@ -39,7 +39,6 @@
HyperionDaemon::HyperionDaemon(QString configFile, const QString rootPath, QObject *parent) HyperionDaemon::HyperionDaemon(QString configFile, const QString rootPath, QObject *parent)
: QObject(parent) : QObject(parent)
, _log(Logger::getInstance("MAIN")) , _log(Logger::getInstance("MAIN"))
, _kodiVideoChecker(nullptr)
, _jsonServer(nullptr) , _jsonServer(nullptr)
, _protoServer(nullptr) , _protoServer(nullptr)
, _boblightServer(nullptr) , _boblightServer(nullptr)
@ -99,7 +98,6 @@ void HyperionDaemon::freeObjects()
{ {
delete grabber; delete grabber;
} }
delete _kodiVideoChecker;
delete _jsonServer; delete _jsonServer;
delete _protoServer; delete _protoServer;
delete _boblightServer; delete _boblightServer;
@ -111,7 +109,6 @@ void HyperionDaemon::freeObjects()
_dispmanx = nullptr; _dispmanx = nullptr;
_fbGrabber = nullptr; _fbGrabber = nullptr;
_osxGrabber = nullptr; _osxGrabber = nullptr;
_kodiVideoChecker = nullptr;
_jsonServer = nullptr; _jsonServer = nullptr;
_protoServer = nullptr; _protoServer = nullptr;
_boblightServer = nullptr; _boblightServer = nullptr;
@ -121,8 +118,6 @@ void HyperionDaemon::freeObjects()
void HyperionDaemon::run() void HyperionDaemon::run()
{ {
createKODIVideoChecker();
// ---- network services ----- // ---- network services -----
startNetworkServices(); startNetworkServices();
@ -266,39 +261,8 @@ void HyperionDaemon::startInitialEffect()
#undef BGCONFIG_ARRAY #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() void HyperionDaemon::startNetworkServices()
{ {
KODIVideoChecker* kodiVideoChecker = KODIVideoChecker::getInstance();
// Create Stats // Create Stats
_stats = new Stats(); _stats = new Stats();
@ -324,11 +288,7 @@ void HyperionDaemon::startNetworkServices()
} }
_protoServer = new ProtoServer(protoPort); _protoServer = new ProtoServer(protoPort);
if (kodiVideoChecker != nullptr) QObject::connect(_hyperion, SIGNAL(videoMode(VideoMode)), _protoServer, SLOT(setVideoMode(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()); Info(_log, "Proto server created and started on port %d", _protoServer->getPort());
// Create Boblight server if configuration is present // 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 = new DispmanxWrapper(_grabber_width, _grabber_height, _grabber_frequency, _grabber_priority);
_dispmanx->setCropping(_grabber_cropLeft, _grabber_cropRight, _grabber_cropTop, _grabber_cropBottom); _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(_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)), _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)) ); 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["redSignalThreshold"].toDouble(0.0)/100.0,
grabberConfig["greenSignalThreshold"].toDouble(0.0)/100.0, grabberConfig["greenSignalThreshold"].toDouble(0.0)/100.0,
grabberConfig["blueSignalThreshold"].toDouble(0.0)/100.0, grabberConfig["blueSignalThreshold"].toDouble(0.0)/100.0,
grabberConfig["priority"].toInt(890), grabberConfig["priority"].toInt(890));
grabberConfig["useKodiChecker"].toBool(false));
grabber->setCropping( grabber->setCropping(
grabberConfig["cropLeft"].toInt(0), grabberConfig["cropLeft"].toInt(0),
grabberConfig["cropRight"].toInt(0), grabberConfig["cropRight"].toInt(0),

View File

@ -41,7 +41,6 @@
#include <utils/Logger.h> #include <utils/Logger.h>
#include <kodivideochecker/KODIVideoChecker.h>
#include <jsonserver/JsonServer.h> #include <jsonserver/JsonServer.h>
#include <protoserver/ProtoServer.h> #include <protoserver/ProtoServer.h>
#include <boblightserver/BoblightServer.h> #include <boblightserver/BoblightServer.h>
@ -65,7 +64,6 @@ public:
void run(); void run();
void startInitialEffect(); void startInitialEffect();
void createKODIVideoChecker();
void startNetworkServices(); void startNetworkServices();
// grabber creators // grabber creators
@ -84,7 +82,6 @@ private:
Logger* _log; Logger* _log;
QJsonObject _qconfig; QJsonObject _qconfig;
KODIVideoChecker* _kodiVideoChecker;
JsonServer* _jsonServer; JsonServer* _jsonServer;
ProtoServer* _protoServer; ProtoServer* _protoServer;
BoblightServer* _boblightServer; BoblightServer* _boblightServer;