mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
destroy grabbers and other stuff on hyperiond restart via webui (#375)
* remove obsolete kodi code for grabbers * destroy grabbers and other stuff on hyperiond restart via webui
This commit is contained in:
parent
abc798a479
commit
3aa2573b88
@ -289,6 +289,7 @@ signals:
|
||||
|
||||
void imageToLedsMappingChanged(int mappingType);
|
||||
void emitImage(int priority, const Image<ColorRgb> & image, const int timeout_ms);
|
||||
void closing();
|
||||
|
||||
private slots:
|
||||
///
|
||||
|
@ -74,6 +74,7 @@ V4L2Grabber::~V4L2Grabber()
|
||||
|
||||
void V4L2Grabber::uninit()
|
||||
{
|
||||
Debug(_log,"uninit grabber: %s", _deviceName.c_str());
|
||||
// stop if the grabber was not stopped
|
||||
if (_initialized)
|
||||
{
|
||||
|
@ -27,6 +27,8 @@ GrabberWrapper::GrabberWrapper(std::string grabberName, const int priority, hype
|
||||
|
||||
GrabberWrapper::~GrabberWrapper()
|
||||
{
|
||||
stop();
|
||||
Debug(_log,"Close grabber: %s", _grabberName.c_str());
|
||||
delete _processor;
|
||||
}
|
||||
|
||||
|
@ -449,6 +449,8 @@ Hyperion::Hyperion(const QJsonObject &qjsonConfig, const QString configFile)
|
||||
|
||||
void Hyperion::freeObjects()
|
||||
{
|
||||
emit closing();
|
||||
|
||||
// switch off all leds
|
||||
clearall();
|
||||
_device->switchOff();
|
||||
|
@ -1,11 +1,18 @@
|
||||
|
||||
SET(Hyperiond_QT_HEADERS
|
||||
hyperiond.h
|
||||
)
|
||||
|
||||
QT5_WRAP_CPP(Hyperiond_HEADERS_MOC ${Hyperiond_QT_HEADERS})
|
||||
|
||||
add_executable(hyperiond
|
||||
${Hyperiond_QT_HEADERS}
|
||||
${Hyperiond_HEADERS_MOC}
|
||||
configMigratorBase.cpp
|
||||
configMigratorBase.h
|
||||
configMigrator.cpp
|
||||
configMigrator.h
|
||||
hyperiond.cpp
|
||||
hyperiond.h
|
||||
main.cpp
|
||||
)
|
||||
|
||||
|
@ -79,6 +79,13 @@ HyperionDaemon::HyperionDaemon(QString configFile, QObject *parent)
|
||||
|
||||
HyperionDaemon::~HyperionDaemon()
|
||||
{
|
||||
freeObjects();
|
||||
delete _hyperion;
|
||||
}
|
||||
|
||||
void HyperionDaemon::freeObjects()
|
||||
{
|
||||
Debug(_log, "destroy grabbers and network stuff");
|
||||
delete _amlGrabber;
|
||||
delete _dispmanx;
|
||||
delete _fbGrabber;
|
||||
@ -92,8 +99,17 @@ HyperionDaemon::~HyperionDaemon()
|
||||
delete _protoServer;
|
||||
delete _boblightServer;
|
||||
delete _udpListener;
|
||||
delete _hyperion;
|
||||
|
||||
_v4l2Grabbers.clear();
|
||||
_amlGrabber = nullptr;
|
||||
_dispmanx = nullptr;
|
||||
_fbGrabber = nullptr;
|
||||
_osxGrabber = nullptr;
|
||||
_kodiVideoChecker = nullptr;
|
||||
_jsonServer = nullptr;
|
||||
_protoServer = nullptr;
|
||||
_boblightServer = nullptr;
|
||||
_udpListener = nullptr;
|
||||
}
|
||||
|
||||
void HyperionDaemon::run()
|
||||
@ -113,7 +129,7 @@ void HyperionDaemon::run()
|
||||
#endif
|
||||
Info(_log, "Hyperion started");
|
||||
|
||||
|
||||
connect(_hyperion,SIGNAL(closing()),this,SLOT(freeObjects()));
|
||||
}
|
||||
|
||||
int HyperionDaemon::tryLoadConfig(const QString & configFile, const int schemaVersion)
|
||||
|
@ -49,6 +49,7 @@
|
||||
|
||||
class HyperionDaemon : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
HyperionDaemon(QString configFile, QObject *parent=nullptr);
|
||||
~HyperionDaemon();
|
||||
@ -65,6 +66,9 @@ public:
|
||||
void createGrabberV4L2();
|
||||
void createSystemFrameGrabber();
|
||||
|
||||
public slots:
|
||||
void freeObjects();
|
||||
|
||||
private:
|
||||
void createGrabberDispmanx();
|
||||
void createGrabberAmlogic();
|
||||
|
Loading…
Reference in New Issue
Block a user