rs-convert converts frames using sensor callback - #6308
Merged
Conversation
aseelegbaria
commented
Apr 27, 2020
Contributor
- the tool now names frames based on frame timestamp (instead of frame number)
- the tool creates metadata text file for the frame
- the tool converts frames by running over sensors and using sensor callback (instead of wait_for_frames), for ply converter it still uses wait_for_frames since we need synced frames
maloel
self-requested a review
May 2, 2020 07:15
maloel
reviewed
May 2, 2020
| if (frames_map_get_and_set(frame.get_profile().stream_type(), frame.get_frame_number())) { | ||
| continue; | ||
| } | ||
| if (depthframe && (_streamType == rs2_stream::RS2_STREAM_ANY || depthframe.get_profile().stream_type() == _streamType)) { |
Contributor
There was a problem hiding this comment.
Can we do this outside the worker? So the thread won't even start of not the right frame/stream?
maloel
reviewed
May 2, 2020
| if (fs) { | ||
| uint8_t buffer[4]; | ||
| add_sub_worker( | ||
| [filenameS, depthframe] { |
Contributor
There was a problem hiding this comment.
Indentation seems off here -- please check
maloel
reviewed
May 2, 2020
| } | ||
| } | ||
| }); | ||
| std::stringstream metadata_file; |
Contributor
There was a problem hiding this comment.
Why is the frame written from a sub_worker but the metadata from here?
maloel
reviewed
May 2, 2020
| for (size_t i = 0; i < frameset.size(); i++) { | ||
| auto frame = frameset[i].as<rs2::depth_frame>(); | ||
| [this, &frame] { | ||
| auto depthframe = frame.as<rs2::depth_frame>(); |
Contributor
There was a problem hiding this comment.
(Same comments here and the other convert hpp files as above)
maloel
reviewed
May 2, 2020
| cout << posP << "%" << "\r" << flush; | ||
| } | ||
|
|
||
| auto plyconverter = make_shared<rs2::tools::converter::converter_ply>( |
Contributor
There was a problem hiding this comment.
No need to allocate anything until we check that filename is set
maloel
reviewed
May 2, 2020
|
|
||
| rs2::frameset frameset; | ||
| auto frameNumber = 0ULL; | ||
| std::mutex mutex; |
maloel
reviewed
May 2, 2020
maloel
reviewed
May 2, 2020
| playback.set_real_time(false); | ||
| std::vector<rs2::sensor> sensors = playback.query_sensors(); | ||
|
|
||
| rs2::frameset frameset; |
maloel
reviewed
May 13, 2020
| // Record all the available metadata attributes | ||
| for (size_t i = 0; i < RS2_FRAME_METADATA_COUNT; i++) | ||
| { | ||
| if (frm.supports_frame_metadata((rs2_frame_metadata_value)i)) |
Contributor
There was a problem hiding this comment.
Maybe make i of type rs2_frame_metadata_value?
added 3 commits
May 18, 2020 18:36
maloel
approved these changes
May 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.