diff --git a/include/grabber/V4L2Wrapper.h b/include/grabber/V4L2Wrapper.h index e013e0ef..99468ac2 100644 --- a/include/grabber/V4L2Wrapper.h +++ b/include/grabber/V4L2Wrapper.h @@ -24,6 +24,7 @@ public slots: void setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom); void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax); void setSignalDetectionEnable(bool enable); + void setDeviceVideoStandard(QString device, VideoStandard videoStandard); private slots: void newFrame(const Image & image); diff --git a/libsrc/grabber/v4l2/V4L2Grabber.cpp b/libsrc/grabber/v4l2/V4L2Grabber.cpp index 2f17f238..8d3a3785 100644 --- a/libsrc/grabber/v4l2/V4L2Grabber.cpp +++ b/libsrc/grabber/v4l2/V4L2Grabber.cpp @@ -54,9 +54,6 @@ V4L2Grabber::V4L2Grabber(const QString & device { setPixelDecimation(pixelDecimation); getV4Ldevices(); - - // init - setDeviceVideoStandard(device, videoStandard); } V4L2Grabber::~V4L2Grabber() diff --git a/libsrc/grabber/v4l2/V4L2Wrapper.cpp b/libsrc/grabber/v4l2/V4L2Wrapper.cpp index f6b161f5..987b016b 100644 --- a/libsrc/grabber/v4l2/V4L2Wrapper.cpp +++ b/libsrc/grabber/v4l2/V4L2Wrapper.cpp @@ -76,3 +76,8 @@ bool V4L2Wrapper::getSignalDetectionEnable() { return _grabber.getSignalDetectionEnabled(); } + +void V4L2Wrapper::setDeviceVideoStandard(QString device, VideoStandard videoStandard) +{ + _grabber.setDeviceVideoStandard(device, videoStandard); +} diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index 95852546..a3d7211b 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -376,6 +376,7 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type& type, const QJso #ifdef ENABLE_V4L2 const QJsonObject & grabberConfig = v4lArray.at(idx).toObject(); + bool enableV4l = grabberConfig["enable"].toBool(true); V4L2Wrapper* grabber = new V4L2Wrapper( grabberConfig["device"].toString("auto"), @@ -403,6 +404,14 @@ void HyperionDaemon::handleSettingsUpdate(const settings::type& type, const QJso connect(this, &HyperionDaemon::videoMode, grabber, &V4L2Wrapper::setVideoMode); connect(this, &HyperionDaemon::settingsChanged, grabber, &V4L2Wrapper::handleSettingsUpdate); + if (enableV4l) + { + v4lEnableCount++; + + // init + grabber->setDeviceVideoStandard(grabberConfig["device"].toString("auto"), parseVideoStandard(grabberConfig["standard"].toString("no-change"))); + } + _v4l2Grabbers.push_back(grabber); #endif }