Skip to content

Conversation

@OhadMeir
Copy link
Contributor

@OhadMeir OhadMeir commented Jan 15, 2024

Currently frame archives are created per extension type. There are several streams that use RS2_EXTENSION_VIDEO_FRAME and the queue might get full, especially if a syncher is involved.

This PR creates archives also based on the stream type, so IR1+2 still share a queue but they come together and don't have to wait in the syncher.

Tracked on [RSDEV-599]

@OhadMeir OhadMeir changed the title Development Frame queue per stream, not per extension Jan 15, 2024
@OhadMeir OhadMeir force-pushed the development branch 2 times, most recently from f49d17f to 9bc101c Compare January 17, 2024 07:50
@OhadMeir OhadMeir marked this pull request as ready for review January 17, 2024 08:42
@OhadMeir OhadMeir requested a review from Nir-Az January 17, 2024 08:43
src/source.h Outdated
{
public:
frame_source(uint32_t max_publish_list_size = 16);
//using stream_uid = std::pair< rs2_stream, int >; // Stream type and index
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

src/source.cpp Outdated
return _archive[RS2_EXTENSION_VIDEO_FRAME]->begin_callback();
// return _archive[RS2_EXTENSION_DEPTH_FRAME]->begin_callback();
if( id.second >= RS2_EXTENSION_COUNT )
id.first = RS2_STREAM_COUNT; // For added extensions like GPU accelerated frames
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes needed.
When adding an extension we need to create the archive because add_extension is templated with the archive type. At that stage we don't know the stream type that will be used, but cannot keep the type for later allocation.
When using the allocated archive we need to find it with the same key.

src/source.cpp Outdated
if( it == _archive.end() )
{
create_archive( id );
it = _archive.find( id ); // Now will successfully find
Copy link
Collaborator

Choose a reason for hiding this comment

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

Verify if we can optimize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Optimized. create_archive now returns iterator to new archive.

src/source.cpp Outdated
throw wrong_api_call_sequence_exception( "Requested frame type is not supported!" );
{
create_archive( id );
it = _archive.find( id ); // Now will successfully find
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Optimized

@Nir-Az Nir-Az self-requested a review January 17, 2024 10:35
Copy link
Collaborator

@Nir-Az Nir-Az left a comment

Choose a reason for hiding this comment

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

Small comments

@OhadMeir OhadMeir merged commit e753ab7 into IntelRealSense:development Jan 18, 2024
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