6import QGroundControl.FactControls
7import QGroundControl.Controls
10 property var _settingsManager: QGroundControl.settingsManager
11 property var _videoManager: QGroundControl.videoManager
12 property var _videoSettings: _settingsManager.videoSettings
13 property string _videoSource: _videoSettings.videoSource.rawValue
14 property bool _isGST: _videoManager.gstreamerEnabled
15 property bool _isStreamSource: _videoManager.isStreamSource
16 property bool _isUDP264: _isStreamSource && (_videoSource === _videoSettings.udp264VideoSource)
17 property bool _isUDP265: _isStreamSource && (_videoSource === _videoSettings.udp265VideoSource)
18 property bool _isRTSP: _isStreamSource && (_videoSource === _videoSettings.rtspVideoSource)
19 property bool _isTCP: _isStreamSource && (_videoSource === _videoSettings.tcpVideoSource)
20 property bool _isMPEGTS: _isStreamSource && (_videoSource === _videoSettings.mpegtsVideoSource)
21 property bool _videoAutoStreamConfig: _videoManager.autoStreamConfigured
22 property bool _videoSourceDisabled: _videoSource === _videoSettings.disabledVideoSource
23 property real _urlFieldWidth: ScreenTools.defaultFontPixelWidth * 40
24 property bool _requiresUDPUrl: _isUDP264 || _isUDP265 || _isMPEGTS
27 Layout.fillWidth: true
28 heading: qsTr("Video Source")
29 headingDescription: _videoAutoStreamConfig ? qsTr("Mavlink camera stream is automatically configured") : ""
30 enabled: !_videoAutoStreamConfig
32 LabelledFactComboBox {
33 Layout.fillWidth: true
36 fact: _videoSettings.videoSource
42 Layout.fillWidth: true
43 heading: qsTr("Connection")
44 visible: !_videoSourceDisabled && !_videoAutoStreamConfig && (_isTCP || _isRTSP | _requiresUDPUrl)
46 LabelledFactTextField {
47 Layout.fillWidth: true
48 textFieldPreferredWidth: _urlFieldWidth
49 label: qsTr("RTSP URL")
50 fact: _videoSettings.rtspUrl
51 visible: _isRTSP && _videoSettings.rtspUrl.visible
54 LabelledFactTextField {
55 Layout.fillWidth: true
56 label: qsTr("TCP URL")
57 textFieldPreferredWidth: _urlFieldWidth
58 fact: _videoSettings.tcpUrl
59 visible: _isTCP && _videoSettings.tcpUrl.visible
62 LabelledFactTextField {
63 Layout.fillWidth: true
64 textFieldPreferredWidth: _urlFieldWidth
65 label: qsTr("UDP URL")
66 fact: _videoSettings.udpUrl
67 visible: _requiresUDPUrl && _videoSettings.udpUrl.visible
72 Layout.fillWidth: true
73 heading: qsTr("Settings")
74 visible: !_videoSourceDisabled
76 LabelledFactTextField {
77 Layout.fillWidth: true
78 label: qsTr("Aspect Ratio")
79 fact: _videoSettings.aspectRatio
80 visible: !_videoAutoStreamConfig && _isStreamSource && _videoSettings.aspectRatio.visible
84 Layout.fillWidth: true
85 text: qsTr("Stop recording when disarmed")
86 fact: _videoSettings.disableWhenDisarmed
87 visible: !_videoAutoStreamConfig && _isStreamSource && fact.visible
91 Layout.fillWidth: true
92 text: qsTr("Low Latency Mode")
93 fact: _videoSettings.lowLatencyMode
94 visible: !_videoAutoStreamConfig && _isStreamSource && fact.visible && _isGST
97 LabelledFactComboBox {
98 Layout.fillWidth: true
99 label: fact.shortDescription
100 fact: _videoSettings.forceVideoDecoder
101 visible: fact.visible
106 SettingsGroupLayout {
107 Layout.fillWidth: true
108 heading: qsTr("Local Video Storage")
110 LabelledFactComboBox {
111 Layout.fillWidth: true
112 label: qsTr("Record File Format")
113 fact: _videoSettings.recordingFormat
114 visible: _videoSettings.recordingFormat.visible
118 Layout.fillWidth: true
119 text: qsTr("Auto-Delete Saved Recordings")
120 fact: _videoSettings.enableStorageLimit
121 visible: fact.visible
124 LabelledFactTextField {
125 Layout.fillWidth: true
126 label: qsTr("Max Storage Usage")
127 fact: _videoSettings.maxVideoSize
128 visible: fact.visible
129 enabled: _videoSettings.enableStorageLimit.rawValue