Support Events for Grabbers generically

This commit is contained in:
Lord-Grey
2023-11-09 18:14:26 +01:00
parent 77b5bb633d
commit c3daeef077
8 changed files with 25 additions and 15 deletions

View File

@@ -68,7 +68,7 @@ protected:
#else
bool nativeEventFilter(const QByteArray& eventType, void* message, long int* result) override;
#endif
^
private:
bool registerOsEventHandler() override;

View File

@@ -92,7 +92,7 @@ public slots:
void stop();
void newThreadFrame(Image<ColorRgb> image);
void handleEvent(Event event);
void handleEvent(Event event) override;
signals:
void newFrame(const Image<ColorRgb> & image);

View File

@@ -9,8 +9,6 @@
#include <grabber/V4L2Grabber.h>
#endif
#include <events/Event.h>
class VideoWrapper : public GrabberWrapper
{
Q_OBJECT
@@ -23,8 +21,6 @@ public slots:
bool start() override;
void stop() override;
void handleEvent(Event event);
void handleSettingsUpdate(settings::type type, const QJsonDocument& config) override;
private slots:

View File

@@ -11,6 +11,8 @@
#include <utils/Logger.h>
#include <utils/Components.h>
#include <events/Event.h>
///
/// @brief The Grabber class is responsible to apply image resizes (with or without ImageResampler)
@@ -111,6 +113,10 @@ public:
QString getGrabberName() const { return _grabberName; }
public slots:
virtual void handleEvent(Event event) {}
protected slots:
///
/// @brief Set device in error state

View File

@@ -18,6 +18,8 @@
#include <grabber/GrabberType.h>
#include <events/Event.h>
class Grabber;
class GlobalSignals;
class QTimer;
@@ -139,6 +141,8 @@ public slots:
///
virtual void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
void handleEvent(Event event);
signals:
///
/// @brief Emit the final processed image