-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added functionality of no throw wait_for_frame #2049
Conversation
-Added API of try_wait_for_frame/s to frame_queue, syncer and pipeline. The function has the same functionality as wait_for_frame except in case of timeout try_wait_for_frame returns false instead of throwing exception. -Fixed bug of high CPU utilization in realsense-viewer Tracked on: DSO-9381
@@ -619,6 +619,37 @@ namespace librealsense | |||
return false; | |||
} | |||
|
|||
bool pipeline::try_wait_for_frames(frame_holder* frame, unsigned int timeout_ms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like duplicate code, can we reuse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought about adding try catch for run-time errors instead of duplicating the code, but than I assume that wait_for_frames throws only run-time exceptions in case of timeout, don't want to catch exception of invalid input for example. Is this a reasonable assumption?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the other way around - wait_for_frames
calls try_wait_for_frames
and throws if it returns false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of device disconnected should I return false or throw exception in try_wait_for frames? I assumed that I should return false, I can't differ between the two cases in which run-time exception is thrown
* refactor pipeline resolve * remove presets from pipeline config * add make_context to pipeline tests * pipeline wildcard streams test added * fix sort_best_quality * remove default streams filter from pipeline * remove make default * resolve default configurations first * override set_marker * set default configurations for each device
A new pull request was opened #2055 |
-Added API of try_wait_for_frame/s to frame_queue, syncer and pipeline.
The function has the same functionality as wait_for_frame except in case of timeout try_wait_for_frame
returns false instead of throwing exception.
-Fixed bug of high CPU utilization in realsense-viewer
Tracked on: DSO-9381