Commit 44e5dcab authored by Tomaz Canabrava's avatar Tomaz Canabrava Committed by Tomaz Canabrava

Record video with name

parent d040b949
......@@ -108,6 +108,15 @@ Item {
indexModel: false
Layout.alignment: Qt.AlignHCenter
}
QGCLabel {
text: qsTr("File Name");
visible: QGroundControl.videoManager.isGStreamer
}
TextField {
id: videoFileName
visible: QGroundControl.videoManager.isGStreamer
width: 100
}
//-- Video Recording
QGCLabel {
text: _recordingVideo ? qsTr("Stop Recording") : qsTr("Record Stream")
......@@ -155,7 +164,7 @@ Item {
// reset blinking animation
recordBtnBackground.opacity = 1
} else {
_videoReceiver.startRecording()
_videoReceiver.startRecording(videoFileName.text)
}
}
}
......
......@@ -1010,17 +1010,14 @@ VideoReceiver::startRecording(const QString &videoFile)
//-- Disk usage maintenance
_cleanupOldVideos();
if(videoFile.isEmpty()) {
QString savePath = qgcApp()->toolbox()->settingsManager()->appSettings()->videoSavePath();
if(savePath.isEmpty()) {
qgcApp()->showMessage(tr("Unabled to record video. Video save path must be specified in Settings."));
return;
}
_videoFile = savePath + "/" + QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss") + "." + kVideoExtensions[muxIdx];
} else {
_videoFile = videoFile;
QString savePath = qgcApp()->toolbox()->settingsManager()->appSettings()->videoSavePath();
if(savePath.isEmpty()) {
qgcApp()->showMessage(tr("Unabled to record video. Video save path must be specified in Settings."));
return;
}
_videoFile = savePath + "/"
+ (videoFile.isEmpty() ? QDateTime::currentDateTime().toString("yyyy-MM-dd_hh.mm.ss") : videoFile)
+ "." + kVideoExtensions[muxIdx];
qDebug() << "New video file:" << _videoFile;
emit videoFileChanged();
......
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