Skip to content
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

Merged
merged 4 commits into from
Mar 5, 2019

Conversation

dorodnic
Copy link
Contributor

This adds function on context that can take instance of software_device and report it later from query_devices.

This opens two possibilities:
a. Make pipeline work with software_device
b. Make the Viewer visualize software_device (by adding it to context in Viewer main

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.

Copy link
Collaborator

@ev-mp ev-mp left a 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 ?

@@ -195,6 +202,8 @@ namespace librealsense

void software_sensor::on_video_frame(rs2_software_video_frame software_frame)
{
if (!_is_streaming) return;
Copy link
Collaborator

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)
Copy link
Collaborator

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);
Copy link
Collaborator

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

@dorodnic
Copy link
Contributor Author

dorodnic commented Mar 3, 2019

Updated

@ev-mp ev-mp merged commit 84b863d into IntelRealSense:development Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants