Skip to content

Commit

Permalink
Follow-up on IntelRealSense#1658
Browse files Browse the repository at this point in the history
(cherry picked from commit e7fc8dc3270c11816adf669be4eabb30046d9a4d)
  • Loading branch information
dorodnic committed May 8, 2018
1 parent 29cab27 commit f45a99e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions include/librealsense2/hpp/rs_processing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ namespace rs2
points calculate(frame depth)
{
_block->invoke(std::move(depth));
return _queue.wait_for_frame();
rs2::frame f;
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return points(f);
}

void map_to(frame mapped)
Expand Down Expand Up @@ -349,7 +352,8 @@ namespace rs2
{
(*_block)(frame);
rs2::frame f;
_queue.poll_for_frame(&f);
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return frameset(f);
}

Expand Down Expand Up @@ -387,7 +391,10 @@ namespace rs2
if(depth)
{
_block->invoke(std::move(depth));
return _queue.wait_for_frame();
rs2::frame f;
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return video_frame(f);
}
return depth;
}
Expand Down Expand Up @@ -432,7 +439,8 @@ namespace rs2
{
(*_block)(frame);
rs2::frame f;
_queue.poll_for_frame(&f);
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return f;
}

Expand Down Expand Up @@ -469,7 +477,8 @@ namespace rs2
{
(*_block)(frame);
rs2::frame f;
_queue.poll_for_frame(&f);
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return f;
}

Expand Down Expand Up @@ -506,7 +515,8 @@ namespace rs2
{
(*_block)(frame);
rs2::frame f;
_queue.poll_for_frame(&f);
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return f;
}

Expand Down Expand Up @@ -543,7 +553,8 @@ namespace rs2
{
(*_block)(frame);
rs2::frame f;
_queue.poll_for_frame(&f);
if (!_queue.poll_for_frame(&f))
throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
return f;
}

Expand Down

0 comments on commit f45a99e

Please sign in to comment.