mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Adds HDCP support for DMInput on 8G+ input cards (requires addtional config info on DmChassisController device config to tell if input cards support HDCP2 or not).
This commit is contained in:
@@ -76,7 +76,6 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
{
|
{
|
||||||
Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
|
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)];
|
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||||
if (inputPort != null)
|
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)
|
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
|
||||||
{
|
{
|
||||||
@@ -109,6 +108,19 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
|
|
||||||
dmChassis.InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
|
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];
|
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<ushort>(s =>
|
||||||
|
{
|
||||||
|
if (s == 0)
|
||||||
|
{
|
||||||
|
port.HdcpSupportOff();
|
||||||
|
}
|
||||||
|
else if (s > 0)
|
||||||
|
{
|
||||||
|
port.HdcpSupportOn();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trilist.SetUShortSigAction(join,
|
||||||
|
new Action<ushort>(s =>
|
||||||
|
{
|
||||||
|
port.HdcpReceiveCapability = (eHdcpCapabilityType)s;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,6 +23,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DmChassisController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IRouting, IHasFeedback
|
public class DmChassisController : CrestronGenericBaseDevice, IRoutingInputsOutputs, IRouting, IHasFeedback
|
||||||
{
|
{
|
||||||
|
public DMChassisPropertiesConfig PropertiesConfig { get; set; }
|
||||||
|
|
||||||
public DmMDMnxn Chassis { get; private set; }
|
public DmMDMnxn Chassis { get; private set; }
|
||||||
|
|
||||||
// Feedbacks for EssentialDM
|
// Feedbacks for EssentialDM
|
||||||
@@ -91,10 +93,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
else if (type == "dmmd32x32cpu3") { chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem); }
|
else if (type == "dmmd32x32cpu3") { chassis = new DmMd32x32Cpu3(ipid, Global.ControlSystem); }
|
||||||
else if (type == "dmmd32x32cpu3rps") { chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem); }
|
else if (type == "dmmd32x32cpu3rps") { chassis = new DmMd32x32Cpu3rps(ipid, Global.ControlSystem); }
|
||||||
|
|
||||||
if (chassis == null)
|
if (chassis == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var controller = new DmChassisController(key, name, chassis);
|
var controller = new DmChassisController(key, name, chassis);
|
||||||
// add the cards and port names
|
// add the cards and port names
|
||||||
@@ -126,6 +128,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
controller.InputNames = properties.InputNames;
|
controller.InputNames = properties.InputNames;
|
||||||
controller.OutputNames = properties.OutputNames;
|
controller.OutputNames = properties.OutputNames;
|
||||||
|
controller.PropertiesConfig = properties;
|
||||||
return controller;
|
return controller;
|
||||||
}
|
}
|
||||||
catch (System.Exception e)
|
catch (System.Exception e)
|
||||||
@@ -232,10 +235,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
||||||
{
|
{
|
||||||
if (Chassis.Outputs[tempX].EndpointOnlineFeedback != null)
|
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
||||||
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,10 +267,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
||||||
{
|
{
|
||||||
if (Chassis.Inputs[tempX].EndpointOnlineFeedback != null)
|
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
|
||||||
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() =>
|
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() =>
|
||||||
@@ -301,6 +298,32 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
|
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
|
else
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
@@ -357,33 +380,39 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
else if (type == "dmcc")
|
else if (type == "dmcc")
|
||||||
{
|
{
|
||||||
new DmcC(number, this.Chassis);
|
var inputCard = new DmcC(number, this.Chassis);
|
||||||
AddDmInCardPorts(number);
|
var cecPort = inputCard.DmInput as ICec;
|
||||||
|
AddDmInCardPorts(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (type == "dmccdsp")
|
else if (type == "dmccdsp")
|
||||||
{
|
{
|
||||||
new DmcCDsp(number, this.Chassis);
|
var inputCard = new DmcCDsp(number, this.Chassis);
|
||||||
AddDmInCardPorts(number);
|
var cecPort = inputCard.DmInput as ICec;
|
||||||
|
AddDmInCardPorts(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (type == "dmc4kc")
|
else if (type == "dmc4kc")
|
||||||
{
|
{
|
||||||
new Dmc4kC(number, this.Chassis);
|
var inputCard = new Dmc4kC(number, this.Chassis);
|
||||||
AddDmInCardPorts(number);
|
var cecPort = inputCard.DmInput as ICec;
|
||||||
|
AddDmInCardPorts(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (type == "dmc4kcdsp")
|
else if (type == "dmc4kcdsp")
|
||||||
{
|
{
|
||||||
new Dmc4kCDsp(number, this.Chassis);
|
var inputCard = new Dmc4kCDsp(number, this.Chassis);
|
||||||
AddDmInCardPorts(number);
|
var cecPort = inputCard.DmInput as ICec;
|
||||||
|
AddDmInCardPorts(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (type == "dmc4kzc")
|
else if (type == "dmc4kzc")
|
||||||
{
|
{
|
||||||
new Dmc4kzC(number, this.Chassis);
|
var inputCard = new Dmc4kzC(number, this.Chassis);
|
||||||
AddDmInCardPorts(number);
|
var cecPort = inputCard.DmInput as ICec;
|
||||||
|
AddDmInCardPorts(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (type == "dmc4kzcdsp")
|
else if (type == "dmc4kzcdsp")
|
||||||
{
|
{
|
||||||
new Dmc4kzCDsp(number, this.Chassis);
|
var inputCard = new Dmc4kzCDsp(number, this.Chassis);
|
||||||
AddDmInCardPorts(number);
|
var cecPort = inputCard.DmInput as ICec;
|
||||||
|
AddDmInCardPorts(number, cecPort);
|
||||||
}
|
}
|
||||||
else if (type == "dmccat")
|
else if (type == "dmccat")
|
||||||
{
|
{
|
||||||
@@ -483,6 +512,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
|
AddInputPortWithDebug(number, "dmIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
|
||||||
AddInCardHdmiAndAudioLoopPorts(number);
|
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)
|
void AddHdmiInCardPorts(uint number, ICec cecPort)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ namespace PepperDash.Essentials.DM.Config
|
|||||||
|
|
||||||
[JsonProperty("outputNames")]
|
[JsonProperty("outputNames")]
|
||||||
public Dictionary<uint, string> OutputNames { get; set; }
|
public Dictionary<uint, string> OutputNames { get; set; }
|
||||||
}
|
|
||||||
|
[JsonProperty("inputSlotSupportsHdcp2")]
|
||||||
|
public Dictionary<uint, bool> InputSlotSupportsHdcp2 { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user