Repository navigation
Add support to dual RGB metadata on Windows - #15327
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Windows support for Dual-RGB devices whose color frames are delivered via the depth sensor by enabling correct metadata parsing and ensuring the Windows metadata registry configuration accounts for the extra media pin.
Changes:
- Allow multiple metadata parsers to be registered for the same metadata key by chaining parsers and selecting the first one that successfully validates against a frame’s metadata layout.
- Add Dual-RGB color-metadata registration on the D500 depth sensor so color frames routed through it expose the expected RGB metadata fields.
- Update Windows metadata enablement logic (PowerShell + helper heuristic) to account for a 4th media pin on Dual-RGB SKUs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/sensor.cpp |
Chains metadata parsers on duplicate registrations instead of ignoring later registrations. |
src/metadata-parser.h |
Adds md_layout_selecting_parser to try multiple parsers; suppresses md-type mismatch debug spam. |
src/ds/d500/d500-dual-rgb.h |
Declares register_color_metadata() for Dual-RGB devices. |
src/ds/d500/d500-dual-rgb.cpp |
Registers RGB-layout metadata parsers on the depth sensor and reuses ds_color_common metadata registration. |
scripts/realsense_metadata_win10.ps1 |
Adds MetadataBufferSizeInKB3 handling for the additional Dual-RGB media pin. |
common/metadata-helper.cpp |
Updates media-pin count heuristic to return 4 for Dual-RGB PIDs on MI_00. |
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
[rs-agentic bot] Code review of latest push (commit 16a3288)
Reviewed the changes in common/metadata-helper.cpp, scripts/realsense_metadata_win10.ps1, and src/metadata-parser.h. Inline comments added below. Additional note:
🐛 BUG — operator== not updated to include vid (common/metadata-helper.cpp lines 48-54)
The vid field was added to device_id in this PR, but operator== still only compares pid, guid, mi, and sn. Two devices from different vendors (e.g. VID_8086 vs VID_38E5) sharing the same PID, MI, and SN would be incorrectly treated as equal in foreach_device_path. Please add equal(a.vid, b.vid) && to the comparison.
No unit tests cover the new md_layout_selecting_parser or the updated number_of_mediapins(vid, pid, mi) logic. The unit-tests/ framework supports targeted test files — consider adding a test for these two behaviours.
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
[rs-agentic bot] Code review of latest push (commit 3bf1b6e)
Reviewed the changes in common/metadata-helper.cpp, scripts/realsense_metadata_win10.ps1, and src/metadata-parser.h.
- ✅ Cross-layer
#include <src/usb/usb-types.h>removed;VID_REALSENSE_CAMERAnow defined locally as a string constant. - ✅
std::stoulusage dropped; explanatory comment added for the intentional 4-pin behavior across all MIs on VID_38E5. - ✅ Code style fixed (space after
//, American English "behavior").
One item from the previous review body is still not addressed — see inline comment below.
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
[rs-agentic bot] Code review of latest push (commit 6804a8e)
✅ operator== updated to include vid — the previous bug is fixed. See inline comments.
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
[rs-agentic bot] Code review of latest push (commit 274952f)
Reviewed changes in common/metadata-helper.cpp, src/metadata-parser.h, and scripts/realsense_metadata_win10.ps1.
- ✅ Extra spaces in
operator==(equal(a.vid, b.vid )/ double-space before&&) are cleaned up — all five comparisons now use consistent formatting. - ✅
src/metadata-parser.h:md_always_enabled_param_parser::is_attribute_valid— the LOG_DEBUG spam for type-mismatch has been removed and replaced with the single explanatory comment// Some mismatched metadata types are expected, e.g dual-RGB color metadata on a depth sensor.as requested by @Nir-Az. - ✅
scripts/realsense_metadata_win10.ps1:$prefixis now computed once with a length guard (if ($devInstance.Length -ge 27)) before the multi-pin list lookup, preventing a potentialSubstringexception on short device instance strings.
No new issues found in this commit. All previously raised bot comments are now resolved.
Tracked on [RSDEV-12267]