feat: SchemaChecker & V4L2 enhancement (#734)

* libjpeg-turbo, QJsonSchemaChecker, V4L2 width/height/fps

Signed-off-by: Paulchen-Panther <Paulchen-Panter@protonmail.com>

* Implement hyperion-v4l cli args

* Apply v4l2 settings during runtime

* feat: Provide minimum values for input restriction

* fix: merge mess

Co-authored-by: brindosch <edeltraud70@gmx.de>
This commit is contained in:
Paulchen Panther
2020-03-27 23:13:58 +01:00
committed by GitHub
parent 20a5e5dc06
commit 662872dafe
26 changed files with 363 additions and 121 deletions

View File

@@ -15,13 +15,23 @@
#include <grabber/VideoStandard.h>
#include <utils/Components.h>
#ifdef HAVE_JPEG
// general JPEG decoder includes
#ifdef HAVE_JPEG_DECODER
#include <QImage>
#include <QColor>
#endif
// System JPEG decoder
#ifdef HAVE_JPEG
#include <jpeglib.h>
#include <csetjmp>
#endif
// TurboJPEG decoder
#ifdef HAVE_TURBO_JPEG
#include <turbojpeg.h>
#endif
/// Capture class for V4L2 devices
///
/// @see http://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html
@@ -31,6 +41,9 @@ class V4L2Grabber : public Grabber
public:
V4L2Grabber(const QString & device,
const unsigned width,
const unsigned height,
const unsigned fps,
VideoStandard videoStandard,
PixelFormat pixelFormat,
int pixelDecimation
@@ -46,11 +59,6 @@ public:
int grabFrame(Image<ColorRgb> &);
///
/// @brief overwrite Grabber.h implementation, as v4l doesn't use width/height
///
virtual void setWidthHeight(){};
///
/// @brief set new PixelDecimation value to ImageResampler
/// @param pixelDecimation The new pixelDecimation value
@@ -84,6 +92,16 @@ public:
///
virtual void setDeviceVideoStandard(QString device, VideoStandard videoStandard);
///
/// @brief overwrite Grabber.h implementation
///
virtual bool setFramerate(int fps);
///
/// @brief overwrite Grabber.h implementation
///
virtual bool setWidthHeight(int width, int height);
public slots:
bool start();
@@ -173,6 +191,11 @@ private:
errorManager* _error;
#endif
#ifdef HAVE_TURBO_JPEG
tjhandle _decompress = nullptr;
int _subsamp;
#endif
private:
QString _deviceName;
std::map<QString,QString> _v4lDevices;

View File

@@ -9,6 +9,9 @@ class V4L2Wrapper : public GrabberWrapper
public:
V4L2Wrapper(const QString & device,
const unsigned grabWidth,
const unsigned grabHeight,
const unsigned fps,
VideoStandard videoStandard,
PixelFormat pixelFormat,
int pixelDecimation );