fix: Resolve enable state for v4l and screen capture (#728)

* fix: Resolve the enable state for v4l and screen capture

* Use instance index instead of pointer

* Second try

* fix(QtGrabber): QScreen ownership

* Remove v4l2 compState listener
This commit is contained in:
brindosch
2020-03-26 17:49:36 +01:00
committed by GitHub
parent 49b30c47f7
commit cb98d51a9c
12 changed files with 109 additions and 52 deletions

View File

@@ -90,8 +90,6 @@ public slots:
void stop();
void compStateChangeRequest(const hyperion::Components component, bool enable);
signals:
void newFrame(const Image<ColorRgb> & image);
void readError(const char* err);

View File

@@ -27,7 +27,6 @@ public slots:
void setDeviceVideoStandard(QString device, VideoStandard videoStandard);
signals:
void compStateChangeRequest(const hyperion::Components component, bool enable);
private slots:
void newFrame(const Image<ColorRgb> & image);

View File

@@ -97,12 +97,6 @@ public:
///
void setEnabled(bool enable);
signals:
///
/// @brief PIPE component state changes from HyperionDaemon to V4L2Grabber
///
void compStateChangeRequest(const hyperion::Components component, bool enable);
protected:
ImageResampler _imageResampler;

View File

@@ -17,6 +17,10 @@ class Grabber;
class GlobalSignals;
class QTimer;
/// List of Hyperion instances that requested screen capt
static QList<int> GRABBER_SYS_CLIENTS;
static QList<int> GRABBER_V4L_CLIENTS;
///
/// This class will be inherted by FramebufferWrapper and others which contains the real capture interface
///
@@ -33,6 +37,11 @@ public:
///
virtual bool start();
///
/// Starts maybe the grabber wich produces led values with the specified update rate
///
virtual void tryStart();
///
/// Stop grabber
///
@@ -94,8 +103,12 @@ signals:
///
void systemImage(const QString& name, const Image<ColorRgb>& image);
protected:
private slots:
/// @brief Handle a source request event from Hyperion.
/// Will start and stop grabber based on active listeners count
void handleSourceRequest(const hyperion::Components& component, const int hyperionInd, const bool listen);
protected:
QString _grabberName;
/// The timer for generating events with the specified update rate

View File

@@ -92,4 +92,12 @@ signals:
///
void globalRegRequired(int priority);
///
/// @brief Tell v4l2/screen capture the listener state
/// @param component The component to handle
/// @param hyperionInd The Hyperion instance index as identifier
/// @param listen True when listening, else false
///
void requestSource(const hyperion::Components& component, const int hyperionInd, const bool listen);
};