From 3648bdcae455e2e7ef7db54450308b288c3a4b58 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Mon, 3 Feb 2020 14:27:28 -0700 Subject: [PATCH] fixed ECS-1255 by checking for inputSlotSupportsHdcp2 config value on each input card and defaulting to false if not defined in config. --- .../Bridges/DmChassisControllerBridge.cs | 10 +- .../Chassis/DmChassisController.cs | 98 +++++++++++++++---- 2 files changed, 83 insertions(+), 25 deletions(-) diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs index c85854b6..f87f2109 100644 --- a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs @@ -81,14 +81,14 @@ namespace PepperDash.Essentials.Bridges } } - if (basicTxDevice != null && advancedTxDevice == null) - trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true; - - if (advancedTxDevice != null) + if (advancedTxDevice != null) // Advanced TX device { advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); + + // Flag if the TX is an advanced endpoint type + trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true; } - else if(advancedTxDevice == null || basicTxDevice != null) + else if(advancedTxDevice == null || basicTxDevice != null) // Basic TX device { Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot); dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]); diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs index 094b8022..d0a6ba63 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs +++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs @@ -104,9 +104,12 @@ namespace PepperDash.Essentials.DM } var controller = new DmChassisController(key, name, chassis); + // add the cards and port names - foreach (var kvp in properties.InputSlots) - controller.AddInputCard(kvp.Value, kvp.Key); + foreach (var kvp in properties.InputSlots) + { + controller.AddInputCard(kvp.Value, kvp.Key); + } foreach (var kvp in properties.OutputSlots) { controller.AddOutputCard(kvp.Value, kvp.Key); @@ -188,11 +191,18 @@ namespace PepperDash.Essentials.DM SystemIdBusyFeedback = new BoolFeedback(() => { return (Chassis as DmMDMnxn).SystemIdBusy.BoolValue; }); InputCardHdcpCapabilityFeedbacks = new Dictionary(); InputCardHdcpCapabilityTypes = new Dictionary(); + } + public override bool CustomActivate() + { + Debug.Console(2, this, "Setting up feedbacks."); - for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) + // Setup Output Card Feedbacks + for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) { - var tempX = x; + var tempX = x; + + Debug.Console(2, this, "Setting up feedbacks for output slot: {0}", tempX); if (Chassis.Outputs[tempX] != null) { @@ -235,26 +245,41 @@ namespace PepperDash.Essentials.DM } }); OutputAudioRouteNameFeedbacks[tempX] = new StringFeedback(() => + { + if (Chassis.Outputs[tempX].AudioOutFeedback != null) { - if (Chassis.Outputs[tempX].AudioOutFeedback != null) - { - return Chassis.Outputs[tempX].AudioOutFeedback.NameFeedback.StringValue; - } - else - { - return NoRouteText; + return Chassis.Outputs[tempX].AudioOutFeedback.NameFeedback.StringValue; + } + else + { + return NoRouteText; - } - }); + } + }); - OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => + OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Outputs[tempX].EndpointOnlineFeedback; }); } + else + { + Debug.Console(2, this, "No Output Card defined in slot: {0}", tempX); + } + }; + + // Setup Input Card Feedbacks + for (uint x = 1; x <= Chassis.NumberOfInputs; x++) + { + var tempX = x; + + Debug.Console(2, this, "Setting up feedbacks for input slot: {0}", tempX); + + CheckForHdcp2Property(tempX); if (Chassis.Inputs[tempX] != null) { + UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => { if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; } @@ -279,7 +304,7 @@ namespace PepperDash.Essentials.DM } }); - InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => + InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; }); @@ -288,6 +313,8 @@ namespace PepperDash.Essentials.DM { var inputCard = Chassis.Inputs[tempX]; + Debug.Console(2, this, "Adding InputCardHdcpCapabilityFeedback for slot: {0}", inputCard); + if (inputCard.Card is DmcHd) { InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport; @@ -342,8 +369,32 @@ namespace PepperDash.Essentials.DM return 0; }); } - } - } + else + { + Debug.Console(2, this, "No Input Card defined in slot: {0}", tempX); + } + } + + return base.CustomActivate(); + } + + /// + /// Checks for presence of config property defining if the input card supports HDCP2. + /// If not found, assumes false. + /// + /// Input Slot + void CheckForHdcp2Property(uint inputSlot) + { + if (!PropertiesConfig.InputSlotSupportsHdcp2.ContainsKey(inputSlot)) + { + Debug.Console(0, this, Debug.ErrorLogLevel.Warning, +@"Properties Config does not define inputSlotSupportsHdcp2 entry for input card: {0}. Assuming false. +If HDCP2 is required, HDCP control/feedback will not fucntion correctly!", inputSlot); + PropertiesConfig.InputSlotSupportsHdcp2.Add(inputSlot, false); + } + else + Debug.Console(2, this, "inputSlotSupportsHdcp2 for input card: {0} = {1}", inputSlot, PropertiesConfig.InputSlotSupportsHdcp2[inputSlot]); + } /// /// @@ -566,6 +617,13 @@ namespace PepperDash.Essentials.DM var cecPort2 = outputCard.Card2.HdmiOutput; AddDmcHdoPorts(number, cecPort1, cecPort2); } + else if (type == "dmc4kzhdo") + { + var outputCard = new Dmc4kzHdoSingle(number, Chassis); + var cecPort1 = outputCard.Card1.HdmiOutput; + var cecPort2 = outputCard.Card2.HdmiOutput; + AddDmcHdoPorts(number, cecPort1, cecPort2); + } else if (type == "dmchdo") { var outputCard = new DmcHdoSingle(number, Chassis); @@ -579,13 +637,13 @@ namespace PepperDash.Essentials.DM var cecPort1 = outputCard.Card1.HdmiOutput; AddDmcCoPorts(number, cecPort1); } - else if (type == "dmc4kzcohd") - { + else if (type == "dmc4kzcohd") + { var outputCard = new Dmc4kzCoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput; AddDmcCoPorts(number, cecPort1); } - else if (type == "dmccohd") + else if (type == "dmccohd") { var outputCard = new DmcCoHdSingle(number, Chassis); var cecPort1 = outputCard.Card1.HdmiOutput;