Skip to content

Commit

Permalink
PR #13619 from OhadMeir: Set/get preset as bulk operation
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir authored Dec 23, 2024
2 parents 7c2d0cb + ce1857e commit e18af41
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/ds/advanced_mode/advanced_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,8 @@ namespace librealsense
preset ds_advanced_mode_base::get_all() const
{
preset p;

rsutils::deferred depth_bulk = _depth_sensor.bulk_operation();
get_depth_control_group(&p.depth_controls);
get_rsm(&p.rsm);
get_rau_support_vector_control(&p.rsvc);
Expand All @@ -753,6 +755,10 @@ namespace librealsense
get_depth_auto_exposure(&p.depth_auto_exposure);
get_depth_gain(&p.depth_gain);
get_depth_auto_white_balance(&p.depth_auto_white_balance);

rsutils::deferred color_bulk;
if( *_color_sensor )
color_bulk = ( *_color_sensor )->bulk_operation();
get_color_exposure(&p.color_exposure);
get_color_auto_exposure(&p.color_auto_exposure);
get_color_backlight_compensation(&p.color_backlight_compensation);
Expand All @@ -766,6 +772,7 @@ namespace librealsense
get_color_white_balance(&p.color_white_balance);
get_color_auto_white_balance(&p.color_auto_white_balance);
get_color_power_line_frequency(&p.color_power_line_frequency);

return p;
}

Expand All @@ -778,6 +785,8 @@ namespace librealsense

void ds_advanced_mode_base::set_all_depth(const preset& p)
{
rsutils::deferred depth_bulk = _depth_sensor.bulk_operation();

set(p.depth_controls, advanced_mode_traits<STDepthControlGroup>::group);
set(p.rsm , advanced_mode_traits<STRsm>::group);
set(p.rsvc , advanced_mode_traits<STRauSupportVectorControl>::group);
Expand Down Expand Up @@ -813,6 +822,10 @@ namespace librealsense

void ds_advanced_mode_base::set_all_rgb( const preset & p )
{
rsutils::deferred color_bulk;
if( *_color_sensor )
color_bulk = ( *_color_sensor )->bulk_operation();

set_color_auto_exposure(p.color_auto_exposure);
if (p.color_auto_exposure.was_set && p.color_auto_exposure.auto_exposure == 0)
{
Expand Down

0 comments on commit e18af41

Please sign in to comment.