mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Merge pull request #1098 from PepperDash/hotfix/DisplayPortHdcp
Resolve Issues with HDCP Displayport
This commit is contained in:
@@ -121,7 +121,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.DisplayPortInput.InputStreamChange += DisplayPortInputStreamChange;
|
Tx.DisplayPortInput.InputStreamChange += InputStreamChangeEvent;
|
||||||
Tx.BaseEvent += Tx_BaseEvent;
|
Tx.BaseEvent += Tx_BaseEvent;
|
||||||
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
Tx.OnlineStatusChange += Tx_OnlineStatusChange;
|
||||||
|
|
||||||
@@ -131,8 +131,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () => (int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
|
||||||
|
|
||||||
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () => (int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
|
||||||
|
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortInHdcpCapability",
|
||||||
DisplayPortInHdcpCapabilityFeedback = new IntFeedback("DisplayPortHdcpCapability",
|
|
||||||
() => (int)tx.DisplayPortInput.HdcpCapabilityFeedback);
|
() => (int)tx.DisplayPortInput.HdcpCapabilityFeedback);
|
||||||
|
|
||||||
|
|
||||||
@@ -171,13 +170,19 @@ namespace PepperDash.Essentials.DM
|
|||||||
(ActualActiveVideoInput == eVst.Hdmi1
|
(ActualActiveVideoInput == eVst.Hdmi1
|
||||||
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
&& tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),
|
&& tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue)
|
||||||
|
|| (ActualActiveVideoInput == eVst.DisplayPort
|
||||||
|
&& tx.DisplayPortInput.VideoAttributes.HdcpActiveFeedback.BoolValue),
|
||||||
|
|
||||||
HdcpStateFeedbackFunc = () =>
|
HdcpStateFeedbackFunc = () =>
|
||||||
{
|
{
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi1)
|
if (ActualActiveVideoInput == eVst.Hdmi1)
|
||||||
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
return tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
return ActualActiveVideoInput == eVst.Hdmi2 ? tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString() : "";
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
|
return tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString();
|
||||||
|
return ActualActiveVideoInput == eVst.DisplayPort
|
||||||
|
? tx.DisplayPortInput.VideoAttributes.HdcpStateFeedback.ToString()
|
||||||
|
: "";
|
||||||
},
|
},
|
||||||
|
|
||||||
VideoResolutionFeedbackFunc = () =>
|
VideoResolutionFeedbackFunc = () =>
|
||||||
@@ -186,6 +191,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString();
|
||||||
if (ActualActiveVideoInput == eVst.Hdmi2)
|
if (ActualActiveVideoInput == eVst.Hdmi2)
|
||||||
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
return tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString();
|
||||||
|
if (ActualActiveVideoInput == eVst.DisplayPort)
|
||||||
|
return tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString();
|
||||||
return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
|
return ActualActiveVideoInput == eVst.Vga ? tx.DisplayPortInput.VideoAttributes.GetVideoResolutionString() : "";
|
||||||
},
|
},
|
||||||
VideoSyncFeedbackFunc = () =>
|
VideoSyncFeedbackFunc = () =>
|
||||||
@@ -193,6 +200,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == eVst.Hdmi2
|
|| (ActualActiveVideoInput == eVst.Hdmi2
|
||||||
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
&& tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue)
|
||||||
|
|| (ActualActiveVideoInput == eVst.DisplayPort
|
||||||
|
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
||||||
|| (ActualActiveVideoInput == eVst.Vga
|
|| (ActualActiveVideoInput == eVst.Vga
|
||||||
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
&& tx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
|
||||||
|
|
||||||
@@ -211,28 +220,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
|
||||||
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
|
||||||
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback,
|
||||||
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback);
|
Hdmi1VideoSyncFeedback, Hdmi2VideoSyncFeedback, DisplayPortVideoSyncFeedback, DisplayPortInHdcpCapabilityFeedback);
|
||||||
|
|
||||||
// Set Ports for CEC
|
|
||||||
HdmiIn1.Port = Tx.HdmiInputs[1];
|
HdmiIn1.Port = Tx.HdmiInputs[1];
|
||||||
HdmiIn2.Port = Tx.HdmiInputs[2];
|
HdmiIn2.Port = Tx.HdmiInputs[2];
|
||||||
|
DisplayPortIn.Port = Tx.DisplayPortInput;
|
||||||
HdmiLoopOut.Port = Tx.HdmiOutput;
|
HdmiLoopOut.Port = Tx.HdmiOutput;
|
||||||
DmOut.Port = Tx.DmOutput;
|
DmOut.Port = Tx.DmOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayPortInputStreamChange(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
|
||||||
{
|
|
||||||
Debug.Console(2, "{0} event {1} stream {2}", Tx.ToString(), inputStream.ToString(), args.EventId.ToString());
|
|
||||||
|
|
||||||
switch (args.EventId)
|
|
||||||
{
|
|
||||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
|
||||||
DisplayPortVideoSyncFeedback.FireUpdate();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public override bool CustomActivate()
|
public override bool CustomActivate()
|
||||||
{
|
{
|
||||||
@@ -344,11 +340,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
case EndpointInputStreamEventIds.HdcpCapabilityFeedbackEventId:
|
||||||
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[1]) HdmiIn1HdcpCapabilityFeedback.FireUpdate();
|
||||||
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[2]) HdmiIn2HdcpCapabilityFeedback.FireUpdate();
|
||||||
|
if (inputStream == Tx.DisplayPortInput) DisplayPortInHdcpCapabilityFeedback.FireUpdate();
|
||||||
|
|
||||||
|
Debug.Console(2, this, "DisplayPortHDCP Mode Trigger = {0}",
|
||||||
|
DisplayPortInHdcpCapabilityFeedback.IntValue);
|
||||||
|
|
||||||
HdcpStateFeedback.FireUpdate();
|
HdcpStateFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
case EndpointInputStreamEventIds.SyncDetectedFeedbackEventId:
|
||||||
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[1]) Hdmi1VideoSyncFeedback.FireUpdate();
|
||||||
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
if (inputStream == Tx.HdmiInputs[2]) Hdmi2VideoSyncFeedback.FireUpdate();
|
||||||
|
if (inputStream == Tx.DisplayPortInput) DisplayPortVideoSyncFeedback.FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharpPro.DM;
|
using Crestron.SimplSharpPro.DM;
|
||||||
@@ -44,7 +42,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
if (typeName.StartsWith("dmtx401"))
|
if (typeName.StartsWith("dmtx401"))
|
||||||
return new DmTx401CController(key, name, new DmTx401C(dmInput), true);
|
return new DmTx401CController(key, name, new DmTx401C(dmInput), true);
|
||||||
if (typeName.StartsWith("hdbasettx"))
|
if (typeName.StartsWith("hdbasettx"))
|
||||||
new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
|
return new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -83,6 +81,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <param name="name"></param>
|
/// <param name="name"></param>
|
||||||
/// <param name="props"></param>
|
/// <param name="props"></param>
|
||||||
|
/// <param name="typeName"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
public static BasicDmTxControllerBase GetDmTxController(string key, string name, string typeName, DmTxPropertiesConfig props)
|
||||||
{
|
{
|
||||||
@@ -180,7 +179,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (parentDev is DmpsRoutingController)
|
if (parentDev is DmpsRoutingController)
|
||||||
{
|
{
|
||||||
// Get the DMPS chassis and link stuff up
|
// Get the DMPS chassis and link stuff up
|
||||||
var dmpsDev = (parentDev as DmpsRoutingController);
|
var dmpsDev = (parentDev as DmpsRoutingController);
|
||||||
@@ -237,11 +236,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
|
||||||
{
|
return null;
|
||||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,8 +332,6 @@ namespace PepperDash.Essentials.DM
|
|||||||
txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]);
|
txR.VideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoInput.JoinNumber]);
|
||||||
txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]);
|
txR.AudioSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioInput.JoinNumber]);
|
||||||
|
|
||||||
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
|
|
||||||
|
|
||||||
if (txR.InputPorts[DmPortName.HdmiIn] != null)
|
if (txR.InputPorts[DmPortName.HdmiIn] != null)
|
||||||
{
|
{
|
||||||
var inputPort = txR.InputPorts[DmPortName.HdmiIn];
|
var inputPort = txR.InputPorts[DmPortName.HdmiIn];
|
||||||
@@ -384,7 +378,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback;
|
var intFeedback = tx.Feedbacks["HdmiIn2HdcpCapability"] as IntFeedback;
|
||||||
if (intFeedback != null)
|
if (intFeedback != null)
|
||||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port1HdcpState.JoinNumber]);
|
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port2HdcpState.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
|
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
|
||||||
@@ -401,16 +395,17 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null)
|
if (tx.Feedbacks["DisplayPortInHdcpCapability"] != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback;
|
var intFeedback = tx.Feedbacks["DisplayPortInHdcpCapability"] as IntFeedback;
|
||||||
if (intFeedback != null)
|
if (intFeedback != null)
|
||||||
|
|
||||||
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
|
intFeedback.LinkInputSig(trilist.UShortInput[joinMap.Port3HdcpState.JoinNumber]);
|
||||||
}
|
|
||||||
|
|
||||||
if (inputPort.ConnectionType == eRoutingPortConnectionType.Hdmi && inputPort.Port != null)
|
if (inputPort.ConnectionType == eRoutingPortConnectionType.DisplayPort && inputPort.Port != null)
|
||||||
{
|
{
|
||||||
var port = inputPort.Port as EndpointDisplayPortInput;
|
var port = inputPort.Port as EndpointDisplayPortInput;
|
||||||
|
SetHdcpCapabilityAction(port, joinMap.Port3HdcpState.JoinNumber, trilist);
|
||||||
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port3HdcpState.JoinNumber, trilist);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,17 +471,15 @@ namespace PepperDash.Essentials.DM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointDisplayPortInput port, uint join,
|
private void SetHdcpCapabilityAction(EndpointDisplayPortInput port, uint join,
|
||||||
BasicTriList trilist)
|
BasicTriList trilist)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
trilist.SetUShortSigAction(join,
|
trilist.SetUShortSigAction(join,
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
port.HdcpCapability = (eHdcpCapabilityType)s;
|
Debug.Console(0, this, "Trying to set HDCP to {0} on port {1}", s, port.ToString());
|
||||||
|
port.HdcpCapability = (eHdcpCapabilityType) s;
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -495,8 +488,22 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
public DmTxControllerFactory()
|
public DmTxControllerFactory()
|
||||||
{
|
{
|
||||||
TypeNames = new List<string>() { "dmtx200c", "dmtx201c", "dmtx201s", "dmtx4k100c", "dmtx4k202c", "dmtx4kz202c", "dmtx4k302c", "dmtx4kz302c",
|
TypeNames = new List<string>
|
||||||
"dmtx401c", "dmtx401s", "dmtx4k100c1g", "dmtx4kz100c1g", "hdbasettx" };
|
{
|
||||||
|
"dmtx200c",
|
||||||
|
"dmtx201c",
|
||||||
|
"dmtx201s",
|
||||||
|
"dmtx4k100c",
|
||||||
|
"dmtx4k202c",
|
||||||
|
"dmtx4kz202c",
|
||||||
|
"dmtx4k302c",
|
||||||
|
"dmtx4kz302c",
|
||||||
|
"dmtx401c",
|
||||||
|
"dmtx401s",
|
||||||
|
"dmtx4k100c1g",
|
||||||
|
"dmtx4kz100c1g",
|
||||||
|
"hdbasettx"
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
@@ -506,8 +513,8 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(1, "Factory Attempting to create new DM-TX Device");
|
Debug.Console(1, "Factory Attempting to create new DM-TX Device");
|
||||||
|
|
||||||
var props = JsonConvert.DeserializeObject
|
var props = JsonConvert.DeserializeObject
|
||||||
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(dc.Properties.ToString());
|
<DmTxPropertiesConfig>(dc.Properties.ToString());
|
||||||
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
|
return DmTxHelper.GetDmTxController(dc.Key, dc.Name, type, props);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user