From b2dbd3c377fa2e452a3940cdd426536b656b4c7f Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Wed, 14 Aug 2019 16:48:15 -0600 Subject: [PATCH] Built HDCP Capability feedbacks for input card HDMI ports --- .../Bridges/DmChassisControllerBridge.cs | 40 ++------------- .../Chassis/DmChassisController.cs | 50 ++++++++++++++++--- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs index 39bd4115..718fa399 100644 --- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs @@ -65,41 +65,7 @@ namespace PepperDash.Essentials.Bridges if (txDevice != null) { - bool hdcpTypeSimple; - - if (txDevice.Hardware is DmTx4kX02CBase || txDevice.Hardware is DmTx4kzX02CBase) - hdcpTypeSimple = false; - else - hdcpTypeSimple = true; - txDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]); - //TxDevice.SetPortHdcpCapability((eHdcpCapabilityType)(u),)); - - trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)txDevice.HdcpSupportCapability; - - if (txDevice is ITxRouting) - { - var txR = txDevice as ITxRouting; - - if (hdcpTypeSimple) - { - - if (txR.InputPorts[DmPortName.HdmiIn] != null) - { - var inputPort = txR.InputPorts[DmPortName.HdmiIn]; - - if (txDevice.Feedbacks["HdmiInHdcpCapability"] != null) - (txDevice.Feedbacks["HdmiInHdcpCapability"] as IntFeedback).LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); - - if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null) - { - var port = inputPort.Port as EndpointHdmiInput; - - SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.HdcpSupportState + ioSlot, trilist); - } - } - } - } } else { @@ -115,14 +81,14 @@ namespace PepperDash.Essentials.Bridges var hdmiInPortWCec = hdmiInPort as HdmiInputWithCEC; if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown) + { SetHdcpCapabilityAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); + } - //TODO: Figure out how the heck to get feedback properly. + dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState]); } - } } - } } else diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 2cc65899..8b5761c2 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -36,7 +36,7 @@ namespace PepperDash.Essentials.DM public Dictionary OutputVideoRouteNameFeedbacks { get; private set; } public Dictionary OutputAudioRouteNameFeedbacks { get; private set; } - public Dictionary InputCardHdcpStateFeedbacks { get; private set; } + public Dictionary InputCardHdcpCapabilityFeedbacks { get; private set; } // Need a couple Lists of generic Backplane ports @@ -157,6 +157,8 @@ namespace PepperDash.Essentials.DM InputEndpointOnlineFeedbacks = new Dictionary(); OutputEndpointOnlineFeedbacks = new Dictionary(); + InputCardHdcpCapabilityFeedbacks = new Dictionary(); + for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) { @@ -219,6 +221,32 @@ namespace PepperDash.Essentials.DM InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; }); OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Outputs[tempX].EndpointOnlineFeedback; }); + + InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => + { + var inputCard = Chassis.Inputs[tempX]; + + if (inputCard.Card is DmcHd) + { + if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue) + return 1; + else + return 0; + } + else if (inputCard.Card is DmcHdDsp) + { + if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue) + return 1; + else + return 0; + } + else if (inputCard.Card is Dmc4kHdBase) + { + return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability; + } + else + return 0; + }); } } @@ -576,20 +604,26 @@ namespace PepperDash.Essentials.DM switch (args.EventId) { case (DMInputEventIds.EndpointOnlineEventId): { - Debug.Console(2, this, "DMINput OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback); - InputEndpointOnlineFeedbacks[args.Number].FireUpdate(); - break; + Debug.Console(2, this, "DMINput OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback); + InputEndpointOnlineFeedbacks[args.Number].FireUpdate(); + break; } case (DMInputEventIds.VideoDetectedEventId): { - Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number); - VideoInputSyncFeedbacks[args.Number].FireUpdate(); - break; + Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number); + VideoInputSyncFeedbacks[args.Number].FireUpdate(); + break; } case (DMInputEventIds.InputNameEventId): { Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number); InputNameFeedbacks[args.Number].FireUpdate(); break; } + case DMInputEventIds.HdcpCapabilityFeedbackEventId: + { + Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number); + InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate(); + break; + } default: { Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId); @@ -621,7 +655,7 @@ namespace PepperDash.Essentials.DM OutputEndpointOnlineFeedbacks[output].FireUpdate(); break; } - case DMInputEventIds.OnlineFeedbackEventId: + case DMOutputEventIds.OnlineFeedbackEventId: { Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback); OutputEndpointOnlineFeedbacks[output].FireUpdate();