Skip to content

Commit 0acba71

Browse files
authored
Support a configurable grabber inactive detection time interval (#1846)
1 parent 77e0a97 commit 0acba71

File tree

9 files changed

+192
-126
lines changed

9 files changed

+192
-126
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Support for ftdi chip based LED-devices with ws2812, sk6812 apa102 LED types (Many thanks to @nurikk) (#1746)
1818
- Support for Skydimo devices
1919
- Support gaps on Matrix Layout (#1696)
20+
- Support a configurable grabber inactive detection time interval (#1740)
2021
- 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.
2122

2223
- Support to import, export and backup Hyperion's full configuration via the UI, JSON-API and commandline (`--importConfig, --exportConfig`) (#804)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ endif()
510510

511511
# If Hyperion is deployed with all dependencies under Linux
512512
# it is necessary to deactivate the linker option dtag
513-
if(ENABLE_DEPLOY_DEPENDENCIES AND SYSTEM_MATCHES_LINUX)
513+
if(ENABLE_DEPLOY_DEPENDENCIES AND UNIX AND NOT APPLE)
514514
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
515515
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--disable-new-dtags")
516516
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--disable-new-dtags")

assets/webconfig/i18n/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,8 @@
502502
"edt_conf_instC_video_grabber_device_expl": "The video capture device used",
503503
"edt_conf_instC_video_grabber_device_title": "Video capture device",
504504
"edt_conf_instCapture_heading_title": "Capture Devices",
505+
"edt_conf_instCapture_timeout_expl": "If no data are received for the given period, the component will be cleared as an input source.",
506+
"edt_conf_instCapture_timeout_title": "Input timeout",
505507
"edt_conf_js_heading_title": "JSON Server",
506508
"edt_conf_log_heading_title": "Logging",
507509
"edt_conf_log_level_expl": "Depending on loglevel you see less or more messages in your log.",

assets/webconfig/js/content_instcapture.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ $(document).ready(function () {
6565
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemEnable", false);
6666
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemGrabberDevice", false);
6767
showInputOptionForItem(conf_editor_instCapt, "instCapture", "systemPriority", false);
68+
showInputOptionForItem(conf_editor_instCapt, "instCapture", "screenInactiveTimeout", false);
6869
}
6970

7071
if (videoGrabberAvailable) {
@@ -80,6 +81,7 @@ $(document).ready(function () {
8081
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lGrabberDevice", false);
8182
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lEnable", false);
8283
showInputOptionForItem(conf_editor_instCapt, "instCapture", "v4lPriority", false);
84+
showInputOptionForItem(conf_editor_instCapt, "instCapture", "videoInactiveTimeout", false);
8385
}
8486

8587
if (audioGrabberAvailable) {
@@ -95,6 +97,7 @@ $(document).ready(function () {
9597
showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioGrabberDevice", false);
9698
showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioEnable", false);
9799
showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioPriority", false);
100+
showInputOptionForItem(conf_editor_instCapt, "instCapture", "audioInactiveTimeout", false);
98101
}
99102

100103
});
@@ -122,11 +125,11 @@ $(document).ready(function () {
122125
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").setValue(window.serverConfig.framegrabber.available_devices);
123126
conf_editor_instCapt.getEditor("root.instCapture.systemGrabberDevice").disable();
124127
showInputOptions("instCapture", ["systemGrabberDevice"], true);
125-
showInputOptions("instCapture", ["systemPriority"], true);
128+
showInputOptions("instCapture", ["systemPriority", "screenInactiveTimeout"], true);
126129

127130
} else {
128131
showInputOptions("instCapture", ["systemGrabberDevice"], false);
129-
showInputOptions("instCapture", ["systemPriority"], false);
132+
showInputOptions("instCapture", ["systemPriority", "screenInactiveTimeout"], false);
130133
}
131134

132135
});
@@ -137,14 +140,14 @@ $(document).ready(function () {
137140
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").setValue(window.serverConfig.grabberV4L2.available_devices);
138141
conf_editor_instCapt.getEditor("root.instCapture.v4lGrabberDevice").disable();
139142
showInputOptions("instCapture", ["v4lGrabberDevice"], true);
140-
showInputOptions("instCapture", ["v4lPriority"], true);
143+
showInputOptions("instCapture", ["v4lPriority", "videoInactiveTimeout"], true);
141144
}
142145
else {
143146
if (!window.serverConfig.grabberV4L2.enable) {
144147
conf_editor_instCapt.getEditor("root.instCapture.v4lEnable").disable();
145148
}
146149
showInputOptions("instCapture", ["v4lGrabberDevice"], false);
147-
showInputOptions("instCapture", ["v4lPriority"], false);
150+
showInputOptions("instCapture", ["v4lPriority", "videoInactiveTimeout"], false);
148151
}
149152
});
150153

@@ -154,14 +157,14 @@ $(document).ready(function () {
154157
conf_editor_instCapt.getEditor("root.instCapture.audioGrabberDevice").setValue(window.serverConfig.grabberAudio.available_devices);
155158
conf_editor_instCapt.getEditor("root.instCapture.audioGrabberDevice").disable();
156159
showInputOptions("instCapture", ["audioGrabberDevice"], true);
157-
showInputOptions("instCapture", ["audioPriority"], true);
160+
showInputOptions("instCapture", ["audioPriority", "audioInactiveTimeout"], true);
158161
}
159162
else {
160163
if (!window.serverConfig.grabberAudio.enable) {
161164
conf_editor_instCapt.getEditor("root.instCapture.audioEnable").disable();
162165
}
163166
showInputOptions("instCapture", ["audioGrabberDevice"], false);
164-
showInputOptions("instCapture", ["audioPriority"], false);
167+
showInputOptions("instCapture", ["audioPriority", "audioInactiveTimeout"], false);
165168
}
166169
});
167170

include/hyperion/CaptureCont.h

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ class CaptureCont : public QObject
1818
public:
1919
CaptureCont(Hyperion* hyperion);
2020

21-
void setSystemCaptureEnable(bool enable);
22-
void setV4LCaptureEnable(bool enable);
21+
void setScreenCaptureEnable(bool enable);
22+
void setVideoCaptureEnable(bool enable);
2323
void setAudioCaptureEnable(bool enable);
2424

2525
private slots:
2626
///
27-
/// @brief Handle component state change of V4L and SystemCapture
27+
/// @brief Handle component state change of Video- (V4L/MF) and Screen capture
2828
/// @param component The component from enum
2929
/// @param enable The new state
3030
///
@@ -38,16 +38,16 @@ private slots:
3838
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
3939

4040
///
41-
/// @brief forward system image
41+
/// @brief forward screen image
4242
/// @param image The image
4343
///
44-
void handleSystemImage(const QString& name, const Image<ColorRgb>& image);
44+
void handleScreenImage(const QString& name, const Image<ColorRgb>& image);
4545

4646
///
47-
/// @brief forward v4l image
47+
/// @brief forward video (v4l, MF) image
4848
/// @param image The image
4949
///
50-
void handleV4lImage(const QString& name, const Image<ColorRgb> & image);
50+
void handleVideoImage(const QString& name, const Image<ColorRgb> & image);
5151

5252
///
5353
/// @brief forward audio image
@@ -56,39 +56,40 @@ private slots:
5656
void handleAudioImage(const QString& name, const Image<ColorRgb>& image);
5757

5858
///
59-
/// @brief Is called from _v4lInactiveTimer to set source after specific time to inactive
59+
/// @brief Sets the video source to inactive
6060
///
61-
void setV4lInactive();
61+
void onVideoIsInactive();
6262

6363
///
64-
/// @brief Is called from _audioInactiveTimer to set source after specific time to inactive
64+
/// @brief Sets the screen source to inactive
6565
///
66-
void setAudioInactive();
66+
void onScreenIsInactive();
6767

6868
///
69-
/// @brief Is called from _systemInactiveTimer to set source after specific time to inactive
69+
/// @brief Sets the audio source to inactive
7070
///
71-
void setSystemInactive();
71+
void onAudioIsInactive();
72+
7273

7374
private:
7475
/// Hyperion instance
7576
Hyperion* _hyperion;
7677

77-
/// Reflect state of System capture and prio
78-
bool _systemCaptEnabled;
79-
quint8 _systemCaptPrio;
80-
QString _systemCaptName;
81-
QTimer* _systemInactiveTimer;
78+
/// Reflect state of screen capture and prio
79+
bool _screenCaptureEnabled;
80+
int _screenCapturePriority;
81+
QString _screenCaptureName;
82+
QTimer* _screenCaptureInactiveTimer;
8283

83-
/// Reflect state of v4l capture and prio
84-
bool _v4lCaptEnabled;
85-
quint8 _v4lCaptPrio;
86-
QString _v4lCaptName;
87-
QTimer* _v4lInactiveTimer;
84+
/// Reflect state of video capture and prio
85+
bool _videoCaptureEnabled;
86+
int _videoCapturePriority;
87+
QString _videoCaptureName;
88+
QTimer* _videoInactiveTimer;
8889

8990
/// Reflect state of audio capture and prio
90-
bool _audioCaptEnabled;
91-
quint8 _audioCaptPrio;
92-
QString _audioCaptName;
93-
QTimer* _audioInactiveTimer;
91+
bool _audioCaptureEnabled;
92+
int _audioCapturePriority;
93+
QString _audioCaptureName;
94+
QTimer* _audioCaptureInactiveTimer;
9495
};

include/hyperion/Hyperion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public slots:
174174
/// @param priority The priority
175175
/// @return True on success false if not found
176176
///
177-
bool setInputInactive(quint8 priority);
177+
bool setInputInactive(int priority);
178178

179179
///
180180
/// Returns the list with unique adjustment identifiers

0 commit comments

Comments
 (0)