mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
First attempt to address HDCP setting on input cards/TXs on DmChassisControllerBridge
This commit is contained in:
@@ -5,6 +5,8 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints;
|
||||||
|
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
@@ -38,26 +40,96 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
|
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
|
||||||
{
|
{
|
||||||
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
|
||||||
var TxKey = dmChassis.TxDictionary[ioSlot];
|
var txKey = dmChassis.TxDictionary[ioSlot];
|
||||||
var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
|
var txDevice = DeviceManager.GetDeviceForKey(txKey) as DmTxControllerBase;
|
||||||
if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
|
if (dmChassis.Chassis is DmMd8x8Cpu3 || dmChassis.Chassis is DmMd8x8Cpu3rps
|
||||||
|| dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
|
|| dmChassis.Chassis is DmMd16x16Cpu3 || dmChassis.Chassis is DmMd16x16Cpu3rps
|
||||||
|| dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps)
|
|| dmChassis.Chassis is DmMd32x32Cpu3 || dmChassis.Chassis is DmMd32x32Cpu3rps)
|
||||||
{
|
{
|
||||||
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
}
|
}
|
||||||
else if (TxDevice != null)
|
else
|
||||||
{
|
{
|
||||||
TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
if (txDevice != null)
|
||||||
|
{
|
||||||
|
txDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
trilist.BooleanInput[joinMap.TxHdcpSupportTypeSimple + ioSlot].BoolValue = hdcpTypeSimple;
|
||||||
|
|
||||||
|
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
|
||||||
|
{
|
||||||
|
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
|
||||||
|
if(inputPort != null)
|
||||||
|
{
|
||||||
|
var hdmiInPort = inputPort.Port;
|
||||||
|
|
||||||
|
if (hdmiInPort != null)
|
||||||
|
{
|
||||||
|
if (hdmiInPort is HdmiInputWithCEC)
|
||||||
|
{
|
||||||
|
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.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
|
||||||
// trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
|
|
||||||
// TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
|
|
||||||
// trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
|
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||||
|
|
||||||
|
var inputPort = dmChassis.InputPorts[string.Format("inputCard{0}-hdmiIn", ioSlot)].Port as EndpointHdmiInput;
|
||||||
|
|
||||||
|
if (inputPort != null)
|
||||||
|
{
|
||||||
|
//trilist.SetUShortSigAction((joinMap.HdcpSupport + ioSlot), u =>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dmChassis.RxDictionary.ContainsKey(ioSlot))
|
if (dmChassis.RxDictionary.ContainsKey(ioSlot))
|
||||||
{
|
{
|
||||||
@@ -88,39 +160,107 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void SetHdcpCapabilityAction(bool hdcpTypeSimple, HdmiInputWithCEC port, uint join, BasicTriList trilist)
|
||||||
|
{
|
||||||
|
if (hdcpTypeSimple)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
|
||||||
|
{
|
||||||
|
if (hdcpTypeSimple)
|
||||||
|
{
|
||||||
|
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.HdcpCapability = (eHdcpCapabilityType)s;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class DmChassisControllerJoinMap : JoinMapBase
|
public class DmChassisControllerJoinMap : JoinMapBase
|
||||||
{
|
{
|
||||||
|
//Digital
|
||||||
public uint IsOnline { get; set; }
|
public uint IsOnline { get; set; }
|
||||||
|
public uint VideoSyncStatus { get; set; }
|
||||||
|
public uint InputEndpointOnline { get; set; }
|
||||||
|
public uint OutputEndpointOnline { get; set; }
|
||||||
|
public uint TxHdcpSupportTypeSimple { get; set; }
|
||||||
|
|
||||||
|
//Analog
|
||||||
public uint OutputVideo { get; set; }
|
public uint OutputVideo { get; set; }
|
||||||
public uint OutputAudio { get; set; }
|
public uint OutputAudio { get; set; }
|
||||||
public uint VideoSyncStatus { get; set; }
|
public uint HdcpSupportState { get; set; }
|
||||||
|
public uint HdcpSupportCapability { get; set; }
|
||||||
|
|
||||||
|
//SErial
|
||||||
public uint InputNames { get; set; }
|
public uint InputNames { get; set; }
|
||||||
public uint OutputNames { get; set; }
|
public uint OutputNames { get; set; }
|
||||||
public uint OutputCurrentVideoInputNames { get; set; }
|
public uint OutputCurrentVideoInputNames { get; set; }
|
||||||
public uint OutputCurrentAudioInputNames { get; set; }
|
public uint OutputCurrentAudioInputNames { get; set; }
|
||||||
public uint InputCurrentResolution { get; set; }
|
public uint InputCurrentResolution { get; set; }
|
||||||
public uint InputEndpointOnline { get; set; }
|
|
||||||
public uint OutputEndpointOnline { get; set; }
|
|
||||||
//public uint HdcpSupport { get; set; }
|
|
||||||
//public uint HdcpSupportCapability { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public DmChassisControllerJoinMap()
|
public DmChassisControllerJoinMap()
|
||||||
{
|
{
|
||||||
|
//Digital
|
||||||
IsOnline = 11;
|
IsOnline = 11;
|
||||||
|
VideoSyncStatus = 100; //101-299
|
||||||
|
InputEndpointOnline = 500; //501-699
|
||||||
|
OutputEndpointOnline = 700; //701-899
|
||||||
|
TxHdcpSupportTypeSimple = 1000; //1001-1199
|
||||||
|
|
||||||
|
//Analog
|
||||||
OutputVideo = 100; //101-299
|
OutputVideo = 100; //101-299
|
||||||
OutputAudio = 300; //301-499
|
OutputAudio = 300; //301-499
|
||||||
VideoSyncStatus = 100; //101-299
|
HdcpSupportState = 1000; //1001-1199
|
||||||
|
HdcpSupportCapability = 1200; //1201-1399
|
||||||
|
|
||||||
|
|
||||||
|
//Serial
|
||||||
InputNames = 100; //101-299
|
InputNames = 100; //101-299
|
||||||
OutputNames = 300; //301-499
|
OutputNames = 300; //301-499
|
||||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||||
InputCurrentResolution = 2400; // 2401-2599
|
InputCurrentResolution = 2400; // 2401-2599
|
||||||
InputEndpointOnline = 500;
|
|
||||||
OutputEndpointOnline = 700;
|
|
||||||
//HdcpSupport = 1000; //1001-1199
|
|
||||||
//HdcpSupportCapability = 1200; //1201-1399
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,8 +279,8 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||||
//HdcpSupport = HdcpSupport + joinOffset;
|
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
tx.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus]);
|
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus]);
|
||||||
tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution]);
|
tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution]);
|
||||||
//tx.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportCapability]);
|
trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||||
|
|
||||||
bool hdcpTypeSimple;
|
bool hdcpTypeSimple;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user