Skip to content

Commit

Permalink
D457 timestamp handling back compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Oct 28, 2024
1 parent 258da85 commit dc7d3c7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/ds/d400/d400-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1090,13 +1090,25 @@ namespace librealsense
// attributes of md_mipi_depth_control structure
auto md_prop_offset = offsetof(metadata_mipi_depth_raw, depth_mode);

// optical_timestamp contains value of exposure/2
depth_sensor.register_metadata(RS2_FRAME_METADATA_SENSOR_TIMESTAMP,
// timestamp metadata field alignment with FW was implemented on FW version 5.17.0.0
if ( _fw_version >= firmware_version( "5.17.0.0" ) )
{
// optical_timestamp contains value of exposure/2
depth_sensor.register_metadata(RS2_FRAME_METADATA_SENSOR_TIMESTAMP,
make_rs400_sensor_ts_parser(make_uvc_header_parser(&platform::uvc_header::timestamp),
make_attribute_parser(&md_mipi_depth_mode::optical_timestamp,
md_mipi_depth_control_attributes::optical_timestamp_attribute,
md_prop_offset)));

}
else // keep backward compatible with previous behavior
{
depth_sensor.register_metadata(RS2_FRAME_METADATA_SENSOR_TIMESTAMP,
make_attribute_parser(&md_mipi_depth_mode::hw_timestamp,
md_mipi_depth_control_attributes::hw_timestamp_attribute,
md_prop_offset));
}

depth_sensor.register_metadata(RS2_FRAME_METADATA_ACTUAL_EXPOSURE,
make_attribute_parser(&md_mipi_depth_mode::exposure_time,
md_mipi_depth_control_attributes::exposure_time_attribute,
Expand Down

0 comments on commit dc7d3c7

Please sign in to comment.