Skip to content

Commit

Permalink
enable runtime exposure update in HDR mode
Browse files Browse the repository at this point in the history
  • Loading branch information
noacoohen committed May 8, 2024
1 parent 88285da commit 891d196
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ds/ds-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,21 @@ namespace librealsense
void hdr_conditional_option::set(float value)
{
if (_hdr_cfg->is_config_in_process())
if( _hdr_cfg->is_enabled() )
{
// keep the index
auto _current_hdr_sequence_index = _hdr_cfg->get( RS2_OPTION_SEQUENCE_ID );
// In order to enable runtime exposure update in HDR mode we first send disable HDR, then set the value
// and at last enable HDR again.
_hdr_cfg->set( RS2_OPTION_HDR_ENABLED, 0, { 0, 1, 1 } );
// restore hdr_sequence_index
_hdr_cfg->set( RS2_OPTION_SEQUENCE_ID, _current_hdr_sequence_index, { 0, 1, 1 } );
_hdr_option->set( value );
_hdr_cfg->set( RS2_OPTION_HDR_ENABLED, 1, { 0, 1, 1 } );
// restore hdr_sequence_index in order to enable again runtime exposure update in HDR
_hdr_cfg->set( RS2_OPTION_SEQUENCE_ID, _current_hdr_sequence_index, { 0, 1, 1 } );
}
else
_hdr_option->set(value);
else
{
Expand Down

0 comments on commit 891d196

Please sign in to comment.