diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs index 2ea259c0..231aa1fb 100644 --- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs @@ -75,8 +75,7 @@ namespace PepperDash.Essentials.Bridges else if (dmChassis.InputEndpointOnlineFeedbacks[ioSlot] != null) { Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot); - dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]); - + dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]); } } @@ -94,13 +93,13 @@ namespace PepperDash.Essentials.Bridges var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)]; if (inputPort != null) { - var hdmiInPort = inputPort.Port; + var port = inputPort.Port; - if (hdmiInPort != null) + if (port != null) { - if (hdmiInPort is HdmiInputWithCEC) + if (port is HdmiInputWithCEC) { - var hdmiInPortWCec = hdmiInPort as HdmiInputWithCEC; + var hdmiInPortWCec = port as HdmiInputWithCEC; if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown) { @@ -109,6 +108,19 @@ namespace PepperDash.Essentials.Bridges dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); + trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; + } + else if (port is DMInputPortWithCec) + { + var dmInPortWCec = port as DMInputPortWithCec; + + if (dmInPortWCec != null) + { + SetHdcpCapabilityAction(dmChassis.PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist); + } + + dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]); + trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)dmChassis.InputCardHdcpCapabilityTypes[ioSlot]; } } @@ -217,5 +229,32 @@ namespace PepperDash.Essentials.Bridges } } + static void SetHdcpCapabilityAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist) + { + if (!supportsHdcp2) + { + trilist.SetUShortSigAction(join, + new Action(s => + { + if (s == 0) + { + port.HdcpSupportOff(); + } + else if (s > 0) + { + port.HdcpSupportOn(); + } + })); + } + else + { + trilist.SetUShortSigAction(join, + new Action(s => + { + port.HdcpReceiveCapability = (eHdcpCapabilityType)s; + })); + } + } + } } \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 8a0a019f..1655e431 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -23,6 +23,8 @@ namespace PepperDash.Essentials.DM /// public class DmChassisController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IRouting, IHasFeedback { + public DMChassisPropertiesConfig PropertiesConfig { get; set; } + public DmMDMnxn Chassis { get; private set; } // Feedbacks for EssentialDM @@ -91,10 +93,10 @@ namespace PepperDash.Essentials.DM else if (type == "dmmd32x32cpu3") { chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem); } else if (type == "dmmd32x32cpu3rps") { chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem); } - if (chassis == null) - { - return null; - } + if (chassis == null) + { + return null; + } var controller = new DmChassisController(key, name, chassis); // add the cards and port names @@ -126,6 +128,7 @@ namespace PepperDash.Essentials.DM controller.InputNames = properties.InputNames; controller.OutputNames = properties.OutputNames; + controller.PropertiesConfig = properties; return controller; } catch (System.Exception e) @@ -232,10 +235,7 @@ namespace PepperDash.Essentials.DM OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { - if (Chassis.Outputs[tempX].EndpointOnlineFeedback != null) - return Chassis.Outputs[tempX].EndpointOnlineFeedback; - else - return false; + return Chassis.Outputs[tempX].EndpointOnlineFeedback; }); } @@ -267,10 +267,7 @@ namespace PepperDash.Essentials.DM InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { - if (Chassis.Inputs[tempX].EndpointOnlineFeedback != null) - return Chassis.Inputs[tempX].EndpointOnlineFeedback; - else - return false; + return Chassis.Inputs[tempX].EndpointOnlineFeedback; }); InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => @@ -301,6 +298,32 @@ namespace PepperDash.Essentials.DM return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability; } + else if (inputCard.Card is Dmc4kCBase) + { + if (PropertiesConfig.InputSlotSupportsHdcp2[tempX]) + { + InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; + + return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability; + } + else if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue) + return 1; + else + return 0; + } + else if (inputCard.Card is Dmc4kCDspBase) + { + if (PropertiesConfig.InputSlotSupportsHdcp2[tempX]) + { + InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; + + return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability; + } + else if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue) + return 1; + else + return 0; + } else return 0; }); @@ -357,33 +380,39 @@ namespace PepperDash.Essentials.DM } else if (type == "dmcc") { - new DmcC(number, this.Chassis); - AddDmInCardPorts(number); + var inputCard = new DmcC(number, this.Chassis); + var cecPort = inputCard.DmInput as ICec; + AddDmInCardPorts(number, cecPort); } else if (type == "dmccdsp") { - new DmcCDsp(number, this.Chassis); - AddDmInCardPorts(number); + var inputCard = new DmcCDsp(number, this.Chassis); + var cecPort = inputCard.DmInput as ICec; + AddDmInCardPorts(number, cecPort); } else if (type == "dmc4kc") { - new Dmc4kC(number, this.Chassis); - AddDmInCardPorts(number); + var inputCard = new Dmc4kC(number, this.Chassis); + var cecPort = inputCard.DmInput as ICec; + AddDmInCardPorts(number, cecPort); } else if (type == "dmc4kcdsp") { - new Dmc4kCDsp(number, this.Chassis); - AddDmInCardPorts(number); + var inputCard = new Dmc4kCDsp(number, this.Chassis); + var cecPort = inputCard.DmInput as ICec; + AddDmInCardPorts(number, cecPort); } else if (type == "dmc4kzc") { - new Dmc4kzC(number, this.Chassis); - AddDmInCardPorts(number); + var inputCard = new Dmc4kzC(number, this.Chassis); + var cecPort = inputCard.DmInput as ICec; + AddDmInCardPorts(number, cecPort); } else if (type == "dmc4kzcdsp") { - new Dmc4kzCDsp(number, this.Chassis); - AddDmInCardPorts(number); + var inputCard = new Dmc4kzCDsp(number, this.Chassis); + var cecPort = inputCard.DmInput as ICec; + AddDmInCardPorts(number, cecPort); } else if (type == "dmccat") { @@ -483,6 +512,11 @@ namespace PepperDash.Essentials.DM AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat); AddInCardHdmiAndAudioLoopPorts(number); } + void AddDmInCardPorts(uint number, ICec cecPort) + { + AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort); + AddInCardHdmiAndAudioLoopPorts(number); + } void AddHdmiInCardPorts(uint number, ICec cecPort) { diff --git a/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs b/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs index 81f28afa..f4b2a141 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Config/DMChassisConfig.cs @@ -31,7 +31,10 @@ namespace PepperDash.Essentials.DM.Config [JsonProperty("outputNames")] public Dictionary OutputNames { get; set; } - } + + [JsonProperty("inputSlotSupportsHdcp2")] + public Dictionary InputSlotSupportsHdcp2 { get; set; } + } /// ///