Browse Source

Merge pull request #8285 from tcanabrava/record_with_name

Record video with name
QGC4.4
Gus Grubba 5 years ago committed by GitHub
parent
commit
385c643c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/FlightMap/Widgets/VideoPageWidget.qml
  2. 17
      src/VideoStreaming/VideoReceiver.cc

11
src/FlightMap/Widgets/VideoPageWidget.qml

@ -108,6 +108,15 @@ Item { @@ -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 { @@ -155,7 +164,7 @@ Item {
// reset blinking animation
recordBtnBackground.opacity = 1
} else {
_videoReceiver.startRecording()
_videoReceiver.startRecording(videoFileName.text)
}
}
}

17
src/VideoStreaming/VideoReceiver.cc

@ -1012,17 +1012,14 @@ VideoReceiver::startRecording(const QString &videoFile) @@ -1012,17 +1012,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();

Loading…
Cancel
Save