QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VideoSettings.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
5#include <QtCore/QStringList>
6#include <QtCore/QVariantList>
7#include <QtQmlIntegration/QtQmlIntegration>
8
9#include "SettingsGroup.h"
10
12{
13 Q_OBJECT
14 QML_ELEMENT
15 QML_UNCREATABLE("")
16
17 friend class VideoSettingsTest;
18
19public:
20 VideoSettings(QObject* parent = nullptr);
22
23 DEFINE_SETTINGFACT(videoSource)
24 DEFINE_SETTINGFACT(udpUrl)
25 DEFINE_SETTINGFACT(tcpUrl)
26 DEFINE_SETTINGFACT(rtspUrl)
27 DEFINE_SETTINGFACT(aspectRatio)
28 DEFINE_SETTINGFACT(videoFit)
29 DEFINE_SETTINGFACT(gridLines)
30 DEFINE_SETTINGFACT(showTelemetryOverlay)
31 DEFINE_SETTINGFACT(showRecControl)
32 DEFINE_SETTINGFACT(recordingFormat)
33 DEFINE_SETTINGFACT(maxVideoSize)
34 DEFINE_SETTINGFACT(enableStorageLimit)
36 DEFINE_SETTINGFACT(rtspTimeout)
37 DEFINE_SETTINGFACT(disableWhenDisarmed)
38 DEFINE_SETTINGFACT(lowLatencyMode)
39 DEFINE_SETTINGFACT(rtpJitterLatencyMs)
41 DEFINE_SETTINGFACT(rtspAutoReconnect)
42 DEFINE_SETTINGFACT(videoBackend)
43 DEFINE_SETTINGFACT(forceVideoDecoder)
44 DEFINE_SETTINGFACT(forceCpuVideoPath)
45 DEFINE_SETTINGFACT(videoConversionElement)
46 DEFINE_SETTINGFACT(disablePixelAspectRatio)
48 DEFINE_SETTINGFACT(maxVideoTiles)
50 DEFINE_SETTINGFACT(uvcTileCamera)
52 DEFINE_SETTINGFACT(uvcTileCameraAsMainPicture)
53 DEFINE_SETTINGFACT(uvcCameraFormat)
54 DEFINE_SETTINGFACT(uvcCameraRotation)
55 DEFINE_SETTINGFACT(uvcCameraMirror)
56 DEFINE_SETTINGFACT(uvcWhiteBalance)
57 DEFINE_SETTINGFACT(uvcZoom)
58 DEFINE_SETTINGFACT(uvcExposureCompensation)
59 DEFINE_SETTINGFACT(uvcFocusMode)
62 DEFINE_SETTINGFACT(uvcRecordingCodec)
63 DEFINE_SETTINGFACT(uvcRecordingQuality)
64
73 Q_ENUM(VideoFit)
74
75
81 Q_ENUM(VideoBackendChoice)
82
83 Q_PROPERTY(QString rtspVideoSource READ rtspVideoSource CONSTANT)
84 Q_PROPERTY(QString udp264VideoSource READ udp264VideoSource CONSTANT)
85 Q_PROPERTY(QString udp265VideoSource READ udp265VideoSource CONSTANT)
86 Q_PROPERTY(QString tcpVideoSource READ tcpVideoSource CONSTANT)
87 Q_PROPERTY(QString mpegtsVideoSource READ mpegtsVideoSource CONSTANT)
88 Q_PROPERTY(QString disabledVideoSource READ disabledVideoSource CONSTANT)
89
90 QString rtspVideoSource () { return videoSourceRTSP; }
93 QString tcpVideoSource () { return videoSourceTCP; }
94 QString mpegtsVideoSource () { return videoSourceMPEGTS; }
95 QString disabledVideoSource () { return videoDisabled; }
96
101
102 static constexpr const char* videoDisabled = QT_TRANSLATE_NOOP("VideoSettings", "Video Stream Disabled");
103 static constexpr const char* videoSourceRTSP = QT_TRANSLATE_NOOP("VideoSettings", "RTSP Video Stream");
104 static constexpr const char* videoSourceUDPH264 = QT_TRANSLATE_NOOP("VideoSettings", "UDP h.264 Video Stream");
105 static constexpr const char* videoSourceUDPH265 = QT_TRANSLATE_NOOP("VideoSettings", "UDP h.265 Video Stream");
106 static constexpr const char* videoSourceTCP = QT_TRANSLATE_NOOP("VideoSettings", "TCP-MPEG2 Video Stream");
107 static constexpr const char* videoSourceMPEGTS = QT_TRANSLATE_NOOP("VideoSettings", "MPEG-TS Video Stream");
108 // A Solo sends video only after a handshake, which APMFirmwarePlugin::initializeVehicle() makes as the vehicle
109 // connects: selected later, the source plays nothing until the next connection. The text is also the stored value.
110 static constexpr const char* videoSource3DRSolo = QT_TRANSLATE_NOOP("VideoSettings", "3DR Solo (requires restart)");
111 static constexpr const char* videoSourceParrotDiscovery = QT_TRANSLATE_NOOP("VideoSettings", "Parrot Discovery");
112 static constexpr const char* videoSourceYuneecMantisG = QT_TRANSLATE_NOOP("VideoSettings", "Yuneec Mantis G");
113 static constexpr const char* videoSourceHerelinkAirUnit = QT_TRANSLATE_NOOP("VideoSettings", "Herelink AirUnit");
114 static constexpr const char* videoSourceHerelinkHotspot = QT_TRANSLATE_NOOP("VideoSettings", "Herelink Hotspot");
115
116private:
117 void _setForceVideoDecodeList();
121 void _updateVideoSources();
124 void _offerCameras(FactMetaData* metaData, Fact* fact, QVariantList values, QStringList labels,
125 const QStringList& cameras);
126
128 std::function<QStringList()> _cameraNames;
129};
#define DEFINE_SETTING_NAME_GROUP()
#define DEFINE_SETTINGFACT(NAME)
Holds the meta data associated with a Fact.
A Fact is used to hold a single value within the system.
Definition Fact.h:15
SettingsGroup(const QString &name, const QString &settingsGroup, QObject *parent=nullptr)
QString rtspVideoSource()
static constexpr const char * videoSource3DRSolo
static constexpr const char * videoSourceParrotDiscovery
static constexpr const char * videoSourceTCP
QString mpegtsVideoSource()
QString tcpVideoSource()
friend class VideoSettingsTest
static constexpr const char * videoSourceUDPH264
static constexpr const char * videoSourceHerelinkHotspot
QString disabledVideoSource()
static constexpr const char * videoSourceRTSP
QString udp265VideoSource()
VideoBackendChoice
videoBackend's values (Video.SettingsGroup.json).
QString udp264VideoSource()
static constexpr const char * videoDisabled
VideoFit
For RTSP streams only: the others keep VideoReceiver::Config's timeout.
void pruneUnavailableDecoders()
static constexpr const char * videoSourceYuneecMantisG
static constexpr const char * videoSourceUDPH265
static constexpr const char * videoSourceMPEGTS
VideoSettings(QObject *parent=nullptr)
static constexpr const char * videoSourceHerelinkAirUnit