Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/pipeline/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#include "media/ros/ros_writer.h"
#include <src/proc/syncer-processing-block.h>
#include <src/core/frame-callback.h>
#ifdef BUILD_WITH_DDS
#include <src/dds/rs-dds-device-proxy.h>
#endif

#include <rsutils/string/from.h>

Expand Down Expand Up @@ -127,8 +130,21 @@ namespace librealsense
}

_dispatcher.start();
profile->_multistream.open();
profile->_multistream.start(callbacks);
#ifdef BUILD_WITH_DDS
if( Is< librealsense::dds_device_proxy >( dev ) )
{
// For DDS devices open() only sets requested profiles, start() actually starts streaming.
// Calling open() then start() sends open-streams control for all sensors before starting to stream,
// second open-streams control will resets the first (reverting first requested streams to defaults).
// open_and_start() starts streaming from the first sensor before the second open so it does not reset.
profile->_multistream.open_and_start( callbacks );
}
else
#endif
{
profile->_multistream.open();
profile->_multistream.start( callbacks );
}
_active_profile = profile;
_prev_conf = std::make_shared<config>(*conf);
}
Expand Down
13 changes: 13 additions & 0 deletions src/pipeline/resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,19 @@ namespace librealsense
sensor.second->start(callback);
}

template< class T >
void open_and_start( T callback )
{
// Calling open() than start() opens all relevant sensors before starting any of them.
// For some device backends we want to open and start each sensor before opening the next sensor.
for( auto it = _dev_to_profiles.rbegin(); it != _dev_to_profiles.rend(); it++ )
{
auto && sub = _results.at( it->first );
sub->open( it->second );
sub->start( callback );
}
}

void stop()
{
for (auto&& sensor : _results)
Expand Down
Loading