hyperion.ng/include/hyperion/CaptureCont.h

76 lines
1.9 KiB
C
Raw Normal View History

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;
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
///
void handleSystemImage(const Image<ColorRgb>& image);
///
/// @brief forward v4l image
/// @param image The image
///
void handleV4lImage(const Image<ColorRgb> & image);
///
/// @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;
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;
QTimer* _v4lInactiveTimer;
2018-12-27 23:11:32 +01:00
};