|
|
|
@ -72,53 +72,67 @@ Item {
@@ -72,53 +72,67 @@ Item {
|
|
|
|
|
//-- Fit Width |
|
|
|
|
return _ar != 0.0 ? parent.width * (1 / _ar) : parent.height |
|
|
|
|
} |
|
|
|
|
QGCVideoBackground { |
|
|
|
|
id: videoContent |
|
|
|
|
height: parent.getHeight() |
|
|
|
|
width: parent.getWidth() |
|
|
|
|
anchors.centerIn: parent |
|
|
|
|
receiver: _videoReceiver |
|
|
|
|
display: _videoReceiver && _videoReceiver.videoSurface |
|
|
|
|
visible: _videoReceiver && _videoReceiver.videoRunning |
|
|
|
|
Connections { |
|
|
|
|
target: _videoReceiver |
|
|
|
|
onImageFileChanged: { |
|
|
|
|
videoContent.grabToImage(function(result) { |
|
|
|
|
if (!result.saveToFile(_videoReceiver.imageFile)) { |
|
|
|
|
console.error('Error capturing video frame'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
Component { |
|
|
|
|
id: videoBackgroundComponent |
|
|
|
|
QGCVideoBackground { |
|
|
|
|
id: videoContent |
|
|
|
|
receiver: _videoReceiver |
|
|
|
|
display: _videoReceiver && _videoReceiver.videoSurface |
|
|
|
|
|
|
|
|
|
Connections { |
|
|
|
|
target: _videoReceiver |
|
|
|
|
onImageFileChanged: { |
|
|
|
|
videoContent.grabToImage(function(result) { |
|
|
|
|
if (!result.saveToFile(_videoReceiver.imageFile)) { |
|
|
|
|
console.error('Error capturing video frame'); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
height: parent.height |
|
|
|
|
width: 1 |
|
|
|
|
x: parent.width * 0.33 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
height: parent.height |
|
|
|
|
width: 1 |
|
|
|
|
x: parent.width * 0.66 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
width: parent.width |
|
|
|
|
height: 1 |
|
|
|
|
y: parent.height * 0.33 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
width: parent.width |
|
|
|
|
height: 1 |
|
|
|
|
y: parent.height * 0.66 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
height: parent.height |
|
|
|
|
width: 1 |
|
|
|
|
x: parent.width * 0.33 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
height: parent.height |
|
|
|
|
width: 1 |
|
|
|
|
x: parent.width * 0.66 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
width: parent.width |
|
|
|
|
height: 1 |
|
|
|
|
y: parent.height * 0.33 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
Rectangle { |
|
|
|
|
color: Qt.rgba(1,1,1,0.5) |
|
|
|
|
width: parent.width |
|
|
|
|
height: 1 |
|
|
|
|
y: parent.height * 0.66 |
|
|
|
|
visible: _showGrid && !QGroundControl.videoManager.fullScreen |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Loader { |
|
|
|
|
// GStreamer is causing crashes on Lenovo laptop OpenGL Intel drivers. In order to workaround this |
|
|
|
|
// we don't load a QGCVideoBackground object when video is disabled. This prevents any video rendering |
|
|
|
|
// code from running. Setting QGCVideoBackground.receiver/display = null does not work to prevent any |
|
|
|
|
// video OpenGL from being generated. Hence the Loader to completely remove it. |
|
|
|
|
height: parent.getHeight() |
|
|
|
|
width: parent.getWidth() |
|
|
|
|
anchors.centerIn: parent |
|
|
|
|
visible: _videoReceiver && _videoReceiver.videoRunning |
|
|
|
|
sourceComponent: videoDisabled ? null : videoBackgroundComponent |
|
|
|
|
|
|
|
|
|
property bool videoDisabled: QGroundControl.settingsManager.videoSettings.videoSource.rawValue === QGroundControl.settingsManager.videoSettings.disabledVideoSource |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MouseArea { |
|
|
|
|
anchors.fill: parent |
|
|
|
|
onDoubleClicked: { |
|
|
|
|