remove kodiVideoChecker (#475)

This commit is contained in:
brindosch
2017-11-22 00:52:55 +01:00
committed by GitHub
parent 0f9f3a17e7
commit fa75143dbf
43 changed files with 79 additions and 1198 deletions

View File

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

View File

@@ -6,7 +6,6 @@
#include <utils/ColorRgb.h>
#include <utils/Image.h>
#include <utils/VideoMode.h>
#include <utils/GrabbingMode.h>
#include <utils/ImageResampler.h>
#include <utils/Logger.h>
@@ -26,7 +25,7 @@ public:
virtual void setVideoMode(VideoMode mode);
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
/// gets resulting height of image
virtual const int getImageWidth() { return _width; };
@@ -39,13 +38,13 @@ protected:
ImageResampler _imageResampler;
bool _useImageResampler;
/// the selected VideoMode
VideoMode _videoMode;
/// With of the captured snapshot [pixels]
int _width;
/// Height of the captured snapshot [pixels]
int _height;

View File

@@ -7,7 +7,6 @@
#include <utils/Logger.h>
#include <utils/Components.h>
#include <utils/GrabbingMode.h>
#include <hyperion/Hyperion.h>
#include <hyperion/ImageProcessor.h>
#include <utils/Image.h>
@@ -21,11 +20,11 @@ class DispmanxFrameGrabber;
class GrabberWrapper : public QObject
{
Q_OBJECT
public:
public:
GrabberWrapper(QString grabberName, Grabber * ggrabber, unsigned width, unsigned height, const unsigned updateRate_Hz, const int priority, hyperion::Components grabberComponentId=hyperion::COMP_GRABBER);
virtual ~GrabberWrapper();
///
/// Starts the grabber wich produces led values with the specified update rate
///
@@ -63,10 +62,10 @@ public:
return false;
}
public slots:
void componentStateChanged(const hyperion::Components component, bool enable);
///
/// virtual method, should perform single frame grab and computes the led-colors
///
@@ -74,12 +73,6 @@ public slots:
void actionWrapper();
///
/// Set the grabbing mode
/// @param[in] mode The new grabbing mode
///
void setGrabbingMode(const GrabbingMode mode);
///
/// Set the video mode (2D/3D)
/// @param[in] mode The new video mode
@@ -94,9 +87,9 @@ signals:
protected:
void setColors(const std::vector<ColorRgb> &ledColors, const int timeout_ms);
QString _grabberName;
/// Pointer to Hyperion for writing led values
Hyperion * _hyperion;
@@ -114,7 +107,7 @@ protected:
/// The Logger instance
Logger * _log;
// forwarding enabled
bool _forward;
@@ -122,7 +115,7 @@ protected:
ImageProcessor * _processor;
hyperion::Components _grabberComponentId;
Grabber *_ggrabber;
/// The image used for grabbing frames
@@ -130,7 +123,6 @@ protected:
/// The list with computed led colors
std::vector<ColorRgb> _ledColors;
bool _imageProcessorEnabled;
};

View File

@@ -22,7 +22,6 @@
#include <utils/Logger.h>
#include <utils/Components.h>
#include <utils/VideoMode.h>
#include <utils/GrabbingMode.h>
// Hyperion includes
#include <hyperion/LedString.h>
@@ -36,8 +35,7 @@
#include <effectengine/ActiveEffectDefinition.h>
#include <effectengine/EffectSchema.h>
// KodiVideoChecker includes
#include <kodivideochecker/KODIVideoChecker.h>
// bonjour includes
#include <bonjour/bonjourservicebrowser.h>
#include <bonjour/bonjourserviceresolver.h>
@@ -48,7 +46,6 @@ class RgbTransform;
class EffectEngine;
class RgbChannelAdjustment;
class MultiColorAdjustment;
class KODIVideoChecker;
///
/// 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
///
/// @param component The component [SMOOTHING, BLACKBORDER, KODICHECKER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER]
/// @param component The component [SMOOTHING, BLACKBORDER, FORWARDER, UDPLISTENER, BOBLIGHT_SERVER, GRABBER]
/// @param state The state of the component [true | false]
///
void setComponentState(const hyperion::Components component, const bool state);
@@ -215,7 +212,6 @@ public:
unsigned addSmoothingConfig(int settlingTime_ms, double ledUpdateFrequency_hz=25.0, unsigned updateDelay=0);
VideoMode getCurrentVideoMode() { return _videoMode; };
GrabbingMode getCurrentGrabbingMode() { return _grabbingMode; };
public slots:
///
@@ -311,13 +307,6 @@ public slots:
///
void setVideoMode(VideoMode mode);
///
/// Set the grabbing mode
/// @param[in] mode The new grabbing mode
///
void setGrabbingMode(const GrabbingMode mode);
public:
static Hyperion *_hyperion;
@@ -365,8 +354,6 @@ signals:
/// Signal emitted when a 3D movie is detected
void videoMode(VideoMode mode);
void grabbingMode(GrabbingMode mode);
private slots:
///
/// Updates the priority muxer with the current time and (re)writes the led color with applied
@@ -478,5 +465,4 @@ private:
QTimer _fsi_blockTimer;
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
#include <utils/Image.h>
#include <utils/ColorRgb.h>
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
#include <utils/Logger.h>
@@ -90,9 +89,8 @@ private slots:
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);
private:
@@ -121,9 +119,9 @@ private:
QTimer _timer;
QAbstractSocket::SocketState _prevSocketState;
/// The buffer used for reading data from the socket
QByteArray _receiveBuffer;
Logger * _log;
};

View File

@@ -4,7 +4,6 @@
// hyperion includes
#include <utils/Image.h>
#include <utils/ColorRgb.h>
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
// hyperion proto includes
@@ -18,12 +17,11 @@ class ProtoConnectionWrapper : public QObject
public:
ProtoConnectionWrapper(const QString &address, int priority, int duration_ms, bool skipProtoReply);
virtual ~ProtoConnectionWrapper();
signals:
signals:
///
/// Forwarding KODI Video Checker Message
/// Forwarding new videoMode
///
void setGrabbingMode(const GrabbingMode mode);
void setVideoMode(const VideoMode videoMode);
public slots:

View File

@@ -15,7 +15,6 @@
// hyperion includes
#include <utils/Image.h>
#include <utils/ColorRgb.h>
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
#include <utils/Logger.h>
@@ -56,9 +55,8 @@ public slots:
signals:
///
/// Forwarding KODI Checker
/// Forwarding videoMode
///
void grabbingMode(const GrabbingMode mode);
void videoMode(const VideoMode VideoMode);
private slots:
@@ -91,7 +89,7 @@ private:
/// Logger instance
Logger * _log;
/// flag if forwarder is enabled
bool _forwarder_enabled;
};

View File

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