mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Update LinkToApi to correctly link HDCP settings
This commit is contained in:
@@ -64,7 +64,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
@@ -1144,74 +1145,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var hdmiPort = inputPort.Port as EndpointHdmiInput;
|
|
||||||
|
|
||||||
if (hdmiPort == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
|
|
||||||
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(
|
|
||||||
trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LinkRxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
|
||||||
{
|
|
||||||
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
|
||||||
var rxKey = RxDictionary[ioSlot];
|
|
||||||
var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
|
|
||||||
var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
|
|
||||||
if (Chassis is DmMd8x8Cpu3 || Chassis is DmMd8x8Cpu3rps
|
|
||||||
|| Chassis is DmMd16x16Cpu3 || Chassis is DmMd16x16Cpu3rps
|
|
||||||
|| Chassis is DmMd32x32Cpu3 || Chassis is DmMd32x32Cpu3rps || hdBaseTDevice != null)
|
|
||||||
{
|
|
||||||
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
|
|
||||||
trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
|
||||||
}
|
|
||||||
else if (rxDevice != null)
|
|
||||||
{
|
|
||||||
rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LinkTxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
|
||||||
{
|
|
||||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
|
||||||
var txKey = TxDictionary[ioSlot];
|
|
||||||
var txDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
|
|
||||||
|
|
||||||
if (txDevice == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LinkTxOnlineFeedbackToApi(trilist, ioSlot, joinMap, ioSlotJoin, txDevice);
|
|
||||||
|
|
||||||
LinkBasicTxToApi(trilist, joinMap, ioSlot, ioSlotJoin, txDevice);
|
|
||||||
|
|
||||||
LinkAdvancedTxToApi(trilist, joinMap, ioSlotJoin, txDevice);
|
|
||||||
|
|
||||||
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
|
|
||||||
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(
|
|
||||||
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LinkBasicTxToApi(BasicTriList trilist, DmChassisControllerJoinMap joinMap, uint ioSlot,
|
|
||||||
uint ioSlotJoin, BasicDmTxControllerBase basicTransmitter)
|
|
||||||
{
|
|
||||||
var advTx = basicTransmitter as DmTxControllerBase;
|
|
||||||
|
|
||||||
if (advTx != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
|
||||||
if (inputPort != null)
|
|
||||||
{
|
|
||||||
Debug.Console(1, "Port value for input card {0} is set", ioSlot);
|
Debug.Console(1, "Port value for input card {0} is set", ioSlot);
|
||||||
var port = inputPort.Port;
|
var port = inputPort.Port;
|
||||||
|
|
||||||
@@ -1248,9 +1182,58 @@ namespace PepperDash.Essentials.DM
|
|||||||
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
|
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
private void LinkRxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
{
|
{
|
||||||
inputPort = InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
|
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
|
||||||
|
var rxKey = RxDictionary[ioSlot];
|
||||||
|
var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
|
||||||
|
var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
|
||||||
|
if (Chassis is DmMd8x8Cpu3 || Chassis is DmMd8x8Cpu3rps
|
||||||
|
|| Chassis is DmMd16x16Cpu3 || Chassis is DmMd16x16Cpu3rps
|
||||||
|
|| Chassis is DmMd32x32Cpu3 || Chassis is DmMd32x32Cpu3rps || hdBaseTDevice != null)
|
||||||
|
{
|
||||||
|
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
|
else if (rxDevice != null)
|
||||||
|
{
|
||||||
|
rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkTxToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap, uint ioSlotJoin)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
|
||||||
|
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
|
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||||
|
var txKey = TxDictionary[ioSlot];
|
||||||
|
var txDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
|
||||||
|
|
||||||
|
if (txDevice == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LinkTxOnlineFeedbackToApi(trilist, ioSlot, joinMap, ioSlotJoin, txDevice);
|
||||||
|
|
||||||
|
LinkBasicTxToApi(trilist, joinMap, ioSlot, ioSlotJoin, txDevice);
|
||||||
|
|
||||||
|
LinkAdvancedTxToApi(trilist, joinMap, ioSlot, ioSlotJoin, txDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkBasicTxToApi(BasicTriList trilist, DmChassisControllerJoinMap joinMap, uint ioSlot,
|
||||||
|
uint ioSlotJoin, BasicDmTxControllerBase basicTransmitter)
|
||||||
|
{
|
||||||
|
var advTx = basicTransmitter as DmTxControllerBase;
|
||||||
|
|
||||||
|
if (advTx != null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var inputPort = InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];
|
||||||
|
|
||||||
if (inputPort == null)
|
if (inputPort == null)
|
||||||
{
|
{
|
||||||
@@ -1271,12 +1254,65 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
//added in case the InputSlotSupportsHdcp2 section isn't included in the config, or this slot is left out.
|
//added in case the InputSlotSupportsHdcp2 section isn't included in the config, or this slot is left out.
|
||||||
//if the key isn't in the dictionary, supportsHdcp2 will be false
|
//if the key isn't in the dictionary, supportsHdcp2 will be false
|
||||||
//todo add if statement
|
|
||||||
PropertiesConfig.InputSlotSupportsHdcp2.TryGetValue(ioSlot, out supportsHdcp2);
|
if(!PropertiesConfig.InputSlotSupportsHdcp2.TryGetValue(ioSlot, out supportsHdcp2))
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||||
|
"Input Slot Supports HDCP2 setting not found for slot {0}. Setting to false. Program may not function as intended.",
|
||||||
|
ioSlot);
|
||||||
|
}
|
||||||
|
|
||||||
SetHdcpStateAction(supportsHdcp2, dmInPortWCec,
|
SetHdcpStateAction(supportsHdcp2, dmInPortWCec,
|
||||||
joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
|
joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
|
||||||
|
|
||||||
|
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
|
if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
|
||||||
|
{
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue =
|
||||||
|
(ushort) InputCardHdcpCapabilityTypes[ioSlot];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkAdvancedTxToApi(BasicTriList trilist, DmChassisControllerJoinMap joinMap,
|
||||||
|
uint ioSlot, uint ioSlotJoin, BasicDmTxControllerBase basicTransmitter)
|
||||||
|
{
|
||||||
|
var transmitter = basicTransmitter as DmTxControllerBase;
|
||||||
|
if (transmitter == null) return;
|
||||||
|
|
||||||
|
trilist.BooleanInput[joinMap.TxAdvancedIsPresent.JoinNumber + ioSlotJoin].BoolValue = true;
|
||||||
|
|
||||||
|
transmitter.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(
|
||||||
|
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
|
var txRoutingInputs = transmitter as IRoutingInputs;
|
||||||
|
|
||||||
|
if (txRoutingInputs == null) return;
|
||||||
|
|
||||||
|
var inputPorts = txRoutingInputs.InputPorts.Where((p) => p.Port is EndpointHdmiInput || p.Port is EndpointDisplayPortInput).ToList();
|
||||||
|
|
||||||
|
if (inputPorts.Count == 0)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "No HDCP-capable input ports found on transmitter for slot {0}", ioSlot);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool supportsHdcp2;
|
||||||
|
|
||||||
|
if (!PropertiesConfig.InputSlotSupportsHdcp2.TryGetValue(ioSlot, out supportsHdcp2))
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||||
|
"Input Slot Supports HDCP2 setting not found for slot {0}. Setting to false. Program may not function as intended.",
|
||||||
|
ioSlot);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetHdcpStateAction(supportsHdcp2, inputPorts, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
|
||||||
|
|
||||||
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(
|
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(
|
||||||
trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
|
trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
|
||||||
|
|
||||||
@@ -1290,21 +1326,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
|
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void LinkAdvancedTxToApi(BasicTriList trilist, DmChassisControllerJoinMap joinMap,
|
|
||||||
uint ioSlotJoin, BasicDmTxControllerBase basicTransmitter)
|
|
||||||
{
|
|
||||||
var transmitter = basicTransmitter as DmTxControllerBase;
|
|
||||||
if (transmitter == null) return;
|
|
||||||
|
|
||||||
trilist.BooleanInput[joinMap.TxAdvancedIsPresent.JoinNumber + ioSlotJoin].BoolValue = true;
|
|
||||||
|
|
||||||
transmitter.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(
|
|
||||||
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
|
||||||
|
|
||||||
//todo add HDCP Stuff here
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LinkTxOnlineFeedbackToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap,
|
private void LinkTxOnlineFeedbackToApi(BasicTriList trilist, uint ioSlot, DmChassisControllerJoinMap joinMap,
|
||||||
uint ioSlotJoin, BasicDmTxControllerBase txDevice)
|
uint ioSlotJoin, BasicDmTxControllerBase txDevice)
|
||||||
@@ -1477,6 +1498,38 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetHdcpStateAction(bool hdcpTypeSimple, List<RoutingInputPort> ports, uint join,
|
||||||
|
BasicTriList triList)
|
||||||
|
{
|
||||||
|
if (hdcpTypeSimple)
|
||||||
|
{
|
||||||
|
triList.SetUShortSigAction(join, a =>
|
||||||
|
{
|
||||||
|
foreach (var tempPort in ports.Select(port => port.Port).OfType<EndpointHdmiInput>())
|
||||||
|
{
|
||||||
|
if (a == 0)
|
||||||
|
{
|
||||||
|
tempPort.HdcpSupportOff();
|
||||||
|
}
|
||||||
|
else if (a > 0)
|
||||||
|
{
|
||||||
|
tempPort.HdcpSupportOn();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
triList.SetUShortSigAction(join, a =>
|
||||||
|
{
|
||||||
|
foreach (var tempPort in ports.Select(port => port.Port).OfType<EndpointHdmiInput>())
|
||||||
|
{
|
||||||
|
tempPort.HdcpCapability = (eHdcpCapabilityType) a;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
|
private void SetHdcpStateAction(bool supportsHdcp2, DMInputPortWithCec port, uint join, BasicTriList trilist)
|
||||||
{
|
{
|
||||||
if (!supportsHdcp2)
|
if (!supportsHdcp2)
|
||||||
|
|||||||
Reference in New Issue
Block a user