Skip to content

Add support to dual RGB metadata on Windows - #15327

Merged
OhadMeir merged 3 commits into
realsenseai:developmentfrom
OhadMeir:d585
Jul 1, 2026
Merged

OhadMeir merged 3 commits into
realsenseai:developmentfrom
OhadMeir:d585

Conversation

@OhadMeir

Copy link
Copy Markdown
Contributor

Tracked on [RSDEV-12267]

Copilot AI review requested due to automatic review settings June 30, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/metadata-parser.h Resolved
Comment thread scripts/realsense_metadata_win10.ps1 Resolved
@OhadMeir
OhadMeir requested a review from Nir-Az June 30, 2026 11:42
Comment thread src/metadata-parser.h Resolved
Comment thread scripts/realsense_metadata_win10.ps1 Resolved

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

⚠️ Missing tests
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.

Comment thread common/metadata-helper.cpp Resolved
Comment thread common/metadata-helper.cpp Resolved
Comment thread common/metadata-helper.cpp Resolved
Comment thread common/metadata-helper.cpp Resolved
Comment thread scripts/realsense_metadata_win10.ps1 Resolved
Nir-Az
Nir-Az previously approved these changes Jul 1, 2026

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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_CAMERA now defined locally as a string constant.
  • ✅ std::stoul usage 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.

Comment thread common/metadata-helper.cpp Resolved

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rs-agentic bot] Code review of latest push (commit 6804a8e)

✅ operator== updated to include vid — the previous bug is fixed. See inline comments.

Comment thread common/metadata-helper.cpp Resolved
Nir-Az
Nir-Az previously approved these changes Jul 1, 2026

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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: $prefix is now computed once with a length guard (if ($devInstance.Length -ge 27)) before the multi-pin list lookup, preventing a potential Substring exception on short device instance strings.

No new issues found in this commit. All previously raised bot comments are now resolved.

@OhadMeir
OhadMeir merged commit 5791ec3 into realsenseai:development Jul 1, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants