Commit 256fed26 authored by dheideman's avatar dheideman

Flight display: Fixed TypeErrors on startup without gstream installed

parent 317636e6
......@@ -25,11 +25,13 @@ Item {
id: root
property double _ar: QGroundControl.settingsManager.videoSettings.aspectRatio.rawValue
property bool _showGrid: QGroundControl.settingsManager.videoSettings.gridLines.rawValue > 0
property var _videoReceiver: QGroundControl.videoManager.videoReceiver
Rectangle {
id: noVideo
anchors.fill: parent
color: Qt.rgba(0,0,0,0.75)
visible: !QGroundControl.videoManager.videoReceiver.videoRunning
visible: !(_videoReceiver && _videoReceiver.videoRunning)
QGCLabel {
text: qsTr("WAITING FOR VIDEO")
font.family: ScreenTools.demiboldFontFamily
......@@ -41,20 +43,20 @@ Item {
Rectangle {
anchors.fill: parent
color: "black"
visible: QGroundControl.videoManager.videoReceiver.videoRunning
visible: _videoReceiver && _videoReceiver.videoRunning
QGCVideoBackground {
id: videoContent
height: parent.height
width: _ar != 0.0 ? height * _ar : parent.width
anchors.centerIn: parent
receiver: QGroundControl.videoManager.videoReceiver
display: QGroundControl.videoManager.videoReceiver.videoSurface
visible: QGroundControl.videoManager.videoReceiver.videoRunning
receiver: _videoReceiver
display: _videoReceiver && _videoReceiver.videoSurface
visible: _videoReceiver && _videoReceiver.videoRunning
Connections {
target: QGroundControl.videoManager.videoReceiver
target: _videoReceiver
onImageFileChanged: {
videoContent.grabToImage(function(result) {
if (!result.saveToFile(QGroundControl.videoManager.videoReceiver.imageFile)) {
if (!result.saveToFile(_videoReceiver.imageFile)) {
console.error('Error capturing video frame');
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment