Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/AppSettings/pages/Video.SettingsUI.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@
},
{
"setting": "videoSettings.disableWhenDisarmed",
"showWhen": "!autoStreamConfig && isStreamSource"
"showWhen": "isStreamSource"
},
{
"setting": "videoSettings.lowLatencyMode",
"showWhen": "!autoStreamConfig && isStreamSource && QGroundControl.settingsManager.videoSettings.lowLatencyMode.userVisible"
"showWhen": "isStreamSource"
},
{
"setting": "videoSettings.rtpJitterLatencyMs",
"showWhen": "!autoStreamConfig && isStreamSource && rtpLatencyVisible && QGroundControl.settingsManager.videoSettings.rtpJitterLatencyMs.userVisible"
"showWhen": "isStreamSource && rtpLatencyVisible"
},
{
"setting": "videoSettings.rtspAutoReconnect",
"showWhen": "!autoStreamConfig && isStreamSource"
"showWhen": "isStreamSource"
},
{
"setting": "videoSettings.forceCpuVideoPath",
Expand Down
45 changes: 45 additions & 0 deletions test/QmlUITests/TopLevelViewsTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,48 @@ void TopLevelViewsTest::_testSettingsSearchExcludesHiddenSections()
searchField->setProperty("text", QString());
QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsButton_Video"), 0));
}

void TopLevelViewsTest::_testDiscoveredCameraReceiverSettingsVisible()
{
#ifndef QGC_GST_STREAMING
QSKIP("GStreamer receiver settings are unavailable in this build");
#else
const auto restoreVideoSource = setVideoSourceWithRestore(VideoSettings::videoSourceRTSP);

Fact* const lowLatencyMode = SettingsManager::instance()->videoSettings()->lowLatencyMode();
const QVariant savedLowLatencyMode = lowLatencyMode->rawValue();
const auto restoreLowLatencyMode =
qScopeGuard([lowLatencyMode, savedLowLatencyMode] { lowLatencyMode->setRawValue(savedLowLatencyMode); });
lowLatencyMode->setRawValue(false);

startUI();
if (QTest::currentTestFailed())
return;

QVERIFY(clickToolSelectDropdownButton(QStringLiteral("toolbar_viewSettings")));
if (!_clickSettingsButton(QStringLiteral("Video"))) {
return;
}

QQuickItem* const videoPage = findVisibleItem(_rootItem, QStringLiteral("settingsPage_Video"));
QVERIFY(videoPage);
QVERIFY(videoPage->property("isStreamSource").toBool());

// autoStreamConfig mirrors the read-only VideoManager property. Override the
// page binding to isolate these UI visibility rules from camera transport.
QVERIFY(videoPage->setProperty("autoStreamConfig", true));

QQuickItem* const sourceGroup = findVisibleItem(_rootItem, QStringLiteral("settingsGroup_VideoSource"));
QVERIFY(sourceGroup);
QTRY_VERIFY(!sourceGroup->isEnabled());
QTRY_VERIFY(!findVisibleItem(_rootItem, QStringLiteral("settingsGroup_Connection"), 0));
QTRY_VERIFY(!findVisibleItem(_rootItem, QStringLiteral("settingsTextField_aspectRatio"), 0));

QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsCheckBox_disableWhenDisarmed"), 0));
QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsCheckBox_lowLatencyMode"), 0));
QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsTextField_rtpJitterLatencyMs"), 0));
QTRY_VERIFY(findVisibleItem(_rootItem, QStringLiteral("settingsCheckBox_rtspAutoReconnect"), 0));

stopUI();
#endif
}
1 change: 1 addition & 0 deletions test/QmlUITests/TopLevelViewsTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ private slots:
void _testSettingsSectionCollapseToSingle();
void _testSettingsPageUnavailableFallback();
void _testSettingsSearchExcludesHiddenSections();
void _testDiscoveredCameraReceiverSettingsVisible();

private:
QQuickItem* _clickSettingsButton(const QString& pageName);
Expand Down
Loading