-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Options registry for non-built-in DDS options #12163
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
Conversation
(cherry picked from commit 7ec4461)
|
||
inline rs2_option index_to_option( size_t index ) | ||
{ | ||
return rs2_option( -( int( index ) + 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 checking if index >= INT_MAX.
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.
Same as the other
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 must say this function is not readable.
I asked Remi to look and he also didn't understand.
Why all the values are negative?
@maloel please add some comments
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.
Added:
// Index = index into the _name_by_index array -> 0-based
// Registered rs2_option value will be negative, and starting at -1:
Will be in next PR
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.
LGTM
New options can now be registered by their name/string:
rs2_option_from_string
, the reverse ofrs2_option_to_string
Various other minor changes along the way. I recommend to just review by commit...
Tracked by [LRS-864]