Commit ca035a53 authored by Matej Frančeškin's avatar Matej Frančeškin

Merge branch 'master' into pr-taisync-android

parents cd4b4991 cfbc6f64
...@@ -82,11 +82,9 @@ install: ...@@ -82,11 +82,9 @@ install:
fi fi
# android dependencies: qt, gstreamer, android-ndk # android dependencies: qt, gstreamer, android-ndk
# gstreamer support temporarily disable until we figure the crash/build problems
#wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/gstreamer-1.0-android-armv7-1.5.2.tar.bz2 &&
#mkdir -p ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 &&
#tar jxf gstreamer-1.0-android-armv7-1.5.2.tar.bz2 -C ${TRAVIS_BUILD_DIR}/gstreamer-1.0-android-armv7-1.5.2 &&
- if [ "${SPEC}" = "android-g++" ]; then - if [ "${SPEC}" = "android-g++" ]; then
wget --quiet http://www.grubba.com/gstreamer-1.0-android-universal-1.14.4.tar.bz2 &&
tar jxf gstreamer-1.0-android-universal-1.14.4.tar.bz2 -C ${TRAVIS_BUILD_DIR} &&
wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.11.0-android_armv7-min.tar.bz2 && wget --quiet https://s3-us-west-2.amazonaws.com/qgroundcontrol/dependencies/Qt5.11.0-android_armv7-min.tar.bz2 &&
tar jxf Qt5.11.0-android_armv7-min.tar.bz2 -C /tmp && tar jxf Qt5.11.0-android_armv7-min.tar.bz2 -C /tmp &&
wget --quiet https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip && wget --quiet https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip &&
......
...@@ -17,6 +17,7 @@ Note: This file only contains high level features or important fixes. ...@@ -17,6 +17,7 @@ Note: This file only contains high level features or important fixes.
* Support loading polygons from SHP files * Support loading polygons from SHP files
* Bumped settings version (now 8). This will cause all settings to be reset to defaults. * Bumped settings version (now 8). This will cause all settings to be reset to defaults.
* Orbit visuals support changing rotation direction * Orbit visuals support changing rotation direction
* Added support for the Taisync 2.4GHz ViUlinx digital HD wireless link.
## 3.4 ## 3.4
......
...@@ -31,7 +31,7 @@ linux { ...@@ -31,7 +31,7 @@ linux {
CONFIG += LinuxBuild CONFIG += LinuxBuild
DEFINES += __STDC_LIMIT_MACROS __rasp_pi2__ DEFINES += __STDC_LIMIT_MACROS __rasp_pi2__
DEFINES += QGC_GST_TAISYNC_ENABLED DEFINES += QGC_GST_TAISYNC_ENABLED
} else : android-g++ { } else : android-g++ | android-clang {
CONFIG += AndroidBuild MobileBuild CONFIG += AndroidBuild MobileBuild
DEFINES += __android__ DEFINES += __android__
DEFINES += __STDC_LIMIT_MACROS DEFINES += __STDC_LIMIT_MACROS
......
...@@ -733,11 +733,13 @@ FactValueSliderListModel* Fact::valueSliderModel(void) ...@@ -733,11 +733,13 @@ FactValueSliderListModel* Fact::valueSliderModel(void)
void Fact::_checkForRebootMessaging(void) void Fact::_checkForRebootMessaging(void)
{ {
if (!qgcApp()->runningUnitTests()) { if(qgcApp()) {
if (vehicleRebootRequired()) { if (!qgcApp()->runningUnitTests()) {
qgcApp()->showMessage(tr("Change of parameter %1 requires a Vehicle reboot to take effect.").arg(name())); if (vehicleRebootRequired()) {
} else if (qgcRebootRequired()) { qgcApp()->showMessage(tr("Change of parameter %1 requires a Vehicle reboot to take effect.").arg(name()));
qgcApp()->showMessage(tr("Change of '%1' value requires restart of %2 to take effect.").arg(shortDescription()).arg(qgcApp()->applicationName())); } else if (qgcRebootRequired()) {
qgcApp()->showMessage(tr("Change of '%1' value requires restart of %2 to take effect.").arg(shortDescription()).arg(qgcApp()->applicationName()));
}
} }
} }
} }
...@@ -17,9 +17,9 @@ class SettingsFact : public Fact ...@@ -17,9 +17,9 @@ class SettingsFact : public Fact
Q_OBJECT Q_OBJECT
public: public:
SettingsFact(QObject* parent = NULL); SettingsFact(QObject* parent = nullptr);
SettingsFact(QString settingsGroup, FactMetaData* metaData, QObject* parent = NULL); SettingsFact(QString settingsGroup, FactMetaData* metaData, QObject* parent = nullptr);
SettingsFact(const SettingsFact& other, QObject* parent = NULL); SettingsFact(const SettingsFact& other, QObject* parent = nullptr);
const SettingsFact& operator=(const SettingsFact& other); const SettingsFact& operator=(const SettingsFact& other);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "TaisyncHandler.h" #include "TaisyncHandler.h"
#include "SettingsManager.h" #include "SettingsManager.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "QGCCorePlugin.h"
#include "VideoManager.h" #include "VideoManager.h"
#include <QSettings> #include <QSettings>
...@@ -88,10 +89,6 @@ TaisyncManager::_reset() ...@@ -88,10 +89,6 @@ TaisyncManager::_reset()
emit connectedChanged(); emit connectedChanged();
_linkConnected = false; _linkConnected = false;
emit linkConnectedChanged(); emit linkConnectedChanged();
_taiSettings = new TaisyncSettings(this);
connect(_taiSettings, &TaisyncSettings::updateSettings, this, &TaisyncManager::_updateSettings);
connect(_taiSettings, &TaisyncSettings::connected, this, &TaisyncManager::_connected);
connect(_taiSettings, &TaisyncSettings::disconnected, this, &TaisyncManager::_disconnected);
if(!_appSettings) { if(!_appSettings) {
_appSettings = _toolbox->settingsManager()->appSettings(); _appSettings = _toolbox->settingsManager()->appSettings();
connect(_appSettings->enableTaisync(), &Fact::rawValueChanged, this, &TaisyncManager::_setEnabled); connect(_appSettings->enableTaisync(), &Fact::rawValueChanged, this, &TaisyncManager::_setEnabled);
...@@ -183,6 +180,7 @@ TaisyncManager::setToolbox(QGCToolbox* toolbox) ...@@ -183,6 +180,7 @@ TaisyncManager::setToolbox(QGCToolbox* toolbox)
_videoRateList.append("high"); _videoRateList.append("high");
connect(_videoRate, &Fact::_containerRawValueChanged, this, &TaisyncManager::_videoSettingsChanged); connect(_videoRate, &Fact::_containerRawValueChanged, this, &TaisyncManager::_videoSettingsChanged);
} }
//-- Start it all
_reset(); _reset();
} }
...@@ -190,7 +188,7 @@ TaisyncManager::setToolbox(QGCToolbox* toolbox) ...@@ -190,7 +188,7 @@ TaisyncManager::setToolbox(QGCToolbox* toolbox)
bool bool
TaisyncManager::setRTSPSettings(QString uri, QString account, QString password) TaisyncManager::setRTSPSettings(QString uri, QString account, QString password)
{ {
if(_taiSettings) { if(_taiSettings && _isConnected) {
if(_taiSettings->setRTSPSettings(uri, account, password)) { if(_taiSettings->setRTSPSettings(uri, account, password)) {
_rtspURI = uri; _rtspURI = uri;
_rtspAccount = account; _rtspAccount = account;
...@@ -255,7 +253,7 @@ TaisyncManager::setIPSettings(QString localIP_, QString remoteIP_, QString netMa ...@@ -255,7 +253,7 @@ TaisyncManager::setIPSettings(QString localIP_, QString remoteIP_, QString netMa
void void
TaisyncManager::_radioSettingsChanged(QVariant) TaisyncManager::_radioSettingsChanged(QVariant)
{ {
if(_taiSettings) { if(_taiSettings && _isConnected) {
_workTimer.stop(); _workTimer.stop();
_taiSettings->setRadioSettings( _taiSettings->setRadioSettings(
_radioModeList[_radioMode->rawValue().toInt()], _radioModeList[_radioMode->rawValue().toInt()],
...@@ -269,7 +267,7 @@ TaisyncManager::_radioSettingsChanged(QVariant) ...@@ -269,7 +267,7 @@ TaisyncManager::_radioSettingsChanged(QVariant)
void void
TaisyncManager::_videoSettingsChanged(QVariant) TaisyncManager::_videoSettingsChanged(QVariant)
{ {
if(_taiSettings) { if(_taiSettings && _isConnected) {
_workTimer.stop(); _workTimer.stop();
_taiSettings->setVideoSettings( _taiSettings->setVideoSettings(
_videoOutputList[_videoOutput->rawValue().toInt()], _videoOutputList[_videoOutput->rawValue().toInt()],
...@@ -286,6 +284,12 @@ TaisyncManager::_setEnabled() ...@@ -286,6 +284,12 @@ TaisyncManager::_setEnabled()
{ {
bool enable = _appSettings->enableTaisync()->rawValue().toBool(); bool enable = _appSettings->enableTaisync()->rawValue().toBool();
if(enable) { if(enable) {
if(!_taiSettings) {
_taiSettings = new TaisyncSettings(this);
connect(_taiSettings, &TaisyncSettings::updateSettings, this, &TaisyncManager::_updateSettings);
connect(_taiSettings, &TaisyncSettings::connected, this, &TaisyncManager::_connected);
connect(_taiSettings, &TaisyncSettings::disconnected, this, &TaisyncManager::_disconnected);
}
#if defined(__ios__) || defined(__android__) #if defined(__ios__) || defined(__android__)
if(!_taiTelemetery) { if(!_taiTelemetery) {
_taiTelemetery = new TaisyncTelemetry(this); _taiTelemetery = new TaisyncTelemetry(this);
...@@ -298,7 +302,7 @@ TaisyncManager::_setEnabled() ...@@ -298,7 +302,7 @@ TaisyncManager::_setEnabled()
_taiTelemetery->start(); _taiTelemetery->start();
} }
#endif #endif
_reqMask = REQ_ALL; _reqMask = static_cast<uint32_t>(REQ_ALL);
_workTimer.start(1000); _workTimer.start(1000);
} else { } else {
//-- Stop everything //-- Stop everything
...@@ -310,26 +314,30 @@ TaisyncManager::_setEnabled() ...@@ -310,26 +314,30 @@ TaisyncManager::_setEnabled()
_setVideoEnabled(); _setVideoEnabled();
} }
//-----------------------------------------------------------------------------
void
TaisyncManager::_restoreVideoSettings(Fact* setting)
{
SettingsFact* pFact = dynamic_cast<SettingsFact*>(setting);
if(pFact) {
pFact->setVisible(qgcApp()->toolbox()->corePlugin()->adjustSettingMetaData(VideoSettings::settingsGroup, *setting->metaData()));
}
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
TaisyncManager::_setVideoEnabled() TaisyncManager::_setVideoEnabled()
{ {
//-- Check both if video is enabled and Taisync support itself is enabled as well.
bool enable = _appSettings->enableTaisyncVideo()->rawValue().toBool() && _appSettings->enableTaisync()->rawValue().toBool(); bool enable = _appSettings->enableTaisyncVideo()->rawValue().toBool() && _appSettings->enableTaisync()->rawValue().toBool();
if(enable) { if(enable) {
if(!_savedVideoSource.isValid()) { //-- Set it up the way we need it do be.
//-- Hide video selection as we will be fixed to Taisync video and set the way we need it. VideoSettings* pVSettings = qgcApp()->toolbox()->settingsManager()->videoSettings();
VideoSettings* pVSettings = qgcApp()->toolbox()->settingsManager()->videoSettings(); pVSettings->setVisible(false);
//-- First save current state pVSettings->udpPort()->setRawValue(5600);
_savedVideoSource = pVSettings->videoSource()->rawValue(); //-- TODO: this AR must come from somewhere
_savedVideoUDP = pVSettings->udpPort()->rawValue(); pVSettings->aspectRatio()->setRawValue(1024.0 / 768.0);
_savedAR = pVSettings->aspectRatio()->rawValue(); pVSettings->videoSource()->setRawValue(QString(VideoSettings::videoSourceUDP));
_savedVideoState = pVSettings->visible();
//-- Now set it up the way we need it do be
pVSettings->setVisible(false);
pVSettings->udpPort()->setRawValue(5600);
pVSettings->aspectRatio()->setRawValue(1024.0 / 768.0);
pVSettings->videoSource()->setRawValue(QString(VideoSettings::videoSourceUDP));
}
#if defined(__ios__) || defined(__android__) #if defined(__ios__) || defined(__android__)
if(!_taiVideo) { if(!_taiVideo) {
//-- iOS and Android receive raw h.264 and need a different pipeline //-- iOS and Android receive raw h.264 and need a different pipeline
...@@ -339,7 +347,7 @@ TaisyncManager::_setVideoEnabled() ...@@ -339,7 +347,7 @@ TaisyncManager::_setVideoEnabled()
} }
#endif #endif
} else { } else {
//-- Restore video settings //-- Restore video settings.
#if defined(__ios__) || defined(__android__) #if defined(__ios__) || defined(__android__)
qgcApp()->toolbox()->videoManager()->setIsTaisync(false); qgcApp()->toolbox()->videoManager()->setIsTaisync(false);
if (_taiVideo) { if (_taiVideo) {
...@@ -348,14 +356,11 @@ TaisyncManager::_setVideoEnabled() ...@@ -348,14 +356,11 @@ TaisyncManager::_setVideoEnabled()
_taiVideo = nullptr; _taiVideo = nullptr;
} }
#endif #endif
if(!_savedVideoSource.isValid()) { VideoSettings* pVSettings = qgcApp()->toolbox()->settingsManager()->videoSettings();
VideoSettings* pVSettings = qgcApp()->toolbox()->settingsManager()->videoSettings(); _restoreVideoSettings(pVSettings->videoSource());
pVSettings->videoSource()->setRawValue(_savedVideoSource); _restoreVideoSettings(pVSettings->aspectRatio());
pVSettings->udpPort()->setRawValue(_savedVideoUDP); _restoreVideoSettings(pVSettings->udpPort());
pVSettings->aspectRatio()->setRawValue(_savedAR); pVSettings->setVisible(true);
pVSettings->setVisible(_savedVideoState);
_savedVideoSource.clear();
}
} }
_enableVideo = enable; _enableVideo = enable;
} }
...@@ -420,8 +425,10 @@ TaisyncManager::_checkTaisync() ...@@ -420,8 +425,10 @@ TaisyncManager::_checkTaisync()
{ {
if(_enabled) { if(_enabled) {
if(!_isConnected) { if(!_isConnected) {
if(!_taiSettings->isServerRunning()) { if(_taiSettings) {
_taiSettings->start(); if(!_taiSettings->isServerRunning()) {
_taiSettings->start();
}
} }
} else { } else {
//qCDebug(TaisyncVerbose) << bin << _reqMask; //qCDebug(TaisyncVerbose) << bin << _reqMask;
......
...@@ -110,6 +110,7 @@ private slots: ...@@ -110,6 +110,7 @@ private slots:
private: private:
void _close (); void _close ();
void _reset (); void _reset ();
void _restoreVideoSettings (Fact* setting);
FactMetaData *_createMetadata (const char *name, QStringList enums); FactMetaData *_createMetadata (const char *name, QStringList enums);
private: private:
...@@ -122,10 +123,10 @@ private: ...@@ -122,10 +123,10 @@ private:
REQ_RADIO_SETTINGS = 16, REQ_RADIO_SETTINGS = 16,
REQ_RTSP_SETTINGS = 32, REQ_RTSP_SETTINGS = 32,
REQ_IP_SETTINGS = 64, REQ_IP_SETTINGS = 64,
REQ_ALL = 0xFFFFFFFF, REQ_ALL = 0xFFFFFFF,
}; };
uint32_t _reqMask = REQ_ALL; uint32_t _reqMask = static_cast<uint32_t>(REQ_ALL);
bool _running = false; bool _running = false;
bool _isConnected = false; bool _isConnected = false;
AppSettings* _appSettings = nullptr; AppSettings* _appSettings = nullptr;
...@@ -148,10 +149,6 @@ private: ...@@ -148,10 +149,6 @@ private:
int _decodeIndex = 0; int _decodeIndex = 0;
QStringList _rateList; QStringList _rateList;
int _rateIndex = 0; int _rateIndex = 0;
bool _savedVideoState = true;
QVariant _savedVideoSource;
QVariant _savedVideoUDP;
QVariant _savedAR;
QString _serialNumber; QString _serialNumber;
QString _fwVersion; QString _fwVersion;
Fact* _radioMode = nullptr; Fact* _radioMode = nullptr;
......
...@@ -220,7 +220,8 @@ VideoReceiver::_timeout() ...@@ -220,7 +220,8 @@ VideoReceiver::_timeout()
void void
VideoReceiver::start() VideoReceiver::start()
{ {
if(!qgcApp()->runningUnitTests()) { qCDebug(VideoReceiverLog) << "start():" << _uri;
if(qgcApp()->runningUnitTests()) {
return; return;
} }
if(!_videoSettings->streamEnabled()->rawValue().toBool() || if(!_videoSettings->streamEnabled()->rawValue().toBool() ||
......
...@@ -73,18 +73,18 @@ LinuxBuild { ...@@ -73,18 +73,18 @@ LinuxBuild {
QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\validate\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\validate\\\" /Y $$escape_expand(\\n) QMAKE_POST_LINK += $$escape_expand(\\n) xcopy \"$$GST_ROOT_WIN\\lib\\gstreamer-1.0\\validate\\*.dll\" \"$$DESTDIR_WIN\\gstreamer-plugins\\validate\\\" /Y $$escape_expand(\\n)
} }
} else:AndroidBuild { } else:AndroidBuild {
#- gstreamer assumed to be installed in $$PWD/../../android/gstreamer-1.0-android-armv7-1.5.2 (or x86) #- gstreamer assumed to be installed in $$PWD/../../gstreamer-1.0-android-universal-1.14.4/armv7 (or x86)
Androidx86Build { Androidx86Build {
GST_ROOT = $$PWD/../../gstreamer-1.0-android-x86-1.5.2 GST_ROOT = $$PWD/../../gstreamer-1.0-android-universal-1.14.4/x86
} else { } else {
GST_ROOT = $$PWD/../../gstreamer-1.0-android-armv7-1.5.2 GST_ROOT = $$PWD/../../gstreamer-1.0-android-universal-1.14.4/armv7
} }
exists($$GST_ROOT) { exists($$GST_ROOT) {
QMAKE_CXXFLAGS += -pthread QMAKE_CXXFLAGS += -pthread
CONFIG += VideoEnabled CONFIG += VideoEnabled
# We want to link these plugins statically # We want to link these plugins statically
LIBS += -L$$GST_ROOT/lib/gstreamer-1.0/static \ LIBS += -L$$GST_ROOT/lib/gstreamer-1.0 \
-lgstvideo-1.0 \ -lgstvideo-1.0 \
-lgstcoreelements \ -lgstcoreelements \
-lgstudp \ -lgstudp \
...@@ -95,7 +95,6 @@ LinuxBuild { ...@@ -95,7 +95,6 @@ LinuxBuild {
-lgstsdpelem \ -lgstsdpelem \
-lgstvideoparsersbad \ -lgstvideoparsersbad \
-lgstrtpmanager \ -lgstrtpmanager \
-lgstrmdemux \
-lgstisomp4 \ -lgstisomp4 \
-lgstmatroska \ -lgstmatroska \
...@@ -105,7 +104,7 @@ LinuxBuild { ...@@ -105,7 +104,7 @@ LinuxBuild {
-lgstnet-1.0 -lgio-2.0 \ -lgstnet-1.0 -lgio-2.0 \
-lgstaudio-1.0 -lgstcodecparsers-1.0 -lgstbase-1.0 \ -lgstaudio-1.0 -lgstcodecparsers-1.0 -lgstbase-1.0 \
-lgstreamer-1.0 -lgstrtp-1.0 -lgstpbutils-1.0 -lgstrtsp-1.0 -lgsttag-1.0 \ -lgstreamer-1.0 -lgstrtp-1.0 -lgstpbutils-1.0 -lgstrtsp-1.0 -lgsttag-1.0 \
-lgstvideo-1.0 -lavformat -lavcodec -lavutil -lx264 -lavresample \ -lgstvideo-1.0 -lavformat -lavcodec -lavutil -lx264 -lavfilter -lswresample \
-lgstriff-1.0 -lgstcontroller-1.0 -lgstapp-1.0 \ -lgstriff-1.0 -lgstcontroller-1.0 -lgstapp-1.0 \
-lgstsdp-1.0 -lbz2 -lgobject-2.0 \ -lgstsdp-1.0 -lbz2 -lgobject-2.0 \
-Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lorc-0.4 -liconv -lffi -lintl \ -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lorc-0.4 -liconv -lffi -lintl \
......
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