-
Notifications
You must be signed in to change notification settings - Fork 5k
remove sqlite, rs2::recording_context & ::mock_context #11345
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
|
|
||
| /** | ||
| * Create librealsense context that will try to record all operations over librealsense into a file | ||
| * \deprecated |
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.
Please explain what do you mean by deprecated? what will happen if someone calls this method? Will he get an exception? It would be great if this would be written besides the "deprecated" comment
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 means the function will be marked as deprecated, as the Doxygen documentation states.
If you check rs.cpp, you'll see that it now throws an exception with the text deprecated...
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.
ok
| standard, | ||
| record, | ||
| playback | ||
| standard |
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.
do we need to let this enum, now that it has only one unique value?
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 started removing it, but kept it because of changed in the dds branch.
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.
you mean there is another value in this enum for the dds branch?
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.
Not another value -- other constructors, one with no parameters and another one, with another parameter type.
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.
ok
| const char* section = nullptr, | ||
| rs2_recording_mode mode = RS2_RECORDING_MODE_COUNT, | ||
| std::string min_api_version = "0.0.0"); | ||
| explicit context( backend_type type ); |
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.
If you choose to keep this enum, maybe we should add as default value the unique value. Agree?
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.
No. On the 'dds` branch there's a default ctor, so this distinguishes it from another usage.
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.
So maybe there is an issue there, because it does not seem right that "standard" is not default, even if there are other possible values.
Let's talk about it tomorrow, please
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 want it to be explicit, just like it has been until now. You want this constructor, you specify standard.
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.
ok
| #include "sr300-fw-update-device.h" | ||
| #include "sr300.h" | ||
| #include "ivcam-private.h" | ||
| #include <librealsense2/h/rs_internal.h> |
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.
Please confirm this is really needed
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.
Yes, needed -- I removed an #include in context.h which included this one. Not that it's removed, I needed to add it elsewhere.
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.
ok
| #include "firmware_logger_device.h" | ||
| #include "device-calibration.h" | ||
| #include "calibrated-sensor.h" | ||
| #include <librealsense2/h/rs_internal.h> |
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.
Please confirm this is needed here
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.
Needed.
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.
ok
| verify_version_compatibility(api_version); | ||
|
|
||
| return new rs2_context{ std::make_shared<librealsense::context>(librealsense::backend_type::standard) }; | ||
| return new rs2_context{ std::make_shared< librealsense::context >( librealsense::backend_type::standard ) }; |
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 do not like these spaces beside the "<>", but... your style :-)
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.
No, it's our style.
There is a .clang-format file that you should be using. See me tomorrow if you do not :)
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.
ok - feel free to send it to me
| verify_version_compatibility(api_version); | ||
|
|
||
| return new rs2_context{ std::make_shared<librealsense::context>(librealsense::backend_type::record, filename, section, mode) }; | ||
| throw not_implemented_exception( "deprecated" ); |
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 answers one of my previous comments, but please add there the fact that exception is thrown when calling the deprecated api methods.
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.
No. A deprecated method should not be called. If someone does, he get an exception.
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.
ok
| inline bool make_context(const char* id, rs2::context* ctx, std::string min_api_version = "0.0.0") | ||
| { | ||
| rs2::log_to_file(RS2_LOG_SEVERITY_DEBUG); | ||
| min_api_version; |
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.
Please confirm this line is needed, and explain why if it is.
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.
To avoid "unused variable" warnings.
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.
Sorry, but I do not agree - I prefer to get a warning than seeing this - don't you?
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.
Normally the usual way to do it is (that I have seen):
(void) min_api_version;
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.
You are correct, but I still do not understand exactly why... there is also std::ignore. I'll fix it in the dds branch when I merge there?
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.
ok
| } | ||
|
|
||
| command_line_params::instance()._found_any_section = true; | ||
| return true; |
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.
Should this method be kept if this is the only things it does?
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's also modified, but differently, on the dds branch. Live tests are old and we'll not invest much in improving them. For now this change you're suggesting may happen, but in a different 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.
ok, please open a ticket for that
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.
No, Remi. We won't waste time on live-tests. I'll do it if I happen to be messing around in live-tests again. Leave it be... you're welcome to open a ticket if you insist.
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.
One thing I can offer is that right after we merge this I'll be merging with the dds branch, where there will be conflicts. I'll take a look then to see what can be removed.
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.
ok
| #include "core/streaming.h" | ||
| #include "device.h" | ||
| #include "context.h" | ||
| #include <librealsense2/h/rs_internal.h> |
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.
Please confirm this line is needed
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.
Needed.
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.
ok
remibettan
left a comment
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.
Few comments added - thanks!
Thank You :) |
remibettan
left a comment
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
SQL usage is by
rs2::recording_contextandrs2::mock_context, both only in use in the legacy live-tests but never actually run. These are removed, as well, andrs2_create_recording_context/_mock_contextare deprecated.Tracked on [LRS-625]