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
f68eccd4
Unverified
Commit
f68eccd4
authored
May 03, 2018
by
Don Gagne
Committed by
GitHub
May 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6368 from bluerobotics/patrickelectric/fix#164
Fix video popup on windows
parents
8176dd37
2acdf6cf
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
18 deletions
+62
-18
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+49
-14
VideoManager.h
src/FlightDisplay/VideoManager.h
+1
-1
VideoReceiver.cc
src/VideoStreaming/VideoReceiver.cc
+5
-1
VideoReceiver.h
src/VideoStreaming/VideoReceiver.h
+1
-0
videonode.cpp
src/VideoStreaming/gstqtvideosink/painters/videonode.cpp
+6
-2
No files found.
src/FlightDisplay/FlightDisplayView.qml
View file @
f68eccd4
...
...
@@ -212,7 +212,23 @@ QGCView {
_flightVideo
.
state
=
"
unpopup
"
videoWindow
.
visible
=
false
}
}
/* This timer will startVideo again after the popup window appears and is loaded.
* Such approach was the only one to avoid a crash for windows users
*/
Timer
{
id
:
videoPopUpTimer
interval
:
2000
;
running
:
false
;
repeat
:
false
onTriggered
:
{
// If state is popup, the next one will be popup-finished
if
(
_flightVideo
.
state
==
"
popup
"
)
{
_flightVideo
.
state
=
"
popup-finished
"
}
QGroundControl
.
videoManager
.
startVideo
()
}
}
QGCMapPalette
{
id
:
mapPal
;
lightColors
:
_mainIsMap
?
_flightMap
.
isSatelliteMap
:
true
}
...
...
@@ -270,6 +286,20 @@ QGCView {
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
visible
:
QGroundControl
.
videoManager
.
hasVideo
&&
(
!
_mainIsMap
||
_isPipVisible
)
onParentChanged
:
{
/* If video comes back from popup
* correct anchors.
* Such thing is not possible with ParentChange.
*/
if
(
parent
==
_panel
)
{
// Do anchors again after popup
anchors
.
left
=
_panel
.
left
anchors
.
bottom
=
_panel
.
bottom
anchors
.
margins
=
ScreenTools
.
defaultFontPixelHeight
}
}
states
:
[
State
{
name
:
"
pipMode
"
...
...
@@ -296,36 +326,41 @@ QGCView {
State
{
name
:
"
popup
"
StateChangeScript
{
script
:
QGroundControl
.
videoManager
.
stopVideo
()
script
:
{
// Stop video, restart it again with Timer
// Avoiding crashs if ParentChange is not yet done
QGroundControl
.
videoManager
.
stopVideo
()
videoPopUpTimer
.
running
=
true
}
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
true
}
},
State
{
name
:
"
popup-finished
"
ParentChange
{
target
:
_flightVideo
parent
:
videoItem
x
:
0
y
:
0
width
:
videoWindow
.
width
height
:
videoWindow
.
height
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
true
width
:
videoItem
.
width
height
:
videoItem
.
height
}
},
State
{
name
:
"
unpopup
"
StateChangeScript
{
script
:
QGroundControl
.
videoManager
.
stopVideo
()
script
:
{
QGroundControl
.
videoManager
.
stopVideo
()
videoPopUpTimer
.
running
=
true
}
}
ParentChange
{
target
:
_flightVideo
parent
:
_panel
}
PropertyChanges
{
target
:
_flightVideo
anchors.left
:
_panel
.
left
anchors.bottom
:
_panel
.
bottom
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
}
PropertyChanges
{
target
:
_flightVideoPipControl
inPopup
:
false
...
...
src/FlightDisplay/VideoManager.h
View file @
f68eccd4
...
...
@@ -56,7 +56,7 @@ public:
// Override from QGCTool
void
setToolbox
(
QGCToolbox
*
toolbox
);
Q_INVOKABLE
void
startVideo
()
{
_videoReceiver
->
st
op
();};
Q_INVOKABLE
void
startVideo
()
{
_videoReceiver
->
st
art
();};
Q_INVOKABLE
void
stopVideo
()
{
_videoReceiver
->
stop
();};
signals:
...
...
src/VideoStreaming/VideoReceiver.cc
View file @
f68eccd4
...
...
@@ -218,6 +218,7 @@ VideoReceiver::start()
return
;
}
#if defined(QGC_GST_STREAMING)
_stop
=
false
;
qCDebug
(
VideoReceiverLog
)
<<
"start()"
;
if
(
_uri
.
isEmpty
())
{
...
...
@@ -433,6 +434,7 @@ void
VideoReceiver
::
stop
()
{
#if defined(QGC_GST_STREAMING)
_stop
=
true
;
qCDebug
(
VideoReceiverLog
)
<<
"stop()"
;
if
(
!
_streaming
)
{
_shutdownPipeline
();
...
...
@@ -870,9 +872,11 @@ VideoReceiver::_updateTimer()
}
if
(
elapsed
>
(
time_t
)
timeout
&&
_videoSurface
)
{
stop
();
// We want to start it back again with _updateTimer
_stop
=
false
;
}
}
else
{
if
(
!
running
()
&&
!
_uri
.
isEmpty
()
&&
_videoSettings
->
streamEnabled
()
->
rawValue
().
toBool
())
{
if
(
!
_stop
&&
!
running
()
&&
!
_uri
.
isEmpty
()
&&
_videoSettings
->
streamEnabled
()
->
rawValue
().
toBool
())
{
start
();
}
}
...
...
src/VideoStreaming/VideoReceiver.h
View file @
f68eccd4
...
...
@@ -114,6 +114,7 @@ private:
bool
_streaming
;
bool
_starting
;
bool
_stopping
;
bool
_stop
;
Sink
*
_sink
;
GstElement
*
_tee
;
...
...
src/VideoStreaming/gstqtvideosink/painters/videonode.cpp
View file @
f68eccd4
...
...
@@ -52,14 +52,18 @@ void VideoNode::setMaterialTypeSolidBlack()
void
VideoNode
::
setCurrentFrame
(
GstBuffer
*
buffer
)
{
Q_ASSERT
(
m_materialType
==
MaterialTypeVideo
);
if
(
m_materialType
!=
MaterialTypeVideo
)
{
return
;
}
static_cast
<
VideoMaterial
*>
(
material
())
->
setCurrentFrame
(
buffer
);
markDirty
(
DirtyMaterial
);
}
void
VideoNode
::
updateColors
(
int
brightness
,
int
contrast
,
int
hue
,
int
saturation
)
{
Q_ASSERT
(
m_materialType
==
MaterialTypeVideo
);
if
(
m_materialType
!=
MaterialTypeVideo
)
{
return
;
}
static_cast
<
VideoMaterial
*>
(
material
())
->
updateColors
(
brightness
,
contrast
,
hue
,
saturation
);
markDirty
(
DirtyMaterial
);
}
...
...
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