2018-12-27 23:11:32 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <utils/Logger.h>
|
|
|
|
#include <utils/settings.h>
|
|
|
|
#include <utils/Components.h>
|
|
|
|
#include <utils/Image.h>
|
|
|
|
|
|
|
|
class Hyperion;
|
2018-12-28 18:12:45 +01:00
|
|
|
class QTimer;
|
2018-12-27 23:11:32 +01:00
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief Capture Control class which is a interface to the HyperionDaemon native capture classes.
|
|
|
|
/// It controls the instance based enable/disable of capture feeds and PriorityMuxer registrations
|
|
|
|
///
|
|
|
|
class CaptureCont : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
CaptureCont(Hyperion* hyperion);
|
|
|
|
~CaptureCont();
|
|
|
|
|
|
|
|
void setSystemCaptureEnable(const bool& enable);
|
|
|
|
void setV4LCaptureEnable(const bool& enable);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
///
|
|
|
|
/// @brief Handle component state change of V4L and SystemCapture
|
|
|
|
/// @param component The component from enum
|
|
|
|
/// @param enable The new state
|
|
|
|
///
|
|
|
|
void componentStateChanged(const hyperion::Components component, bool enable);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief Handle settings update from Hyperion Settingsmanager emit or this constructor
|
|
|
|
/// @param type settingyType from enum
|
|
|
|
/// @param config configuration object
|
|
|
|
///
|
|
|
|
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
|
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief forward system image
|
|
|
|
/// @param image The image
|
|
|
|
///
|
2019-02-17 15:26:11 +01:00
|
|
|
void handleSystemImage(const QString& name, const Image<ColorRgb>& image);
|
2018-12-27 23:11:32 +01:00
|
|
|
|
|
|
|
///
|
|
|
|
/// @brief forward v4l image
|
|
|
|
/// @param image The image
|
|
|
|
///
|
2019-02-17 15:26:11 +01:00
|
|
|
void handleV4lImage(const QString& name, const Image<ColorRgb> & image);
|
2018-12-27 23:11:32 +01:00
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
///
|
|
|
|
/// @brief Is called from _v4lInactiveTimer to set source after specific time to inactive
|
|
|
|
///
|
|
|
|
void setV4lInactive();
|
|
|
|
|
2018-12-31 15:48:29 +01:00
|
|
|
///
|
|
|
|
/// @brief Is called from _systemInactiveTimer to set source after specific time to inactive
|
|
|
|
///
|
|
|
|
void setSystemInactive();
|
|
|
|
|
2018-12-27 23:11:32 +01:00
|
|
|
private:
|
|
|
|
/// Hyperion instance
|
|
|
|
Hyperion* _hyperion;
|
|
|
|
|
|
|
|
/// Reflect state of System capture and prio
|
|
|
|
bool _systemCaptEnabled;
|
|
|
|
quint8 _systemCaptPrio;
|
2019-02-17 15:26:11 +01:00
|
|
|
QString _systemCaptName;
|
2018-12-31 15:48:29 +01:00
|
|
|
QTimer* _systemInactiveTimer;
|
2018-12-27 23:11:32 +01:00
|
|
|
|
|
|
|
/// Reflect state of v4l capture and prio
|
|
|
|
bool _v4lCaptEnabled;
|
|
|
|
quint8 _v4lCaptPrio;
|
2019-02-17 15:26:11 +01:00
|
|
|
QString _v4lCaptName;
|
2018-12-28 18:12:45 +01:00
|
|
|
QTimer* _v4lInactiveTimer;
|
2018-12-27 23:11:32 +01:00
|
|
|
};
|