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
58b8db24
Commit
58b8db24
authored
Apr 13, 2020
by
Andrew Voznytsa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More consistent video receiver state handling
parent
ff1eb2d3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
41 deletions
+41
-41
main.cpp
VideoReceiverApp/main.cpp
+39
-28
VideoManager.cc
src/VideoManager/VideoManager.cc
+0
-13
GstVideoReceiver.cc
src/VideoReceiver/GstVideoReceiver.cc
+2
-0
No files found.
VideoReceiverApp/main.cpp
View file @
58b8db24
...
...
@@ -302,25 +302,8 @@ VideoReceiverApp::exec()
startStreaming
();
QObject
::
connect
(
_receiver
,
&
VideoReceiver
::
timeout
,
[
this
](){
QObject
::
connect
(
_receiver
,
&
VideoReceiver
::
timeout
,
[](){
qCDebug
(
AppLog
)
<<
"Streaming timeout"
;
_dispatch
([
this
](){
if
(
_streaming
)
{
_receiver
->
stop
();
}
else
{
if
(
--
_connect
>
0
)
{
qCDebug
(
AppLog
)
<<
"Restarting streaming"
;
_dispatch
([
this
](){
startStreaming
();
});
}
else
{
qCDebug
(
AppLog
)
<<
"Closing..."
;
delete
_receiver
;
_app
.
exit
();
}
}
});
});
QObject
::
connect
(
_receiver
,
&
VideoReceiver
::
streamingChanged
,
[
this
](
bool
active
){
...
...
@@ -329,16 +312,6 @@ VideoReceiverApp::exec()
qCDebug
(
AppLog
)
<<
"Streaming started"
;
}
else
{
qCDebug
(
AppLog
)
<<
"Streaming stopped"
;
_dispatch
([
this
](){
if
(
--
_connect
>
0
)
{
qCDebug
(
AppLog
)
<<
"Restarting streaming"
;
startStreaming
();
}
else
{
qCDebug
(
AppLog
)
<<
"Closing..."
;
delete
_receiver
;
_app
.
exit
();
}
});
}
});
...
...
@@ -374,6 +347,44 @@ VideoReceiverApp::exec()
}
});
QObject
::
connect
(
_receiver
,
&
VideoReceiver
::
onStartComplete
,
[
this
](
VideoReceiver
::
STATUS
status
){
if
(
status
!=
VideoReceiver
::
STATUS_OK
)
{
qCDebug
(
AppLog
)
<<
"Video receiver start failed"
;
_dispatch
([
this
](){
if
(
--
_connect
>
0
)
{
qCDebug
(
AppLog
)
<<
"Restarting ..."
;
_dispatch
([
this
](){
startStreaming
();
});
}
else
{
qCDebug
(
AppLog
)
<<
"Closing..."
;
delete
_receiver
;
_app
.
exit
();
}
});
}
else
{
qCDebug
(
AppLog
)
<<
"Video receiver started"
;
}
});
QObject
::
connect
(
_receiver
,
&
VideoReceiver
::
onStopComplete
,
[
this
](
VideoReceiver
::
STATUS
){
qCDebug
(
AppLog
)
<<
"Video receiver stopped"
;
_dispatch
([
this
](){
if
(
--
_connect
>
0
)
{
qCDebug
(
AppLog
)
<<
"Restarting ..."
;
_dispatch
([
this
](){
startStreaming
();
});
}
else
{
qCDebug
(
AppLog
)
<<
"Closing..."
;
delete
_receiver
;
_app
.
exit
();
}
});
});
return
_app
.
exec
();
}
...
...
src/VideoManager/VideoManager.cc
View file @
58b8db24
...
...
@@ -115,14 +115,9 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
_videoReceiver
[
0
]
=
toolbox
->
corePlugin
()
->
createVideoReceiver
(
this
);
_videoReceiver
[
1
]
=
toolbox
->
corePlugin
()
->
createVideoReceiver
(
this
);
connect
(
_videoReceiver
[
0
],
&
VideoReceiver
::
timeout
,
this
,
[
this
](){
_stopReceiver
(
0
);
});
connect
(
_videoReceiver
[
0
],
&
VideoReceiver
::
streamingChanged
,
this
,
[
this
](
bool
active
){
_streaming
=
active
;
emit
streamingChanged
();
_restartVideo
(
0
);
});
connect
(
_videoReceiver
[
0
],
&
VideoReceiver
::
onStartComplete
,
this
,
[
this
](
VideoReceiver
::
STATUS
status
)
{
...
...
@@ -178,14 +173,6 @@ VideoManager::setToolbox(QGCToolbox *toolbox)
// FIXME: AV: I believe _thermalVideoReceiver should be handled just like _videoReceiver in terms of event
// and I expect that it will be changed during multiple video stream activity
if
(
_videoReceiver
[
1
]
!=
nullptr
)
{
connect
(
_videoReceiver
[
1
],
&
VideoReceiver
::
timeout
,
this
,
[
this
](){
_stopReceiver
(
1
);
});
connect
(
_videoReceiver
[
1
],
&
VideoReceiver
::
streamingChanged
,
this
,
[
this
](
bool
active
){
_restartVideo
(
1
);
});
connect
(
_videoReceiver
[
1
],
&
VideoReceiver
::
onStartComplete
,
this
,
[
this
](
VideoReceiver
::
STATUS
status
)
{
if
(
status
==
VideoReceiver
::
STATUS_OK
)
{
_videoStarted
[
1
]
=
true
;
...
...
src/VideoReceiver/GstVideoReceiver.cc
View file @
58b8db24
...
...
@@ -644,6 +644,7 @@ GstVideoReceiver::_watchdog(void)
_dispatchSignal
([
this
](){
emit
timeout
();
});
stop
();
}
if
(
_decoding
&&
!
_removingDecoder
)
{
...
...
@@ -656,6 +657,7 @@ GstVideoReceiver::_watchdog(void)
_dispatchSignal
([
this
](){
emit
timeout
();
});
stop
();
}
}
});
...
...
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