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
23f21402
Commit
23f21402
authored
May 02, 2017
by
Gus Grubba
Committed by
GitHub
May 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5054 from lbegani/issue_videorestart
Support Video Source & Setting Changes Runtime
parents
08f54ff7
cb488272
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
6 deletions
+46
-6
VideoManager.cc
src/FlightDisplay/VideoManager.cc
+39
-5
VideoManager.h
src/FlightDisplay/VideoManager.h
+6
-0
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+1
-1
No files found.
src/FlightDisplay/VideoManager.cc
View file @
23f21402
...
...
@@ -57,6 +57,9 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
_videoSettings
=
toolbox
->
settingsManager
()
->
videoSettings
();
QString
videoSource
=
_videoSettings
->
videoSource
()
->
rawValue
().
toString
();
connect
(
_videoSettings
->
videoSource
(),
&
Fact
::
rawValueChanged
,
this
,
&
VideoManager
::
_videoSourceChanged
);
connect
(
_videoSettings
->
udpPort
(),
&
Fact
::
rawValueChanged
,
this
,
&
VideoManager
::
_udpPortChanged
);
connect
(
_videoSettings
->
rtspUrl
(),
&
Fact
::
rawValueChanged
,
this
,
&
VideoManager
::
_rtspUrlChanged
);
#if defined(QGC_GST_STREAMING)
#ifndef QGC_DISABLE_UVC
...
...
@@ -96,6 +99,17 @@ void VideoManager::_videoSourceChanged(void)
{
emit
hasVideoChanged
();
emit
isGStreamerChanged
();
_restartVideo
();
}
void
VideoManager
::
_udpPortChanged
(
void
)
{
_restartVideo
();
}
void
VideoManager
::
_rtspUrlChanged
(
void
)
{
_restartVideo
();
}
//-----------------------------------------------------------------------------
...
...
@@ -170,6 +184,18 @@ void VideoManager::_updateTimer()
#endif
}
//-----------------------------------------------------------------------------
void
VideoManager
::
_updateSettings
()
{
if
(
!
_videoSettings
||
!
_videoReceiver
)
return
;
if
(
_videoSettings
->
videoSource
()
->
rawValue
().
toString
()
==
VideoSettings
::
videoSourceUDP
)
_videoReceiver
->
setUri
(
QStringLiteral
(
"udp://0.0.0.0:%1"
).
arg
(
_videoSettings
->
udpPort
()
->
rawValue
().
toInt
()));
else
_videoReceiver
->
setUri
(
_videoSettings
->
rtspUrl
()
->
rawValue
().
toString
());
}
//-----------------------------------------------------------------------------
void
VideoManager
::
_updateVideo
()
{
...
...
@@ -182,12 +208,20 @@ void VideoManager::_updateVideo()
_videoReceiver
=
new
VideoReceiver
(
this
);
#if defined(QGC_GST_STREAMING)
_videoReceiver
->
setVideoSink
(
_videoSurface
->
videoSink
());
QString
videoSource
=
_videoSettings
->
videoSource
()
->
rawValue
().
toString
();
if
(
_videoSettings
->
videoSource
()
->
rawValue
().
toString
()
==
VideoSettings
::
videoSourceUDP
)
_videoReceiver
->
setUri
(
QStringLiteral
(
"udp://0.0.0.0:%1"
).
arg
(
_videoSettings
->
udpPort
()
->
rawValue
().
toInt
()));
else
_videoReceiver
->
setUri
(
_videoSettings
->
rtspUrl
()
->
rawValue
().
toString
());
_updateSettings
();
#endif
_videoReceiver
->
start
();
}
}
//-----------------------------------------------------------------------------
void
VideoManager
::
_restartVideo
()
{
if
(
!
_videoReceiver
)
return
;
#if defined(QGC_GST_STREAMING)
_videoReceiver
->
stop
();
_updateSettings
();
_videoReceiver
->
start
();
#endif
}
src/FlightDisplay/VideoManager.h
View file @
23f21402
...
...
@@ -69,10 +69,16 @@ signals:
private
slots
:
void
_videoSourceChanged
(
void
);
void
_udpPortChanged
(
void
);
void
_rtspUrlChanged
(
void
);
private:
void
_updateTimer
();
void
_updateSettings
();
void
_updateVideo
();
void
_restartVideo
();
VideoSurface
*
_videoSurface
;
VideoReceiver
*
_videoReceiver
;
...
...
src/ui/preferences/GeneralSettings.qml
View file @
23f21402
...
...
@@ -495,7 +495,7 @@ QGCView {
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
visible
QGCLabel
{
id
:
videoLabel
text
:
qsTr
(
"
Video
(Requires Restart)
"
)
text
:
qsTr
(
"
Video
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
}
...
...
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