-
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
add dds custom on-video-frame to avoid data copy #11561
Conversation
@@ -699,6 +700,40 @@ namespace librealsense | |||
software_sensor::open( profiles ); | |||
} | |||
|
|||
void custom_on_video_frame( rs2_software_video_frame const & software_frame ) |
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 override the base class on_video_frame
?
custom
does not convey any meaning. If not overriding use on_video_frame_deffered_deleter
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.
Because eventually we won't even be using rs2_software_video_frame
. We can maybe still override the name, but let's do it separately -- for now I like that it's clear that this is not some virtual function (which it isn't) that can be called from elsewhere.
data.metadata_size = (uint32_t)( _metadata_map.size() * sizeof( rs2_metadata_type ) ); | ||
memcpy( data.metadata_blob.data(), _metadata_map.data(), data.metadata_size ); | ||
|
||
auto frame_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 does the i
in frame_i
stands for? allocated_frame
or new_frame
seems a more meaningful name
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 a frame_interface
(as opposed to a frame
)
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 don't like it that the name is dependent on the type. The name should convey the purpose of the variable and should remain the same even if allocate_new_video_frame
will change to return frame
or video_frame
and not frame_interface
.
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, I'll change it when I overhaul the function?
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.
Approved, some comments should be handled in the upcoming PR that will further refactor the frame metadata.
rsutils::deferred
, which is an easy RAII for functions, kinda like a destructor when you go out of scopeframe::data
)rs2_software_video_frame
usage completelyframe_additional_data
being copied and moved around a lot