4#include <QtCore/QVariantList>
6#ifdef QGC_GST_STREAMING
16 QVariantList videoSourceList;
17#if defined(QGC_GST_STREAMING) || defined(QGC_QT_STREAMING)
18 videoSourceList.append(videoSourceRTSP);
19 videoSourceList.append(videoSourceUDPH264);
20 videoSourceList.append(videoSourceUDPH265);
21 videoSourceList.append(videoSourceTCP);
22 videoSourceList.append(videoSourceMPEGTS);
23 videoSourceList.append(videoSource3DRSolo);
24 videoSourceList.append(videoSourceParrotDiscovery);
25 videoSourceList.append(videoSourceYuneecMantisG);
27 #ifdef QGC_HERELINK_AIRUNIT_VIDEO
28 videoSourceList.append(videoSourceHerelinkAirUnit);
30 videoSourceList.append(videoSourceHerelinkHotspot);
33#ifndef QGC_DISABLE_UVC
35 for (
const QString& device : uvcDevices) {
36 videoSourceList.append(device);
39 if (videoSourceList.count() == 0) {
41 videoSourceList.append(videoSourceNoVideo);
44 videoSourceList.insert(0, videoDisabled);
48 QStringList videoSourceCookedList;
49 for (
const QVariant& videoSource: videoSourceList) {
50 videoSourceCookedList.append( VideoSettings::tr(videoSource.toString().toStdString().c_str()) );
53 _nameToMetaDataMap[videoSourceName]->setEnumInfo(videoSourceCookedList, videoSourceList);
55 _setForceVideoDecodeList();
61void VideoSettings::_setDefaults()
82 if (!_videoSourceFact) {
83 _videoSourceFact = _createSettingsFact(videoSourceName);
85 if(!_videoSourceFact->enumValues().contains(_videoSourceFact->rawValue().toString())) {
87 _videoSourceFact->setRawValue(videoSourceNoVideo);
89 _videoSourceFact->setRawValue(videoDisabled);
94 return _videoSourceFact;
99 if (!_forceVideoDecoderFact) {
100 _forceVideoDecoderFact = _createSettingsFact(forceVideoDecoderName);
102 _forceVideoDecoderFact->setVisible(
103#ifdef QGC_GST_STREAMING
110 connect(_forceVideoDecoderFact, &
Fact::valueChanged,
this, &VideoSettings::_configChanged);
112 return _forceVideoDecoderFact;
117 if (!_lowLatencyModeFact) {
118 _lowLatencyModeFact = _createSettingsFact(lowLatencyModeName);
120 _lowLatencyModeFact->setVisible(
121#ifdef QGC_GST_STREAMING
128 connect(_lowLatencyModeFact, &
Fact::valueChanged,
this, &VideoSettings::_configChanged);
130 return _lowLatencyModeFact;
135 if (!_rtspTimeoutFact) {
136 _rtspTimeoutFact = _createSettingsFact(rtspTimeoutName);
138 _rtspTimeoutFact->setVisible(
139#ifdef QGC_GST_STREAMING
148 return _rtspTimeoutFact;
154 _udpUrlFact = _createSettingsFact(udpUrlName);
163 _rtspUrlFact = _createSettingsFact(rtspUrlName);
172 _tcpUrlFact = _createSettingsFact(tcpUrlName);
178bool VideoSettings::streamConfigured(
void)
181 if(VideoManager::instance()->autoStreamConfigured()) {
182 qCDebug(VideoManagerLog) <<
"Stream auto configured";
186 QString vSource =
videoSource()->rawValue().toString();
192 qCDebug(VideoManagerLog) <<
"Testing configuration for UDP Stream:" <<
udpUrl()->rawValue().toString();
193 return !
udpUrl()->rawValue().toString().isEmpty();
197 qCDebug(VideoManagerLog) <<
"Testing configuration for RTSP Stream:" <<
rtspUrl()->rawValue().toString();
198 return !
rtspUrl()->rawValue().toString().isEmpty();
202 qCDebug(VideoManagerLog) <<
"Testing configuration for TCP Stream:" <<
tcpUrl()->rawValue().toString();
203 return !
tcpUrl()->rawValue().toString().isEmpty();
207 qCDebug(VideoManagerLog) <<
"Testing configuration for MPEG-TS Stream:" <<
udpUrl()->rawValue().toString();
208 return !
udpUrl()->rawValue().toString().isEmpty();
212 qCDebug(VideoManagerLog) <<
"Stream configured for Herelink Air Unit";
217 qCDebug(VideoManagerLog) <<
"Stream configured for Herelink Hotspot";
220#ifndef QGC_DISABLE_UVC
222 qCDebug(VideoManagerLog) <<
"Stream configured for UVC";
229void VideoSettings::_configChanged(QVariant)
234void VideoSettings::_setForceVideoDecodeList()
236#ifdef QGC_GST_STREAMING
237 static const QList<GStreamer::VideoDecoderOptions> removeForceVideoDecodeList{
238#if defined(Q_OS_ANDROID)
244#elif defined(Q_OS_LINUX)
247#elif defined(Q_OS_WIN)
250#elif defined(Q_OS_MACOS)
253#elif defined(Q_OS_IOS)
261 for (
const auto &value : removeForceVideoDecodeList) {
#define DECLARE_SETTINGSFACT_NO_FUNC(CLASS, NAME)
#define DECLARE_SETTINGSFACT(CLASS, NAME)
#define DECLARE_SETTINGGROUP(NAME, GROUP)
void valueChanged(const QVariant &value)
This signal is only meant for use by the QT property system. It should not be connected to by client ...
QMap< QString, FactMetaData * > _nameToMetaDataMap
static bool deviceExists(const QString &device)
static QStringList getDeviceNameList()
Fact *rtspUrl READ rtspUrl CONSTANT Fact * rtspUrl()
static constexpr const char * videoSourceTCP
static const char * videoSourceName
static constexpr const char * videoSourceUDPH264
static constexpr const char * videoSourceHerelinkHotspot
bool streamConfigured READ streamConfigured NOTIFY streamConfiguredChanged(QString rtspVideoSource READ rtspVideoSource CONSTANT) 1(QString udp264VideoSource READ udp264VideoSource CONSTANT) 1(QString udp265VideoSource READ udp265VideoSource CONSTANT) 1(QString tcpVideoSource READ tcpVideoSource CONSTANT) 1(QString mpegtsVideoSource READ mpegtsVideoSource CONSTANT) 1(QString disabledVideoSource READ disabledVideoSource CONSTANT) bool streamConfigured()
static constexpr const char * videoSourceRTSP
static const char * forceVideoDecoderName
static constexpr const char * videoDisabled
Fact *udpUrl READ udpUrl CONSTANT Fact * udpUrl()
Fact *tcpUrl READ tcpUrl CONSTANT Fact * tcpUrl()
Fact *videoSource READ videoSource CONSTANT Fact * videoSource()
static constexpr const char * videoSourceUDPH265
static constexpr const char * videoSourceNoVideo
static constexpr const char * videoSourceMPEGTS
static constexpr const char * videoSourceHerelinkAirUnit
@ ForceVideoDecoderVulkan
@ ForceVideoDecoderNVIDIA
@ ForceVideoDecoderVideoToolbox
@ ForceVideoDecoderDirectX3D