diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a901b56..6f38fbf91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Support for ftdi chip based LED-devices with ws2812, sk6812 apa102 LED types (Many thanks to @nurikk) (#1746) - Support for Skydimo devices - Support gaps on Matrix Layout (#1696) +- Support a configurable grabber inactive detection time interval (#1740) - Windows: Added a new grabber that uses the DXGI DDA (Desktop Duplication API). This has much better performance than the DX grabber as it does more of its work on the GPU. - Support to import, export and backup Hyperion's full configuration via the UI, JSON-API and commandline (`--importConfig, --exportConfig`) (#804) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c3c100c7..22a69be0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -510,7 +510,7 @@ endif() # If Hyperion is deployed with all dependencies under Linux # it is necessary to deactivate the linker option dtag -if(ENABLE_DEPLOY_DEPENDENCIES AND SYSTEM_MATCHES_LINUX) +if(ENABLE_DEPLOY_DEPENDENCIES AND UNIX AND NOT APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--disable-new-dtags") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--disable-new-dtags") diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 14fae3e6c..a6310652e 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -502,6 +502,8 @@ "edt_conf_instC_video_grabber_device_expl": "The video capture device used", "edt_conf_instC_video_grabber_device_title": "Video capture device", "edt_conf_instCapture_heading_title": "Capture Devices", + "edt_conf_instCapture_timeout_expl": "If no data are received for the given period, the component will be cleared as an input source.", + "edt_conf_instCapture_timeout_title": "Input timeout", "edt_conf_js_heading_title": "JSON Server", "edt_conf_log_heading_title": "Logging", "edt_conf_log_level_expl": "Depending on loglevel you see less or more messages in your log.", diff --git a/assets/webconfig/js/content_instcapture.js b/assets/webconfig/js/content_instcapture.js index abe000813..321294646 100644 --- a/assets/webconfig/js/content_instcapture.js +++ b/assets/webconfig/js/content_instcapture.js @@ -65,6 +65,7 @@ $(document).ready(function () { showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemEnable", false); showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemGrabberDevice", false); showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemPriority", false); + showInputOptionForItem(conf_editor_instCapt, "instCapture", "screenInactiveTimeout", false); } if (videoGrabberAvailable) { @@ -80,6 +81,7 @@ $(document).ready(function () { showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lGrabberDevice", false); showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lEnable", false); showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lPriority", false); + showInputOptionForItem(conf_editor_instCapt, "instCapture", "videoInactiveTimeout", false); } if (audioGrabberAvailable) { @@ -95,6 +97,7 @@ $(document).ready(function () { showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioGrabberDevice", false); showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioEnable", false); showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioPriority", false); + showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioInactiveTimeout", false); } }); @@ -122,11 +125,11 @@ $(document).ready(function () { conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").setValue(window.serverConfig.framegrabber.available_devices); conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").disable(); showInputOptions("instCapture", ["systemGrabberDevice"], true); - showInputOptions("instCapture", ["systemPriority"], true); + showInputOptions("instCapture", ["systemPriority", "screenInactiveTimeout"], true); } else { showInputOptions("instCapture", ["systemGrabberDevice"], false); - showInputOptions("instCapture", ["systemPriority"], false); + showInputOptions("instCapture", ["systemPriority", "screenInactiveTimeout"], false); } }); @@ -137,14 +140,14 @@ $(document).ready(function () { conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").setValue(window.serverConfig.grabberV4L2.available_devices); conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").disable(); showInputOptions("instCapture", ["v4lGrabberDevice"], true); - showInputOptions("instCapture", ["v4lPriority"], true); + showInputOptions("instCapture", ["v4lPriority", "videoInactiveTimeout"], true); } else { if (!window.serverConfig.grabberV4L2.enable) { conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable(); } showInputOptions("instCapture", ["v4lGrabberDevice"], false); - showInputOptions("instCapture", ["v4lPriority"], false); + showInputOptions("instCapture", ["v4lPriority", "videoInactiveTimeout"], false); } }); @@ -154,14 +157,14 @@ $(document).ready(function () { conf_editor_instCapt.getEditor("root.instCapture.audioGrabberDevice").setValue(window.serverConfig.grabberAudio.available_devices); conf_editor_instCapt.getEditor("root.instCapture.audioGrabberDevice").disable(); showInputOptions("instCapture", ["audioGrabberDevice"], true); - showInputOptions("instCapture", ["audioPriority"], true); + showInputOptions("instCapture", ["audioPriority", "audioInactiveTimeout"], true); } else { if (!window.serverConfig.grabberAudio.enable) { conf_editor_instCapt.getEditor("root.instCapture.audioEnable").disable(); } showInputOptions("instCapture", ["audioGrabberDevice"], false); - showInputOptions("instCapture", ["audioPriority"], false); + showInputOptions("instCapture", ["audioPriority", "audioInactiveTimeout"], false); } }); diff --git a/include/hyperion/CaptureCont.h b/include/hyperion/CaptureCont.h index c1eca98e5..689e92c79 100644 --- a/include/hyperion/CaptureCont.h +++ b/include/hyperion/CaptureCont.h @@ -18,13 +18,13 @@ class CaptureCont : public QObject public: CaptureCont(Hyperion* hyperion); - void setSystemCaptureEnable(bool enable); - void setV4LCaptureEnable(bool enable); + void setScreenCaptureEnable(bool enable); + void setVideoCaptureEnable(bool enable); void setAudioCaptureEnable(bool enable); private slots: /// - /// @brief Handle component state change of V4L and SystemCapture + /// @brief Handle component state change of Video- (V4L/MF) and Screen capture /// @param component The component from enum /// @param enable The new state /// @@ -38,16 +38,16 @@ private slots: void handleSettingsUpdate(settings::type type, const QJsonDocument& config); /// - /// @brief forward system image + /// @brief forward screen image /// @param image The image /// - void handleSystemImage(const QString& name, const Image& image); + void handleScreenImage(const QString& name, const Image& image); /// - /// @brief forward v4l image + /// @brief forward video (v4l, MF) image /// @param image The image /// - void handleV4lImage(const QString& name, const Image & image); + void handleVideoImage(const QString& name, const Image & image); /// /// @brief forward audio image @@ -56,39 +56,40 @@ private slots: void handleAudioImage(const QString& name, const Image& image); /// - /// @brief Is called from _v4lInactiveTimer to set source after specific time to inactive + /// @brief Sets the video source to inactive /// - void setV4lInactive(); + void onVideoIsInactive(); /// - /// @brief Is called from _audioInactiveTimer to set source after specific time to inactive + /// @brief Sets the screen source to inactive /// - void setAudioInactive(); + void onScreenIsInactive(); /// - /// @brief Is called from _systemInactiveTimer to set source after specific time to inactive + /// @brief Sets the audio source to inactive /// - void setSystemInactive(); + void onAudioIsInactive(); + private: /// Hyperion instance Hyperion* _hyperion; - /// Reflect state of System capture and prio - bool _systemCaptEnabled; - quint8 _systemCaptPrio; - QString _systemCaptName; - QTimer* _systemInactiveTimer; + /// Reflect state of screen capture and prio + bool _screenCaptureEnabled; + int _screenCapturePriority; + QString _screenCaptureName; + QTimer* _screenCaptureInactiveTimer; - /// Reflect state of v4l capture and prio - bool _v4lCaptEnabled; - quint8 _v4lCaptPrio; - QString _v4lCaptName; - QTimer* _v4lInactiveTimer; + /// Reflect state of video capture and prio + bool _videoCaptureEnabled; + int _videoCapturePriority; + QString _videoCaptureName; + QTimer* _videoInactiveTimer; /// Reflect state of audio capture and prio - bool _audioCaptEnabled; - quint8 _audioCaptPrio; - QString _audioCaptName; - QTimer* _audioInactiveTimer; + bool _audioCaptureEnabled; + int _audioCapturePriority; + QString _audioCaptureName; + QTimer* _audioCaptureInactiveTimer; }; diff --git a/include/hyperion/Hyperion.h b/include/hyperion/Hyperion.h index 546416233..6ae9a2426 100644 --- a/include/hyperion/Hyperion.h +++ b/include/hyperion/Hyperion.h @@ -174,7 +174,7 @@ public slots: /// @param priority The priority /// @return True on success false if not found /// - bool setInputInactive(quint8 priority); + bool setInputInactive(int priority); /// /// Returns the list with unique adjustment identifiers diff --git a/libsrc/hyperion/CaptureCont.cpp b/libsrc/hyperion/CaptureCont.cpp index 5ae2a9e53..9dfb5accf 100644 --- a/libsrc/hyperion/CaptureCont.cpp +++ b/libsrc/hyperion/CaptureCont.cpp @@ -1,5 +1,7 @@ #include +#include + // hyperion includes #include @@ -9,21 +11,27 @@ // qt includes #include +namespace { +const int DEFAULT_VIDEO_CAPTURE_PRIORITY = 240; +const int DEFAULT_SCREEN_CAPTURE_PRIORITY = 250; +const int DEFAULT_AUDIO_CAPTURE_PRIORITY = 230; + +constexpr std::chrono::seconds DEFAULT_VIDEO_CAPTURE_INACTIVE_TIMEOUT{1}; +constexpr std::chrono::seconds DEFAULT_SCREEN_CAPTURE_INACTIVE_TIMEOUT{5}; +constexpr std::chrono::seconds DEFAULT_AUDIO_CAPTURE_INACTIVE_TIMEOUT{1}; +} + CaptureCont::CaptureCont(Hyperion* hyperion) - : QObject() - , _hyperion(hyperion) - , _systemCaptEnabled(false) - , _systemCaptPrio(0) - , _systemCaptName() - , _systemInactiveTimer(new QTimer(this)) - , _v4lCaptEnabled(false) - , _v4lCaptPrio(0) - , _v4lCaptName() - , _v4lInactiveTimer(new QTimer(this)) - , _audioCaptEnabled(false) - , _audioCaptPrio(0) - , _audioCaptName() - , _audioInactiveTimer(new QTimer(this)) + : _hyperion(hyperion) + , _screenCaptureEnabled(false) + , _screenCapturePriority(0) + , _screenCaptureInactiveTimer(new QTimer(this)) + , _videoCaptureEnabled(false) + , _videoCapturePriority(0) + , _videoInactiveTimer(new QTimer(this)) + , _audioCaptureEnabled(false) + , _audioCapturePriority(0) + , _audioCaptureInactiveTimer(new QTimer(this)) { // settings changes connect(_hyperion, &Hyperion::settingsChanged, this, &CaptureCont::handleSettingsUpdate); @@ -31,101 +39,101 @@ CaptureCont::CaptureCont(Hyperion* hyperion) // comp changes connect(_hyperion, &Hyperion::compStateChangeRequest, this, &CaptureCont::handleCompStateChangeRequest); - // inactive timer system - connect(_systemInactiveTimer, &QTimer::timeout, this, &CaptureCont::setSystemInactive); - _systemInactiveTimer->setSingleShot(true); - _systemInactiveTimer->setInterval(5000); + // inactive timer screen + connect(_screenCaptureInactiveTimer, &QTimer::timeout, this, &CaptureCont::onScreenIsInactive); + _screenCaptureInactiveTimer->setSingleShot(true); + _screenCaptureInactiveTimer->setInterval(DEFAULT_SCREEN_CAPTURE_INACTIVE_TIMEOUT); - // inactive timer v4l - connect(_v4lInactiveTimer, &QTimer::timeout, this, &CaptureCont::setV4lInactive); - _v4lInactiveTimer->setSingleShot(true); - _v4lInactiveTimer->setInterval(1000); + // inactive timer video + connect(_videoInactiveTimer, &QTimer::timeout, this, &CaptureCont::onVideoIsInactive); + _videoInactiveTimer->setSingleShot(true); + _videoInactiveTimer->setInterval(DEFAULT_VIDEO_CAPTURE_INACTIVE_TIMEOUT); // inactive timer audio - connect(_audioInactiveTimer, &QTimer::timeout, this, &CaptureCont::setAudioInactive); - _audioInactiveTimer->setSingleShot(true); - _audioInactiveTimer->setInterval(1000); + connect(_audioCaptureInactiveTimer, &QTimer::timeout, this, &CaptureCont::onAudioIsInactive); + _audioCaptureInactiveTimer->setSingleShot(true); + _audioCaptureInactiveTimer->setInterval(DEFAULT_AUDIO_CAPTURE_INACTIVE_TIMEOUT); // init handleSettingsUpdate(settings::INSTCAPTURE, _hyperion->getSetting(settings::INSTCAPTURE)); } -void CaptureCont::handleV4lImage(const QString& name, const Image & image) +void CaptureCont::handleVideoImage(const QString& name, const Image & image) { - if(_v4lCaptName != name) + if(_videoCaptureName != name) { - _hyperion->registerInput(_v4lCaptPrio, hyperion::COMP_V4L, "System", name); - _v4lCaptName = name; - emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_V4L, int(_hyperion->getInstanceIndex()), _v4lCaptEnabled); + _hyperion->registerInput(_videoCapturePriority, hyperion::COMP_V4L, "System", name); + _videoCaptureName = name; + emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_V4L, int(_hyperion->getInstanceIndex()), _videoCaptureEnabled); } - _v4lInactiveTimer->start(); - _hyperion->setInputImage(_v4lCaptPrio, image); + _videoInactiveTimer->start(); + _hyperion->setInputImage(_videoCapturePriority, image); } -void CaptureCont::handleSystemImage(const QString& name, const Image& image) +void CaptureCont::handleScreenImage(const QString& name, const Image& image) { - if(_systemCaptName != name) + if(_screenCaptureName != name) { - _hyperion->registerInput(_systemCaptPrio, hyperion::COMP_GRABBER, "System", name); - _systemCaptName = name; - emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_GRABBER, int(_hyperion->getInstanceIndex()), _systemCaptEnabled); + _hyperion->registerInput(_screenCapturePriority, hyperion::COMP_GRABBER, "System", name); + _screenCaptureName = name; + emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_GRABBER, int(_hyperion->getInstanceIndex()), _screenCaptureEnabled); } - _systemInactiveTimer->start(); - _hyperion->setInputImage(_systemCaptPrio, image); + _screenCaptureInactiveTimer->start(); + _hyperion->setInputImage(_screenCapturePriority, image); } void CaptureCont::handleAudioImage(const QString& name, const Image& image) { - if (_audioCaptName != name) + if (_audioCaptureName != name) { - _hyperion->registerInput(_audioCaptPrio, hyperion::COMP_AUDIO, "System", name); - _audioCaptName = name; + _hyperion->registerInput(_audioCapturePriority, hyperion::COMP_AUDIO, "System", name); + _audioCaptureName = name; } - _audioInactiveTimer->start(); - _hyperion->setInputImage(_audioCaptPrio, image); + _audioCaptureInactiveTimer->start(); + _hyperion->setInputImage(_audioCapturePriority, image); } -void CaptureCont::setSystemCaptureEnable(bool enable) +void CaptureCont::setScreenCaptureEnable(bool enable) { - if(_systemCaptEnabled != enable) + if(_screenCaptureEnabled != enable) { if(enable) { - _hyperion->registerInput(_systemCaptPrio, hyperion::COMP_GRABBER); - connect(GlobalSignals::getInstance(), &GlobalSignals::setSystemImage, this, &CaptureCont::handleSystemImage); + _hyperion->registerInput(_screenCapturePriority, hyperion::COMP_GRABBER); + connect(GlobalSignals::getInstance(), &GlobalSignals::setSystemImage, this, &CaptureCont::handleScreenImage); connect(GlobalSignals::getInstance(), &GlobalSignals::setSystemImage, _hyperion, &Hyperion::forwardSystemProtoMessage); } else { disconnect(GlobalSignals::getInstance(), &GlobalSignals::setSystemImage, this, nullptr); - _hyperion->clear(_systemCaptPrio); - _systemInactiveTimer->stop(); - _systemCaptName = ""; + _hyperion->clear(_screenCapturePriority); + _screenCaptureInactiveTimer->stop(); + _screenCaptureName = ""; } - _systemCaptEnabled = enable; + _screenCaptureEnabled = enable; _hyperion->setNewComponentState(hyperion::COMP_GRABBER, enable); emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_GRABBER, int(_hyperion->getInstanceIndex()), enable); } } -void CaptureCont::setV4LCaptureEnable(bool enable) +void CaptureCont::setVideoCaptureEnable(bool enable) { - if(_v4lCaptEnabled != enable) + if(_videoCaptureEnabled != enable) { if(enable) { - _hyperion->registerInput(_v4lCaptPrio, hyperion::COMP_V4L); - connect(GlobalSignals::getInstance(), &GlobalSignals::setV4lImage, this, &CaptureCont::handleV4lImage); + _hyperion->registerInput(_videoCapturePriority, hyperion::COMP_V4L); + connect(GlobalSignals::getInstance(), &GlobalSignals::setV4lImage, this, &CaptureCont::handleVideoImage); connect(GlobalSignals::getInstance(), &GlobalSignals::setV4lImage, _hyperion, &Hyperion::forwardV4lProtoMessage); } else { disconnect(GlobalSignals::getInstance(), &GlobalSignals::setV4lImage, this, nullptr); - _hyperion->clear(_v4lCaptPrio); - _v4lInactiveTimer->stop(); - _v4lCaptName = ""; + _hyperion->clear(_videoCapturePriority); + _videoInactiveTimer->stop(); + _videoCaptureName = ""; } - _v4lCaptEnabled = enable; + _videoCaptureEnabled = enable; _hyperion->setNewComponentState(hyperion::COMP_V4L, enable); emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_V4L, int(_hyperion->getInstanceIndex()), enable); } @@ -133,22 +141,22 @@ void CaptureCont::setV4LCaptureEnable(bool enable) void CaptureCont::setAudioCaptureEnable(bool enable) { - if (_audioCaptEnabled != enable) + if (_audioCaptureEnabled != enable) { if (enable) { - _hyperion->registerInput(_audioCaptPrio, hyperion::COMP_AUDIO); + _hyperion->registerInput(_audioCapturePriority, hyperion::COMP_AUDIO); connect(GlobalSignals::getInstance(), &GlobalSignals::setAudioImage, this, &CaptureCont::handleAudioImage); connect(GlobalSignals::getInstance(), &GlobalSignals::setAudioImage, _hyperion, &Hyperion::forwardAudioProtoMessage); } else { disconnect(GlobalSignals::getInstance(), &GlobalSignals::setAudioImage, this, nullptr); - _hyperion->clear(_audioCaptPrio); - _audioInactiveTimer->stop(); - _audioCaptName = ""; + _hyperion->clear(_audioCapturePriority); + _audioCaptureInactiveTimer->stop(); + _audioCaptureName = ""; } - _audioCaptEnabled = enable; + _audioCaptureEnabled = enable; _hyperion->setNewComponentState(hyperion::COMP_AUDIO, enable); emit GlobalSignals::getInstance()->requestSource(hyperion::COMP_AUDIO, int(_hyperion->getInstanceIndex()), enable); } @@ -160,26 +168,47 @@ void CaptureCont::handleSettingsUpdate(settings::type type, const QJsonDocument& { const QJsonObject& obj = config.object(); - if(_v4lCaptPrio != obj["v4lPriority"].toInt(240)) + int videoCapturePriority = obj["v4lPriority"].toInt(DEFAULT_VIDEO_CAPTURE_PRIORITY); + if(_videoCapturePriority != videoCapturePriority) + { + setVideoCaptureEnable(false); // clear prio + _videoCapturePriority = videoCapturePriority; + } + + std::chrono::milliseconds videoCaptureInactiveTimeout = static_cast(obj["videoInactiveTimeout"].toInt(DEFAULT_VIDEO_CAPTURE_INACTIVE_TIMEOUT.count()) * 1000); + if(_videoInactiveTimer->intervalAsDuration() != videoCaptureInactiveTimeout) { - setV4LCaptureEnable(false); // clear prio - _v4lCaptPrio = obj["v4lPriority"].toInt(240); + _videoInactiveTimer->setInterval(videoCaptureInactiveTimeout); } - if(_systemCaptPrio != obj["systemPriority"].toInt(250)) + int screenCapturePriority = obj["systemPriority"].toInt(DEFAULT_SCREEN_CAPTURE_PRIORITY); + if(_screenCapturePriority != screenCapturePriority) { - setSystemCaptureEnable(false); // clear prio - _systemCaptPrio = obj["systemPriority"].toInt(250); + setScreenCaptureEnable(false); // clear prio + _screenCapturePriority = screenCapturePriority; } - if (_audioCaptPrio != obj["audioPriority"].toInt(230)) + std::chrono::milliseconds screenCaptureInactiveTimeout = static_cast(obj["screenInactiveTimeout"].toInt(DEFAULT_SCREEN_CAPTURE_INACTIVE_TIMEOUT.count()) * 1000); + if(_screenCaptureInactiveTimer->intervalAsDuration() != screenCaptureInactiveTimeout) + { + _screenCaptureInactiveTimer->setInterval(screenCaptureInactiveTimeout); + } + + int autoCapturePriority = obj["audioPriority"].toInt(DEFAULT_AUDIO_CAPTURE_PRIORITY); + if (_audioCapturePriority != autoCapturePriority) { setAudioCaptureEnable(false); // clear prio - _audioCaptPrio = obj["audioPriority"].toInt(230); + _audioCapturePriority = autoCapturePriority; + } + + std::chrono::milliseconds audioCaptureInactiveTimeout = static_cast(obj["audioInactiveTimeout"].toInt(DEFAULT_AUDIO_CAPTURE_INACTIVE_TIMEOUT.count()) * 1000); + if(_audioCaptureInactiveTimer->intervalAsDuration() != audioCaptureInactiveTimeout) + { + _audioCaptureInactiveTimer->setInterval(audioCaptureInactiveTimeout); } - setV4LCaptureEnable(obj["v4lEnable"].toBool(false)); - setSystemCaptureEnable(obj["systemEnable"].toBool(false)); + setVideoCaptureEnable(obj["v4lEnable"].toBool(false)); + setScreenCaptureEnable(obj["systemEnable"].toBool(false)); setAudioCaptureEnable(obj["audioEnable"].toBool(true)); } } @@ -188,11 +217,11 @@ void CaptureCont::handleCompStateChangeRequest(hyperion::Components component, b { if(component == hyperion::COMP_GRABBER) { - setSystemCaptureEnable(enable); + setScreenCaptureEnable(enable); } else if(component == hyperion::COMP_V4L) { - setV4LCaptureEnable(enable); + setVideoCaptureEnable(enable); } else if (component == hyperion::COMP_AUDIO) { @@ -200,17 +229,17 @@ void CaptureCont::handleCompStateChangeRequest(hyperion::Components component, b } } -void CaptureCont::setV4lInactive() +void CaptureCont::onVideoIsInactive() { - _hyperion->setInputInactive(_v4lCaptPrio); + _hyperion->setInputInactive(_videoCapturePriority); } -void CaptureCont::setSystemInactive() +void CaptureCont::onScreenIsInactive() { - _hyperion->setInputInactive(_systemCaptPrio); + _hyperion->setInputInactive(_screenCapturePriority); } -void CaptureCont::setAudioInactive() +void CaptureCont::onAudioIsInactive() { - _hyperion->setInputInactive(_audioCaptPrio); + _hyperion->setInputInactive(_audioCapturePriority); } diff --git a/libsrc/hyperion/Hyperion.cpp b/libsrc/hyperion/Hyperion.cpp index 1e5131166..83273209b 100644 --- a/libsrc/hyperion/Hyperion.cpp +++ b/libsrc/hyperion/Hyperion.cpp @@ -484,7 +484,7 @@ bool Hyperion::setInputImage(int priority, const Image& image, int64_t return false; } -bool Hyperion::setInputInactive(quint8 priority) +bool Hyperion::setInputInactive(int priority) { return _muxer->setInputInactive(priority); } diff --git a/libsrc/hyperion/schema/schema-instCapture.json b/libsrc/hyperion/schema/schema-instCapture.json index c07fd550d..b225d951e 100644 --- a/libsrc/hyperion/schema/schema-instCapture.json +++ b/libsrc/hyperion/schema/schema-instCapture.json @@ -25,19 +25,29 @@ "default": 250, "propertyOrder": 3 }, + "screenInactiveTimeout": { + "type": "integer", + "title": "edt_conf_instCapture_timeout_title", + "append": "s", + "minimum": 1, + "maximum": 300, + "default": 5, + "access": "advanced", + "propertyOrder": 4 + }, "v4lEnable": { "type": "boolean", "required": true, "title": "edt_conf_instC_v4lEnable_title", "default": false, - "propertyOrder": 4 + "propertyOrder": 5 }, "v4lGrabberDevice": { "type": "string", "required": true, "title": "edt_conf_instC_video_grabber_device_title", "default": "NONE", - "propertyOrder": 5 + "propertyOrder": 6 }, "v4lPriority": { "type": "integer", @@ -46,21 +56,31 @@ "minimum": 100, "maximum": 253, "default": 240, - "propertyOrder": 6 + "propertyOrder": 7 + }, + "videoInactiveTimeout": { + "type": "integer", + "title": "edt_conf_instCapture_timeout_title", + "append": "s", + "minimum": 1, + "maximum": 300, + "default": 1, + "access": "advanced", + "propertyOrder": 8 }, "audioEnable": { "type": "boolean", "required": true, "title": "edt_conf_instC_audioEnable_title", "default": false, - "propertyOrder": 7 + "propertyOrder": 9 }, "audioGrabberDevice": { "type": "string", "required": true, "title": "edt_conf_instC_video_grabber_device_title", "default": "NONE", - "propertyOrder": 7 + "propertyOrder": 10 }, "audioPriority": { "type": "integer", @@ -69,7 +89,17 @@ "minimum": 100, "maximum": 253, "default": 230, - "propertyOrder": 9 + "propertyOrder": 11 + }, + "audioInactiveTimeout": { + "type": "integer", + "title": "edt_conf_instCapture_timeout_title", + "append": "s", + "minimum": 1, + "maximum": 300, + "default": 1, + "access": "advanced", + "propertyOrder": 12 } }, "additionalProperties" : false