Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima
Commits
95aeeae8
Commit
95aeeae8
authored
Mar 05, 2021
by
Alejandro Homs Puron
Committed by
operator for beamline
Mar 06, 2021
Browse files
Buffer & Video: fix issues with SoftOpExt:
* Take into account SoftOpExt in image buffer overrun & availability
parent
091b2201
Pipeline
#42710
failed with stages
in 8 minutes and 8 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
control/src/CtControl.cpp
View file @
95aeeae8
...
...
@@ -1296,11 +1296,18 @@ bool CtControl::_checkOverrun(Data& aData, AutoMutex& l)
const
ImageStatus
&
imageStatus
=
m_status
.
ImageCounters
;
long
imageToProcess
=
imageStatus
.
LastImageAcquired
-
imageStatus
.
LastBaseImageReady
;
// ext ops are not in-place, relaxing hw buffer limit is LastImageReady
// if no ext ops, full processing chain needs orig hw buffer
bool
full_chain
=
!
m_op_ext_link_task_active
;
long
imageToSave
=
imageStatus
.
LastImageAcquired
-
imageStatus
.
LastImageSaved
;
bool
lastProcIsCounter
=
m_op_ext_sink_task_active
&&
full_chain
;
long
lastProcessed
=
lastProcIsCounter
?
imageStatus
.
LastCounterReady
:
imageStatus
.
LastImageReady
;
long
imageToProcess
=
imageStatus
.
LastImageAcquired
-
lastProcessed
;
long
lastUsedForSave
=
full_chain
?
imageStatus
.
LastImageSaved
:
imageStatus
.
LastImageReady
;
long
imageToSave
=
imageStatus
.
LastImageAcquired
-
lastUsedForSave
;
long
nb_buffers
;
m_ct_buffer
->
getNumber
(
nb_buffers
);
...
...
@@ -1322,7 +1329,7 @@ bool CtControl::_checkOverrun(Data& aData, AutoMutex& l)
m_ct_saving
->
getSaveCounters
(
first_to_save
,
last_to_save
);
DEB_ERROR
()
<<
DEB_VAR2
(
first_to_save
,
last_to_save
);
int
frames_to_save
=
last_to_save
-
first_to_save
+
1
;
int
frames_to_compress
=
imageStatus
.
Last
Base
ImageReady
-
last_to_save
;
int
frames_to_compress
=
imageStatus
.
LastImageReady
-
last_to_save
;
bool
slow_processing
=
frames_to_compress
>
frames_to_save
;
DEB_ERROR
()
<<
DEB_VAR2
(
frames_to_compress
,
frames_to_save
);
error_code
=
slow_processing
?
ProcessingOverun
:
SaveOverun
;
...
...
control/src/CtVideo.cpp
View file @
95aeeae8
...
...
@@ -4,6 +4,7 @@
#include
"lima/CtAcquisition.h"
#include
"lima/CtImage.h"
#include
"lima/CtBuffer.h"
#include
"lima/SoftOpExternalMgr.h"
#include
"processlib/PoolThreadMgr.h"
#include
"processlib/SinkTask.h"
...
...
@@ -26,7 +27,8 @@ class CtVideo::_Data2ImageTask : public SinkTaskBase
{
DEB_CLASS_NAMESPC
(
DebModControl
,
"Data to image"
,
"Control"
);
public:
_Data2ImageTask
(
CtVideo
&
cnt
)
:
SinkTaskBase
(),
m_nb_buffer
(
0
),
m_cnt
(
cnt
)
{}
_Data2ImageTask
(
CtVideo
&
cnt
)
:
SinkTaskBase
(),
m_nb_buffer
(
0
),
m_data_always_available
(
false
),
m_cnt
(
cnt
)
{}
virtual
void
process
(
Data
&
aData
)
{
...
...
@@ -82,13 +84,21 @@ public:
}
long
m_nb_buffer
;
bool
m_data_always_available
;
private:
inline
bool
_check_available
(
Data
&
aData
)
{
DEB_MEMBER_FUNCT
();
CtControl
::
ImageStatus
status
;
m_cnt
.
m_ct
.
getImageStatus
(
status
);
if
(
m_data_always_available
)
return
true
;
long
offset
=
status
.
LastImageAcquired
-
aData
.
frameNumber
;
DEB_TRACE
()
<<
DEB_VAR4
(
status
.
LastImageAcquired
,
aData
.
frameNumber
,
offset
,
m_nb_buffer
);
return
offset
<
m_nb_buffer
;
}
...
...
@@ -1054,6 +1064,13 @@ void CtVideo::_prepareAcq()
m_read_image
->
frameNumber
=
-
1
;
m_write_image
->
frameNumber
=
-
1
;
m_data_2_image_task
->
m_data_always_available
=
false
;
SoftOpExternalMgr
*
op_ext
=
m_ct
.
externalOperation
();
bool
op_ext_link_task_active
,
op_ext_sink_task_active
;
op_ext
->
isTaskActive
(
op_ext_link_task_active
,
op_ext_sink_task_active
);
if
((
m_pars
.
video_source
==
LAST_IMAGE
)
&&
op_ext_link_task_active
)
m_data_2_image_task
->
m_data_always_available
=
true
;
CtBuffer
*
buffer
=
m_ct
.
buffer
();
buffer
->
getNumber
(
m_data_2_image_task
->
m_nb_buffer
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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