Skip to content

Commit 504063b

Browse files
committed
Set DDS processing block settings
1 parent e18af41 commit 504063b

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/dds/rs-dds-sensor-proxy.cpp

+25
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

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

28+
#include <rsutils/string/nocase.h>
2829
#include <rsutils/json.h>
2930
using rsutils::json;
3031

@@ -664,7 +665,11 @@ void dds_sensor_proxy::add_processing_block( std::string const & filter_name )
664665
if( ! ppb )
665666
LOG_WARNING( "Unsupported processing block '" + filter_name + "' received" );
666667
else
668+
{
669+
// Currently processing block factory does not support block settings, add here if needed.
670+
add_processing_block_settings( filter_name, ppb );
667671
super::add_processing_block( ppb );
672+
}
668673
}
669674
catch( std::exception const & e )
670675
{
@@ -673,5 +678,25 @@ void dds_sensor_proxy::add_processing_block( std::string const & filter_name )
673678
}
674679
}
675680

681+
void dds_sensor_proxy::add_processing_block_settings( const std::string & filter_name,
682+
std::shared_ptr< librealsense::processing_block_interface > & ppb ) const
683+
{
684+
if( rsutils::string::nocase_equal( filter_name, "Decimation Filter" ) )
685+
if( !ppb->supports_option( RS2_OPTION_STREAM_FILTER ) )
686+
LOG_ERROR( "Decimation Filter does not support stream filter option" );
687+
else
688+
if( rsutils::string::nocase_equal( get_name(), "RGB Camera" ) )
689+
{
690+
691+
ppb->get_option( RS2_OPTION_STREAM_FILTER ).set( RS2_STREAM_COLOR );
692+
ppb->get_option( RS2_OPTION_STREAM_FORMAT_FILTER ).set( RS2_FORMAT_ANY );
693+
}
694+
else
695+
{
696+
ppb->get_option( RS2_OPTION_STREAM_FILTER ).set( RS2_STREAM_DEPTH );
697+
ppb->get_option( RS2_OPTION_STREAM_FORMAT_FILTER ).set( RS2_FORMAT_Z16 );
698+
}
699+
}
700+
676701

677702
} // namespace librealsense

src/dds/rs-dds-sensor-proxy.h

+3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ class dds_sensor_proxy : public software_sensor
115115
virtual void add_no_metadata( frame *, streaming_impl & );
116116
virtual void add_frame_metadata( frame *, rsutils::json const & metadata, streaming_impl & );
117117

118+
void add_processing_block_settings( const std::string & filter_name,
119+
std::shared_ptr< librealsense::processing_block_interface > & ppb ) const;
120+
118121
friend class dds_device_proxy; // Currently calls handle_new_metadata
119122
};
120123

0 commit comments

Comments
 (0)