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
9b46aaca
Unverified
Commit
9b46aaca
authored
Sep 04, 2019
by
Don Gagne
Committed by
GitHub
Sep 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7762 from DonLakeFlyer/DisableVideo
Disable video workaround for gstreamer crashes
parents
c8b6adf5
54929a0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
44 deletions
+60
-44
FlightDisplayViewVideo.qml
src/FlightDisplay/FlightDisplayViewVideo.qml
+58
-44
VideoSettings.h
src/Settings/VideoSettings.h
+2
-0
No files found.
src/FlightDisplay/FlightDisplayViewVideo.qml
View file @
9b46aaca
...
...
@@ -72,53 +72,67 @@ Item {
//-- Fit Width
return
_ar
!=
0.0
?
parent
.
width
*
(
1
/
_ar
)
:
parent
.
height
}
QGCVideoBackground
{
id
:
videoContent
height
:
parent
.
getHeight
()
width
:
parent
.
getWidth
()
anchors.centerIn
:
parent
receiver
:
_videoReceiver
display
:
_videoReceiver
&&
_videoReceiver
.
videoSurface
visible
:
_videoReceiver
&&
_videoReceiver
.
videoRunning
Connections
{
target
:
_videoReceiver
onImageFileChanged
:
{
videoContent
.
grabToImage
(
function
(
result
)
{
if
(
!
result
.
saveToFile
(
_videoReceiver
.
imageFile
))
{
console
.
error
(
'
Error capturing video frame
'
);
}
});
Component
{
id
:
videoBackgroundComponent
QGCVideoBackground
{
id
:
videoContent
receiver
:
_videoReceiver
display
:
_videoReceiver
&&
_videoReceiver
.
videoSurface
Connections
{
target
:
_videoReceiver
onImageFileChanged
:
{
videoContent
.
grabToImage
(
function
(
result
)
{
if
(
!
result
.
saveToFile
(
_videoReceiver
.
imageFile
))
{
console
.
error
(
'
Error capturing video frame
'
);
}
});
}
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
height
:
parent
.
height
width
:
1
x
:
parent
.
width
*
0.33
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
height
:
parent
.
height
width
:
1
x
:
parent
.
width
*
0.66
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
width
:
parent
.
width
height
:
1
y
:
parent
.
height
*
0.33
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
width
:
parent
.
width
height
:
1
y
:
parent
.
height
*
0.66
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
height
:
parent
.
height
width
:
1
x
:
parent
.
width
*
0.33
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
height
:
parent
.
height
width
:
1
x
:
parent
.
width
*
0.66
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
width
:
parent
.
width
height
:
1
y
:
parent
.
height
*
0.33
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
Rectangle
{
color
:
Qt
.
rgba
(
1
,
1
,
1
,
0.5
)
width
:
parent
.
width
height
:
1
y
:
parent
.
height
*
0.66
visible
:
_showGrid
&&
!
QGroundControl
.
videoManager
.
fullScreen
}
}
Loader
{
// GStreamer is causing crashes on Lenovo laptop OpenGL Intel drivers. In order to workaround this
// we don't load a QGCVideoBackground object when video is disabled. This prevents any video rendering
// code from running. Setting QGCVideoBackground.receiver/display = null does not work to prevent any
// video OpenGL from being generated. Hence the Loader to completely remove it.
height
:
parent
.
getHeight
()
width
:
parent
.
getWidth
()
anchors.centerIn
:
parent
visible
:
_videoReceiver
&&
_videoReceiver
.
videoRunning
sourceComponent
:
videoDisabled
?
null
:
videoBackgroundComponent
property
bool
videoDisabled
:
QGroundControl
.
settingsManager
.
videoSettings
.
videoSource
.
rawValue
===
QGroundControl
.
settingsManager
.
videoSettings
.
disabledVideoSource
}
MouseArea
{
anchors.fill
:
parent
onDoubleClicked
:
{
...
...
src/Settings/VideoSettings.h
View file @
9b46aaca
...
...
@@ -40,12 +40,14 @@ public:
Q_PROPERTY
(
QString
udpVideoSource
READ
udpVideoSource
CONSTANT
)
Q_PROPERTY
(
QString
tcpVideoSource
READ
tcpVideoSource
CONSTANT
)
Q_PROPERTY
(
QString
mpegtsVideoSource
READ
mpegtsVideoSource
CONSTANT
)
Q_PROPERTY
(
QString
disabledVideoSource
READ
disabledVideoSource
CONSTANT
)
bool
streamConfigured
();
QString
rtspVideoSource
()
{
return
videoSourceRTSP
;
}
QString
udpVideoSource
()
{
return
videoSourceUDP
;
}
QString
tcpVideoSource
()
{
return
videoSourceTCP
;
}
QString
mpegtsVideoSource
()
{
return
videoSourceMPEGTS
;
}
QString
disabledVideoSource
()
{
return
videoDisabled
;
}
static
const
char
*
videoSourceNoVideo
;
static
const
char
*
videoDisabled
;
...
...
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