Unverified Commit 76b58cbc authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #9007 from DonLakeFlyer/VideoStreaming

Video Streaming: Camera ui allows switch to photo mode to capture individual images from stream
parents a688855e 138d683a
...@@ -4,6 +4,7 @@ Note: This file only contains high level features or important fixes. ...@@ -4,6 +4,7 @@ Note: This file only contains high level features or important fixes.
## 4.1 - Daily build ## 4.1 - Daily build
* Video Streaming: New camera control supports capturing individual images from the stream
* Fly: Press and hold on arm button will change it to Force Arm. Click again to force arm. * Fly: Press and hold on arm button will change it to Force Arm. Click again to force arm.
* VTOL: General setting for transition distance which affects Plan takeoff, landing pattern creation * VTOL: General setting for transition distance which affects Plan takeoff, landing pattern creation
* VTOL: Much better VTOL support throughout QGC * VTOL: Much better VTOL support throughout QGC
......
...@@ -387,10 +387,7 @@ QGCCameraControl::takePhoto() ...@@ -387,10 +387,7 @@ QGCCameraControl::takePhoto()
_captureInfoRetries = 0; _captureInfoRetries = 0;
//-- Capture local image as well //-- Capture local image as well
if(qgcApp()->toolbox()->videoManager()) { if(qgcApp()->toolbox()->videoManager()) {
QString photoPath = qgcApp()->toolbox()->settingsManager()->appSettings()->savePath()->rawValue().toString() + QStringLiteral("/Photo"); qgcApp()->toolbox()->videoManager()->grabImage();
QDir().mkpath(photoPath);
photoPath += + "/" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss.zzz") + ".jpg";
qgcApp()->toolbox()->videoManager()->grabImage(photoPath);
} }
return true; return true;
} }
......
This diff is collapsed.
...@@ -27,12 +27,13 @@ const char* AppSettings::kmlFileExtension = "kml"; ...@@ -27,12 +27,13 @@ const char* AppSettings::kmlFileExtension = "kml";
const char* AppSettings::shpFileExtension = "shp"; const char* AppSettings::shpFileExtension = "shp";
const char* AppSettings::logFileExtension = "ulg"; const char* AppSettings::logFileExtension = "ulg";
const char* AppSettings::parameterDirectory = "Parameters"; const char* AppSettings::parameterDirectory = QT_TRANSLATE_NOOP("AppSettings", "Parameters");
const char* AppSettings::telemetryDirectory = "Telemetry"; const char* AppSettings::telemetryDirectory = QT_TRANSLATE_NOOP("AppSettings", "Telemetry");
const char* AppSettings::missionDirectory = "Missions"; const char* AppSettings::missionDirectory = QT_TRANSLATE_NOOP("AppSettings", "Missions");
const char* AppSettings::logDirectory = "Logs"; const char* AppSettings::logDirectory = QT_TRANSLATE_NOOP("AppSettings", "Logs");
const char* AppSettings::videoDirectory = "Video"; const char* AppSettings::videoDirectory = QT_TRANSLATE_NOOP("AppSettings", "Video");
const char* AppSettings::crashDirectory = "CrashLogs"; const char* AppSettings::photoDirectory = QT_TRANSLATE_NOOP("AppSettings", "Photo");
const char* AppSettings::crashDirectory = QT_TRANSLATE_NOOP("AppSettings", "CrashLogs");
DECLARE_SETTINGGROUP(App, "") DECLARE_SETTINGGROUP(App, "")
{ {
...@@ -160,6 +161,7 @@ void AppSettings::_checkSavePathDirectories(void) ...@@ -160,6 +161,7 @@ void AppSettings::_checkSavePathDirectories(void)
savePathDir.mkdir(missionDirectory); savePathDir.mkdir(missionDirectory);
savePathDir.mkdir(logDirectory); savePathDir.mkdir(logDirectory);
savePathDir.mkdir(videoDirectory); savePathDir.mkdir(videoDirectory);
savePathDir.mkdir(photoDirectory);
savePathDir.mkdir(crashDirectory); savePathDir.mkdir(crashDirectory);
} }
} }
...@@ -219,6 +221,16 @@ QString AppSettings::videoSavePath(void) ...@@ -219,6 +221,16 @@ QString AppSettings::videoSavePath(void)
return QString(); return QString();
} }
QString AppSettings::photoSavePath(void)
{
QString path = savePath()->rawValue().toString();
if (!path.isEmpty() && QDir(path).exists()) {
QDir dir(path);
return dir.filePath(photoDirectory);
}
return QString();
}
QString AppSettings::crashSavePath(void) QString AppSettings::crashSavePath(void)
{ {
QString path = savePath()->rawValue().toString(); QString path = savePath()->rawValue().toString();
......
...@@ -71,6 +71,7 @@ public: ...@@ -71,6 +71,7 @@ public:
Q_PROPERTY(QString telemetrySavePath READ telemetrySavePath NOTIFY savePathsChanged) Q_PROPERTY(QString telemetrySavePath READ telemetrySavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString logSavePath READ logSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString logSavePath READ logSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString videoSavePath READ videoSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString videoSavePath READ videoSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString photoSavePath READ photoSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString crashSavePath READ crashSavePath NOTIFY savePathsChanged) Q_PROPERTY(QString crashSavePath READ crashSavePath NOTIFY savePathsChanged)
Q_PROPERTY(QString planFileExtension MEMBER planFileExtension CONSTANT) Q_PROPERTY(QString planFileExtension MEMBER planFileExtension CONSTANT)
...@@ -87,6 +88,7 @@ public: ...@@ -87,6 +88,7 @@ public:
QString telemetrySavePath (); QString telemetrySavePath ();
QString logSavePath (); QString logSavePath ();
QString videoSavePath (); QString videoSavePath ();
QString photoSavePath ();
QString crashSavePath (); QString crashSavePath ();
// Helper methods for working with firstRunPromptIds QVariant settings string list // Helper methods for working with firstRunPromptIds QVariant settings string list
...@@ -112,6 +114,7 @@ public: ...@@ -112,6 +114,7 @@ public:
static const char* missionDirectory; static const char* missionDirectory;
static const char* logDirectory; static const char* logDirectory;
static const char* videoDirectory; static const char* videoDirectory;
static const char* photoDirectory;
static const char* crashDirectory; static const char* crashDirectory;
// Returns the current language setting bypassing the standard SettingsGroup path. This should only be used // Returns the current language setting bypassing the standard SettingsGroup path. This should only be used
......
...@@ -350,7 +350,12 @@ VideoManager::grabImage(const QString& imageFile) ...@@ -350,7 +350,12 @@ VideoManager::grabImage(const QString& imageFile)
return; return;
} }
_imageFile = imageFile; if (imageFile.isEmpty()) {
_imageFile = qgcApp()->toolbox()->settingsManager()->appSettings()->photoSavePath();
_imageFile += + "/" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss.zzz") + ".jpg";
} else {
_imageFile = imageFile;
}
emit imageFileChanged(); emit imageFileChanged();
......
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
Q_INVOKABLE void startRecording (const QString& videoFile = QString()); Q_INVOKABLE void startRecording (const QString& videoFile = QString());
Q_INVOKABLE void stopRecording (); Q_INVOKABLE void stopRecording ();
Q_INVOKABLE void grabImage(const QString& imageFile); Q_INVOKABLE void grabImage(const QString& imageFile = QString());
signals: signals:
void hasVideoChanged (); void hasVideoChanged ();
......
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