hyperion won't fail, if v4l2 has invalid device + auto device (#118)

* hyperion won't fail, if v4l2 has invalid device

* add v4l auto select. use "auto" as device name
This commit is contained in:
redPanther
2016-07-14 23:40:10 +02:00
committed by brindosch
parent 9f1bc6d9e8
commit b49ada956b
6 changed files with 152 additions and 78 deletions

View File

@@ -164,8 +164,8 @@ int main(int argc, char** argv)
{
ProtoConnectionWrapper handler(argAddress.getValue(), argPriority.getValue(), 1000, argSkipReply.isSet());
QObject::connect(&grabber, SIGNAL(newFrame(Image<ColorRgb>)), &handler, SLOT(receiveImage(Image<ColorRgb>)));
grabber.start();
QCoreApplication::exec();
if (grabber.start())
QCoreApplication::exec();
grabber.stop();
}
}

View File

@@ -360,8 +360,6 @@ void HyperionDaemon::createGrabberV4L2()
if (_config.isMember("grabber-v4l2"))
{
const Json::Value & grabberConfig = _config["grabber-v4l2"];
if (grabberConfig.get("enable", true).asBool())
{
_v4l2Grabber = new V4L2Wrapper(
grabberConfig.get("device", "/dev/video0").asString(),
grabberConfig.get("input", 0).asInt(),
@@ -381,11 +379,12 @@ void HyperionDaemon::createGrabberV4L2()
grabberConfig.get("cropRight", 0).asInt(),
grabberConfig.get("cropTop", 0).asInt(),
grabberConfig.get("cropBottom", 0).asInt());
Debug(_log, "V4L2 grabber created");
QObject::connect(_v4l2Grabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
_v4l2Grabber->start();
Info(_log, "V4L2 grabber created and started");
QObject::connect(_v4l2Grabber, SIGNAL(emitImage(int, const Image<ColorRgb>&, const int)), _protoServer, SLOT(sendImageToProtoSlaves(int, const Image<ColorRgb>&, const int)) );
if (grabberConfig.get("enable", true).asBool() && _v4l2Grabber->start())
{
Info(_log, "V4L2 grabber started");
}
}
#else