added enable to v4lgrabber (#93)

* added enable to v4lgrabber

* updated configs with v4l enable/disable example
This commit is contained in:
penfold42 2016-07-10 21:36:05 +10:00 committed by brindosch
parent ca795d883e
commit c1cb148f41
3 changed files with 28 additions and 22 deletions

View File

@ -141,6 +141,7 @@
},
/// Configuration for the embedded V4L2 grabber
/// * enable : Enable or disable the v4lgrabber (true/false)
/// * device : V4L2 Device to use [default="/dev/video0"]
/// * input : V4L2 input to use [default=0]
/// * standard : Video standard (no-change/PAL/NTSC) [default="no-change"]
@ -159,6 +160,7 @@
/// * blueSignalThreshold : Signal threshold for the blue channel between 0.0 and 1.0 [default=0.0]
"grabber-v4l2" :
{
"enable" : false,
"device" : "/dev/video0",
"input" : 0,
"standard" : "no-change",

View File

@ -92,6 +92,7 @@
"grabber-v4l2" :
{
"enable" : false,
"device" : "/dev/video0",
"input" : 0,
"standard" : "PAL",

View File

@ -359,6 +359,8 @@ 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(),
@ -384,6 +386,7 @@ void HyperionDaemon::createGrabberV4L2()
_v4l2Grabber->start();
Info(_log, "V4L2 grabber created and started");
}
}
#else
ErrorIf(_config.isMember("grabber-v4l2"), _log, "The v4l2 grabber can not be instantiated, because it has been left out from the build");
#endif