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
f6e72014
Unverified
Commit
f6e72014
authored
Aug 12, 2019
by
Gus Grubba
Committed by
GitHub
Aug 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7676 from mavlink/noVehicleNoFullScreen
Disable full screen video if no vehicle or connection lost
parents
397c66ce
80926470
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
VideoManager.cc
src/FlightDisplay/VideoManager.cc
+29
-0
VideoManager.h
src/FlightDisplay/VideoManager.h
+2
-1
No files found.
src/FlightDisplay/VideoManager.cc
View file @
f6e72014
...
...
@@ -271,6 +271,20 @@ VideoManager::uvcEnabled()
}
#endif
//-----------------------------------------------------------------------------
void
VideoManager
::
setfullScreen
(
bool
f
)
{
if
(
f
)
{
//-- No can do if no vehicle or connection lost
if
(
!
_activeVehicle
||
_activeVehicle
->
connectionLost
())
{
f
=
false
;
}
}
_fullScreen
=
f
;
emit
fullScreenChanged
();
}
//-----------------------------------------------------------------------------
void
VideoManager
::
_updateSettings
()
...
...
@@ -357,6 +371,7 @@ void
VideoManager
::
_setActiveVehicle
(
Vehicle
*
vehicle
)
{
if
(
_activeVehicle
)
{
disconnect
(
_activeVehicle
,
&
Vehicle
::
connectionLostChanged
,
this
,
&
VideoManager
::
_connectionLostChanged
);
if
(
_activeVehicle
->
dynamicCameras
())
{
QGCCameraControl
*
pCamera
=
_activeVehicle
->
dynamicCameras
()
->
currentCameraInstance
();
if
(
pCamera
)
{
...
...
@@ -367,6 +382,7 @@ VideoManager::_setActiveVehicle(Vehicle* vehicle)
}
_activeVehicle
=
vehicle
;
if
(
_activeVehicle
)
{
connect
(
_activeVehicle
,
&
Vehicle
::
connectionLostChanged
,
this
,
&
VideoManager
::
_connectionLostChanged
);
if
(
_activeVehicle
->
dynamicCameras
())
{
connect
(
_activeVehicle
->
dynamicCameras
(),
&
QGCCameraManager
::
streamChanged
,
this
,
&
VideoManager
::
restartVideo
);
QGCCameraControl
*
pCamera
=
_activeVehicle
->
dynamicCameras
()
->
currentCameraInstance
();
...
...
@@ -374,11 +390,24 @@ VideoManager::_setActiveVehicle(Vehicle* vehicle)
pCamera
->
resumeStream
();
}
}
}
else
{
//-- Disable full screen video if vehicle is gone
setfullScreen
(
false
);
}
emit
autoStreamConfiguredChanged
();
restartVideo
();
}
//----------------------------------------------------------------------------------------
void
VideoManager
::
_connectionLostChanged
(
bool
connectionLost
)
{
if
(
connectionLost
)
{
//-- Disable full screen video if connection is lost
setfullScreen
(
false
);
}
}
//----------------------------------------------------------------------------------------
void
VideoManager
::
_aspectRatioChanged
()
...
...
src/FlightDisplay/VideoManager.h
View file @
f6e72014
...
...
@@ -73,7 +73,7 @@ public:
virtual
bool
uvcEnabled
();
#endif
virtual
void
setfullScreen
(
bool
f
)
{
_fullScreen
=
f
;
emit
fullScreenChanged
();
}
virtual
void
setfullScreen
(
bool
f
)
;
virtual
void
setIsTaisync
(
bool
t
)
{
_isTaisync
=
t
;
emit
isTaisyncChanged
();
}
// Override from QGCTool
...
...
@@ -100,6 +100,7 @@ protected slots:
void
_updateUVC
();
void
_setActiveVehicle
(
Vehicle
*
vehicle
);
void
_aspectRatioChanged
();
void
_connectionLostChanged
(
bool
connectionLost
);
protected:
void
_updateSettings
();
...
...
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