Skip to content
Snippets Groups Projects
Commit e685235f authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Use structure in PM::getState

parent 44d0919d
No related branches found
No related tags found
1 merge request!379Resolve "Problem::getState(structure) doesn't care about structure"
......@@ -420,6 +420,8 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr)
VectorComposite ProcessorMotion::getState(const StateStructure& _structure) const
{
const StateStructure& structure = (_structure == "" ? state_structure_ : _structure);
if (last_ptr_ == nullptr or last_ptr_->getFrame() == nullptr) // We do not have any info of where to find a valid state
// Further checking here for origin_ptr is redundant: if last=null, then origin=null too.
......@@ -435,7 +437,7 @@ VectorComposite ProcessorMotion::getState(const StateStructure& _structure) cons
// this may happen when in the very first frame where the capture has no motion info --> empty buffer
if (last_ptr_->getBuffer().empty())
{
return last_ptr_->getFrame()->getState(state_structure_);
return last_ptr_->getFrame()->getState(structure);
}
/* Doing this:
......@@ -511,6 +513,7 @@ VectorComposite ProcessorMotion::getState(const StateStructure& _structure) cons
// _x needs to have the size of the processor state
VectorComposite ProcessorMotion::getState(const TimeStamp& _ts, const StateStructure& _structure) const
{
const StateStructure& structure = (_structure == "" ? state_structure_ : _structure);
// We need to search for the capture containing a motion buffer with the queried time stamp
CaptureMotionPtr capture_motion = findCaptureContainingTimeStamp(_ts);
......@@ -528,7 +531,7 @@ VectorComposite ProcessorMotion::getState(const TimeStamp& _ts, const StateStruc
// this may happen when in the very first frame where the capture has no motion info --> empty buffer
if (capture_motion->getBuffer().empty())
{
return capture_motion->getFrame()->getState(state_structure_);
return capture_motion->getFrame()->getState(structure);
}
/* Doing this:
......
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