QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
FlightDisplayViewVideoOutput.qml
Go to the documentation of this file.
1import QtQuick
2import QtMultimedia
3
4import QGroundControl
5
6VideoOutput {
7 objectName: "videoContent"
8
9 // Do NOT set `orientation` here — VideoOutput composes orientation on top of the
10 // QVideoFrame's own rotation()/mirrored() metadata that GstAppSinkAdapter forwards from
11 // GstVideoOrientationMeta. Setting it would double-rotate any stream with orientation tags.
12
13 // videoFit enum: 0=Fit Width, 1=Fit Height, 2=Fill, 3=No Crop. The container
14 // handles fit-width/fit-height sizing; only Fill needs the cropping fillMode.
15 fillMode: QGroundControl.settingsManager.videoSettings.videoFit.rawValue === 2
16 ? VideoOutput.PreserveAspectCrop
17 : VideoOutput.PreserveAspectFit
18
19 Connections {
20 target: QGroundControl.videoManager
21 function onImageFileChanged(filename) {
22 grabToImage(function(result) {
23 if (!result.saveToFile(filename)) {
24 console.error('Error capturing video frame');
25 }
26 });
27 }
28 }
29}