mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Start SmartPointers (#1679)
* Refactor to fix #1671 * Add GUI/NonGUI mode to info page * Do not show lock config, if in non-UI mode * Updae Changelog * Correct includes * Ensure key member initialization - RGB Channels * Ensure key member initialization - WebServer * Update RGBChannels * Fix initialization order * Fix key when inserting new logger in LoggerMap, Prepare logBuffer-JSON snapshot view in LoggerManager, Increase buffered loglines to 500 * Fix Memory leak in GrabberWrapper * Fix Memory leak in BlackBorderProcessor * Fix Memory leak in BlackBorderProcessor * use ninja generator under macos * Fix BGEffectHandler destruction * Fix Mdns code * Clear list after applying qDeleteAll * Fix deletion of CecHandler * Fix memory leak caused by wrong buffer allocation * Remove extra pixel consistently * Change mDNS to Qt SmartPointers * Correct removal * Fix usage of _width/_height (they are the output resolution, not the screen resolution) That avoids unnecessary resizing of the output image with every transferFrame call * Move main non Thread Objects to Smart Pointers * Refactor Hyperion Daemon unsing smartpointers * Correction * Correct typos/ align text * Fix startGrabberDispmanx * Fix startGrabberDispmanx * Address CodeQL finding * Create Screen grabbers via Template * Fix typo * Change way of logging * Revert change * Address deprecation warning * Correct auto screen grabber evaluation --------- Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
@@ -142,7 +142,7 @@ void JsonAPI::initialize()
|
||||
}
|
||||
|
||||
//notify eventhadler on suspend/resume/idle requests
|
||||
connect(this, &JsonAPI::signalEvent, EventHandler::getInstance(), &EventHandler::handleEvent);
|
||||
connect(this, &JsonAPI::signalEvent, EventHandler::getInstance().data(), &EventHandler::handleEvent);
|
||||
|
||||
connect(_ledStreamTimer, &QTimer::timeout, this, &JsonAPI::streamLedColorsUpdate, Qt::UniqueConnection);
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ void JsonAPI::handleConfigRestoreCommand(const QJsonObject &message, const QStri
|
||||
}
|
||||
}
|
||||
|
||||
void JsonAPI::handleSchemaGetCommand(const QJsonObject &message, const QString &command, int tan)
|
||||
void JsonAPI::handleSchemaGetCommand(const QJsonObject& /*message*/, const QString &command, int tan)
|
||||
{
|
||||
// create result
|
||||
QJsonObject schemaJson, alldevices, properties;
|
||||
@@ -1226,7 +1226,7 @@ void JsonAPI::handleLoggingCommand(const QJsonObject &message, const QString &co
|
||||
if (!_streaming_logging_activated)
|
||||
{
|
||||
_streaming_logging_reply["command"] = command + "-update";
|
||||
connect(LoggerManager::getInstance(), &LoggerManager::newLogMessage, this, &JsonAPI::incommingLogMessage);
|
||||
connect(LoggerManager::getInstance().data(), &LoggerManager::newLogMessage, this, &JsonAPI::incommingLogMessage);
|
||||
|
||||
emit incommingLogMessage (Logger::T_LOG_MESSAGE{}); // needed to trigger log sending
|
||||
Debug(_log, "log streaming activated for client %s", _peerAddress.toStdString().c_str());
|
||||
@@ -1236,7 +1236,7 @@ void JsonAPI::handleLoggingCommand(const QJsonObject &message, const QString &co
|
||||
{
|
||||
if (_streaming_logging_activated)
|
||||
{
|
||||
disconnect(LoggerManager::getInstance(), &LoggerManager::newLogMessage, this, &JsonAPI::incommingLogMessage);
|
||||
disconnect(LoggerManager::getInstance().data(), &LoggerManager::newLogMessage, this, &JsonAPI::incommingLogMessage);
|
||||
_streaming_logging_activated = false;
|
||||
Debug(_log, "log streaming deactivated for client %s", _peerAddress.toStdString().c_str());
|
||||
}
|
||||
@@ -1700,59 +1700,54 @@ void JsonAPI::handleInputSourceCommand(const QJsonObject& message, const QString
|
||||
|
||||
QJsonObject device;
|
||||
#ifdef ENABLE_QT
|
||||
QtGrabber* qtgrabber = new QtGrabber();
|
||||
QScopedPointer<QtGrabber> qtgrabber(new QtGrabber());
|
||||
device = qtgrabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete qtgrabber;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DX
|
||||
DirectXGrabber* dxgrabber = new DirectXGrabber();
|
||||
QScopedPointer<DirectXGrabber> dxgrabber (new DirectXGrabber());
|
||||
device = dxgrabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete dxgrabber;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_X11
|
||||
X11Grabber* x11Grabber = new X11Grabber();
|
||||
QScopedPointer<X11Grabber> x11Grabber(new X11Grabber());
|
||||
device = x11Grabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete x11Grabber;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_XCB
|
||||
XcbGrabber* xcbGrabber = new XcbGrabber();
|
||||
QScopedPointer<XcbGrabber> xcbGrabber (new XcbGrabber());
|
||||
device = xcbGrabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete xcbGrabber;
|
||||
#endif
|
||||
|
||||
//Ignore FB for Amlogic, as it is embedded in the Amlogic grabber itself
|
||||
#if defined(ENABLE_FB) && !defined(ENABLE_AMLOGIC)
|
||||
|
||||
FramebufferFrameGrabber* fbGrabber = new FramebufferFrameGrabber();
|
||||
QScopedPointer<FramebufferFrameGrabber> fbGrabber(new FramebufferFrameGrabber());
|
||||
device = fbGrabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete fbGrabber;
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_DISPMANX)
|
||||
DispmanxFrameGrabber* dispmanx = new DispmanxFrameGrabber();
|
||||
QScopedPointer<DispmanxFrameGrabber> dispmanx(new DispmanxFrameGrabber());
|
||||
if (dispmanx->isAvailable())
|
||||
{
|
||||
device = dispmanx->discover(params);
|
||||
@@ -1761,27 +1756,24 @@ void JsonAPI::handleInputSourceCommand(const QJsonObject& message, const QString
|
||||
videoInputs.append(device);
|
||||
}
|
||||
}
|
||||
delete dispmanx;
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_AMLOGIC)
|
||||
AmlogicGrabber* amlGrabber = new AmlogicGrabber();
|
||||
QScopedPointer<AmlogicGrabber> amlGrabber(new AmlogicGrabber());
|
||||
device = amlGrabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete amlGrabber;
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_OSX)
|
||||
OsxFrameGrabber* osxGrabber = new OsxFrameGrabber();
|
||||
QScopedPointer<OsxFrameGrabber> osxGrabber(new OsxFrameGrabber());
|
||||
device = osxGrabber->discover(params);
|
||||
if (!device.isEmpty() )
|
||||
{
|
||||
videoInputs.append(device);
|
||||
}
|
||||
delete osxGrabber;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1826,10 +1818,10 @@ void JsonAPI::handleServiceCommand(const QJsonObject &message, const QString &co
|
||||
if (!serviceType.isEmpty())
|
||||
{
|
||||
#ifdef ENABLE_MDNS
|
||||
QMetaObject::invokeMethod(&MdnsBrowser::getInstance(), "browseForServiceType",
|
||||
QMetaObject::invokeMethod(MdnsBrowser::getInstance().data(), "browseForServiceType",
|
||||
Qt::QueuedConnection, Q_ARG(QByteArray, serviceType));
|
||||
|
||||
serviceList = MdnsBrowser::getInstance().getServicesDiscoveredJson(serviceType, MdnsServiceRegister::getServiceNameFilter(type), DEFAULT_DISCOVER_TIMEOUT);
|
||||
serviceList = MdnsBrowser::getInstance().data()->getServicesDiscoveredJson(serviceType, MdnsServiceRegister::getServiceNameFilter(type), DEFAULT_DISCOVER_TIMEOUT);
|
||||
#endif
|
||||
servicesOfType.insert(type, serviceList);
|
||||
|
||||
@@ -1983,7 +1975,7 @@ void JsonAPI::incommingLogMessage(const Logger::T_LOG_MESSAGE &msg)
|
||||
if (!_streaming_logging_activated)
|
||||
{
|
||||
_streaming_logging_activated = true;
|
||||
QMetaObject::invokeMethod(LoggerManager::getInstance(), "getLogMessageBuffer",
|
||||
QMetaObject::invokeMethod(LoggerManager::getInstance().data(), "getLogMessageBuffer",
|
||||
Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QJsonArray, messageArray),
|
||||
Q_ARG(Logger::LogLevel, _log->getLogLevel()));
|
||||
@@ -2033,7 +2025,7 @@ void JsonAPI::handleTokenResponse(bool success, const QString &token, const QStr
|
||||
sendErrorReply("Token request timeout or denied", cmd, tan);
|
||||
}
|
||||
|
||||
void JsonAPI::handleInstanceStateChange(InstanceState state, quint8 instance, const QString &name)
|
||||
void JsonAPI::handleInstanceStateChange(InstanceState state, quint8 instance, const QString& /*name */)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
|
Reference in New Issue
Block a user