Skip to content

MD performance and misc changes #11600

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

Merged
merged 12 commits into from
Mar 23, 2023
Merged

MD performance and misc changes #11600

merged 12 commits into from
Mar 23, 2023

Conversation

maloel
Copy link
Contributor

@maloel maloel commented Mar 22, 2023

This is an interim PR, to avoid massive changes all together

  • performance-related changes for metadata
  • one bug fix (a frame without metadata needs to clear the map)
  • unit-tests are still WIP
  • add py stream_profile::bytes_per_pixel() (because it just makes life easier!)

@maloel maloel requested a review from OhadMeir March 22, 2023 13:37
LOG_DEBUG( "-----> JSON size = " << stream_header_message.json_data().dump().length() );
LOG_DEBUG( "-----> CBOR size = " << json::to_cbor( stream_header_message.json_data() ).size() );
auto json_string = slice( stream_header_message.custom_data< char const >(), stream_header_message._data.size() );
LOG_DEBUG( "-----> JSON = " << shorten_json_string( json_string, 300 ) << " size " << json_string.length() );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 300? I think that if we shorten it than about a line width, 120 chars, should be better

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have lots of info, so this depends on the message, I found 300 to be not too long and long enough that you could see the top-level json elements and their values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@@ -117,11 +120,11 @@ static void on_discovery_stream_header( std::shared_ptr< dds_stream_server > con
{ "stream-name", stream->name() },
{ "options" , stream_options },
{ "intrinsics" , intrinsics },
{ "recommended-filters", stream_filters },
{ "recommended-filters", std::move( stream_filters ) },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't move be better also for intrinsics and options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could do it for everything, but really the biggest value would be for compound json objects or objects that allocated memory of their own. I don't believe intrinsics fit, but you're right about options.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed. Will be in next PR.

@@ -4,6 +4,8 @@ Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
#include "pyrealsense2.h"
#include <librealsense2/rs.hpp>

#include <src/image.cpp> // bad idea? for get_image_bpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Including image.h won't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the function is not exposed thru rs2. I needed the actual implementation as part of the pyd.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I don't like including cpp files but it is in the python wrapper so lesser evil.
Exposing it in the API is currently not necessary.

Copy link
Contributor

@OhadMeir OhadMeir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for an interim PR. Comments can be handled in the next one.

@maloel maloel merged commit 0092641 into IntelRealSense:dds Mar 23, 2023
@maloel maloel deleted the dds branch March 23, 2023 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants