Skip to content
Snippets Groups Projects
Commit 1c95d9b5 authored by Joaquim Casals Buñuel's avatar Joaquim Casals Buñuel
Browse files

Added storeKeyFrame() storeCapture()

parent 9c2872db
No related branches found
No related tags found
1 merge request!329WIP: New processor workflow
...@@ -249,6 +249,18 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce ...@@ -249,6 +249,18 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce
*/ */
virtual bool triggerInKeyFrame(FrameBasePtr _keyframe_ptr, const Scalar& _time_tolerance) = 0; virtual bool triggerInKeyFrame(FrameBasePtr _keyframe_ptr, const Scalar& _time_tolerance) = 0;
/** \brief store key frame
*
* Returns true if the key frame should be stored
*/
virtual bool storeKeyFrame(FrameBasePtr) = 0;
/** \brief store capture
*
* Returns true if the capture should be stored
*/
virtual bool storeCapture(CaptureBasePtr) = 0;
/** \brief Vote for KeyFrame generation /** \brief Vote for KeyFrame generation
* *
* If a KeyFrame criterion is validated, this function returns true, * If a KeyFrame criterion is validated, this function returns true,
......
...@@ -36,8 +36,10 @@ void ProcessorBase::keyFrameCallback(FrameBasePtr _keyframe_ptr, const Scalar& _ ...@@ -36,8 +36,10 @@ void ProcessorBase::keyFrameCallback(FrameBasePtr _keyframe_ptr, const Scalar& _
WOLF_DEBUG("P", isMotion() ? "M " : "T ", getName(), ": KF", _keyframe_ptr->id(), " callback received with ts = ", _keyframe_ptr->getTimeStamp()); WOLF_DEBUG("P", isMotion() ? "M " : "T ", getName(), ": KF", _keyframe_ptr->id(), " callback received with ts = ", _keyframe_ptr->getTimeStamp());
assert(_keyframe_ptr != nullptr && "keyFrameCallback with a nullptr frame"); assert(_keyframe_ptr != nullptr && "keyFrameCallback with a nullptr frame");
// buffering anyway
buffer_pack_kf_.add(_keyframe_ptr, _time_tol_other); // asking if key frame should be stored
if (storeKeyFrame(_keyframe_ptr))
buffer_pack_kf_.add(_keyframe_ptr, _time_tol_other);
// if trigger true -> processKeyFrame // if trigger true -> processKeyFrame
if (triggerInKeyFrame(_keyframe_ptr, _time_tol_other)) if (triggerInKeyFrame(_keyframe_ptr, _time_tol_other))
...@@ -53,7 +55,8 @@ void ProcessorBase::captureCallback(CaptureBasePtr _capture_ptr) ...@@ -53,7 +55,8 @@ void ProcessorBase::captureCallback(CaptureBasePtr _capture_ptr)
// if trigger, process directly without buffering // if trigger, process directly without buffering
if (triggerInCapture(_capture_ptr)) if (triggerInCapture(_capture_ptr))
processCapture(_capture_ptr); processCapture(_capture_ptr);
else // asking if capture should be stored
if (storeCapture(_capture_ptr))
buffer_capture_.add(_capture_ptr->getTimeStamp(), _capture_ptr); buffer_capture_.add(_capture_ptr->getTimeStamp(), _capture_ptr);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment