This commit is contained in:
Paulchen-Panther
2018-12-31 15:48:29 +01:00
parent 0e3ddb7eca
commit d6b2cfaf9d
49 changed files with 899 additions and 535 deletions

View File

@@ -1,7 +1,7 @@
add_subdirectory(hyperiond)
add_subdirectory(hyperion-remote)
# The following clients depend on the protobuf library
# The following binaries are just compiled if requested
if (ENABLE_AMLOGIC)
add_subdirectory(hyperion-aml)
endif()

View File

@@ -23,9 +23,7 @@ add_executable(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME}
effectengine
commandline
blackborder
hyperion-utils
flatbufserver
flatbuffers

View File

@@ -37,7 +37,7 @@ int main(int argc, char ** argv)
// create the option parser and initialize all parser
Parser parser("AmLogic capture application for Hyperion. Will automatically search a Hyperion server if -a option isn't used. Please note that if you have more than one server running it's more or less random which one will be used.");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 25);
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");

View File

@@ -30,9 +30,7 @@ add_executable( ${PROJECT_NAME}
)
target_link_libraries( ${PROJECT_NAME}
effectengine
commandline
blackborder
hyperion-utils
flatbufserver
flatbuffers

View File

@@ -36,9 +36,9 @@ int main(int argc, char ** argv)
// create the option parser and initialize all parameters
Parser parser("Dispmanx capture application for Hyperion. Will automatically search a Hyperion server if -a option isn't used. Please note that if you have more than one server running it's more or less random which one will be used.");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "64", 32, 4096);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "64", 32, 4096);
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 25);
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "64", 64);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "64", 64);
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");

View File

@@ -23,9 +23,7 @@ add_executable( ${PROJECT_NAME}
)
target_link_libraries( ${PROJECT_NAME}
effectengine
commandline
blackborder
hyperion-utils
flatbufserver
flatbuffers

View File

@@ -1,5 +1,3 @@
// QT includes
#include <QCoreApplication>
#include <QImage>
@@ -31,9 +29,9 @@ int main(int argc, char ** argv)
Parser parser("FrameBuffer capture application for Hyperion. Will automatically search a Hyperion server if -a option isn't used. Please note that if you have more than one server running it's more or less random which one will be used.");
Option & argDevice = parser.add<Option> ('d', "device", "Set the video device [default: %1]", "/dev/video0");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10");
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 25);
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160);
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (suggested 100-199) [default: %1]", "150");

View File

@@ -23,9 +23,7 @@ add_executable( ${PROJECT_NAME}
)
target_link_libraries( ${PROJECT_NAME}
effectengine
commandline
blackborder
hyperion-utils
flatbufserver
flatbuffers

View File

@@ -30,10 +30,10 @@ int main(int argc, char ** argv)
// create the option parser and initialize all parameters
Parser parser("OSX capture application for Hyperion. Will automatically search a Hyperion server if -a option isn't used. Please note that if you have more than one server running it's more or less random which one will be used.");
Option & argDisplay = parser.add<Option> ('d', "display", "Set the display to capture [default: %1]");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 600);
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160, 4096);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160, 4096);
Option & argDisplay = parser.add<Option> ('d', "display", "Set the display to capture [default: %1]", "0");
IntOption & argFps = parser.add<IntOption> ('f', "framerate", "Capture frame rate [default: %1]", "10", 1, 25);
IntOption & argWidth = parser.add<IntOption> (0x0, "width", "Width of the captured image [default: %1]", "160", 160);
IntOption & argHeight = parser.add<IntOption> (0x0, "height", "Height of the captured image [default: %1]", "160", 160);
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (suggested 100-199) [default: %1]", "150");

View File

@@ -23,10 +23,8 @@ add_executable(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME}
effectengine
v4l2-grabber
commandline
blackborder
hyperion-utils
flatbufserver
flatbuffers

View File

@@ -67,7 +67,7 @@ int main(int argc, char** argv)
IntOption & argCropRight = parser.add<IntOption> (0x0, "crop-right", "Number of pixels to crop from the right of the picture before decimation (overrides --crop-width)");
IntOption & argCropTop = parser.add<IntOption> (0x0, "crop-top", "Number of pixels to crop from the top of the picture before decimation (overrides --crop-height)");
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)");
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "1");
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "6", 1);
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
BooleanOption & argSignalDetection = parser.add<BooleanOption>('s', "signal-detection-disabled", "disable signal detection");

View File

@@ -25,8 +25,6 @@ add_executable(${PROJECT_NAME}
)
target_link_libraries(${PROJECT_NAME}
effectengine
blackborder
commandline
hyperion-utils
flatbufserver

View File

@@ -42,7 +42,7 @@ int main(int argc, char ** argv)
IntOption & argCropRight = parser.add<IntOption> (0x0, "crop-right", "Number of pixels to crop from the right of the picture before decimation (overrides --crop-width)");
IntOption & argCropTop = parser.add<IntOption> (0x0, "crop-top", "Number of pixels to crop from the top of the picture before decimation (overrides --crop-height)");
IntOption & argCropBottom = parser.add<IntOption> (0x0, "crop-bottom", "Number of pixels to crop from the bottom of the picture before decimation (overrides --crop-height)");
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "8");
IntOption & argSizeDecimation = parser.add<IntOption> ('s', "size-decimator", "Decimation factor for the output size [default=%1]", "8", 1);
BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot", "Take a single screenshot, save it to file and quit");
Option & argAddress = parser.add<Option> ('a', "address", "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
IntOption & argPriority = parser.add<IntOption> ('p', "priority", "Use the provided priority channel (suggested 100-199) [default: %1]", "150");

View File

@@ -1,4 +1,3 @@
find_package(PythonLibs 3.5 REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..)
@@ -21,6 +20,7 @@ target_link_libraries(hyperiond
bonjour
ssdp
python
resources
${PYTHON_LIBRARIES}
)
@@ -60,6 +60,7 @@ qt5_use_modules(hyperiond Core Gui Network Widgets)
install ( TARGETS hyperiond DESTINATION "share/hyperion/bin/" COMPONENT "${PLATFORM}" )
install ( DIRECTORY ${CMAKE_SOURCE_DIR}/bin/service DESTINATION "share/hyperion/" COMPONENT "${PLATFORM}" )
install ( FILES ${CMAKE_SOURCE_DIR}/effects/readme.txt DESTINATION "share/hyperion/effects" COMPONENT "${PLATFORM}" )
install ( FILES ${CMAKE_SOURCE_DIR}/resources/icons/hyperion-icon-32px.png DESTINATION "share/hyperion/icons" COMPONENT "${PLATFORM}" )
if(CMAKE_HOST_UNIX)
install(CODE "EXECUTE_PROCESS(COMMAND ln -sf \"../share/hyperion/bin/hyperiond\" \"${CMAKE_BINARY_DIR}/symlink_hyperiond\" )" COMPONENT "${PLATFORM}" )

View File

@@ -6,7 +6,6 @@
#include <QResource>
#include <QLocale>
#include <QFile>
#include <QHostAddress>
#include <QString>
#include <QJsonDocument>
#include <QJsonObject>
@@ -42,6 +41,9 @@
// Init Python
#include <python/PythonInit.h>
// EffectFileHandler
#include <effectengine/EffectFileHandler.h>
HyperionDaemon* HyperionDaemon::daemon = nullptr;
HyperionDaemon::HyperionDaemon(QString configFile, const QString rootPath, QObject *parent, const bool& logLvlOverwrite)
@@ -79,6 +81,10 @@ HyperionDaemon::HyperionDaemon(QString configFile, const QString rootPath, QObje
if(!logLvlOverwrite)
handleSettingsUpdate(settings::LOGGER, _settingsManager->getSetting(settings::LOGGER));
// init EffectFileHandler
EffectFileHandler* efh = new EffectFileHandler(rootPath, _settingsManager->getSetting(settings::EFFECTS), this);
connect(this, &HyperionDaemon::settingsChanged, efh, &EffectFileHandler::handleSettingsUpdate);
// spawn all Hyperion instances before network services
_hyperion = Hyperion::initInstance(this, 0, configFile, rootPath);
@@ -201,7 +207,7 @@ void HyperionDaemon::startNetworkServices()
connect(this, &HyperionDaemon::settingsChanged, _webserver, &WebServer::handleSettingsUpdate);
wsThread->start();
// create SSDPHandler in thread
// create ssdp server in thread
_ssdp = new SSDPHandler(_webserver, getSetting(settings::FLATBUFSERVER).object()["port"].toInt());
QThread* ssdpThread = new QThread(this);
_ssdp->moveToThread(ssdpThread);
@@ -268,15 +274,72 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type& type, const QJso
{
type = "framebuffer";
}
Info( _log, "set screen capture device to '%s'", QSTRING_CSTR(type));
}
if (type == "") { Info( _log, "screen capture device disabled"); }
else if (type == "framebuffer" && _fbGrabber == nullptr) createGrabberFramebuffer(grabberConfig);
else if (type == "dispmanx" && _dispmanx == nullptr) createGrabberDispmanx();
else if (type == "amlogic" && _amlGrabber == nullptr) createGrabberAmlogic();
else if (type == "osx" && _osxGrabber == nullptr) createGrabberOsx(grabberConfig);
else if (type == "x11" && _x11Grabber == nullptr) createGrabberX11(grabberConfig);
if(_prevType != type)
{
Info( _log, "set screen capture device to '%s'", QSTRING_CSTR(type));
// stop all capture interfaces
#ifdef ENABLE_FB
if(_fbGrabber != nullptr) _fbGrabber->stop();
#endif
#ifdef ENABLE_DISPMANX
if(_dispmanx != nullptr) _dispmanx->stop();
#endif
#ifdef ENABLE_AMLOGIC
if(_amlGrabber != nullptr) _amlGrabber->stop();
#endif
#ifdef ENABLE_OSX
if(_osxGrabber != nullptr) _osxGrabber->stop();
#endif
#ifdef ENABLE_X11
if(_x11Grabber != nullptr) _x11Grabber->stop();
#endif
// create/start capture interface
if(type == "framebuffer")
{
if(_fbGrabber == nullptr)
createGrabberFramebuffer(grabberConfig);
#ifdef ENABLE_FB
_fbGrabber->start();
#endif
}
else if(type == "dispmanx")
{
if(_dispmanx == nullptr)
createGrabberDispmanx();
#ifdef ENABLE_DISPMANX
_dispmanx->start();
#endif
}
else if(type == "amlogic")
{
if(_amlGrabber == nullptr)
createGrabberAmlogic();
#ifdef ENABLE_AMLOGIC
_amlGrabber->start();
#endif
}
else if(type == "osx")
{
if(_osxGrabber == nullptr)
createGrabberOsx(grabberConfig);
#ifdef ENABLE_OSX
_osxGrabber->start();
#endif
}
else if(type == "x11")
{
if(_x11Grabber == nullptr)
createGrabberX11(grabberConfig);
#ifdef ENABLE_X11
_x11Grabber->start();
#endif
}
_prevType = type;
}
}
else if(type == settings::V4L2)
{
@@ -341,7 +404,7 @@ void HyperionDaemon::createGrabberDispmanx()
_dispmanx->start();
Info(_log, "DISPMANX frame grabber created and started");
Info(_log, "DISPMANX frame grabber created");
#else
Error( _log, "The dispmanx framegrabber can not be instantiated, because it has been left out from the build");
#endif
@@ -360,7 +423,7 @@ void HyperionDaemon::createGrabberAmlogic()
connect(this, &HyperionDaemon::settingsChanged, _amlGrabber, &AmlogicWrapper::handleSettingsUpdate);
_amlGrabber->start();
Info(_log, "AMLOGIC grabber created and started");
Info(_log, "AMLOGIC grabber created");
#else
Error( _log, "The AMLOGIC grabber can not be instantiated, because it has been left out from the build");
#endif
@@ -381,7 +444,7 @@ void HyperionDaemon::createGrabberX11(const QJsonObject & grabberConfig)
connect(this, &HyperionDaemon::settingsChanged, _x11Grabber, &X11Wrapper::handleSettingsUpdate);
_x11Grabber->start();
Info(_log, "X11 grabber created and started");
Info(_log, "X11 grabber created");
#else
Error(_log, "The X11 grabber can not be instantiated, because it has been left out from the build");
#endif
@@ -402,7 +465,7 @@ void HyperionDaemon::createGrabberFramebuffer(const QJsonObject & grabberConfig)
connect(this, &HyperionDaemon::settingsChanged, _fbGrabber, &FramebufferWrapper::handleSettingsUpdate);
_fbGrabber->start();
Info(_log, "Framebuffer grabber created and started");
Info(_log, "Framebuffer grabber created");
#else
Error(_log, "The framebuffer grabber can not be instantiated, because it has been left out from the build");
#endif
@@ -423,7 +486,7 @@ void HyperionDaemon::createGrabberOsx(const QJsonObject & grabberConfig)
connect(this, &HyperionDaemon::settingsChanged, _osxGrabber, &OsxWrapper::handleSettingsUpdate);
_osxGrabber->start();
Info(_log, "OSX grabber created and started");
Info(_log, "OSX grabber created");
#else
Error(_log, "The osx grabber can not be instantiated, because it has been left out from the build");
#endif

View File

@@ -156,7 +156,9 @@ private:
unsigned _grabber_cropLeft;
unsigned _grabber_cropRight;
unsigned _grabber_cropTop;
unsigned _grabber_cropBottom;
unsigned _grabber_cropBottom;
QString _prevType;
VideoMode _currVideoMode;
SettingsManager* _settingsManager;

View File

@@ -104,6 +104,7 @@ QCoreApplication* createApplication(int &argc, char *argv[])
{
QApplication* app = new QApplication(argc, argv);
app->setApplicationDisplayName("Hyperion");
app->setWindowIcon(QIcon(":/hyperion-icon-32px.png"));
return app;
}

View File

@@ -22,7 +22,7 @@ SysTray::SysTray(HyperionDaemon *hyperiond)
, _hyperion(nullptr)
, _webPort(8090)
{
Q_INIT_RESOURCE(resource);
Q_INIT_RESOURCE(resources);
// webserver port
WebServer* webserver = _hyperiond->getWebServerInstance();
@@ -33,7 +33,7 @@ SysTray::SysTray(HyperionDaemon *hyperiond)
connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
connect(&_colorDlg, SIGNAL(currentColorChanged(const QColor&)), this, SLOT(setColor(const QColor &)));
QIcon icon(":/hyperion-icon.png");
QIcon icon(":/hyperion-icon-32px.png");
_trayIcon->setIcon(icon);
_trayIcon->show();
setWindowIcon(icon);