2018-12-28 18:12:45 +01:00
|
|
|
// project includes
|
|
|
|
#include <api/JsonAPI.h>
|
2024-05-08 22:06:32 +02:00
|
|
|
#include <api/JsonInfo.h>
|
2018-12-28 18:12:45 +01:00
|
|
|
|
|
|
|
// Qt includes
|
|
|
|
#include <QResource>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QBuffer>
|
|
|
|
#include <QByteArray>
|
2019-08-24 22:53:30 +02:00
|
|
|
#include <QTimer>
|
2020-05-12 19:51:19 +02:00
|
|
|
#include <QHostInfo>
|
2020-06-17 20:55:57 +02:00
|
|
|
#include <QMultiMap>
|
2024-05-08 22:06:32 +02:00
|
|
|
#include <QRegularExpression>
|
|
|
|
#include <QStringList>
|
2018-12-28 18:12:45 +01:00
|
|
|
|
|
|
|
// hyperion includes
|
2019-08-24 22:53:30 +02:00
|
|
|
#include <leddevice/LedDeviceWrapper.h>
|
2020-07-12 20:27:56 +02:00
|
|
|
#include <leddevice/LedDevice.h>
|
|
|
|
#include <leddevice/LedDeviceFactory.h>
|
|
|
|
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
#include <HyperionConfig.h> // Required to determine the cmake options
|
|
|
|
|
2023-01-16 11:01:28 +00:00
|
|
|
#include <utils/WeakConnect.h>
|
2023-11-27 09:06:43 +01:00
|
|
|
#include <events/EventEnum.h>
|
2023-01-16 11:01:28 +00:00
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
#include <utils/jsonschema/QJsonFactory.h>
|
2019-08-24 22:53:30 +02:00
|
|
|
#include <utils/jsonschema/QJsonSchemaChecker.h>
|
2018-12-28 18:12:45 +01:00
|
|
|
#include <utils/ColorSys.h>
|
|
|
|
#include <utils/Process.h>
|
|
|
|
#include <utils/JsonUtils.h>
|
|
|
|
|
|
|
|
// ledmapping int <> string transform methods
|
|
|
|
#include <hyperion/ImageProcessor.h>
|
|
|
|
|
|
|
|
// api includes
|
2024-05-08 22:06:32 +02:00
|
|
|
#include <api/JsonCallbacks.h>
|
2023-11-27 09:06:43 +01:00
|
|
|
#include <events/EventHandler.h>
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2019-07-12 16:54:26 +02:00
|
|
|
// auth manager
|
|
|
|
#include <hyperion/AuthManager.h>
|
|
|
|
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
#ifdef ENABLE_MDNS
|
|
|
|
// mDNS discover
|
|
|
|
#include <mdns/MdnsBrowser.h>
|
|
|
|
#include <mdns/MdnsServiceRegister.h>
|
|
|
|
#else
|
|
|
|
// ssdp discover
|
|
|
|
#include <ssdp/SSDPDiscover.h>
|
|
|
|
#endif
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
#include <chrono>
|
|
|
|
#include <utility>
|
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
using namespace hyperion;
|
|
|
|
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
// Constants
|
2024-05-08 22:06:32 +02:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
constexpr std::chrono::milliseconds NEW_TOKEN_REQUEST_TIMEOUT{ 180000 };
|
|
|
|
|
|
|
|
const char TOKEN_TAG[] = "token";
|
|
|
|
constexpr int TOKEN_TAG_LENGTH = sizeof(TOKEN_TAG) - 1;
|
|
|
|
const char BEARER_TOKEN_TAG[] = "Bearer";
|
|
|
|
constexpr int BEARER_TOKEN_TAG_LENGTH = sizeof(BEARER_TOKEN_TAG) - 1;
|
|
|
|
|
|
|
|
const int MIN_PASSWORD_LENGTH = 8;
|
|
|
|
const int APP_TOKEN_LENGTH = 36;
|
|
|
|
|
|
|
|
const bool verbose = false;
|
|
|
|
}
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
|
|
|
|
JsonAPI::JsonAPI(QString peerAddress, Logger *log, bool localConnection, QObject *parent, bool noListener)
|
2020-03-26 17:59:41 +01:00
|
|
|
: API(log, localConnection, parent)
|
2024-05-08 22:06:32 +02:00
|
|
|
,_noListener(noListener)
|
|
|
|
,_peerAddress (std::move(peerAddress))
|
|
|
|
,_jsonCB (nullptr)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2019-01-01 19:47:07 +01:00
|
|
|
Q_INIT_RESOURCE(JSONRPC_schemas);
|
2023-11-27 09:06:43 +01:00
|
|
|
|
|
|
|
qRegisterMetaType<Event>("Event");
|
2024-05-08 22:06:32 +02:00
|
|
|
_jsonCB = QSharedPointer<JsonCallbacks>(new JsonCallbacks( _log, _peerAddress, parent));
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|
2019-01-01 19:47:07 +01:00
|
|
|
|
2020-08-08 13:09:15 +02:00
|
|
|
void JsonAPI::initialize()
|
2019-09-17 21:33:46 +02:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
// init API, REQUIRED!
|
|
|
|
API::init();
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2019-07-12 16:54:26 +02:00
|
|
|
// setup auth interface
|
2024-05-08 22:06:32 +02:00
|
|
|
connect(this, &API::onPendingTokenRequest, this, &JsonAPI::issueNewPendingTokenRequest);
|
2020-03-26 17:59:41 +01:00
|
|
|
connect(this, &API::onTokenResponse, this, &JsonAPI::handleTokenResponse);
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2019-07-14 22:43:22 +02:00
|
|
|
// listen for killed instances
|
|
|
|
connect(_instanceManager, &HyperionIManager::instanceStateChanged, this, &JsonAPI::handleInstanceStateChange);
|
2018-12-30 22:07:53 +01:00
|
|
|
|
2019-09-17 21:33:46 +02:00
|
|
|
// pipe callbacks from subscriptions to parent
|
2024-05-08 22:06:32 +02:00
|
|
|
connect(_jsonCB.data(), &JsonCallbacks::newCallback, this, &JsonAPI::callbackMessage);
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2019-07-20 11:28:16 +02:00
|
|
|
// notify hyperion about a jsonMessageForward
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
if (_hyperion != nullptr)
|
|
|
|
{
|
|
|
|
// Initialise jsonCB with current instance
|
|
|
|
_jsonCB->setSubscriptionsTo(_hyperion);
|
|
|
|
connect(this, &JsonAPI::forwardJsonMessage, _hyperion, &Hyperion::forwardJsonMessage);
|
|
|
|
}
|
2022-12-22 12:40:39 +01:00
|
|
|
|
2023-11-27 09:06:43 +01:00
|
|
|
//notify eventhadler on suspend/resume/idle requests
|
2024-02-25 17:35:39 +01:00
|
|
|
connect(this, &JsonAPI::signalEvent, EventHandler::getInstance().data(), &EventHandler::handleEvent);
|
2019-07-14 22:43:22 +02:00
|
|
|
}
|
|
|
|
|
2023-11-27 09:06:43 +01:00
|
|
|
bool JsonAPI::handleInstanceSwitch(quint8 inst, bool /*forced*/)
|
2019-07-14 22:43:22 +02:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
if (API::setHyperionInstance(inst))
|
2019-07-14 22:43:22 +02:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
Debug(_log, "Client '%s' switch to Hyperion instance %d", QSTRING_CSTR(_peerAddress), inst);
|
2019-09-17 21:33:46 +02:00
|
|
|
// the JsonCB creates json messages you can subscribe to e.g. data change events
|
|
|
|
_jsonCB->setSubscriptionsTo(_hyperion);
|
2019-07-14 22:43:22 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
void JsonAPI::handleMessage(const QString &messageString, const QString &httpAuthHeader)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
const QString ident = "JsonRpc@" + _peerAddress;
|
2018-12-28 18:12:45 +01:00
|
|
|
QJsonObject message;
|
2021-10-16 13:55:23 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
//parse the message
|
|
|
|
QPair<bool, QStringList> parsingResult = JsonUtils::parse(ident, messageString, message, _log);
|
|
|
|
if (!parsingResult.first)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
//Try to find command and tan, even parsing failed
|
|
|
|
QString command = findCommand(messageString);
|
|
|
|
int tan = findTan(messageString);
|
|
|
|
|
|
|
|
sendErrorReply("Parse error", parsingResult.second, command, tan);
|
2018-12-28 18:12:45 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
DebugIf(verbose, _log, "message: [%s]", QJsonDocument(message).toJson(QJsonDocument::Compact).constData() );
|
|
|
|
|
|
|
|
// check specific message
|
|
|
|
const QString command = message.value("command").toString();
|
|
|
|
const QString subCommand = message.value("subcommand").toString();
|
|
|
|
|
|
|
|
int tan {0};
|
2020-09-14 20:09:21 +02:00
|
|
|
if (message.value("tan") != QJsonValue::Undefined)
|
2024-05-08 22:06:32 +02:00
|
|
|
{
|
2020-09-14 20:09:21 +02:00
|
|
|
tan = message["tan"].toInt();
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2020-09-14 20:09:21 +02:00
|
|
|
|
2018-12-28 18:12:45 +01:00
|
|
|
// check basic message
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject schemaJson = QJsonFactory::readSchema(":schema");
|
|
|
|
QPair<bool, QStringList> validationResult = JsonUtils::validate(ident, message, schemaJson, _log);
|
|
|
|
if (!validationResult.first)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply("Invalid command", validationResult.second, command, tan);
|
2018-12-28 18:12:45 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
JsonApiCommand cmd = ApiCommandRegister::getCommandInfo(command, subCommand);
|
|
|
|
cmd.tan = tan;
|
|
|
|
|
|
|
|
if (cmd.command == Command::Unknown)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
const QStringList errorDetails (subCommand.isEmpty() ? "subcommand is missing" : QString("Invalid subcommand: %1").arg(subCommand));
|
|
|
|
sendErrorReply("Invalid command", errorDetails, command, tan);
|
2018-12-28 18:12:45 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (_noListener)
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
setAuthorization(false);
|
|
|
|
if(cmd.isNolistenerCmd == NoListenerCmd::No)
|
|
|
|
{
|
|
|
|
sendErrorReply("Command not supported via single API calls using HTTP/S", cmd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check authorization for HTTP requests
|
|
|
|
if (!httpAuthHeader.isEmpty())
|
|
|
|
{
|
|
|
|
int bearTokenLenght {0};
|
|
|
|
if (httpAuthHeader.startsWith(BEARER_TOKEN_TAG, Qt::CaseInsensitive)) {
|
|
|
|
bearTokenLenght = BEARER_TOKEN_TAG_LENGTH;
|
|
|
|
}
|
|
|
|
else if (httpAuthHeader.startsWith(TOKEN_TAG, Qt::CaseInsensitive)) {
|
|
|
|
bearTokenLenght = TOKEN_TAG_LENGTH;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bearTokenLenght == 0)
|
|
|
|
{
|
|
|
|
sendErrorReply("No bearer token found in Authorization header", cmd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString cToken =httpAuthHeader.mid(bearTokenLenght).trimmed();
|
|
|
|
API::isTokenAuthorized(cToken); // _authorized && _adminAuthorized are set
|
|
|
|
}
|
|
|
|
|
|
|
|
if (islocalConnection() && !_authManager->isLocalAuthRequired())
|
|
|
|
{
|
|
|
|
// if the request comes via a local network connection, plus authorization is disabled for local request,
|
|
|
|
// no token authorization is required for non-admin requests
|
|
|
|
setAuthorization(true);
|
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (cmd.authorization != Authorization::No )
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
if (!isAuthorized() || (cmd.authorization == Authorization::Admin && !isAdminAuthorized()))
|
2020-03-26 17:59:41 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendNoAuthorization(cmd);
|
|
|
|
return;
|
2020-03-26 17:59:41 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
schemaJson = QJsonFactory::readSchema(QString(":schema-%1").arg(command));
|
|
|
|
validationResult = JsonUtils::validate(ident, message, schemaJson, _log);
|
|
|
|
if (!validationResult.first)
|
|
|
|
{
|
|
|
|
sendErrorReply("Invalid params", validationResult.second, cmd);
|
2019-07-12 16:54:26 +02:00
|
|
|
return;
|
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
if (_hyperion == nullptr)
|
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply("Service Unavailable", cmd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!message.contains("instance") || cmd.isInstanceCmd == InstanceCmd::No)
|
|
|
|
{
|
|
|
|
handleCommand(cmd, message);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
handleInstanceCommand(cmd, message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void JsonAPI::handleInstanceCommand(const JsonApiCommand& cmd, const QJsonObject &message)
|
|
|
|
{
|
|
|
|
const QJsonValue instanceElement = message.value("instance");
|
|
|
|
QJsonArray instances;
|
|
|
|
if (instanceElement.isDouble())
|
|
|
|
{
|
|
|
|
instances.append(instanceElement);
|
|
|
|
} else if (instanceElement.isArray())
|
|
|
|
{
|
|
|
|
instances = instanceElement.toArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
QList<quint8> runningInstanceIdxs = _instanceManager->getRunningInstanceIdx();
|
|
|
|
|
|
|
|
QList<quint8> instanceIdxList;
|
|
|
|
QStringList errorDetails;
|
|
|
|
if (instances.contains("all"))
|
|
|
|
{
|
|
|
|
for (const auto& instanceIdx : runningInstanceIdxs)
|
|
|
|
{
|
|
|
|
instanceIdxList.append(instanceIdx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (const auto &instance : std::as_const(instances)) {
|
|
|
|
|
|
|
|
quint8 instanceIdx = static_cast<quint8>(instance.toInt());
|
|
|
|
if (instance.isDouble() && runningInstanceIdxs.contains(instanceIdx))
|
|
|
|
{
|
|
|
|
instanceIdxList.append(instanceIdx);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
errorDetails.append("Not a running or valid instance: " + instance.toVariant().toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (instanceIdxList.isEmpty() || !errorDetails.isEmpty() )
|
|
|
|
{
|
|
|
|
sendErrorReply("Invalid instance(s) given", errorDetails, cmd);
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
quint8 currentInstanceIdx = getCurrentInstanceIndex();
|
|
|
|
if (instanceIdxList.size() > 1)
|
|
|
|
{
|
|
|
|
if (cmd.isInstanceCmd != InstanceCmd::Multi)
|
|
|
|
{
|
|
|
|
sendErrorReply("Command does not support multiple instances", cmd);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const auto &instanceIdx : instanceIdxList)
|
|
|
|
{
|
|
|
|
if (setHyperionInstance(instanceIdx))
|
|
|
|
{
|
|
|
|
handleCommand(cmd, message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setHyperionInstance(currentInstanceIdx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void JsonAPI::handleCommand(const JsonApiCommand& cmd, const QJsonObject &message)
|
|
|
|
{
|
|
|
|
switch (cmd.command) {
|
|
|
|
case Command::Authorize:
|
|
|
|
handleAuthorizeCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Color:
|
|
|
|
handleColorCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Image:
|
|
|
|
handleImageCommand(message, cmd);
|
|
|
|
break;
|
2022-02-11 20:36:15 +01:00
|
|
|
#if defined(ENABLE_EFFECTENGINE)
|
2024-05-08 22:06:32 +02:00
|
|
|
case Command::Effect:
|
|
|
|
handleEffectCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::CreateEffect:
|
|
|
|
handleCreateEffectCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::DeleteEffect:
|
|
|
|
handleDeleteEffectCommand(message, cmd);
|
|
|
|
break;
|
2022-02-11 20:36:15 +01:00
|
|
|
#endif
|
2024-05-08 22:06:32 +02:00
|
|
|
case Command::SysInfo:
|
|
|
|
handleSysInfoCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::ServerInfo:
|
|
|
|
handleServerInfoCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Clear:
|
|
|
|
handleClearCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Adjustment:
|
|
|
|
handleAdjustmentCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::SourceSelect:
|
|
|
|
handleSourceSelectCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Config:
|
|
|
|
handleConfigCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::ComponentState:
|
|
|
|
handleComponentStateCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::LedColors:
|
|
|
|
handleLedColorsCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Logging:
|
|
|
|
handleLoggingCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Processing:
|
|
|
|
handleProcessingCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::VideoMode:
|
|
|
|
handleVideoModeCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Instance:
|
|
|
|
handleInstanceCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::LedDevice:
|
|
|
|
handleLedDeviceCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::InputSource:
|
|
|
|
handleInputSourceCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::Service:
|
|
|
|
handleServiceCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::System:
|
|
|
|
handleSystemCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
case Command::ClearAll:
|
|
|
|
handleClearallCommand(message, cmd);
|
|
|
|
break;
|
|
|
|
// BEGIN | The following commands are deprecated but used to ensure backward compatibility with Hyperion Classic remote control
|
|
|
|
case Command::Transform:
|
|
|
|
case Command::Correction:
|
|
|
|
case Command::Temperature:
|
|
|
|
sendErrorReply("The command is deprecated, please use the Hyperion Web Interface to configure", cmd);
|
|
|
|
break;
|
|
|
|
// END
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleColorCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
emit forwardJsonMessage(message);
|
|
|
|
int priority = message["priority"].toInt();
|
|
|
|
int duration = message["duration"].toInt(-1);
|
2020-02-26 18:54:56 +01:00
|
|
|
const QString origin = message["origin"].toString("JsonRpc") + "@" + _peerAddress;
|
2018-12-28 18:12:45 +01:00
|
|
|
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
const QJsonArray &jsonColor = message["color"].toArray();
|
2020-02-26 18:54:56 +01:00
|
|
|
std::vector<uint8_t> colors;
|
2024-05-08 22:06:32 +02:00
|
|
|
colors.reserve(static_cast<std::vector<uint8_t>::size_type>(jsonColor.size()));
|
|
|
|
// Transform each entry in jsonColor to uint8_t and append to colors
|
|
|
|
std::transform(jsonColor.begin(), jsonColor.end(), std::back_inserter(colors),
|
|
|
|
[](const QJsonValue &value) { return static_cast<uint8_t>(value.toInt()); });
|
2020-02-26 18:54:56 +01:00
|
|
|
|
2020-03-26 17:59:41 +01:00
|
|
|
API::setColor(priority, colors, duration, origin);
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleImageCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
emit forwardJsonMessage(message);
|
|
|
|
|
2020-03-26 17:59:41 +01:00
|
|
|
API::ImageCmdData idata;
|
|
|
|
idata.priority = message["priority"].toInt();
|
|
|
|
idata.origin = message["origin"].toString("JsonRpc") + "@" + _peerAddress;
|
|
|
|
idata.duration = message["duration"].toInt(-1);
|
|
|
|
idata.width = message["imagewidth"].toInt();
|
|
|
|
idata.height = message["imageheight"].toInt();
|
|
|
|
idata.scale = message["scale"].toInt(-1);
|
|
|
|
idata.format = message["format"].toString();
|
|
|
|
idata.imgName = message["name"].toString("");
|
|
|
|
idata.data = QByteArray::fromBase64(QByteArray(message["imagedata"].toString().toUtf8()));
|
|
|
|
QString replyMsg;
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (API::setImage(idata, COMP_IMAGE, replyMsg)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply(replyMsg, cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-11 20:36:15 +01:00
|
|
|
#if defined(ENABLE_EFFECTENGINE)
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleEffectCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
emit forwardJsonMessage(message);
|
|
|
|
|
2020-03-26 17:59:41 +01:00
|
|
|
EffectCmdData dat;
|
|
|
|
dat.priority = message["priority"].toInt();
|
|
|
|
dat.duration = message["duration"].toInt(-1);
|
|
|
|
dat.pythonScript = message["pythonScript"].toString();
|
|
|
|
dat.origin = message["origin"].toString("JsonRpc") + "@" + _peerAddress;
|
|
|
|
dat.effectName = message["effect"].toObject()["name"].toString();
|
|
|
|
dat.data = message["imageData"].toString("").toUtf8();
|
|
|
|
dat.args = message["effect"].toObject()["args"].toObject();
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (API::setEffect(dat)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Effect '" + dat.effectName + "' not found", cmd);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleCreateEffectCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
const QString resultMsg = API::saveEffect(message);
|
2024-05-08 22:06:32 +02:00
|
|
|
resultMsg.isEmpty() ? sendSuccessReply(cmd) : sendErrorReply(resultMsg, cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleDeleteEffectCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
const QString res = API::deleteEffect(message["name"].toString());
|
2024-05-08 22:06:32 +02:00
|
|
|
res.isEmpty() ? sendSuccessReply(cmd) : sendErrorReply(res, cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2022-02-11 20:36:15 +01:00
|
|
|
#endif
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleSysInfoCommand(const QJsonObject & /*unused*/, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReply(JsonInfo::getSystemInfo(_hyperion), cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleServerInfoCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject info {};
|
|
|
|
QStringList errorDetails;
|
|
|
|
|
|
|
|
switch (cmd.getSubCommand()) {
|
|
|
|
case SubCommand::Empty:
|
|
|
|
case SubCommand::GetInfo:
|
|
|
|
info["priorities"] = JsonInfo::getPrioritiestInfo(_hyperion);
|
|
|
|
info["priorities_autoselect"] = _hyperion->sourceAutoSelectEnabled();
|
|
|
|
info["adjustment"] = JsonInfo::getAdjustmentInfo(_hyperion, _log);
|
|
|
|
info["ledDevices"] = JsonInfo::getAvailableLedDevices();
|
|
|
|
info["grabbers"] = JsonInfo::getGrabbers(_hyperion);
|
|
|
|
info["videomode"] = QString(videoMode2String(_hyperion->getCurrentVideoMode()));
|
|
|
|
info["cec"] = JsonInfo::getCecInfo();
|
|
|
|
info["services"] = JsonInfo::getServices();
|
|
|
|
info["components"] = JsonInfo::getComponents(_hyperion);
|
|
|
|
info["imageToLedMappingType"] = ImageProcessor::mappingTypeToStr(_hyperion->getLedMappingType());
|
|
|
|
info["instance"] = JsonInfo::getInstanceInfo();
|
|
|
|
info["leds"] = _hyperion->getSetting(settings::LEDS).array();
|
|
|
|
info["activeLedColor"] = JsonInfo::getActiveColors(_hyperion);
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
#if defined(ENABLE_EFFECTENGINE)
|
|
|
|
info["effects"] = JsonInfo::getEffects(_hyperion);
|
|
|
|
info["activeEffects"] = JsonInfo::getActiveEffects(_hyperion);
|
|
|
|
#endif
|
2022-02-22 20:58:59 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
// BEGIN | The following entries are deprecated but used to ensure backward compatibility with hyperion Classic or up to Hyperion 2.0.16
|
|
|
|
info["hostname"] = QHostInfo::localHostName();
|
|
|
|
info["transform"] = JsonInfo::getTransformationInfo(_hyperion);
|
2022-02-22 20:58:59 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (!_noListener && message.contains("subscribe"))
|
2022-02-22 20:58:59 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
const QJsonArray &subscriptions = message["subscribe"].toArray();
|
|
|
|
QStringList invaliCommands = _jsonCB->subscribe(subscriptions);
|
|
|
|
if (!invaliCommands.isEmpty())
|
|
|
|
{
|
|
|
|
errorDetails.append("subscribe - Invalid commands provided: " + invaliCommands.join(','));
|
|
|
|
}
|
2022-02-22 20:58:59 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
// END
|
2018-12-31 15:48:29 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::Subscribe:
|
|
|
|
case SubCommand::Unsubscribe:
|
|
|
|
{
|
|
|
|
const QJsonObject ¶ms = message["data"].toObject();
|
|
|
|
const QJsonArray &subscriptions = params["subscriptions"].toArray();
|
|
|
|
if (subscriptions.isEmpty()) {
|
|
|
|
sendErrorReply("Invalid params", {"No subscriptions provided"}, cmd);
|
|
|
|
return;
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
QStringList invaliCommands;
|
|
|
|
if (cmd.subCommand == SubCommand::Subscribe)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
invaliCommands = _jsonCB->subscribe(subscriptions);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
else
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
invaliCommands = _jsonCB->unsubscribe(subscriptions);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (!invaliCommands.isEmpty())
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
errorDetails.append("subscriptions - Invalid commands provided: " + invaliCommands.join(','));
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
}
|
2020-11-14 16:22:21 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
2020-11-14 17:58:56 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::GetSubscriptions:
|
|
|
|
info["subscriptions"] = QJsonArray::fromStringList(_jsonCB->getSubscribedCommands());
|
|
|
|
break;
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::GetSubscriptionCommands:
|
|
|
|
info["commands"] = QJsonArray::fromStringList(_jsonCB->getCommands());
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReplyWithError(info, cmd, errorDetails);
|
|
|
|
}
|
2023-02-19 00:36:39 -08:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleClearCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
emit forwardJsonMessage(message);
|
|
|
|
int priority = message["priority"].toInt();
|
|
|
|
QString replyMsg;
|
2023-02-19 00:36:39 -08:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (!API::clearPriority(priority, replyMsg))
|
2023-02-19 00:36:39 -08:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply(replyMsg, cmd);
|
|
|
|
return;
|
2023-02-19 00:36:39 -08:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
|
|
|
}
|
2023-02-19 00:36:39 -08:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleClearallCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
emit forwardJsonMessage(message);
|
|
|
|
QString replyMsg;
|
|
|
|
API::clearPriority(-1, replyMsg);
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
}
|
2023-02-19 00:36:39 -08:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleAdjustmentCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QJsonObject &adjustment = message["adjustment"].toObject();
|
2020-04-17 16:59:20 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
const QList<QString> adjustmentIds = _hyperion->getAdjustmentIds();
|
|
|
|
if (adjustmentIds.isEmpty()) {
|
|
|
|
sendErrorReply("No adjustment data available", cmd);
|
|
|
|
return;
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
const QString adjustmentId = adjustment["id"].toString(adjustmentIds.first());
|
|
|
|
ColorAdjustment *colorAdjustment = _hyperion->getAdjustment(adjustmentId);
|
|
|
|
if (colorAdjustment == nullptr) {
|
|
|
|
Warning(_log, "Incorrect adjustment identifier: %s", adjustmentId.toStdString().c_str());
|
|
|
|
return;
|
|
|
|
}
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
applyColorAdjustments(adjustment, colorAdjustment);
|
|
|
|
applyTransforms(adjustment, colorAdjustment);
|
|
|
|
_hyperion->adjustmentsUpdated();
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
}
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::applyColorAdjustments(const QJsonObject &adjustment, ColorAdjustment *colorAdjustment)
|
|
|
|
{
|
|
|
|
applyColorAdjustment("red", adjustment, colorAdjustment->_rgbRedAdjustment);
|
|
|
|
applyColorAdjustment("green", adjustment, colorAdjustment->_rgbGreenAdjustment);
|
|
|
|
applyColorAdjustment("blue", adjustment, colorAdjustment->_rgbBlueAdjustment);
|
|
|
|
applyColorAdjustment("cyan", adjustment, colorAdjustment->_rgbCyanAdjustment);
|
|
|
|
applyColorAdjustment("magenta", adjustment, colorAdjustment->_rgbMagentaAdjustment);
|
|
|
|
applyColorAdjustment("yellow", adjustment, colorAdjustment->_rgbYellowAdjustment);
|
|
|
|
applyColorAdjustment("white", adjustment, colorAdjustment->_rgbWhiteAdjustment);
|
|
|
|
}
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::applyColorAdjustment(const QString &colorName, const QJsonObject &adjustment, RgbChannelAdjustment &rgbAdjustment)
|
|
|
|
{
|
|
|
|
if (adjustment.contains(colorName)) {
|
|
|
|
const QJsonArray &values = adjustment[colorName].toArray();
|
|
|
|
if (values.size() >= 3) {
|
|
|
|
rgbAdjustment.setAdjustment(static_cast<uint8_t>(values[0U].toInt()),
|
|
|
|
static_cast<uint8_t>(values[1U].toInt()),
|
|
|
|
static_cast<uint8_t>(values[2U].toInt()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::applyTransforms(const QJsonObject &adjustment, ColorAdjustment *colorAdjustment)
|
|
|
|
{
|
|
|
|
applyGammaTransform("gammaRed", adjustment, colorAdjustment->_rgbTransform, 'r');
|
|
|
|
applyGammaTransform("gammaGreen", adjustment, colorAdjustment->_rgbTransform, 'g');
|
|
|
|
applyGammaTransform("gammaBlue", adjustment, colorAdjustment->_rgbTransform, 'b');
|
|
|
|
applyTransform("backlightThreshold", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBacklightThreshold);
|
|
|
|
applyTransform("backlightColored", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBacklightColored);
|
|
|
|
applyTransform("brightness", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBrightness);
|
|
|
|
applyTransform("brightnessCompensation", adjustment, colorAdjustment->_rgbTransform, &RgbTransform::setBrightnessCompensation);
|
|
|
|
applyTransform("saturationGain", adjustment, colorAdjustment->_okhsvTransform, &OkhsvTransform::setSaturationGain);
|
|
|
|
applyTransform("brightnessGain", adjustment, colorAdjustment->_okhsvTransform, &OkhsvTransform::setBrightnessGain);
|
|
|
|
}
|
2022-02-11 20:36:15 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::applyGammaTransform(const QString &transformName, const QJsonObject &adjustment, RgbTransform &rgbTransform, char channel)
|
|
|
|
{
|
|
|
|
if (adjustment.contains(transformName)) {
|
|
|
|
rgbTransform.setGamma(channel == 'r' ? adjustment[transformName].toDouble() : rgbTransform.getGammaR(),
|
|
|
|
channel == 'g' ? adjustment[transformName].toDouble() : rgbTransform.getGammaG(),
|
|
|
|
channel == 'b' ? adjustment[transformName].toDouble() : rgbTransform.getGammaB());
|
|
|
|
}
|
|
|
|
}
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
template<typename T>
|
|
|
|
void JsonAPI::applyTransform(const QString &transformName, const QJsonObject &adjustment, T &transform, void (T::*setFunction)(bool))
|
|
|
|
{
|
|
|
|
if (adjustment.contains(transformName)) {
|
|
|
|
(transform.*setFunction)(adjustment[transformName].toBool());
|
|
|
|
}
|
|
|
|
}
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
template<typename T>
|
|
|
|
void JsonAPI::applyTransform(const QString &transformName, const QJsonObject &adjustment, T &transform, void (T::*setFunction)(double))
|
|
|
|
{
|
|
|
|
if (adjustment.contains(transformName)) {
|
|
|
|
(transform.*setFunction)(adjustment[transformName].toDouble());
|
|
|
|
}
|
|
|
|
}
|
2022-01-07 14:47:51 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
template<typename T>
|
|
|
|
void JsonAPI::applyTransform(const QString &transformName, const QJsonObject &adjustment, T &transform, void (T::*setFunction)(uint8_t))
|
|
|
|
{
|
|
|
|
if (adjustment.contains(transformName)) {
|
|
|
|
(transform.*setFunction)(static_cast<uint8_t>(adjustment[transformName].toInt()));
|
|
|
|
}
|
|
|
|
}
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleSourceSelectCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
if (message.contains("auto"))
|
2022-01-07 14:47:51 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
API::setSourceAutoSelect(message["auto"].toBool(false));
|
2022-01-07 14:47:51 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
else if (message.contains("priority"))
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
API::setVisiblePriority(message["priority"].toInt());
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
else
|
2019-07-14 22:43:22 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply("Priority request is invalid", cmd);
|
|
|
|
return;
|
2019-07-14 22:43:22 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
|
|
|
}
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleConfigCommand(const QJsonObject& message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::GetSchema:
|
|
|
|
handleSchemaGetCommand(message, cmd);
|
|
|
|
break;
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::GetConfig:
|
|
|
|
sendSuccessDataReply(_hyperion->getQJsonConfig(), cmd);
|
|
|
|
break;
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::SetConfig:
|
|
|
|
handleConfigSetCommand(message, cmd);
|
|
|
|
break;
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::RestoreConfig:
|
|
|
|
handleConfigRestoreCommand(message, cmd);
|
|
|
|
break;
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::Reload:
|
|
|
|
Debug(_log, "Restarting due to RPC command");
|
|
|
|
emit signalEvent(Event::Reload);
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
default:
|
|
|
|
break;
|
2020-03-26 17:59:41 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleConfigSetCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
if (message.contains("config"))
|
2020-03-26 17:59:41 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject config = message["config"].toObject();
|
|
|
|
if (API::isHyperionEnabled())
|
2019-02-03 14:36:57 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
if ( API::saveSettings(config) ) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Save settings failed", cmd);
|
|
|
|
}
|
2019-02-03 14:36:57 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
else
|
2019-02-03 14:36:57 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply("Saving configuration while Hyperion is disabled isn't possible", cmd);
|
2019-02-03 14:36:57 +01:00
|
|
|
}
|
2020-03-26 17:59:41 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleConfigRestoreCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
if (message.contains("config"))
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
QJsonObject config = message["config"].toObject();
|
2020-03-26 17:59:41 +01:00
|
|
|
if (API::isHyperionEnabled())
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
if ( API::restoreSettings(config) )
|
2020-11-01 19:47:30 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
2020-11-01 19:47:30 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply("Restore settings failed", cmd);
|
2020-11-01 19:47:30 +01:00
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
else
|
2021-11-17 20:30:43 +00:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply("Restoring configuration while Hyperion is disabled is not possible", cmd);
|
2021-11-17 20:30:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleSchemaGetCommand(const QJsonObject& /*message*/, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
// create result
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject schemaJson;
|
|
|
|
QJsonObject alldevices;
|
|
|
|
QJsonObject properties;
|
2018-12-28 18:12:45 +01:00
|
|
|
|
|
|
|
// make sure the resources are loaded (they may be left out after static linking)
|
|
|
|
Q_INIT_RESOURCE(resource);
|
|
|
|
|
|
|
|
// read the hyperion json schema from the resource
|
|
|
|
QString schemaFile = ":/hyperion-schema";
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
schemaJson = QJsonFactory::readSchema(schemaFile);
|
|
|
|
}
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
catch (const std::runtime_error &error)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
throw std::runtime_error(error.what());
|
|
|
|
}
|
|
|
|
|
|
|
|
// collect all LED Devices
|
|
|
|
properties = schemaJson["properties"].toObject();
|
2019-01-01 19:47:07 +01:00
|
|
|
alldevices = LedDeviceWrapper::getLedDeviceSchemas();
|
2018-12-28 18:12:45 +01:00
|
|
|
properties.insert("alldevices", alldevices);
|
|
|
|
|
2022-02-11 20:36:15 +01:00
|
|
|
#if defined(ENABLE_EFFECTENGINE)
|
2018-12-28 18:12:45 +01:00
|
|
|
// collect all available effect schemas
|
2021-02-23 20:38:54 +01:00
|
|
|
QJsonArray schemaList;
|
|
|
|
const std::list<EffectSchema>& effectsSchemas = _hyperion->getEffectSchemas();
|
|
|
|
for (const EffectSchema& effectSchema : effectsSchemas)
|
|
|
|
{
|
|
|
|
QJsonObject schema;
|
|
|
|
schema.insert("script", effectSchema.pyFile);
|
|
|
|
schema.insert("schemaLocation", effectSchema.schemaFile);
|
|
|
|
schema.insert("schemaContent", effectSchema.pySchema);
|
|
|
|
if (effectSchema.pyFile.startsWith(':'))
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2021-02-23 20:38:54 +01:00
|
|
|
schema.insert("type", "system");
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-02-23 20:38:54 +01:00
|
|
|
schema.insert("type", "custom");
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2021-02-23 20:38:54 +01:00
|
|
|
schemaList.append(schema);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2021-02-23 20:38:54 +01:00
|
|
|
properties.insert("effectSchemas", schemaList);
|
2022-02-11 20:36:15 +01:00
|
|
|
#endif
|
2018-12-28 18:12:45 +01:00
|
|
|
|
|
|
|
schemaJson.insert("properties", properties);
|
|
|
|
|
|
|
|
// send the result
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReply(schemaJson, cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleComponentStateCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
const QJsonObject &componentState = message["componentstate"].toObject();
|
2020-03-26 17:59:41 +01:00
|
|
|
QString comp = componentState["component"].toString("invalid");
|
|
|
|
bool compState = componentState["state"].toBool(true);
|
|
|
|
QString replyMsg;
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (API::setComponentState(comp, compState, replyMsg)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply(replyMsg, cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLedColorsCommand(const QJsonObject& /*message*/, const JsonApiCommand& cmd)
|
2023-10-01 21:56:53 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::LedStreamStart:
|
|
|
|
_jsonCB->subscribe( Subscription::LedColorsUpdate);
|
|
|
|
// push once
|
|
|
|
_hyperion->update();
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::LedStreamStop:
|
|
|
|
_jsonCB->unsubscribe( Subscription::LedColorsUpdate);
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
2019-08-24 22:53:30 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::ImageStreamStart:
|
|
|
|
_jsonCB->subscribe(Subscription::ImageUpdate);
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
2019-08-24 22:53:30 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::ImageStreamStop:
|
|
|
|
_jsonCB->unsubscribe(Subscription::ImageUpdate);
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
2023-10-01 21:56:53 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
default:
|
|
|
|
break;
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-08-24 22:53:30 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLoggingCommand(const QJsonObject& /*message*/, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::Start:
|
|
|
|
_jsonCB->subscribe("logmsg-update");
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SubCommand::Stop:
|
|
|
|
_jsonCB->unsubscribe("logmsg-update");
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleProcessingCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
API::setLedMappingType(ImageProcessor::mappingTypeToInt(message["mappingType"].toString("multicolor_mean")));
|
|
|
|
sendSuccessReply(cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleVideoModeCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
API::setVideoMode(parse3DMode(message["videoMode"].toString("2D")));
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleAuthorizeCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::TokenRequired:
|
|
|
|
handleTokenRequired(cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::AdminRequired:
|
|
|
|
handleAdminRequired(cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::NewPasswordRequired:
|
|
|
|
handleNewPasswordRequired(cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::Logout:
|
|
|
|
handleLogout(cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::NewPassword:
|
|
|
|
handleNewPassword(message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::CreateToken:
|
|
|
|
handleCreateToken(message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::RenameToken:
|
|
|
|
handleRenameToken(message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::DeleteToken:
|
|
|
|
handleDeleteToken(message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::RequestToken:
|
|
|
|
handleRequestToken(message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::GetPendingTokenRequests:
|
|
|
|
handleGetPendingTokenRequests(cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::AnswerRequest:
|
|
|
|
handleAnswerRequest(message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::GetTokenList:
|
|
|
|
handleGetTokenList(cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::Login:
|
|
|
|
handleLogin(message, cmd);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2020-03-26 17:59:41 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleTokenRequired(const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
bool isTokenRequired = !islocalConnection() || _authManager->isLocalAuthRequired();
|
|
|
|
QJsonObject response { { "required", isTokenRequired} };
|
|
|
|
sendSuccessDataReply(response, cmd);
|
|
|
|
}
|
2022-01-22 17:48:03 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleAdminRequired(const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
bool isAdminAuthRequired = true;
|
|
|
|
QJsonObject response { { "adminRequired", isAdminAuthRequired} };
|
|
|
|
sendSuccessDataReply(response, cmd);
|
|
|
|
}
|
2020-03-26 17:59:41 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleNewPasswordRequired(const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
QJsonObject response { { "newPasswordRequired", API::hasHyperionDefaultPw() } };
|
|
|
|
sendSuccessDataReply(response, cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLogout(const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
API::logout();
|
|
|
|
sendSuccessReply(cmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleNewPassword(const QJsonObject &message, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
const QString password = message["password"].toString().trimmed();
|
|
|
|
const QString newPassword = message["newPassword"].toString().trimmed();
|
|
|
|
if (API::updateHyperionPassword(password, newPassword)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Failed to update user password", cmd);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleCreateToken(const QJsonObject &message, const JsonApiCommand& cmd)
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
const QString &comment = message["comment"].toString().trimmed();
|
2024-05-08 22:06:32 +02:00
|
|
|
AuthManager::AuthDefinition def;
|
|
|
|
const QString createTokenResult = API::createToken(comment, def);
|
|
|
|
if (createTokenResult.isEmpty()) {
|
|
|
|
QJsonObject newTok;
|
|
|
|
newTok["comment"] = def.comment;
|
|
|
|
newTok["id"] = def.id;
|
|
|
|
newTok["token"] = def.token;
|
|
|
|
|
|
|
|
sendSuccessDataReply(newTok, cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Token creation failed", {createTokenResult}, cmd);
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleRenameToken(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QString &identifier = message["id"].toString().trimmed();
|
|
|
|
const QString &comment = message["comment"].toString().trimmed();
|
|
|
|
const QString renameTokenResult = API::renameToken(identifier, comment);
|
|
|
|
if (renameTokenResult.isEmpty()) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Token rename failed", {renameTokenResult}, cmd);
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleDeleteToken(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QString &identifier = message["id"].toString().trimmed();
|
|
|
|
const QString deleteTokenResult = API::deleteToken(identifier);
|
|
|
|
if (deleteTokenResult.isEmpty()) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Token deletion failed", {deleteTokenResult}, cmd);
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleRequestToken(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QString &identifier = message["id"].toString().trimmed();
|
|
|
|
const QString &comment = message["comment"].toString().trimmed();
|
|
|
|
const bool &acc = message["accept"].toBool(true);
|
|
|
|
if (acc) {
|
|
|
|
API::setNewTokenRequest(comment, identifier, cmd.tan);
|
|
|
|
} else {
|
|
|
|
API::cancelNewTokenRequest(comment, identifier);
|
|
|
|
// client should wait for answer
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleGetPendingTokenRequests(const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
QVector<AuthManager::AuthDefinition> vec;
|
|
|
|
if (API::getPendingTokenRequests(vec)) {
|
|
|
|
QJsonArray pendingTokeRequests;
|
|
|
|
for (const auto &entry : std::as_const(vec))
|
2019-09-17 21:33:46 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject obj;
|
|
|
|
obj["comment"] = entry.comment;
|
|
|
|
obj["id"] = entry.id;
|
|
|
|
obj["timeout"] = int(entry.timeoutTime);
|
|
|
|
obj["tan"] = entry.tan;
|
|
|
|
pendingTokeRequests.append(obj);
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReply(pendingTokeRequests, cmd);
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleAnswerRequest(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QString &identifier = message["id"].toString().trimmed();
|
|
|
|
const bool &accept = message["accept"].toBool(false);
|
|
|
|
if (API::handlePendingTokenRequest(identifier, accept)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Unable to handle token acceptance or denial", cmd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void JsonAPI::handleGetTokenList(const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
QVector<AuthManager::AuthDefinition> defVect;
|
|
|
|
if (API::getTokenList(defVect))
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonArray tokenList;
|
|
|
|
for (const auto &entry : std::as_const(defVect))
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject token;
|
|
|
|
token["comment"] = entry.comment;
|
|
|
|
token["id"] = entry.id;
|
|
|
|
token["last_use"] = entry.lastUse;
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
tokenList.append(token);
|
2020-03-26 17:59:41 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReply(tokenList, cmd);
|
2020-03-26 17:59:41 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2020-03-26 17:59:41 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLogin(const QJsonObject &message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QString &token = message["token"].toString().trimmed();
|
|
|
|
if (!token.isEmpty())
|
2020-03-26 17:59:41 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
// userToken is longer than app token
|
|
|
|
if (token.size() > APP_TOKEN_LENGTH)
|
2020-03-26 17:59:41 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
if (API::isUserTokenAuthorized(token)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendNoAuthorization(cmd);
|
|
|
|
}
|
|
|
|
|
2019-07-12 16:54:26 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (token.size() == APP_TOKEN_LENGTH)
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
if (API::isTokenAuthorized(token)) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendNoAuthorization(cmd);
|
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
// password
|
|
|
|
const QString &password = message["password"].toString().trimmed();
|
|
|
|
if (password.size() >= MIN_PASSWORD_LENGTH)
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QString userTokenRep;
|
|
|
|
if (API::isUserAuthorized(password) && API::getUserToken(userTokenRep))
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
// Return the current valid Hyperion user token
|
|
|
|
QJsonObject response { { "token", userTokenRep } };
|
|
|
|
sendSuccessDataReply(response, cmd);
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
|
|
|
else
|
2020-08-02 10:44:42 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendNoAuthorization(cmd);
|
2020-08-02 10:44:42 +02:00
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
else
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply(QString("Password is too short. Minimum length: %1 characters").arg(MIN_PASSWORD_LENGTH), cmd);
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::issueNewPendingTokenRequest(const QString &identifier, const QString &comment)
|
|
|
|
{
|
|
|
|
QJsonObject tokenRequest;
|
|
|
|
tokenRequest["comment"] = comment;
|
|
|
|
tokenRequest["id"] = identifier;
|
|
|
|
tokenRequest["timeout"] = static_cast<int>(NEW_TOKEN_REQUEST_TIMEOUT.count());
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
sendNewRequest(tokenRequest, "authorize-tokenRequest");
|
|
|
|
}
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleTokenResponse(bool success, const QString &token, const QString &comment, const QString &identifier, const int &tan)
|
|
|
|
{
|
|
|
|
const QString cmd = "authorize-requestToken";
|
|
|
|
QJsonObject result;
|
|
|
|
result["token"] = token;
|
|
|
|
result["comment"] = comment;
|
|
|
|
result["id"] = identifier;
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (success) {
|
|
|
|
sendSuccessDataReply(result, cmd, tan);
|
|
|
|
} else {
|
|
|
|
sendErrorReply("Token request timeout or denied", {}, cmd, tan);
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleInstanceCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2019-01-27 13:41:21 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QString replyMsg;
|
|
|
|
|
2023-01-16 11:01:28 +00:00
|
|
|
const quint8 &inst = static_cast<quint8>(message["instance"].toInt());
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
const QString &name = message["name"].toString();
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::SwitchTo:
|
2020-03-26 17:59:41 +01:00
|
|
|
if (handleInstanceSwitch(inst))
|
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject response { { "instance", inst } };
|
|
|
|
sendSuccessDataReply(response, cmd);
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|
2019-07-14 22:43:22 +02:00
|
|
|
else
|
2024-05-08 22:06:32 +02:00
|
|
|
{
|
|
|
|
sendErrorReply("Selected Hyperion instance is not running", cmd);
|
|
|
|
}
|
|
|
|
break;
|
2019-01-27 13:41:21 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::StartInstance:
|
2023-01-16 11:01:28 +00:00
|
|
|
//Only send update once
|
2024-05-08 22:06:32 +02:00
|
|
|
weakConnect(this, &API::onStartInstanceResponse, [this, cmd] ()
|
2023-01-16 11:01:28 +00:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
2023-01-16 11:01:28 +00:00
|
|
|
});
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (!API::startInstance(inst, cmd.tan))
|
|
|
|
{
|
|
|
|
sendErrorReply("Cannot start Hyperion instance index " + QString::number(inst), cmd);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SubCommand::StopInstance:
|
2019-07-14 22:43:22 +02:00
|
|
|
// silent fail
|
2020-03-26 17:59:41 +01:00
|
|
|
API::stopInstance(inst);
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
|
|
|
break;
|
2019-07-14 22:43:22 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::DeleteInstance:
|
|
|
|
handleConfigRestoreCommand(message, cmd);
|
2020-03-26 17:59:41 +01:00
|
|
|
if (API::deleteInstance(inst, replyMsg))
|
2024-05-08 22:06:32 +02:00
|
|
|
{
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
}
|
2019-07-14 22:43:22 +02:00
|
|
|
else
|
2024-05-08 22:06:32 +02:00
|
|
|
{
|
|
|
|
sendErrorReply(replyMsg, cmd);
|
|
|
|
}
|
|
|
|
break;
|
2019-07-14 22:43:22 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
case SubCommand::CreateInstance:
|
|
|
|
case SubCommand::SaveName:
|
|
|
|
// create and save name requires name
|
|
|
|
if (name.isEmpty()) {
|
|
|
|
sendErrorReply("Name string required for this command", cmd);
|
|
|
|
return;
|
|
|
|
}
|
2019-07-14 22:43:22 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (cmd.subCommand == SubCommand::CreateInstance) {
|
|
|
|
replyMsg = API::createInstance(name);
|
|
|
|
} else {
|
|
|
|
replyMsg = setInstanceName(inst, name);
|
|
|
|
}
|
2019-07-14 22:43:22 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (replyMsg.isEmpty()) {
|
|
|
|
sendSuccessReply(cmd);
|
|
|
|
} else {
|
|
|
|
sendErrorReply(replyMsg, cmd);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2019-07-14 22:43:22 +02:00
|
|
|
}
|
2019-01-27 13:41:21 +01:00
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLedDeviceCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
2020-07-12 20:27:56 +02:00
|
|
|
{
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
const QString &devType = message["ledDeviceType"].toString().trimmed();
|
2024-05-08 22:06:32 +02:00
|
|
|
const LedDeviceRegistry& ledDevices = LedDeviceWrapper::getDeviceMap();
|
2020-07-12 20:27:56 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (ledDevices.count(devType) == 0) {
|
|
|
|
sendErrorReply(QString("Unknown LED-Device type: %1").arg(devType), cmd);
|
|
|
|
return;
|
|
|
|
}
|
2020-07-12 20:27:56 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject config { { "type", devType } };
|
|
|
|
LedDevice* ledDevice = LedDeviceFactory::construct(config);
|
|
|
|
|
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::Discover:
|
|
|
|
handleLedDeviceDiscover(*ledDevice, message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::GetProperties:
|
|
|
|
handleLedDeviceGetProperties(*ledDevice, message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::Identify:
|
|
|
|
handleLedDeviceIdentify(*ledDevice, message, cmd);
|
|
|
|
break;
|
|
|
|
case SubCommand::AddAuthorization:
|
|
|
|
handleLedDeviceAddAuthorization(*ledDevice, message, cmd);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2020-07-12 20:27:56 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
delete ledDevice;
|
|
|
|
}
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLedDeviceDiscover(LedDevice& ledDevice, const QJsonObject& message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QJsonObject ¶ms = message["params"].toObject();
|
|
|
|
const QJsonObject devicesDiscovered = ledDevice.discover(params);
|
|
|
|
Debug(_log, "response: [%s]", QJsonDocument(devicesDiscovered).toJson(QJsonDocument::Compact).constData() );
|
|
|
|
sendSuccessDataReply(devicesDiscovered, cmd);
|
|
|
|
}
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLedDeviceGetProperties(LedDevice& ledDevice, const QJsonObject& message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QJsonObject ¶ms = message["params"].toObject();
|
|
|
|
const QJsonObject deviceProperties = ledDevice.getProperties(params);
|
|
|
|
Debug(_log, "response: [%s]", QJsonDocument(deviceProperties).toJson(QJsonDocument::Compact).constData() );
|
|
|
|
sendSuccessDataReply(deviceProperties, cmd);
|
|
|
|
}
|
2020-08-02 10:44:42 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLedDeviceIdentify(LedDevice& ledDevice, const QJsonObject& message, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
const QJsonObject ¶ms = message["params"].toObject();
|
|
|
|
ledDevice.identify(params);
|
|
|
|
sendSuccessReply(cmd);
|
2020-07-12 20:27:56 +02:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleLedDeviceAddAuthorization(LedDevice& ledDevice, const QJsonObject& message, const JsonApiCommand& cmd)
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
const QJsonObject& params = message["params"].toObject();
|
|
|
|
const QJsonObject response = ledDevice.addAuthorization(params);
|
|
|
|
sendSuccessDataReply(response, cmd);
|
|
|
|
}
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleInputSourceCommand(const QJsonObject& message, const JsonApiCommand& cmd) {
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
const QString& sourceType = message["sourceType"].toString().trimmed();
|
2024-05-08 22:06:32 +02:00
|
|
|
const QStringList sourceTypes {"screen", "video", "audio"};
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (!sourceTypes.contains(sourceType)) {
|
|
|
|
sendErrorReply(QString("Unknown input source type: %1").arg(sourceType), cmd);
|
|
|
|
return;
|
|
|
|
}
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (cmd.subCommand == SubCommand::Discover) {
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
const QJsonObject& params = message["params"].toObject();
|
|
|
|
QJsonObject inputSourcesDiscovered = JsonInfo().discoverSources(sourceType, params);
|
2023-02-19 00:36:39 -08:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
DebugIf(verbose, _log, "response: [%s]", QJsonDocument(inputSourcesDiscovered).toJson(QJsonDocument::Compact).constData());
|
2023-02-19 00:36:39 -08:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReply(inputSourcesDiscovered, cmd);
|
Media Foundation/V4L2 grabber ... (#1119)
* - New Media Foundation grabber
- JsonAPI available grabber fix
- commented json config removed
* Added libjpeg-turbo to dependencies
* Fix OSX build
Removed Azure Pipelines from build scripts
* Remove Platform from Dashboard
* Correct Grabber Namings
* Grabber UI improvements, generic JSONEditor Selection Update
* Active grabber fix
* Stop Framebuffer grabber on failure
* - Image format NV12 and I420 added
- Flip mode
- Scaling factor for MJPEG
- VSCode (compile before run)
- CI (push) dependency libjpeg-turbo added
* Refactor MediaFoundation (Part 1)
* Remove QDebug output
* Added image flipping ability to MF Grabber
* fix issue 1160
* -Reload MF Grabber only once per WebUI update
- Cleanup
* Improvements
* - Set 'Software Frame Decimation' begin to 0
- Removed grabber specific device name from Log
- Keep pixel format when switching resolution
- Display 'Flip mode' correct in Log
- BGR24 images always flipped
* Refactor MediaFoundation (Part 2)
* Refactor V4L2 grabber (part 1) (#62)
* Media Foundation grabber adapted to V4L2 change
* Enable Media Foundation grabber on windows
* Have fps as int, fix height typo
* Added video standards to JsonAPI output
* Error handling in source reader improved
* Fix "Frame to small" error
* Discovery VideoSources and Dynamically Update Editor
* Hide all element when no video grabber discovered, upate naming
* Do not show unsupported grabbers
* Copy Log to Clipboard
* Update Grabber schema and Defaults
* Update access levels and validate crop ranges
* Height and width in Qt grabber corrected
* Correct formatting
* Untabify
* Global component states across instances
* Components divided on the dashboard
* refactor
* Fix Merge-issues
* Database migration aligning with updated grabber model
* Align Grabber.js with new utility functions
* Allow editor-validation for enum-lists
* Handle "Show Explainations scenario" correctly
* Grabber - Ensure save is only possible on valid content
* Dashboard update + fix GlobalSignal connection
* Ensure default database is populated with current release
* Correct grabber4L2 access level
* Display Signal detection area in preview
* Write Hyperion version into default config on compiling.
* Create defaultconfig.json dynamically
* WebUI changes
* Correct grabber config look-ups
* Refactor i18n language loading
* Fix en.json
* Split global capture from instance capture config
* Update grabber default values
* Standalone grabber: Add --debug switch
* Enhance showInputOptionsForKey for multiple keys
* Add grabber instance link to system grabber config
* Only show signal detection area, if grabber is enabled
* Always show Active element on grabber page
* Remote control - Only display gabber status, if global grabber is enabled
* WebUI optimization (thx to @mkcologne)
Start Grabber only when global settings are enabled
Fixed an issue in the WebUI preview
* V4L2/MF changes
* Jsoneditor, Correct translation for default values
* Refactor LED-Device handling in UI and make element naming consistent
* MF Discovery extended
* Fix LGTM finding
* Support Grabber Bri, Hue, Sat and Con in UI, plus their defaults
* Concider Access level for item filtering
* Concider Access level for item filtering
* Revert "Concider Access level for item filtering"
This reverts commit 5b0ce3c0f2de67e0c43788190cfff45614706129.
* Disable fpsSoftwareDecimation for framegrabber, as not supported yet
* JSON-Editor- Add updated schema for validation on dynamic elements
* added V4L2 color IDs
* LGTM findings fix
* destroy SR callback only on exit
* Grabber.js - Hide elements not supported by platform
* Fixed freezing start effect
* Grabber UI - Hardware controls - Show current values and allow to reset to defaults
* Grabber - Discovery - Add current values to properties
* Small things
* Clean-up Effects and have ENDLESS consistently defined
* Fix on/off/on priority during startup, by initializing _prevVisComp in line with background priority
* Add missing translation mappings
* DirectX Grabber reactivated/ QT Grabber size decimation fixed
* typo in push-master workflow
* Use PreciseTimer for Grabber to ensure stable FPS timing
* Set default Screencapture rate consistently
* Fix libjpeg-turbo download
* Remove Zero character from file
* docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Framebuffer, Dispmanx, OSX, AML Grabber discovery, various clean-up and consistencies across grabbers
* Fix merge problem - on docker-compile Add PLATFORM parameter, only copy output file after successful compile
* Fix definition
* OSXFRameGrabber - Revert cast
* Clean-ups nach Feedback
* Disable certain libraries when building armlogic via standard stretch image as developer
* Add CEC availability to ServerInfo to have it platform independent
* Grabber UI - Fix problem that crop values are not populated when refining editor rage
* Preserve value when updating json-editor range
* LEDVisualisation - Clear image when source changes
* Fix - Preserve value when updating json-editor range
* LEDVisualisation - Clear image when no component is active
* Allow to have password handled by Password-Manager (#1263)
* Update default signal detection area to green assuming rainbow grabber
* LED Visualisation - Handle empty priority update
* Fix yuv420 in v4l2 grabber
* V4L2-Grabber discovery - Only report grabbers with valid video input information
* Grabber - Update static variables to have them working in release build
* LED Visualisation - ClearImage when no priorities
* LED Visualisation - Fix Logo resizing issue
* LED Visualisation - Have nearly black background and negative logo
Co-authored-by: LordGrey <lordgrey.emmel@gmail.com>
Co-authored-by: LordGrey <48840279+Lord-Grey@users.noreply.github.com>
2021-07-14 20:48:33 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleServiceCommand(const QJsonObject &message, const JsonApiCommand& cmd)
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
if (cmd.subCommand == SubCommand::Discover)
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
{
|
|
|
|
QByteArray serviceType;
|
2024-05-08 22:06:32 +02:00
|
|
|
const QString type = message["serviceType"].toString().trimmed();
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
#ifdef ENABLE_MDNS
|
|
|
|
QString discoveryMethod("mDNS");
|
|
|
|
serviceType = MdnsServiceRegister::getServiceType(type);
|
|
|
|
#else
|
|
|
|
QString discoveryMethod("ssdp");
|
|
|
|
#endif
|
|
|
|
if (!serviceType.isEmpty())
|
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonArray serviceList;
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
#ifdef ENABLE_MDNS
|
2024-02-25 17:35:39 +01:00
|
|
|
QMetaObject::invokeMethod(MdnsBrowser::getInstance().data(), "browseForServiceType",
|
2024-05-08 22:06:32 +02:00
|
|
|
Qt::QueuedConnection, Q_ARG(QByteArray, serviceType));
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
|
2024-02-25 17:35:39 +01:00
|
|
|
serviceList = MdnsBrowser::getInstance().data()->getServicesDiscoveredJson(serviceType, MdnsServiceRegister::getServiceNameFilter(type), DEFAULT_DISCOVER_TIMEOUT);
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
#endif
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject servicesDiscovered;
|
|
|
|
QJsonObject servicesOfType;
|
|
|
|
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
servicesOfType.insert(type, serviceList);
|
|
|
|
|
|
|
|
servicesDiscovered.insert("discoveryMethod", discoveryMethod);
|
|
|
|
servicesDiscovered.insert("services", servicesOfType);
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReply(servicesDiscovered, cmd);
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply(QString("Discovery of service type [%1] via %2 not supported").arg(type, discoveryMethod), cmd);
|
mDNS Support (#1452)
* Allow build, if no grabbers are enabled
* Align available functions to right Qt version
* Update to next development version
* Align available functions to right Qt version
* fix workflows (apt/nightly)
* Disable QNetworkConfigurationManager deprecation warnings
* Initial go on Smart Pointers
* Add Deallocation
* Correct QT_WARNING_DISABLE_DEPRECATED (available since 5.9)
* Cluster Build Variables
* Hyperion Light
* Address build warnings
* Hyperion Light - UI
* Update Protobuf to latest master
* Removed compiler warnings
* Added restart ability to systray
* Correct Protobuf
* Ignore 'no-return' warning on protobuf build
* hyperion-remote: Fix auto discovery of hyperion server
* Fix Qt version override
* Update changelog
* Remove Grabber Components, if no Grabber exists
* Standalone Grabber - Fix fps default
* Remote Control - Have Source Selction accrosswhole screen
* Enable Blackborder detection only, if relevant input sources available
* Enable Blackborder detection only, if relevant input sources available
* Remote UI - rearrange containers
* Checkout
* Fix compilation on windows
* Re-added qmdnsengine template cmake
* chrono added for linux
* Removed existing AVAHI/Bonjour, allow to enable/disable mDNS
* hyperiond macos typo fix
* Fix macOS Bundle build
* Fix macOS bundle info details
* Correct CMake files
* Removed existing AVAHI/Bonjour (2)
* Share hyperion's services via mDNS
* Add mDNS Browser and mDNS for LED-Devices
* Support mDNS discovery for standalone grabbers
* Remove ZLib Dependency & Cleanup
* mDNS - hanle 2.local2 an ".local." domains equally
* Hue - Link discovery to bridge class, workaround port 443 for mDNS discovery
* Fix save button state when switching between devices
* Removed sessions (of other hyperions)
* mDNS Publisher - Simplify service naming
* mDNS refactoring & Forwarder discovery
* mDNS Updates to use device service name
* Consistency of standalone grabbers with mDNS Service Registry
* Merge branch 'hyperion-project:master' into mDNS
* Start JSON and WebServers only after Instance 0 is available
* Remove bespoke qDebug Output again
* MDNS updates and refactor Forwarder
* Minor updates
* Upgrade to CMake 3.1
* typo
* macOS fix
* Correct merge
* - Remove dynamic linker flag from standalone dispmanX Grabber
- Added ability to use system qmdns libs
* Cec handler library will load at runtime
* typo fix
* protobuf changes
* mDNS changes for Windows/macOS
* test window build qmdnsengine
* absolute path to protobuf cmake dir
* Rework Hue Wizard supporting mDNS
* LED-Devices - Retry support + Refactoring (excl. Hue)
* LED-Devices - Refactoring/Retry support Hue + additional alignments
* Address LGTM findings
* Fix CI-Build, revert test changes
* Build Windows in Release mode to avoid python problem
* Correct that WebServerObject is available earlier
* Ensure that instance name in logs for one instance are presented
* Update content LEDs
* Rework mDNS Address lookup
* Fix LED UI
* Fix for non mDNS Services (ignore default port)
* Disbale device when now input is available
* Revert back some updates, ensure last color is updated when switched on
* Handle reopening case and changed IP, port for API-calls
* Add UPD-DDP Device
* WLED support for DDP
* Fix printout
* LEDDevice - Allow more retries, udapte defaults
* LED-Net Devices - Select Custom device, if configured
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
Co-authored-by: Paulchen Panther <Paulchen-Panter@protonmail.com>
2022-05-01 19:42:47 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::handleSystemCommand(const QJsonObject& /*message*/, const JsonApiCommand& cmd)
|
2022-12-22 12:40:39 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
switch (cmd.subCommand) {
|
|
|
|
case SubCommand::Suspend:
|
2023-11-27 09:06:43 +01:00
|
|
|
emit signalEvent(Event::Suspend);
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
|
|
|
case SubCommand::Resume:
|
2023-11-27 09:06:43 +01:00
|
|
|
emit signalEvent(Event::Resume);
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
|
|
|
case SubCommand::Restart:
|
2023-11-27 09:06:43 +01:00
|
|
|
emit signalEvent(Event::Restart);
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
|
|
|
case SubCommand::ToggleSuspend:
|
2023-11-27 09:06:43 +01:00
|
|
|
emit signalEvent(Event::ToggleSuspend);
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
|
|
|
case SubCommand::Idle:
|
2023-11-27 09:06:43 +01:00
|
|
|
emit signalEvent(Event::Idle);
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
|
|
|
case SubCommand::ToggleIdle:
|
2023-11-27 09:06:43 +01:00
|
|
|
emit signalEvent(Event::ToggleIdle);
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
2022-12-22 12:40:39 +01:00
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd);
|
2022-12-22 12:40:39 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject JsonAPI::getBasicCommandReply(bool success, const QString &command, int tan, InstanceCmd::Type isInstanceCmd) const
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
|
|
|
QJsonObject reply;
|
2024-05-08 22:06:32 +02:00
|
|
|
reply["success"] = success;
|
2018-12-28 18:12:45 +01:00
|
|
|
reply["command"] = command;
|
|
|
|
reply["tan"] = tan;
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (isInstanceCmd == InstanceCmd::Yes || ( isInstanceCmd == InstanceCmd::Multi && !_noListener))
|
|
|
|
{
|
|
|
|
reply["instance"] = _hyperion->getInstanceIndex();
|
|
|
|
}
|
|
|
|
return reply;
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendSuccessReply(const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessReply(cmd.toString(), cmd.tan, cmd.isInstanceCmd);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendSuccessReply(const QString &command, int tan, InstanceCmd::Type isInstanceCmd)
|
|
|
|
{
|
|
|
|
emit callbackMessage(getBasicCommandReply(true, command, tan , isInstanceCmd));
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendSuccessDataReply(const QJsonValue &infoData, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReplyWithError(infoData, cmd.toString(), cmd.tan, {}, cmd.isInstanceCmd);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendSuccessDataReply(const QJsonValue &infoData, const QString &command, int tan, InstanceCmd::Type isInstanceCmd)
|
|
|
|
{
|
|
|
|
sendSuccessDataReplyWithError(infoData, command, tan, {}, isInstanceCmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendSuccessDataReplyWithError(const QJsonValue &infoData, const JsonApiCommand& cmd, const QStringList& errorDetails)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendSuccessDataReplyWithError(infoData, cmd.toString(), cmd.tan, errorDetails, cmd.isInstanceCmd);
|
|
|
|
}
|
2018-12-31 15:48:29 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendSuccessDataReplyWithError(const QJsonValue &infoData, const QString &command, int tan, const QStringList& errorDetails, InstanceCmd::Type isInstanceCmd)
|
|
|
|
{
|
|
|
|
QJsonObject reply {getBasicCommandReply(true, command, tan , isInstanceCmd)};
|
|
|
|
reply["info"] = infoData;
|
|
|
|
|
|
|
|
if (!errorDetails.isEmpty())
|
2019-08-24 22:53:30 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonArray errorsArray;
|
|
|
|
for (const QString& errorString : errorDetails)
|
|
|
|
{
|
|
|
|
QJsonObject errorObject;
|
|
|
|
errorObject["description"] = errorString;
|
|
|
|
errorsArray.append(errorObject);
|
|
|
|
}
|
|
|
|
reply["errorData"] = errorsArray;
|
2019-08-24 22:53:30 +02:00
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
emit callbackMessage(reply);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendErrorReply(const QString &error, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply(error, {}, cmd.toString(), cmd.tan, cmd.isInstanceCmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendErrorReply(const QString &error, const QStringList& errorDetails, const JsonApiCommand& cmd)
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply(error, errorDetails, cmd.toString(), cmd.tan, cmd.isInstanceCmd);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendErrorReply(const QString &error, const QStringList& errorDetails, const QString &command, int tan, InstanceCmd::Type isInstanceCmd)
|
|
|
|
{
|
|
|
|
QJsonObject reply {getBasicCommandReply(false, command, tan , isInstanceCmd)};
|
|
|
|
reply["error"] = error;
|
|
|
|
if (!errorDetails.isEmpty())
|
2018-12-28 18:12:45 +01:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonArray errorsArray;
|
|
|
|
for (const QString& errorString : errorDetails)
|
|
|
|
{
|
|
|
|
QJsonObject errorObject;
|
|
|
|
errorObject["description"] = errorString;
|
|
|
|
errorsArray.append(errorObject);
|
|
|
|
}
|
|
|
|
reply["errorData"] = errorsArray;
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
emit callbackMessage(reply);
|
|
|
|
}
|
2018-12-28 18:12:45 +01:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendNewRequest(const QJsonValue &infoData, const JsonApiCommand& cmd)
|
|
|
|
{
|
|
|
|
sendSuccessDataReplyWithError(infoData, cmd.toString(), cmd.isInstanceCmd);
|
2018-12-28 18:12:45 +01:00
|
|
|
}
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendNewRequest(const QJsonValue &infoData, const QString &command, InstanceCmd::Type isInstanceCmd)
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
QJsonObject request;
|
|
|
|
request["command"] = command;
|
2019-07-12 16:54:26 +02:00
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
if (isInstanceCmd != InstanceCmd::No)
|
|
|
|
{
|
|
|
|
request["instance"] = _hyperion->getInstanceIndex();
|
|
|
|
}
|
|
|
|
|
|
|
|
request["info"] = infoData;
|
|
|
|
|
|
|
|
emit callbackMessage(request);
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
|
|
|
|
2024-05-08 22:06:32 +02:00
|
|
|
void JsonAPI::sendNoAuthorization(const JsonApiCommand& cmd)
|
2019-07-12 16:54:26 +02:00
|
|
|
{
|
2024-05-08 22:06:32 +02:00
|
|
|
sendErrorReply(NO_AUTHORIZATION, cmd);
|
2019-07-12 16:54:26 +02:00
|
|
|
}
|
2019-07-14 22:43:22 +02:00
|
|
|
|
2024-02-25 17:35:39 +01:00
|
|
|
void JsonAPI::handleInstanceStateChange(InstanceState state, quint8 instance, const QString& /*name */)
|
2019-07-14 22:43:22 +02:00
|
|
|
{
|
2020-03-26 17:59:41 +01:00
|
|
|
switch (state)
|
|
|
|
{
|
2020-07-12 09:19:59 +02:00
|
|
|
case InstanceState::H_ON_STOP:
|
2020-03-26 17:59:41 +01:00
|
|
|
if (_hyperion->getInstanceIndex() == instance)
|
|
|
|
{
|
|
|
|
handleInstanceSwitch();
|
|
|
|
}
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
2022-12-27 08:36:10 +01:00
|
|
|
|
|
|
|
case InstanceState::H_STARTED:
|
|
|
|
case InstanceState::H_STOPPED:
|
|
|
|
case InstanceState::H_CREATED:
|
|
|
|
case InstanceState::H_DELETED:
|
2024-05-08 22:06:32 +02:00
|
|
|
break;
|
2019-07-14 22:43:22 +02:00
|
|
|
}
|
|
|
|
}
|
2019-09-17 21:33:46 +02:00
|
|
|
|
2020-08-08 13:09:15 +02:00
|
|
|
void JsonAPI::stopDataConnections()
|
2019-09-17 21:33:46 +02:00
|
|
|
{
|
|
|
|
_jsonCB->resetSubscriptions();
|
2024-05-08 22:06:32 +02:00
|
|
|
LoggerManager::getInstance()->disconnect();
|
|
|
|
}
|
|
|
|
|
|
|
|
QString JsonAPI::findCommand (const QString& jsonString)
|
|
|
|
{
|
|
|
|
QString commandValue {"unknown"};
|
|
|
|
|
|
|
|
// Define a regular expression pattern to match the value associated with the key "command"
|
|
|
|
static QRegularExpression regex("\"command\"\\s*:\\s*\"([^\"]+)\"");
|
|
|
|
QRegularExpressionMatch match = regex.match(jsonString);
|
|
|
|
|
|
|
|
if (match.hasMatch()) {
|
|
|
|
commandValue = match.captured(1);
|
|
|
|
}
|
|
|
|
return commandValue;
|
|
|
|
}
|
|
|
|
|
|
|
|
int JsonAPI::findTan (const QString& jsonString)
|
|
|
|
{
|
|
|
|
int tanValue {0};
|
|
|
|
static QRegularExpression regex("\"tan\"\\s*:\\s*(\\d+)");
|
|
|
|
QRegularExpressionMatch match = regex.match(jsonString);
|
|
|
|
|
|
|
|
if (match.hasMatch()) {
|
|
|
|
QString valueStr = match.captured(1);
|
|
|
|
tanValue = valueStr.toInt();
|
|
|
|
}
|
|
|
|
return tanValue;
|
2019-09-17 21:33:46 +02:00
|
|
|
}
|