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
1683185c
Commit
1683185c
authored
Feb 13, 2019
by
Gus Grubba
Committed by
Gus Grubba
Feb 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CP - Fix crash bug that could occur when reconnecting a camera.
parent
cf7e6107
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
14 deletions
+18
-14
QGCCameraManager.cc
src/Camera/QGCCameraManager.cc
+17
-13
QGCCameraManager.h
src/Camera/QGCCameraManager.h
+1
-1
No files found.
src/Camera/QGCCameraManager.cc
View file @
1683185c
...
...
@@ -12,8 +12,9 @@
QGC_LOGGING_CATEGORY
(
CameraManagerLog
,
"CameraManagerLog"
)
//-----------------------------------------------------------------------------
QGCCameraManager
::
CameraStruct
::
CameraStruct
(
QObject
*
parent
)
QGCCameraManager
::
CameraStruct
::
CameraStruct
(
QObject
*
parent
,
uint8_t
compID_
)
:
QObject
(
parent
)
,
compID
(
compID_
)
{
}
...
...
@@ -112,7 +113,7 @@ QGCCameraManager::_handleHeartbeat(const mavlink_message_t &message)
QString
sCompID
=
QString
::
number
(
message
.
compid
);
if
(
!
_cameraInfoRequest
.
contains
(
sCompID
))
{
qCDebug
(
CameraManagerLog
)
<<
"Hearbeat from "
<<
message
.
compid
;
CameraStruct
*
pInfo
=
new
CameraStruct
(
this
);
CameraStruct
*
pInfo
=
new
CameraStruct
(
this
,
message
.
compid
);
pInfo
->
lastHeartbeat
.
start
();
_cameraInfoRequest
[
sCompID
]
=
pInfo
;
//-- Request camera info
...
...
@@ -226,7 +227,9 @@ QGCCameraManager::_cameraTimeout()
//-- Has the camera stopped talking to us?
if
(
pInfo
->
lastHeartbeat
.
elapsed
()
>
5000
)
{
//-- Camera is gone. Remove it.
bool
autoStream
=
false
;
QGCCameraControl
*
pCamera
=
_findCamera
(
pInfo
->
compID
);
if
(
pCamera
)
{
qWarning
()
<<
"Camera"
<<
pCamera
->
modelName
()
<<
"stopped transmitting. Removing from list."
;
int
idx
=
_cameraLabels
.
indexOf
(
pCamera
->
modelName
());
if
(
idx
>=
0
)
{
...
...
@@ -236,9 +239,10 @@ QGCCameraManager::_cameraTimeout()
if
(
idx
>=
0
)
{
_cameras
.
removeAt
(
idx
);
}
bool
autoStream
=
pCamera
->
autoStream
();
autoStream
=
pCamera
->
autoStream
();
pCamera
->
deleteLater
();
delete
pInfo
;
}
_cameraInfoRequest
.
remove
(
sCompID
);
emit
cameraLabelsChanged
();
//-- If we have another camera, switch current camera.
...
...
src/Camera/QGCCameraManager.h
View file @
1683185c
...
...
@@ -76,7 +76,7 @@ protected:
class
CameraStruct
:
public
QObject
{
public:
CameraStruct
(
QObject
*
parent
);
CameraStruct
(
QObject
*
parent
,
uint8_t
compID_
);
QTime
lastHeartbeat
;
bool
infoReceived
=
false
;
bool
gaveUp
=
false
;
...
...
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