mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user