diff --git a/skyscraper8/Dvb/DataBroadcasting/IntDescriptors/0x13_IpMacStreamLocationDescriptor.cs b/skyscraper8/Dvb/DataBroadcasting/IntDescriptors/0x13_IpMacStreamLocationDescriptor.cs index afde365..b65c6c8 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntDescriptors/0x13_IpMacStreamLocationDescriptor.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntDescriptors/0x13_IpMacStreamLocationDescriptor.cs @@ -12,7 +12,7 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntDescriptors { [SkyscraperPlugin] [TsDescriptor(0x13,"INT")] - internal class IpMacStreamLocationDescriptor : TsDescriptor + public class IpMacStreamLocationDescriptor : TsDescriptor { public IpMacStreamLocationDescriptor(byte[] buffer) { @@ -22,6 +22,7 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntDescriptors TransportStreamId = ms.ReadUInt16BE(); ServiceId = ms.ReadUInt16BE(); ComponentTag = ms.ReadUInt8(); + Valid = true; } public byte ComponentTag { get; private set; } @@ -33,5 +34,21 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntDescriptors public ushort OriginalNetworkId { get; private set; } public ushort NetworkId { get; private set; } - } + + public override bool Equals(object? obj) + { + return obj is IpMacStreamLocationDescriptor descriptor && + Valid == descriptor.Valid && + ComponentTag == descriptor.ComponentTag && + ServiceId == descriptor.ServiceId && + TransportStreamId == descriptor.TransportStreamId && + OriginalNetworkId == descriptor.OriginalNetworkId && + NetworkId == descriptor.NetworkId; + } + + public override int GetHashCode() + { + return HashCode.Combine(Valid, ComponentTag, ServiceId, TransportStreamId, OriginalNetworkId, NetworkId); + } + } } diff --git a/skyscraper8/Dvb/DataBroadcasting/IntModel/IpMacNotification.cs b/skyscraper8/Dvb/DataBroadcasting/IntModel/IpMacNotification.cs index b62500d..3a3fbb7 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntModel/IpMacNotification.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntModel/IpMacNotification.cs @@ -27,14 +27,25 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntModel public override bool Equals(object? obj) { - return obj is IpMacNotification notification && - EqualityComparer.Default.Equals(Platform, notification.Platform) && - EqualityComparer.Default.Equals(Target, notification.Target); + if (obj == null) + return false; + IpMacNotification that = obj as IpMacNotification; + if (that == null) + return false; + + if (!this.Platform.Equals(that.Platform)) + return false; + if (!this.Target.Equals(that.Target)) + return false; + if (!this.Operational.Equals(that.Operational)) + return false; + + return true; } public override int GetHashCode() { - return HashCode.Combine(Platform, Target); + return HashCode.Combine(Platform.GetHashCode(), Target.GetHashCode(), Operational.GetHashCode()); } } } diff --git a/skyscraper8/Dvb/DataBroadcasting/IntModel/Operational.cs b/skyscraper8/Dvb/DataBroadcasting/IntModel/Operational.cs index 199e9ea..523675f 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntModel/Operational.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntModel/Operational.cs @@ -1,4 +1,6 @@ -using System; +using skyscraper5.Dvb.DataBroadcasting.IntDescriptors; +using skyscraper8.Skyscraper.Collections; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -17,10 +19,37 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntModel public bool? TimeSlicing { get; set; } //0x13 ip mac stream location descriptor - public byte? ComponentTag { get; set; } - public ushort? NetworkId { get; set; } - public ushort? OriginalNetworkId { get; set; } - public ushort? ServiceId { get; set; } - public ushort? TransportStreamId { get; set; } + + public List IpMacStreams { get; set; } + + public override bool Equals(object? obj) + { + if (obj == null) + return false; + Operational that = obj as Operational; + if (that == null) + return false; + if (this.TimeSliceFrameSize != that.TimeSliceFrameSize) + return false; + if (this.TimeSliceMaxAverageRate != that.TimeSliceMaxAverageRate) + return false; + if (this.TimeSliceMaxBurstDuration != that.TimeSliceMaxBurstDuration) + return false; + if (this.MpeFecAlgorithm != that.MpeFecAlgorithm) + return false; + if (this.TimeSliceFecId != that.TimeSliceFecId) + return false; + if (this.TimeSlicing != that.TimeSlicing) + return false; + + return ListUtility.AreEqual(this.IpMacStreams, that.IpMacStreams); + } + + public override int GetHashCode() + { + throw new NotImplementedException(); + } } + + } diff --git a/skyscraper8/Dvb/DataBroadcasting/IntModel/Platform.cs b/skyscraper8/Dvb/DataBroadcasting/IntModel/Platform.cs index 5e1ad6a..d7c48c9 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntModel/Platform.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntModel/Platform.cs @@ -30,13 +30,23 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntModel public override bool Equals(object? obj) { - return obj is Platform platform && - PlatformId == platform.PlatformId; + if (obj == null) + return false; + Platform that = obj as Platform; + if (that == null) + return false; + if (this.PlatformId != that.PlatformId) + return false; + if (this.ProcessingOrder != that.ProcessingOrder) + return false; + if (this.ActionType != that.ActionType) + return false; + return true; } public override int GetHashCode() { - return HashCode.Combine(PlatformId); + throw new NotImplementedException(); } } } diff --git a/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs b/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs index 57162b3..adf2f51 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs @@ -5,6 +5,7 @@ using System.Net; using System.Text; using System.Threading.Tasks; using skyscraper5.Skyscraper.Net; +using skyscraper8.Skyscraper.Collections; namespace skyscraper5.Dvb.DataBroadcasting.IntModel { @@ -18,14 +19,21 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntModel public override bool Equals(object? obj) { - return obj is Target target && - EqualityComparer>.Default.Equals(TargetIpSlashes, target.TargetIpSlashes) && - AllReceivers == target.AllReceivers; + if (obj == null) + return false; + Target that = obj as Target; + if (that == null) + return false; + + if (this.AllReceivers != that.AllReceivers) + return false; + + return ListUtility.AreEqual(this.TargetIpSlashes, that.TargetIpSlashes); } public override int GetHashCode() { - return HashCode.Combine(TargetIpSlashes, AllReceivers); + throw new NotImplementedException(); } public uint GenerateId() diff --git a/skyscraper8/Dvb/DataBroadcasting/IntParser.cs b/skyscraper8/Dvb/DataBroadcasting/IntParser.cs index 10dca83..6daaa4a 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntParser.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntParser.cs @@ -130,10 +130,9 @@ namespace skyscraper5.Dvb.DataBroadcasting foreach (TsDescriptor tsDescriptor in TsDescriptorUnpacker.GetInstance().UnpackDescriptors(input, "INT")) { string cName = tsDescriptor.GetType().Name; - switch (cName) + switch (tsDescriptor) { - case nameof(TimeSliceFecIdentifierDescriptor): - TimeSliceFecIdentifierDescriptor tsfid = (TimeSliceFecIdentifierDescriptor)tsDescriptor; + case TimeSliceFecIdentifierDescriptor tsfid: output.TimeSliceFrameSize = tsfid.FrameSize; output.TimeSliceMaxAverageRate = tsfid.MaxAverageRate; output.TimeSliceMaxBurstDuration = tsfid.MaxBurstDuration; @@ -141,15 +140,10 @@ namespace skyscraper5.Dvb.DataBroadcasting output.TimeSliceFecId = tsfid.TimeSliceFecId; output.TimeSlicing = tsfid.TimeSlicing; break; - case nameof(IpMacStreamLocationDescriptor): - IpMacStreamLocationDescriptor ipmac = (IpMacStreamLocationDescriptor)tsDescriptor; - if (output.TransportStreamId.HasValue) - throw new NotImplementedException("multiple ip mac stram location descriptors"); - output.ComponentTag = ipmac.ComponentTag; - output.NetworkId = ipmac.NetworkId; - output.OriginalNetworkId = ipmac.OriginalNetworkId; - output.ServiceId = ipmac.ServiceId; - output.TransportStreamId = ipmac.TransportStreamId; + case IpMacStreamLocationDescriptor imsld: + if (output.IpMacStreams == null) + output.IpMacStreams = new List(); + output.IpMacStreams.Add(imsld); break; default: throw new NotImplementedException(cName); diff --git a/skyscraper8/Properties/launchSettings.json b/skyscraper8/Properties/launchSettings.json index ad853c5..3934ca2 100644 --- a/skyscraper8/Properties/launchSettings.json +++ b/skyscraper8/Properties/launchSettings.json @@ -2,7 +2,7 @@ "profiles": { "skyscraper8": { "commandName": "Project", - "commandLineArgs": "salvage strat1 \"Z:\\Persönliches\\Satellitescommunity\\Skyscraper Test Fixture\\65.0W_11304.256_V_30000_(2026-05-17 09.44.02)_dump.ts\"", + "commandLineArgs": "\"Z:\\Persönliches\\Satellitescommunity\\Skyscraper Test Fixture\\117W_4050_OTT.ts\"", "remoteDebugEnabled": false }, "Container (Dockerfile)": { diff --git a/skyscraper8/Skyscraper/Collections/ListUtility.cs b/skyscraper8/Skyscraper/Collections/ListUtility.cs new file mode 100644 index 0000000..6f4b02b --- /dev/null +++ b/skyscraper8/Skyscraper/Collections/ListUtility.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace skyscraper8.Skyscraper.Collections +{ + internal static class ListUtility + { + public static bool AreEqual(List dilly, List dally) + { + if (dilly == null && dally == null) + return true; + if (dilly == null && dally != null) + return false; + if (dilly != null && dally == null) + return false; + if (dilly.Count != dally.Count) + return false; + + for (int i = 0; i < dilly.Count; i++) + { + T l = dilly[i]; + T r = dally[i]; + if (!l.Equals(r)) + return false; + } + return true; + } + } +} diff --git a/skyscraper8/Skyscraper/Net/CidrSubnet.cs b/skyscraper8/Skyscraper/Net/CidrSubnet.cs index ae6a65e..6afa843 100644 --- a/skyscraper8/Skyscraper/Net/CidrSubnet.cs +++ b/skyscraper8/Skyscraper/Net/CidrSubnet.cs @@ -22,5 +22,24 @@ namespace skyscraper5.Skyscraper.Net { return String.Format("{0}/{1}", IpAddress.ToString(), Length); } + + public override bool Equals(object? obj) + { + if (obj == null) + return false; + CidrSubnet that = obj as CidrSubnet; + if (that == null) + return false; + if (!this.IpAddress.Equals(that.IpAddress)) + return false; + if (this.Length != that.Length) + return false; + return true; + } + + public override int GetHashCode() + { + return HashCode.Combine(IpAddress.GetHashCode(), Length); + } } } diff --git a/skyscraper8/Skyscraper/Plugins/PluginManager.cs b/skyscraper8/Skyscraper/Plugins/PluginManager.cs index 66c5373..ad49b8c 100644 --- a/skyscraper8/Skyscraper/Plugins/PluginManager.cs +++ b/skyscraper8/Skyscraper/Plugins/PluginManager.cs @@ -593,7 +593,10 @@ namespace skyscraper5.Skyscraper.Plugins { ConstructorInfo constructorInfo = type.GetConstructor(new Type[] { typeof(byte[]) }); if (constructorInfo == null) + { + logger.ErrorFormat("Couldn't find a publicly accessible constructor in {0}. This is a bug, tell Fey.", type.Name); return; + } TsDescriptorAttribute unboxedAttribute = attribute as TsDescriptorAttribute; foreach (string compatibleTable in unboxedAttribute.CompatibleTables)