1pragma ComponentBehavior: Bound
7import QGroundControl.Controls
8import QGroundControl.VideoManager
10// Frame rate and bitrate of the measured video source (its resolution where the receiver can't count the bitrate, as
11// for the USB camera), orange while a source degrades. The drawer shows each source's statistics, and expands to the
12// video settings that change a running stream.
16 property bool showIndicator: _stats.valid
17 /// The manager whose sources the indicator reports.
18 property VideoManager videoManager: QGroundControl.videoManager
20 readonly property VideoStreamController _measuredSource: root.videoManager.measuredSource
21 readonly property videoStreamStats _stats: _measuredSource.stats
23 objectName: "toolbar_videoStreamIndicator"
24 width: indicatorRow.width
25 anchors.top: parent.top
26 anchors.bottom: parent.bottom
28 QGCPalette { id: qgcPal }
32 anchors.top: parent.top
33 anchors.bottom: parent.bottom
34 spacing: ScreenTools.defaultFontPixelWidth / 2
38 anchors.top: parent.top
39 anchors.bottom: parent.bottom
40 objectName: "videoStreamIcon"
41 source: "/InstrumentValueIcons/video-camera.svg"
42 fillMode: Image.PreserveAspectFit
43 sourceSize.height: height
44 color: root.videoManager.degraded ? qgcPal.colorOrange : qgcPal.textPrimary
48 anchors.verticalCenter: parent.verticalCenter
52 text: qsTr("%1 fps").arg(root._stats.fps.toFixed(0))
56 text: root._stats.bitrateKbps >= 0 ? VideoStreamFormat.bitrateText(root._stats.bitrateKbps)
57 : qsTr("%1p").arg(root._measuredSource.videoSize.height)
64 onClicked: mainWindow.showIndicatorDrawer(videoStreamPage, root)
73 contentComponent: Component {
75 videoManager: root.videoManager
79 expandedComponent: Component {
81 spacing: ScreenTools.defaultFontPixelHeight / 4
83 VideoStreamSettingsGroup { }
85 VideoDecodingSettingsGroup { }
87 VideoDisplaySettingsGroup { }
90 spacing: ScreenTools.defaultFontPixelWidth
93 text: qsTr("Restart Video")
94 visible: !root.videoManager.isUvc
95 onClicked: root.videoManager.startVideo()
99 text: qsTr("All Video Settings")
101 if (mainWindow.allowViewSwitch()) {
102 mainWindow.closeIndicatorDrawer()
103 mainWindow.showSettingsTool("Video")