Hyperion X11 KodiCheck (#685)

* Update X11Grabber.h

* Update ProtoConnection.h

* Update ProtoConnectionWrapper.h

* Update ProtoServer.h

* Update X11Grabber.cpp

* Update message.proto

* Update ProtoClientConnection.cpp

* Update ProtoClientConnection.h

* Update ProtoConnection.cpp

* Update ProtoConnectionWrapper.cpp

* Update ProtoServer.cpp

* Update hyperion-x11.cpp

* Update X11Wrapper.cpp

* Update X11Wrapper.h

* Update hyperiond.cpp

* Update ProtoClientConnection.cpp

* Update X11Wrapper.cpp

* Update hyperiond.cpp


Former-commit-id: a572f275b270217cd8ce8cdd91b3eca3037d6472
This commit is contained in:
Paulchen-Panther
2016-06-07 23:12:18 +02:00
committed by brindosch
parent 614131ebe6
commit f0dec4cf73
15 changed files with 235 additions and 50 deletions

View File

@@ -39,3 +39,26 @@ void X11Wrapper::capture()
const Image<ColorRgb> & screenshot = _grabber.grab();
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_INVALID:
start();
break;
case GRABBINGMODE_OFF:
stop();
break;
}
}
void X11Wrapper::setVideoMode(const VideoMode mode)
{
_grabber.setVideoMode(mode);
}

View File

@@ -5,6 +5,10 @@
// Hyperion-X11 includes
#include <grabber/X11Grabber.h>
//Utils includes
#include <utils/GrabbingMode.h>
#include <utils/VideoMode.h>
class X11Wrapper : public QObject
{
Q_OBJECT
@@ -25,6 +29,19 @@ public:
signals:
void sig_screenshot(const Image<ColorRgb> & screenshot);
public slots:
///
/// 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
///
void setVideoMode(const VideoMode videoMode);
private slots:
///
/// Performs a single screenshot capture and publishes the capture screenshot on the screenshot

View File

@@ -104,6 +104,10 @@ 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
QObject::connect(&protoWrapper, SIGNAL(setGrabbingMode(GrabbingMode)), &x11Wrapper, SLOT(setGrabbingMode(GrabbingMode)));
QObject::connect(&protoWrapper, SIGNAL(setVideoMode(VideoMode)), &x11Wrapper, SLOT(setVideoMode(VideoMode)));
// Start the capturing
x11Wrapper.start();

View File

@@ -187,7 +187,7 @@ void startXBMCVideoChecker(const Json::Value &config, XBMCVideoChecker* &xbmcVid
}
}
void startNetworkServices(const Json::Value &config, Hyperion &hyperion, JsonServer* &jsonServer, ProtoServer* &protoServer, BoblightServer* &boblightServer)
void startNetworkServices(const Json::Value &config, Hyperion &hyperion, JsonServer* &jsonServer, ProtoServer* &protoServer, BoblightServer* &boblightServer, XBMCVideoChecker* &xbmcVideoChecker)
{
// Create Json server if configuration is present
if (config.isMember("jsonServer"))
@@ -216,6 +216,11 @@ void startNetworkServices(const Json::Value &config, Hyperion &hyperion, JsonSer
{
const Json::Value & protoServerConfig = config["protoServer"];
protoServer = new ProtoServer(&hyperion, protoServerConfig["port"].asUInt() );
if (xbmcVideoChecker != nullptr)
{
QObject::connect(xbmcVideoChecker, SIGNAL(grabbingMode(GrabbingMode)), protoServer, SIGNAL(grabbingMode(GrabbingMode)));
QObject::connect(xbmcVideoChecker, SIGNAL(videoMode(VideoMode)), protoServer, SIGNAL(videoMode(VideoMode)));
}
std::cout << "INFO: Proto server created and started on port " << protoServer->getPort() << std::endl;
#ifdef ENABLE_ZEROCONF
@@ -481,7 +486,7 @@ int main(int argc, char** argv)
JsonServer * jsonServer = nullptr;
ProtoServer * protoServer = nullptr;
BoblightServer * boblightServer = nullptr;
startNetworkServices(config, hyperion, jsonServer, protoServer, boblightServer);
startNetworkServices(config, hyperion, jsonServer, protoServer, boblightServer, xbmcVideoChecker);
// ---- grabber -----