Skip to content

fix: update routing logic#1424

Open
ndorin wants to merge 1 commit into
mainfrom
fix/videoCodec-routing-issues
Open

fix: update routing logic#1424
ndorin wants to merge 1 commit into
mainfrom
fix/videoCodec-routing-issues

Conversation

@ndorin
Copy link
Copy Markdown
Contributor

@ndorin ndorin commented May 21, 2026

Closes #1423

This pull request introduces several improvements to the routing logic and device type handling in the Essentials Core library. The main focus is on refining how routing sources and sinks are identified, enhancing debug logging for route tracing, and correcting type assignments for mock and base video codec classes.

Key improvements and changes:

Routing Logic and Device Type Handling

  • Refined the selection of routing sources and sinks in MapDestinationsToSources() by removing restrictions that excluded devices implementing both IRoutingInputs and IRoutingOutputs. The filtering is now applied within the loop, making the logic clearer and more flexible.
  • Updated the call to GetRouteToSource to use the correct signal type (outputPort.Type instead of inputPort.Type) when mapping routes, ensuring accurate routing behavior.

Debug Logging Enhancements

  • Improved debug logging in several places to provide more detailed information about routing attempts, found routes, and failures. This includes:
    • Logging both destination.Key and source.Key in route-building messages.
    • Adding verbose logs when routes are found or not found, and when tie lines are being walked, aiding in troubleshooting and traceability. [1] [2] [3]

Device Class Type Corrections

  • Added IRoutingInputs to the MockVC class to ensure it is properly recognized as a routing input in the system.
  • Removed IRoutingInputsOutputs from the VideoCodecBase class, clarifying its intended role and preventing incorrect type assignments.

@ndorin ndorin self-assigned this May 21, 2026
Copilot AI review requested due to automatic review settings May 21, 2026 22:29
@ndorin ndorin added the bug Something isn't working label May 21, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 addresses a routing regression affecting devices inheriting from VideoCodecBase by adjusting routing-device type identification and refining route discovery/logging in the Essentials Core routing extensions.

Changes:

  • Removes IRoutingInputsOutputs from VideoCodecBase to avoid codecs being treated as midpoint routing devices and filtered out of endpoint route mapping.
  • Updates route mapping to use the source outputPort.Type when building routes, and adds additional verbose diagnostics for route discovery.
  • Updates MockVC to explicitly implement IRoutingInputs so it is recognized as a routing sink/input-capable device.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/PepperDash.Essentials.Devices.Common/VideoCodec/VideoCodecBase.cs Removes IRoutingInputsOutputs from the base codec class to prevent misclassification in routing discovery.
src/PepperDash.Essentials.Devices.Common/VideoCodec/MockVC/MockVC.cs Adds IRoutingInputs to MockVC for correct routing-input identification.
src/PepperDash.Essentials.Core/Routing/Extensions.cs Adjusts route mapping signal type selection and expands verbose logging for route discovery/tracing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/PepperDash.Essentials.Core/Routing/Extensions.cs
Comment thread src/PepperDash.Essentials.Core/Routing/Extensions.cs
@ndorin ndorin requested a review from andrew-welker May 21, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]-Routing not working on devices that inherit from VideoCodecBase

3 participants