Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix wrong format using dds
Browse files Browse the repository at this point in the history
noacoohen committed Jan 12, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 220d03d commit e6f4424
Showing 2 changed files with 23 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/dds/rs-dds-sensor-proxy.cpp
Original file line number Diff line number Diff line change
@@ -190,6 +190,10 @@ rsutils::subscription dds_sensor_proxy::register_options_changed_callback( optio
return _options_watcher.subscribe( std::move( cb ) );
}

stream_profiles dds_sensor_proxy::get_active_streams() const
{
return _target_profiles;
}

std::shared_ptr< realdds::dds_video_stream_profile >
dds_sensor_proxy::find_profile( sid_index sidx, realdds::dds_video_stream_profile const & profile ) const
@@ -243,7 +247,7 @@ dds_sensor_proxy::find_profile( sid_index sidx, realdds::dds_motion_stream_profi
void dds_sensor_proxy::open( const stream_profiles & profiles )
{
_formats_converter.prepare_to_convert( profiles );

_target_profiles = profiles;
const auto & source_profiles = _formats_converter.get_active_source_profiles();
// TODO - register processing block options?

@@ -698,4 +702,18 @@ void dds_sensor_proxy::add_processing_block_settings( const std::string & filter
}


void dds_sensor_proxy::set_frames_callback( rs2_frame_callback_sptr callback )
{
// This callback is mutable, might be modified.
// For instance, record_sensor modifies this callback in order to hook it to record frames.
_formats_converter.set_frames_callback( callback );
}


rs2_frame_callback_sptr dds_sensor_proxy::get_frames_callback() const
{
return _formats_converter.get_frames_callback();
}


} // namespace librealsense
4 changes: 4 additions & 0 deletions src/dds/rs-dds-sensor-proxy.h
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ class dds_sensor_proxy : public software_sensor
std::map< std::string, streaming_impl > _streaming_by_name;

formats_converter _formats_converter;
stream_profiles _target_profiles;

public:
dds_sensor_proxy( std::string const & sensor_name,
@@ -86,10 +87,13 @@ class dds_sensor_proxy : public software_sensor
void add_processing_block( std::string const & filter_name );

const std::map< sid_index, std::shared_ptr< realdds::dds_stream > > & streams() const { return _streams; }
void set_frames_callback( rs2_frame_callback_sptr callback ) override;
rs2_frame_callback_sptr get_frames_callback() const override;

// sensor_interface
public:
rsutils::subscription register_options_changed_callback( options_watcher::callback && ) override;
stream_profiles get_active_streams() const override;

protected:
void register_basic_converters();

0 comments on commit e6f4424

Please sign in to comment.