Skip to content

Commit

Permalink
fix wrong format using dds
Browse files Browse the repository at this point in the history
  • Loading branch information
noacoohen committed Jan 13, 2025
1 parent d40c2e2 commit a74f79c
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down Expand Up @@ -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?

Expand Down Expand Up @@ -706,4 +710,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
Expand Up @@ -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,
Expand All @@ -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();
Expand Down

0 comments on commit a74f79c

Please sign in to comment.