-
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
API for adding software device into existing context #3340
API for adding software device into existing context #3340
Conversation
(cherry picked from commit 530d17b)
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.
Can you add a unit-test that exercises the new API ?
src/software-device.cpp
Outdated
@@ -195,6 +202,8 @@ namespace librealsense | |||
|
|||
void software_sensor::on_video_frame(rs2_software_video_frame software_frame) | |||
{ | |||
if (!_is_streaming) return; |
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.
Can you add it to software_sensor::on_motion_frame(...
? Seem to be missing as well
@@ -239,6 +239,13 @@ namespace rs2 | |||
|
|||
return software_sensor(sensor); | |||
} | |||
|
|||
void inject_to(context ctx) |
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.
Shouldn't be &ctx?
src/context.h
Outdated
@@ -131,6 +131,7 @@ namespace librealsense | |||
|
|||
std::shared_ptr<device_interface> add_device(const std::string& file); | |||
void remove_device(const std::string& file); | |||
void add_device(std::shared_ptr<device_info> software_device); |
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 may be confusing with the definition 2 lines above.
Maybe add_software_device
- will also be consistent with internal rs2_context_add_software_device
Updated |
cef0514
to
4811632
Compare
This adds function on context that can take instance of
software_device
and report it later fromquery_devices
.This opens two possibilities:
a. Make
pipeline
work withsoftware_device
b. Make the Viewer visualize
software_device
(by adding it tocontext
in Viewermain
Ultimately, this is good for all kinds of importers - software device can be used to implement converters from other file formats, but also convert other live sensors into librealsense sensors.