-
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
Refactor pipeline resolve #2006
Refactor pipeline resolve #2006
Conversation
It's finally green! 🎉 |
src/context.cpp
Outdated
{ | ||
std::vector<tagged_profile> markers; | ||
markers.push_back({ RS2_STREAM_COLOR, -1, 640, 480, RS2_FORMAT_RGB8, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); | ||
markers.push_back({ RS2_STREAM_DEPTH, -1, 640, 480, RS2_FORMAT_Z16, 30, profile_tag::PROFILE_TAG_SUPERSET | profile_tag::PROFILE_TAG_DEFAULT }); |
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.
I would not expect depth and infrared to be available on a platform camera
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.
it probably can also default to higher resolution... 1920x1080?
src/core/streaming.h
Outdated
typedef enum profile_tag | ||
{ | ||
PROFILE_TAG_ANY = 0, | ||
PROFILE_TAG_SUPERSET = 1, |
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.
Consider adding comment:
PROFILE_TAG_SUPERSET // to be included in enable_all
PROFILE_TAG_DEFAULT // to be included in default pipeline start
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.
done
platform::usb_spec ds5_device::get_usb_spec() const | ||
{ | ||
if(!supports_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR)) | ||
return platform::usb_undefined; |
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.
Why not USB3?
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.
it is better to let the caller decide what to do in case usb type is unknown
@@ -37,6 +37,25 @@ namespace librealsense | |||
ds5_advanced_mode_base(ds5_device::_hw_monitor, get_depth_sensor()) {} | |||
|
|||
std::shared_ptr<matcher> create_matcher(const frame_holder& frame) const override; | |||
|
|||
std::vector<tagged_profile> get_profiles_tags() const override |
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.
Suggestion, to consider:
Profile tags are queries every time you call tag_profile
, so the resulting vector will be created and re-created over and over again. This is only during start-up, but still.
Perhaps you can add another (non-virtual) getter that would fetch a lazy<std::vector<tagged_profile>>
that would be initialized with lambda to get_profiles_tags
?
@@ -79,7 +79,7 @@ namespace librealsense | |||
assign_stream(_owner->_gpio_streams[p->get_stream_index()-1], p); | |||
if (p->get_framerate() == 1000 && | |||
p->get_format() == RS2_FORMAT_MOTION_XYZ32F) | |||
p->make_default(); | |||
get_device().tag_profile(p.get()); |
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.
Is there a way to ensure that library writer will not forget to call tag_profile
on one of the camera profiles?
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.
actually this "if" should be removed and added is a default stream.
for both this comment and the one above I can init the profiles on the device creation, but I guess that I will need to record everything again.
src/mock/recorder.cpp
Outdated
int min_version[ver_size]; | ||
std::sscanf(api_version.c_str(), "%d.%d.%d", §ion_version[0], §ion_version[1], §ion_version[2]); | ||
std::sscanf(min_api_version.c_str(), "%d.%d.%d", &min_version[0], &min_version[1], &min_version[2]); | ||
for (int i = 0; i < ver_size; i++) |
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 if invalid string format will be passed?
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.
throw exception in case of bad format
done
src/mock/recorder.cpp
Outdated
@@ -403,6 +403,19 @@ namespace librealsense | |||
select_api_version.bind(1, section_id); | |||
select_api_version.bind(2, API_VERSION_KEY); | |||
auto api_version = select_api_version()[0].get_string(); | |||
const int ver_size = 3; | |||
int section_version[ver_size]; |
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.
Maybe initialize with zeros?
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.
with -1
src/sensor.cpp
Outdated
if (tag == profile_tag::PROFILE_TAG_ANY) | ||
return *_profiles; | ||
|
||
stream_profiles profiles; |
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.
Consider renaming to something like result
. profiles
is confusing with _profiles
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.
done
unit-tests/unit-tests-live.cpp
Outdated
{ | ||
auto it = std::find_if(begin(all_streams), end(all_streams), [d](const rs2::stream_profile profile) | ||
{ | ||
return d == profile; |
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.
Wouldn't this work with regular find
?
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.
done
Tracked on: DSO-9472,
Following-up on #1543