v4l grabber wont crash hyperiond anymore (#168)

* v4l errors won't lead to crash hyperiond (exceptions are catched)
v4l auto device mode with better log messages
createV4l in hyperiond.cpp refactored, now v4l is always available as long as it is compiled in

* change back, code accidently altered

* fix compile of dispmanx grabber
This commit is contained in:
redPanther
2016-08-12 09:39:41 +02:00
committed by GitHub
parent f1cc82b8c7
commit 050ab11c8e
7 changed files with 82 additions and 57 deletions

View File

@@ -37,10 +37,9 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
qRegisterMetaType<std::vector<ColorRgb>>("std::vector<ColorRgb>");
// Handle the image in the captured thread using a direct connection
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);
// send color data to Hyperion using a queued connection to handle the data over to the main event loop
// QObject::connect(
@@ -92,6 +91,12 @@ void V4L2Wrapper::newFrame(const Image<ColorRgb> &image)
_hyperion->setColors(_priority, _ledColors, _timeout_ms);
}
void V4L2Wrapper::readError(const char* err)
{
Error(_log, "stop grabber, because reading device failed. (%s)", err);
stop();
}
void V4L2Wrapper::checkSources()
{
QList<int> activePriorities = _hyperion->getActivePriorities();