Skip to content

Commit

Permalink
AE reading for color metadata corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed Feb 17, 2021
1 parent cfe686c commit 38aacac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6470,7 +6470,7 @@ namespace rs2
{
std::vector<rs2_option> supported_options = sub->s->get_supported_options();

// moving the color dediacted options to the end of the vector
// moving the color dedicated options to the end of the vector
std::vector<rs2_option> color_options = {
RS2_OPTION_BACKLIGHT_COMPENSATION,
RS2_OPTION_BRIGHTNESS,
Expand Down
2 changes: 1 addition & 1 deletion src/archive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ namespace librealsense
<< get_string(get_stream()->get_stream_type()) << " stream");

auto parsers = metadata_parsers->equal_range(frame_metadata);
if (parsers.first == metadata_parsers->end()) // Possible user error - md attribute is not supported by this frame type
if (parsers.first == metadata_parsers->end()) // Possible user error - md attribute is not supported by this frame type
throw invalid_value_exception(to_string() << get_string(frame_metadata)
<< " attribute is not applicable for "
<< get_string(get_stream()->get_stream_type()) << " stream ");
Expand Down
18 changes: 16 additions & 2 deletions src/ds5/ds5-color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,22 @@ namespace librealsense
std::make_shared<auto_disabling_control>(
gain_option,
auto_exposure_option));

auto md_prop_offset = offsetof(metadata_raw, mode) +
offsetof(md_rgb_mode, rgb_mode) +
offsetof(md_rgb_normal_mode, intel_rgb_control);

color_ep.register_metadata(RS2_FRAME_METADATA_AUTO_EXPOSURE, make_attribute_parser(&md_rgb_control::ae_mode, md_rgb_control_attributes::ae_mode_attribute, md_prop_offset,
[](rs2_metadata_type param) { return (param != 1); })); // OFF value via UVC is 1 (ON is 8)
}
else
{
// attributes of md_rgb_control
auto md_prop_offset = offsetof(metadata_raw, mode) +
offsetof(md_rgb_mode, rgb_mode) +
offsetof(md_rgb_normal_mode, intel_rgb_control);

color_ep.register_metadata(RS2_FRAME_METADATA_AUTO_EXPOSURE, make_attribute_parser(&md_rgb_control::ae_mode, md_rgb_control_attributes::ae_mode_attribute, md_prop_offset));
}

color_ep.register_metadata(RS2_FRAME_METADATA_FRAME_TIMESTAMP, make_uvc_header_parser(&platform::uvc_header::timestamp));
Expand Down Expand Up @@ -199,8 +215,6 @@ namespace librealsense

color_ep.register_metadata(RS2_FRAME_METADATA_GAIN_LEVEL, make_attribute_parser(&md_rgb_control::gain, md_rgb_control_attributes::gain_attribute, md_prop_offset));
color_ep.register_metadata(RS2_FRAME_METADATA_ACTUAL_EXPOSURE, make_attribute_parser(&md_rgb_control::manual_exp, md_rgb_control_attributes::manual_exp_attribute, md_prop_offset));
color_ep.register_metadata(RS2_FRAME_METADATA_AUTO_EXPOSURE, make_attribute_parser(&md_rgb_control::ae_mode, md_rgb_control_attributes::ae_mode_attribute, md_prop_offset,
[](rs2_metadata_type param) { return (param != 1); }));

// attributes of md_capture_stats
md_prop_offset = offsetof(metadata_raw, mode) +
Expand Down

0 comments on commit 38aacac

Please sign in to comment.