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
dfffd3bc
Commit
dfffd3bc
authored
Sep 12, 2017
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define how long to wait for RTSP frame before deciding the link is gone.
parent
081d2ee9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
Video.SettingsGroup.json
src/Settings/Video.SettingsGroup.json
+9
-0
VideoSettings.cc
src/Settings/VideoSettings.cc
+11
-0
VideoSettings.h
src/Settings/VideoSettings.h
+4
-0
VideoReceiver.cc
src/VideoStreaming/VideoReceiver.cc
+2
-1
No files found.
src/Settings/Video.SettingsGroup.json
View file @
dfffd3bc
...
...
@@ -69,5 +69,14 @@
"min"
:
100
,
"units"
:
"MB"
,
"defaultValue"
:
2048
},
{
"name"
:
"RtspTimeout"
,
"shortDescription"
:
"RTSP Video Timeout"
,
"longDescription"
:
"How long to wait before assuming RTSP link is gone."
,
"type"
:
"uint32"
,
"min"
:
1
,
"units"
:
"s"
,
"defaultValue"
:
2
}
]
src/Settings/VideoSettings.cc
View file @
dfffd3bc
...
...
@@ -27,6 +27,7 @@ const char* VideoSettings::videoGridLinesName = "VideoGridLines";
const
char
*
VideoSettings
::
showRecControlName
=
"ShowRecControl"
;
const
char
*
VideoSettings
::
recordingFormatName
=
"RecordingFormat"
;
const
char
*
VideoSettings
::
maxVideoSizeName
=
"MaxVideoSize"
;
const
char
*
VideoSettings
::
rtspTimeoutName
=
"RtspTimeout"
;
const
char
*
VideoSettings
::
videoSourceNoVideo
=
"No Video Available"
;
const
char
*
VideoSettings
::
videoDisabled
=
"Video Stream Disabled"
;
...
...
@@ -43,6 +44,7 @@ VideoSettings::VideoSettings(QObject* parent)
,
_showRecControlFact
(
NULL
)
,
_recordingFormatFact
(
NULL
)
,
_maxVideoSizeFact
(
NULL
)
,
_rtspTimeoutFact
(
NULL
)
{
QQmlEngine
::
setObjectOwnership
(
this
,
QQmlEngine
::
CppOwnership
);
qmlRegisterUncreatableType
<
VideoSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"VideoSettings"
,
"Reference only"
);
...
...
@@ -153,3 +155,12 @@ Fact* VideoSettings::maxVideoSize(void)
return
_maxVideoSizeFact
;
}
Fact
*
VideoSettings
::
rtspTimeout
(
void
)
{
if
(
!
_rtspTimeoutFact
)
{
_rtspTimeoutFact
=
_createSettingsFact
(
rtspTimeoutName
);
}
return
_rtspTimeoutFact
;
}
src/Settings/VideoSettings.h
View file @
dfffd3bc
...
...
@@ -27,6 +27,7 @@ public:
Q_PROPERTY
(
Fact
*
showRecControl
READ
showRecControl
CONSTANT
)
Q_PROPERTY
(
Fact
*
recordingFormat
READ
recordingFormat
CONSTANT
)
Q_PROPERTY
(
Fact
*
maxVideoSize
READ
maxVideoSize
CONSTANT
)
Q_PROPERTY
(
Fact
*
rtspTimeout
READ
rtspTimeout
CONSTANT
)
Fact
*
videoSource
(
void
);
Fact
*
udpPort
(
void
);
...
...
@@ -36,6 +37,7 @@ public:
Fact
*
showRecControl
(
void
);
Fact
*
recordingFormat
(
void
);
Fact
*
maxVideoSize
(
void
);
Fact
*
rtspTimeout
(
void
);
static
const
char
*
videoSettingsGroupName
;
...
...
@@ -47,6 +49,7 @@ public:
static
const
char
*
showRecControlName
;
static
const
char
*
recordingFormatName
;
static
const
char
*
maxVideoSizeName
;
static
const
char
*
rtspTimeoutName
;
static
const
char
*
videoSourceNoVideo
;
static
const
char
*
videoDisabled
;
...
...
@@ -62,6 +65,7 @@ private:
SettingsFact
*
_showRecControlFact
;
SettingsFact
*
_recordingFormatFact
;
SettingsFact
*
_maxVideoSizeFact
;
SettingsFact
*
_rtspTimeoutFact
;
};
#endif
src/VideoStreaming/VideoReceiver.cc
View file @
dfffd3bc
...
...
@@ -768,12 +768,13 @@ VideoReceiver::_updateTimer()
}
}
if
(
_videoRunning
)
{
uint32_t
timeout
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
videoSettings
()
->
rtspTimeout
()
->
rawValue
().
toUInt
();
time_t
elapsed
=
0
;
time_t
lastFrame
=
_videoSurface
->
lastFrame
();
if
(
lastFrame
!=
0
)
{
elapsed
=
time
(
0
)
-
_videoSurface
->
lastFrame
();
}
if
(
elapsed
>
2
&&
_videoSurface
)
{
if
(
elapsed
>
timeout
&&
_videoSurface
)
{
stop
();
}
}
else
{
...
...
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