2014-02-23 22:39:23 +01:00
|
|
|
#pragma once
|
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
#include <hyperion/GrabberWrapper.h>
|
2014-02-23 22:39:23 +01:00
|
|
|
#include <grabber/V4L2Grabber.h>
|
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
class V4L2Wrapper : public GrabberWrapper
|
2014-02-23 22:39:23 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-03-04 22:17:42 +01:00
|
|
|
V4L2Wrapper(const QString & device,
|
2020-03-27 23:13:58 +01:00
|
|
|
const unsigned grabWidth,
|
|
|
|
const unsigned grabHeight,
|
|
|
|
const unsigned fps,
|
2020-06-17 20:55:57 +02:00
|
|
|
const unsigned input,
|
2014-02-23 22:39:23 +01:00
|
|
|
VideoStandard videoStandard,
|
2014-03-31 17:36:36 +02:00
|
|
|
PixelFormat pixelFormat,
|
2018-12-27 23:11:32 +01:00
|
|
|
int pixelDecimation );
|
2020-07-12 18:27:24 +02:00
|
|
|
~V4L2Wrapper() override;
|
2014-02-23 22:39:23 +01:00
|
|
|
|
2017-03-15 20:33:11 +01:00
|
|
|
bool getSignalDetectionEnable();
|
|
|
|
|
2014-02-23 22:39:23 +01:00
|
|
|
public slots:
|
2016-07-14 23:40:10 +02:00
|
|
|
bool start();
|
2014-02-23 22:39:23 +01:00
|
|
|
void stop();
|
|
|
|
|
2018-12-27 23:11:32 +01:00
|
|
|
void setSignalThreshold(double redSignalThreshold, double greenSignalThreshold, double blueSignalThreshold);
|
2020-05-25 21:51:11 +02:00
|
|
|
void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
|
2016-12-16 19:48:43 +01:00
|
|
|
void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax);
|
2017-03-15 20:33:11 +01:00
|
|
|
void setSignalDetectionEnable(bool enable);
|
2019-02-13 09:09:34 +01:00
|
|
|
void setDeviceVideoStandard(QString device, VideoStandard videoStandard);
|
2014-02-23 22:39:23 +01:00
|
|
|
|
2019-07-14 22:43:22 +02:00
|
|
|
signals:
|
|
|
|
|
2014-02-23 22:39:23 +01:00
|
|
|
private slots:
|
|
|
|
void newFrame(const Image<ColorRgb> & image);
|
2016-08-12 09:39:41 +02:00
|
|
|
void readError(const char* err);
|
2014-02-23 22:39:23 +01:00
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
virtual void action();
|
2014-03-22 15:35:25 +01:00
|
|
|
|
2014-02-23 22:39:23 +01:00
|
|
|
private:
|
|
|
|
/// The V4L2 grabber
|
|
|
|
V4L2Grabber _grabber;
|
|
|
|
};
|