Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
2037cdcd
Commit
2037cdcd
authored
Jan 02, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting a path and filename for the recorded video (optional)
parent
35743f65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
VideoReceiver.cc
src/VideoStreaming/VideoReceiver.cc
+14
-11
VideoReceiver.h
src/VideoStreaming/VideoReceiver.h
+5
-1
No files found.
src/VideoStreaming/VideoReceiver.cc
View file @
2037cdcd
...
@@ -609,7 +609,7 @@ VideoReceiver::_cleanupOldVideos()
...
@@ -609,7 +609,7 @@ VideoReceiver::_cleanupOldVideos()
// | |
// | |
// +--------------------------------------+
// +--------------------------------------+
void
void
VideoReceiver
::
startRecording
(
void
)
VideoReceiver
::
startRecording
(
const
QString
&
videoFile
)
{
{
#if defined(QGC_GST_STREAMING)
#if defined(QGC_GST_STREAMING)
...
@@ -620,12 +620,6 @@ VideoReceiver::startRecording(void)
...
@@ -620,12 +620,6 @@ VideoReceiver::startRecording(void)
return
;
return
;
}
}
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
;
}
uint32_t
muxIdx
=
_videoSettings
->
recordingFormat
()
->
rawValue
().
toUInt
();
uint32_t
muxIdx
=
_videoSettings
->
recordingFormat
()
->
rawValue
().
toUInt
();
if
(
muxIdx
>=
NUM_MUXES
)
{
if
(
muxIdx
>=
NUM_MUXES
)
{
qgcApp
()
->
showMessage
(
tr
(
"Invalid video format defined."
));
qgcApp
()
->
showMessage
(
tr
(
"Invalid video format defined."
));
...
@@ -648,11 +642,20 @@ VideoReceiver::startRecording(void)
...
@@ -648,11 +642,20 @@ VideoReceiver::startRecording(void)
return
;
return
;
}
}
QString
videoFile
;
if
(
videoFile
.
isEmpty
())
{
videoFile
=
savePath
+
"/"
+
QDateTime
::
currentDateTime
().
toString
(
"yyyy-MM-dd_hh.mm.ss"
)
+
"."
+
kVideoExtensions
[
muxIdx
];
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
;
}
emit
videoFileChanged
();
g_object_set
(
G_OBJECT
(
_sink
->
filesink
),
"location"
,
qPrintable
(
videoFile
),
NULL
);
g_object_set
(
G_OBJECT
(
_sink
->
filesink
),
"location"
,
qPrintable
(
_
videoFile
),
NULL
);
qCDebug
(
VideoReceiverLog
)
<<
"New video file:"
<<
videoFile
;
qCDebug
(
VideoReceiverLog
)
<<
"New video file:"
<<
_
videoFile
;
gst_object_ref
(
_sink
->
queue
);
gst_object_ref
(
_sink
->
queue
);
gst_object_ref
(
_sink
->
parse
);
gst_object_ref
(
_sink
->
parse
);
...
...
src/VideoStreaming/VideoReceiver.h
View file @
2037cdcd
...
@@ -42,6 +42,7 @@ public:
...
@@ -42,6 +42,7 @@ public:
Q_PROPERTY
(
VideoSurface
*
videoSurface
READ
videoSurface
CONSTANT
)
Q_PROPERTY
(
VideoSurface
*
videoSurface
READ
videoSurface
CONSTANT
)
Q_PROPERTY
(
bool
videoRunning
READ
videoRunning
NOTIFY
videoRunningChanged
)
Q_PROPERTY
(
bool
videoRunning
READ
videoRunning
NOTIFY
videoRunningChanged
)
Q_PROPERTY
(
QString
imageFile
READ
imageFile
NOTIFY
imageFileChanged
)
Q_PROPERTY
(
QString
imageFile
READ
imageFile
NOTIFY
imageFileChanged
)
Q_PROPERTY
(
QString
videoFile
READ
videoFile
NOTIFY
videoFileChanged
)
Q_PROPERTY
(
bool
showFullScreen
READ
showFullScreen
WRITE
setShowFullScreen
NOTIFY
showFullScreenChanged
)
Q_PROPERTY
(
bool
showFullScreen
READ
showFullScreen
WRITE
setShowFullScreen
NOTIFY
showFullScreenChanged
)
explicit
VideoReceiver
(
QObject
*
parent
=
0
);
explicit
VideoReceiver
(
QObject
*
parent
=
0
);
...
@@ -58,6 +59,7 @@ public:
...
@@ -58,6 +59,7 @@ public:
VideoSurface
*
videoSurface
()
{
return
_videoSurface
;
}
VideoSurface
*
videoSurface
()
{
return
_videoSurface
;
}
bool
videoRunning
()
{
return
_videoRunning
;
}
bool
videoRunning
()
{
return
_videoRunning
;
}
QString
imageFile
()
{
return
_imageFile
;
}
QString
imageFile
()
{
return
_imageFile
;
}
QString
videoFile
()
{
return
_videoFile
;
}
bool
showFullScreen
()
{
return
_showFullScreen
;
}
bool
showFullScreen
()
{
return
_showFullScreen
;
}
void
grabImage
(
QString
imageFile
);
void
grabImage
(
QString
imageFile
);
...
@@ -67,6 +69,7 @@ public:
...
@@ -67,6 +69,7 @@ public:
signals:
signals:
void
videoRunningChanged
();
void
videoRunningChanged
();
void
imageFileChanged
();
void
imageFileChanged
();
void
videoFileChanged
();
void
showFullScreenChanged
();
void
showFullScreenChanged
();
#if defined(QGC_GST_STREAMING)
#if defined(QGC_GST_STREAMING)
void
recordingChanged
();
void
recordingChanged
();
...
@@ -80,7 +83,7 @@ public slots:
...
@@ -80,7 +83,7 @@ public slots:
void
stop
();
void
stop
();
void
setUri
(
const
QString
&
uri
);
void
setUri
(
const
QString
&
uri
);
void
stopRecording
();
void
stopRecording
();
void
startRecording
();
void
startRecording
(
const
QString
&
videoFile
=
QString
()
);
private
slots
:
private
slots
:
void
_updateTimer
();
void
_updateTimer
();
...
@@ -136,6 +139,7 @@ private:
...
@@ -136,6 +139,7 @@ private:
QString
_uri
;
QString
_uri
;
QString
_imageFile
;
QString
_imageFile
;
QString
_videoFile
;
VideoSurface
*
_videoSurface
;
VideoSurface
*
_videoSurface
;
bool
_videoRunning
;
bool
_videoRunning
;
bool
_showFullScreen
;
bool
_showFullScreen
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment