multiple v4l devices. (#210)

* implement use of multiple v4l devices.
Not all v4l devices are compat with that or must be attaches to different usb controllers

* fix typo in config
spilt grabber components in "GRABBER" and "V4L"
This commit is contained in:
redPanther
2016-08-31 10:13:43 +02:00
committed by GitHub
12 changed files with 184 additions and 155 deletions

View File

@@ -50,7 +50,7 @@ V4L2Grabber::V4L2Grabber(const std::string & device,
, _noSignalCounter(0)
, _streamNotifier(nullptr)
, _imageResampler()
, _log(Logger::getInstance("V4L2"))
, _log(Logger::getInstance("V4L2:"+device))
, _initialized(false)
, _deviceAutoDiscoverEnabled(false)
{

View File

@@ -16,7 +16,7 @@ V4L2Wrapper::V4L2Wrapper(const std::string &device,
double greenSignalThreshold,
double blueSignalThreshold,
const int priority)
: GrabberWrapper("V4L2", priority)
: GrabberWrapper("V4L2:"+device, priority, hyperion::COMP_V4L)
, _timeout_ms(1000)
, _grabber(device,
input,

View File

@@ -4,7 +4,7 @@
#include <hyperion/GrabberWrapper.h>
GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority)
GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority, hyperion::Components grabberComponentId)
: _grabberName(grabberName)
, _hyperion(Hyperion::getInstance())
, _priority(priority)
@@ -12,6 +12,7 @@ GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority)
, _log(Logger::getInstance(grabberName.c_str()))
, _forward(true)
, _processor(ImageProcessorFactory::getInstance().newImageProcessor())
, _grabberComponentId(grabberComponentId)
{
_timer.setSingleShot(false);
@@ -44,7 +45,7 @@ void GrabberWrapper::stop()
void GrabberWrapper::componentStateChanged(const hyperion::Components component, bool enable)
{
if (component == hyperion::COMP_GRABBER && _timer.isActive() != enable)
if (component == _grabberComponentId && _timer.isActive() != enable)
{
if (enable) start();
else stop();

View File

@@ -399,83 +399,87 @@
},
"grabber-v4l2" :
{
"type" : "object",
"properties" :
"type":"array",
"items":
{
"enable" :
"type" : "object",
"properties" :
{
"type" : "boolean"
"enable" :
{
"type" : "boolean"
},
"device" :
{
"type" : "string"
},
"input" :
{
"type" : "integer"
},
"standard" :
{
"type" : "string"
},
"width" :
{
"type" : "integer"
},
"height" :
{
"type" : "integer"
},
"frameDecimation" :
{
"type" : "integer"
},
"sizeDecimation" :
{
"type" : "integer"
},
"priority" :
{
"type" : "integer"
},
"mode" :
{
"type" : "string"
},
"useKodiChecker" :
{
"type" : "boolean"
},
"cropLeft" :
{
"type" : "integer"
},
"cropRight" :
{
"type" : "integer"
},
"cropTop" :
{
"type" : "integer"
},
"cropBottom" :
{
"type" : "integer"
},
"redSignalThreshold" :
{
"type" : "number"
},
"greenSignalThreshold" :
{
"type" : "number"
},
"blueSignalThreshold" :
{
"type" : "number"
}
},
"device" :
{
"type" : "string"
},
"input" :
{
"type" : "integer"
},
"standard" :
{
"type" : "string"
},
"width" :
{
"type" : "integer"
},
"height" :
{
"type" : "integer"
},
"frameDecimation" :
{
"type" : "integer"
},
"sizeDecimation" :
{
"type" : "integer"
},
"priority" :
{
"type" : "integer"
},
"mode" :
{
"type" : "string"
},
"useKodiChecker" :
{
"type" : "boolean"
},
"cropLeft" :
{
"type" : "integer"
},
"cropRight" :
{
"type" : "integer"
},
"cropTop" :
{
"type" : "integer"
},
"cropBottom" :
{
"type" : "integer"
},
"redSignalThreshold" :
{
"type" : "number"
},
"greenSignalThreshold" :
{
"type" : "number"
},
"blueSignalThreshold" :
{
"type" : "number"
}
},
"additionalProperties" : false
}
},
"framegrabber" :
{

View File

@@ -21,7 +21,7 @@
"component":
{
"type" : "string",
"enum" : ["SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER"],
"enum" : ["SMOOTHING", "BLACKBORDER", "KODICHECKER", "FORWARDER", "UDPLISTENER", "BOBLIGHTSERVER", "GRABBER", "V4L"],
"required": true
},
"state":