Skip to content

Commit

Permalink
PR #13625 from OhadMeir: Set DDS processing block settings
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir authored Dec 31, 2024
2 parents 0bad4a1 + 5dde7fa commit f7f622e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/dds/rs-dds-sensor-proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <src/proc/color-formats-converter.h>

#include <rsutils/string/nocase.h>
#include <rsutils/json.h>
using rsutils::json;

Expand Down Expand Up @@ -664,7 +665,11 @@ void dds_sensor_proxy::add_processing_block( std::string const & filter_name )
if( ! ppb )
LOG_WARNING( "Unsupported processing block '" + filter_name + "' received" );
else
{
// Currently processing block factory does not support block settings, add here if needed.
add_processing_block_settings( filter_name, ppb );
super::add_processing_block( ppb );
}
}
catch( std::exception const & e )
{
Expand All @@ -673,5 +678,24 @@ void dds_sensor_proxy::add_processing_block( std::string const & filter_name )
}
}

void dds_sensor_proxy::add_processing_block_settings( const std::string & filter_name,
std::shared_ptr< librealsense::processing_block_interface > & ppb ) const
{
if( rsutils::string::nocase_equal( filter_name, "Decimation Filter" ) )
if( !ppb->supports_option( RS2_OPTION_STREAM_FILTER ) )
LOG_ERROR( "Decimation Filter does not support stream filter option" );
else
if( rsutils::string::nocase_equal( get_name(), "RGB Camera" ) )
{
ppb->get_option( RS2_OPTION_STREAM_FILTER ).set( RS2_STREAM_COLOR );
ppb->get_option( RS2_OPTION_STREAM_FORMAT_FILTER ).set( RS2_FORMAT_ANY );
}
else
{
ppb->get_option( RS2_OPTION_STREAM_FILTER ).set( RS2_STREAM_DEPTH );
ppb->get_option( RS2_OPTION_STREAM_FORMAT_FILTER ).set( RS2_FORMAT_Z16 );
}
}


} // namespace librealsense
3 changes: 3 additions & 0 deletions src/dds/rs-dds-sensor-proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ class dds_sensor_proxy : public software_sensor
virtual void add_no_metadata( frame *, streaming_impl & );
virtual void add_frame_metadata( frame *, rsutils::json const & metadata, streaming_impl & );

void add_processing_block_settings( const std::string & filter_name,
std::shared_ptr< librealsense::processing_block_interface > & ppb ) const;

friend class dds_device_proxy; // Currently calls handle_new_metadata
};

Expand Down

0 comments on commit f7f622e

Please sign in to comment.