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
ebda2a12
Commit
ebda2a12
authored
Jul 02, 2017
by
Gus Grubba
Committed by
GitHub
Jul 02, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5386 from mavlink/defaultVideo
Set default video streaming to Disabled.
parents
851aeb31
9b74e3df
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
19 deletions
+23
-19
VideoManager.cc
src/FlightDisplay/VideoManager.cc
+2
-5
VideoSettings.cc
src/Settings/VideoSettings.cc
+10
-5
VideoSettings.h
src/Settings/VideoSettings.h
+1
-0
VideoReceiver.cc
src/VideoStreaming/VideoReceiver.cc
+4
-3
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+6
-6
No files found.
src/FlightDisplay/VideoManager.cc
View file @
ebda2a12
...
...
@@ -114,11 +114,8 @@ VideoManager::_rtspUrlChanged()
bool
VideoManager
::
hasVideo
()
{
#if defined(QGC_GST_STREAMING)
return
true
;
#endif
QString
videoSource
=
_videoSettings
->
videoSource
()
->
rawValue
().
toString
();
return
!
videoSource
.
isEmpty
()
&&
videoSource
!=
VideoSettings
::
videoSourceNoVideo
;
return
!
videoSource
.
isEmpty
()
&&
videoSource
!=
VideoSettings
::
videoSourceNoVideo
&&
videoSource
!=
VideoSettings
::
videoDisabled
;
}
//-----------------------------------------------------------------------------
...
...
@@ -150,7 +147,7 @@ VideoManager::_updateSettings()
return
;
if
(
_videoSettings
->
videoSource
()
->
rawValue
().
toString
()
==
VideoSettings
::
videoSourceUDP
)
_videoReceiver
->
setUri
(
QStringLiteral
(
"udp://0.0.0.0:%1"
).
arg
(
_videoSettings
->
udpPort
()
->
rawValue
().
toInt
()));
else
else
if
(
_videoSettings
->
videoSource
()
->
rawValue
().
toString
()
==
VideoSettings
::
videoSourceRTSP
)
_videoReceiver
->
setUri
(
_videoSettings
->
rtspUrl
()
->
rawValue
().
toString
());
}
...
...
src/Settings/VideoSettings.cc
View file @
ebda2a12
...
...
@@ -29,6 +29,7 @@ const char* VideoSettings::recordingFormatName = "RecordingFormat";
const
char
*
VideoSettings
::
maxVideoSizeName
=
"MaxVideoSize"
;
const
char
*
VideoSettings
::
videoSourceNoVideo
=
"No Video Available"
;
const
char
*
VideoSettings
::
videoDisabled
=
"Video Stream Disabled"
;
const
char
*
VideoSettings
::
videoSourceUDP
=
"UDP Video Stream"
;
const
char
*
VideoSettings
::
videoSourceRTSP
=
"RTSP Video Stream"
;
...
...
@@ -47,6 +48,7 @@ VideoSettings::VideoSettings(QObject* parent)
qmlRegisterUncreatableType
<
VideoSettings
>
(
"QGroundControl.SettingsManager"
,
1
,
0
,
"VideoSettings"
,
"Reference only"
);
// Setup enum values for videoSource settings into meta data
bool
noVideo
=
false
;
QStringList
videoSourceList
;
#ifdef QGC_GST_STREAMING
#ifndef NO_UDP_VIDEO
...
...
@@ -61,7 +63,10 @@ VideoSettings::VideoSettings(QObject* parent)
}
#endif
if
(
videoSourceList
.
count
()
==
0
)
{
noVideo
=
true
;
videoSourceList
.
append
(
videoSourceNoVideo
);
}
else
{
videoSourceList
.
insert
(
0
,
videoDisabled
);
}
QVariantList
videoSourceVarList
;
foreach
(
const
QString
&
videoSource
,
videoSourceList
)
{
...
...
@@ -70,11 +75,11 @@ VideoSettings::VideoSettings(QObject* parent)
_nameToMetaDataMap
[
videoSourceName
]
->
setEnumInfo
(
videoSourceList
,
videoSourceVarList
);
// Set default value for videoSource
#if defined(NO_UDP_VIDEO)
_nameToMetaDataMap
[
videoSourceName
]
->
setRawDefaultValue
(
videoSourceRTSP
);
#else
_nameToMetaDataMap
[
videoSourceName
]
->
setRawDefaultValue
(
videoSourceUDP
);
#endif
if
(
noVideo
)
{
_nameToMetaDataMap
[
videoSourceName
]
->
setRawDefaultValue
(
videoSourceNoVideo
);
}
else
{
_nameToMetaDataMap
[
videoSourceName
]
->
setRawDefaultValue
(
videoDisabled
);
}
}
Fact
*
VideoSettings
::
videoSource
(
void
)
...
...
src/Settings/VideoSettings.h
View file @
ebda2a12
...
...
@@ -49,6 +49,7 @@ public:
static
const
char
*
maxVideoSizeName
;
static
const
char
*
videoSourceNoVideo
;
static
const
char
*
videoDisabled
;
static
const
char
*
videoSourceUDP
;
static
const
char
*
videoSourceRTSP
;
...
...
src/VideoStreaming/VideoReceiver.cc
View file @
ebda2a12
...
...
@@ -220,10 +220,11 @@ VideoReceiver::start()
_starting
=
true
;
bool
isUdp
=
_uri
.
contains
(
"udp://"
);
bool
isUdp
=
_uri
.
contains
(
"udp://"
);
bool
isRtsp
=
_uri
.
contains
(
"rtsp://"
);
//-- For RTSP, check to see if server is there first
if
(
!
_serverPresent
&&
!
isUd
p
)
{
if
(
!
_serverPresent
&&
isRts
p
)
{
_timer
.
start
(
100
);
return
;
}
...
...
@@ -776,7 +777,7 @@ VideoReceiver::_updateTimer()
stop
();
}
}
else
{
if
(
!
running
())
{
if
(
!
running
()
&&
!
_uri
.
isEmpty
()
)
{
start
();
}
}
...
...
src/ui/preferences/GeneralSettings.qml
View file @
ebda2a12
...
...
@@ -529,7 +529,7 @@ QGCView {
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
udpPort
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
===
0
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
udpPort
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
===
1
QGCLabel
{
text
:
qsTr
(
"
UDP Port:
"
)
width
:
_labelWidth
...
...
@@ -543,7 +543,7 @@ QGCView {
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
rtspUrl
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
===
1
visible
:
QGroundControl
.
settingsManager
.
videoSettings
.
rtspUrl
.
visible
&&
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
===
2
QGCLabel
{
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
RTSP URL:
"
)
...
...
@@ -557,7 +557,7 @@ QGCView {
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
<
2
&&
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
.
visible
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
&&
videoSource
.
currentIndex
<
3
&&
QGroundControl
.
settingsManager
.
videoSettings
.
aspectRatio
.
visible
QGCLabel
{
text
:
qsTr
(
"
Aspect Ratio:
"
)
width
:
_labelWidth
...
...
@@ -571,7 +571,7 @@ QGCView {
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
<
2
&&
QGroundControl
.
settingsManager
.
videoSettings
.
gridLines
.
visible
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
&&
videoSource
.
currentIndex
<
3
&&
QGroundControl
.
settingsManager
.
videoSettings
.
gridLines
.
visible
QGCLabel
{
text
:
qsTr
(
"
Grid Lines:
"
)
width
:
_labelWidth
...
...
@@ -613,7 +613,7 @@ QGCView {
anchors.centerIn
:
parent
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
<
2
&&
QGroundControl
.
settingsManager
.
videoSettings
.
maxVideoSize
.
visible
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
&&
videoSource
.
currentIndex
<
3
&&
QGroundControl
.
settingsManager
.
videoSettings
.
maxVideoSize
.
visible
QGCLabel
{
text
:
qsTr
(
"
Max Storage Usage:
"
)
width
:
_labelWidth
...
...
@@ -627,7 +627,7 @@ QGCView {
}
Row
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
<
2
&&
QGroundControl
.
settingsManager
.
videoSettings
.
recordingFormat
.
visible
visible
:
QGroundControl
.
videoManager
.
isGStreamer
&&
videoSource
.
currentIndex
&&
videoSource
.
currentIndex
<
3
&&
QGroundControl
.
settingsManager
.
videoSettings
.
recordingFormat
.
visible
QGCLabel
{
text
:
qsTr
(
"
Video File Format:
"
)
width
:
_labelWidth
...
...
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