Skip to content

Commit

Permalink
Merge pull request #1187 from PepperDash/hotfix/add-hdcp-control-to-a…
Browse files Browse the repository at this point in the history
…irmedia

main <- hotfix/add-hdcp-control-to-airmedia
  • Loading branch information
ndorin authored May 16, 2024
2 parents 12e81af + 78e4987 commit 428f9f3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ public class AirMediaControllerJoinMap : JoinMapBaseAdvanced
public JoinDataComplete AutomaticInputRoutingEnabled = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata { Description = "Air Media Automatic Input Routing Enable(d)", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });

[JoinName("HdmiInHdcpSupportOn")]
public JoinDataComplete HdmiInHdcpSupportOn = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata { Description = "Turns on HDCP support for HDMI in. Reports state as FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });

[JoinName("HdmiInHdcpSupportOff")]
public JoinDataComplete HdmiInHdcpSupportOff = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata { Description = "Turns off HDCP support for HDMI in. Reports state as FB", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });

[JoinName("HdmiInDisabledByHdcp")]
public JoinDataComplete HdmiInDisabledByHdcp = new JoinDataComplete(new JoinData { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata { Description = "Reports if ", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });

[JoinName("VideoOut")]
public JoinDataComplete VideoOut = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata { Description = "Air Media Video Route Select / Feedback", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ public class AirMediaController : CrestronGenericBridgeableBaseDevice, IRoutingN
public BoolFeedback HdmiVideoSyncDetectedFeedback { get; private set; }
public StringFeedback SerialNumberFeedback { get; private set; }
public BoolFeedback AutomaticInputRoutingEnabledFeedback { get; private set; }
public BoolFeedback HdmiInHdcpSupportOnFeedback { get; private set; }
public BoolFeedback HdmiInDisabledByHdcpFeedback { get; private set; }

public AirMediaController(string key, string name, Am3x00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
: base(key, name, device)
{

AirMedia = device;

DeviceConfig = dc;
Expand Down Expand Up @@ -101,6 +102,8 @@ public AirMediaController(string key, string name, Am3x00 device, DeviceConfig d
LoginCodeFeedback = new IntFeedback(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue);
ConnectionAddressFeedback = new StringFeedback(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue);
HostnameFeedback = new StringFeedback(() => AirMedia.AirMedia.HostNameFeedback.StringValue);
HdmiInHdcpSupportOnFeedback = new BoolFeedback(() => AirMedia.HdmiIn.HdcpSupportOnFeedback.BoolValue);
HdmiInDisabledByHdcpFeedback = new BoolFeedback(() => AirMedia.HdmiIn.DisabledByHdcpFeedback.BoolValue);

// TODO: Figure out if we can actually get the TSID/Serial
SerialNumberFeedback = new StringFeedback(() => "unknown");
Expand Down Expand Up @@ -178,6 +181,13 @@ public override void LinkToApi(BasicTriList trilist, uint joinStart, string join
ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB.JoinNumber]);
HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB.JoinNumber]);
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);

trilist.SetSigFalseAction(joinMap.HdmiInHdcpSupportOn.JoinNumber, () => SetHcdpSupport(true));
HdmiInHdcpSupportOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpSupportOn.JoinNumber]);
trilist.SetSigFalseAction(joinMap.HdmiInHdcpSupportOff.JoinNumber, () => SetHcdpSupport(false));
HdmiInHdcpSupportOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.HdmiInHdcpSupportOff.JoinNumber]);

HdmiInDisabledByHdcpFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiInDisabledByHdcp.JoinNumber]);
}

/// <summary>
Expand Down Expand Up @@ -248,6 +258,14 @@ void HdmiIn_StreamChange(Stream stream, Crestron.SimplSharpPro.DeviceSupport.Str
{
if (args.EventId == DMInputEventIds.SourceSyncEventId)
HdmiVideoSyncDetectedFeedback.FireUpdate();
else if (args.EventId == DMInputEventIds.HdcpSupportOnEventId)
{
HdmiInHdcpSupportOnFeedback.FireUpdate();
}
else if (args.EventId == DMInputEventIds.DisabledByHdcpEventId)
{
HdmiInDisabledByHdcpFeedback.FireUpdate();
}
}

/// <summary>
Expand Down Expand Up @@ -296,6 +314,14 @@ public void SelectAirboardIn()
AirMedia.DisplayControl.VideoOut = AmX00DisplayControl.eAirMediaX00VideoSource.AirBoard;
}

public void SetHcdpSupport(bool on)
{
if (on)
AirMedia.HdmiIn.HdcpSupportOn();
else
AirMedia.HdmiIn.HdcpSupportOff();
}

/// <summary>
/// Reboots the device
/// </summary>
Expand Down

0 comments on commit 428f9f3

Please sign in to comment.