Made the Astra SDT channel work.
This commit is contained in:
parent
ed3f273238
commit
bc4562cd52
1
.gitignore
vendored
1
.gitignore
vendored
@ -107,3 +107,4 @@ imgui.ini
|
|||||||
/skyscraper8/bin/Debug/net8.0
|
/skyscraper8/bin/Debug/net8.0
|
||||||
/skyscraper8/obj
|
/skyscraper8/obj
|
||||||
/GUIs/skyscraper8.UI.ImGui/bin/Debug/net8.0/skyscraper5.ini
|
/GUIs/skyscraper8.UI.ImGui/bin/Debug/net8.0/skyscraper5.ini
|
||||||
|
/.vs/skyscraper8/CopilotIndices/17.14.698.11175
|
||||||
|
|||||||
1
skyscraper8.Tests/AssemblySettings.cs
Normal file
1
skyscraper8.Tests/AssemblySettings.cs
Normal file
@ -0,0 +1 @@
|
|||||||
|
[assembly: CollectionBehavior(DisableTestParallelization = true)]
|
||||||
61
skyscraper8.Tests/AstraBarkerTransponderTests.cs
Normal file
61
skyscraper8.Tests/AstraBarkerTransponderTests.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
using skyscraper5.Mpeg2;
|
||||||
|
using skyscraper5.Skyscraper.IO;
|
||||||
|
using skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants;
|
||||||
|
using skyscraper8.Tests.ClassDependencies.AsraBarkerTransponderTests;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.Tests
|
||||||
|
{
|
||||||
|
public class AstraBarkerTransponderTests
|
||||||
|
{
|
||||||
|
private const string BARKER_TRANSPONDER_FILE_PATH = "Z:\\Freebies\\Datasets\\SkyscraperLibrarian\\DVB-S Mai 2025\\sgt-000000.ts";
|
||||||
|
private Stream GetBarkerTransponder()
|
||||||
|
{
|
||||||
|
FileInfo fi = new FileInfo(BARKER_TRANSPONDER_FILE_PATH);
|
||||||
|
if (!fi.Exists)
|
||||||
|
{
|
||||||
|
Debug.WriteLine(String.Format("Could not find file: {0}", BARKER_TRANSPONDER_FILE_PATH));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return fi.OpenRead();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void TestAstraSdt()
|
||||||
|
{
|
||||||
|
Stream stream = GetBarkerTransponder();
|
||||||
|
if (stream == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SdtContestant contestant = new SdtContestant(0x002d);
|
||||||
|
|
||||||
|
TsDescriptorUnpacker descriptorUnpacker = TsDescriptorUnpacker.GetInstance();
|
||||||
|
for (byte i = 0x80; i < 0xfe; i++)
|
||||||
|
{
|
||||||
|
descriptorUnpacker.SetUserDefined(i, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
descriptorUnpacker.SetUserDefined(0xfe, true);
|
||||||
|
|
||||||
|
TsContext tsContext = new TsContext();
|
||||||
|
tsContext.FilterChain = new List<skyscraper5.src.Mpeg2.PacketFilter.IPacketFilter>();
|
||||||
|
tsContext.FilterChain.Add(new DummyFilter());
|
||||||
|
tsContext.RegisterPacketProcessor(0x002d, contestant.PacketProcessor);
|
||||||
|
|
||||||
|
byte[] buffer = new byte[188];
|
||||||
|
while (stream.GetAvailableBytes() >= 188)
|
||||||
|
{
|
||||||
|
stream.Read(buffer, 0, 188);
|
||||||
|
tsContext.PushPacket(buffer);
|
||||||
|
if (contestant.Score >= 10)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
stream.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
using skyscraper5.Mpeg2;
|
||||||
|
using skyscraper5.src.Mpeg2.PacketFilter;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.Tests.ClassDependencies.AsraBarkerTransponderTests
|
||||||
|
{
|
||||||
|
internal class DummyFilter : IPacketFilter
|
||||||
|
{
|
||||||
|
public bool PassPacket(TsPacket packet)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -46,8 +46,6 @@ namespace skyscraper8.Tests
|
|||||||
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||||
|
|
||||||
byte[] buffer = Properties.Resources.MultipartRegistrationResponseTest;
|
byte[] buffer = Properties.Resources.MultipartRegistrationResponseTest;
|
||||||
|
|
||||||
|
|
||||||
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
||||||
Assert.True(test.Valid);
|
Assert.True(test.Valid);
|
||||||
}
|
}
|
||||||
@ -98,5 +96,23 @@ namespace skyscraper8.Tests
|
|||||||
CommonTlvEncodingObject.TransmitChannelConfigurationObject child = new CommonTlvEncodingObject.TransmitChannelConfigurationObject(testPayload);
|
CommonTlvEncodingObject.TransmitChannelConfigurationObject child = new CommonTlvEncodingObject.TransmitChannelConfigurationObject(testPayload);
|
||||||
Assert.True(child.Valid);
|
Assert.True(child.Valid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void MultipartRegistrationResponse2()
|
||||||
|
{
|
||||||
|
Random rng = new Random();
|
||||||
|
|
||||||
|
byte[] sourceBuffer = new byte[6];
|
||||||
|
rng.NextBytes(sourceBuffer);
|
||||||
|
PhysicalAddress source = new PhysicalAddress(sourceBuffer);
|
||||||
|
|
||||||
|
byte[] targetBuffer = new byte[6];
|
||||||
|
rng.NextBytes(targetBuffer);
|
||||||
|
PhysicalAddress target = new PhysicalAddress(targetBuffer);
|
||||||
|
|
||||||
|
byte[] buffer = Properties.Resources.MultipartRegistrationResponseTest2;
|
||||||
|
T45_V4_MultipartRegistrationResponse test = new T45_V4_MultipartRegistrationResponse(source, target, buffer);
|
||||||
|
Assert.True(test.Valid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
skyscraper8.Tests/Properties/Resources.Designer.cs
generated
10
skyscraper8.Tests/Properties/Resources.Designer.cs
generated
@ -80,6 +80,16 @@ namespace skyscraper8.Tests.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||||
|
/// </summary>
|
||||||
|
internal static byte[] MultipartRegistrationResponseTest2 {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("MultipartRegistrationResponseTest2", resourceCulture);
|
||||||
|
return ((byte[])(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -130,6 +130,9 @@
|
|||||||
<data name="ranging_response_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="ranging_response_test" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\ranging_response_test.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>..\Resources\ranging_response_test.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="MultipartRegistrationResponseTest2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\T45_V4_MultipartRegistrationResponseTest2.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
<data name="test-1packet-01" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="test-1packet-01" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\test-1packet-01.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>..\Resources\test-1packet-01.ts;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
Binary file not shown.
@ -72,6 +72,10 @@ namespace skyscraper5.Docsis.AnnexC
|
|||||||
DsidEncodings = new List<DsidEncoding>();
|
DsidEncodings = new List<DsidEncoding>();
|
||||||
DsidEncodings.Add(new DsidEncoding(v));
|
DsidEncodings.Add(new DsidEncoding(v));
|
||||||
break;
|
break;
|
||||||
|
case 52:
|
||||||
|
(v[0], v[1]) = (v[1], v[0]);
|
||||||
|
InitializingChannelTimeout = new TimeSpan(0, 0, BitConverter.ToUInt16(v));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
//CM-SP-MULPIv4.0-I01-190815.pdf page 652
|
//CM-SP-MULPIv4.0-I01-190815.pdf page 652
|
||||||
throw new NotImplementedException(string.Format("Common TLV Encodings Type {0}", type));
|
throw new NotImplementedException(string.Format("Common TLV Encodings Type {0}", type));
|
||||||
@ -155,6 +159,7 @@ namespace skyscraper5.Docsis.AnnexC
|
|||||||
public InitalizationTechniqueEnum? InitializationTechnique { get; }
|
public InitalizationTechniqueEnum? InitializationTechnique { get; }
|
||||||
public UpstreamChannelDescriptor UpstreamChannelDescriptor { get; }
|
public UpstreamChannelDescriptor UpstreamChannelDescriptor { get; }
|
||||||
public byte DynamicRangeWindow { get; }
|
public byte DynamicRangeWindow { get; }
|
||||||
|
public byte P16Hi { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte KeySequenceNumber { get; set; }
|
public byte KeySequenceNumber { get; set; }
|
||||||
@ -167,5 +172,6 @@ namespace skyscraper5.Docsis.AnnexC
|
|||||||
public RcpIdEncoding RcpId { get; private set; }
|
public RcpIdEncoding RcpId { get; private set; }
|
||||||
public AuthorizationBlock AuthorizationHint { get; }
|
public AuthorizationBlock AuthorizationHint { get; }
|
||||||
public List<DsidEncoding> DsidEncodings { get; private set; }
|
public List<DsidEncoding> DsidEncodings { get; private set; }
|
||||||
|
public TimeSpan InitializingChannelTimeout { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ namespace skyscraper5.Docsis.MacManagement
|
|||||||
{
|
{
|
||||||
public T45_V4_MultipartRegistrationResponse(PhysicalAddress source, PhysicalAddress destination, byte[] buffer) : base(source, destination, buffer)
|
public T45_V4_MultipartRegistrationResponse(PhysicalAddress source, PhysicalAddress destination, byte[] buffer) : base(source, destination, buffer)
|
||||||
{
|
{
|
||||||
|
File.WriteAllBytes("T45_V4_MultipartRegistrationResponseTest.bin", buffer);
|
||||||
MemoryStream ms = new MemoryStream(buffer, false);
|
MemoryStream ms = new MemoryStream(buffer, false);
|
||||||
SID = ms.ReadUInt16BE();
|
SID = ms.ReadUInt16BE();
|
||||||
Response = ms.ReadUInt8();
|
Response = ms.ReadUInt8();
|
||||||
|
|||||||
@ -12,7 +12,7 @@ using ExtensionDescriptor = skyscraper5.Dvb.ExtensionDescriptor;
|
|||||||
|
|
||||||
namespace skyscraper5.Mpeg2
|
namespace skyscraper5.Mpeg2
|
||||||
{
|
{
|
||||||
class TsDescriptorUnpacker
|
public class TsDescriptorUnpacker
|
||||||
{
|
{
|
||||||
private const bool CRASH_ON_UNIMPLEMENTED_DESCRIPTOR = true;
|
private const bool CRASH_ON_UNIMPLEMENTED_DESCRIPTOR = true;
|
||||||
private static TsDescriptorUnpacker _instance;
|
private static TsDescriptorUnpacker _instance;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"profiles": {
|
"profiles": {
|
||||||
"skyscraper8": {
|
"skyscraper8": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"commandLineArgs": "\"D:\\\\DocsisDemo\\\\docsis-000575.ts\"",
|
"commandLineArgs": "\"Z:\\Freebies\\Datasets\\SkyscraperLibrarian\\DVB-S Mai 2025\\sgt-000000.ts\"",
|
||||||
"remoteDebugEnabled": false
|
"remoteDebugEnabled": false
|
||||||
},
|
},
|
||||||
"Container (Dockerfile)": {
|
"Container (Dockerfile)": {
|
||||||
|
|||||||
@ -20,18 +20,21 @@ namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
|
|||||||
|
|
||||||
public void OnBatBouquet(BatBouquet batBouquet)
|
public void OnBatBouquet(BatBouquet batBouquet)
|
||||||
{
|
{
|
||||||
Score++;
|
hasBat = true;
|
||||||
|
CheckAchievement();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnBatTransportStream(BatBouquet batBouquet, BatTransportStream child)
|
public void OnBatTransportStream(BatBouquet batBouquet, BatTransportStream child)
|
||||||
{
|
{
|
||||||
Score++;
|
hasBat = true;
|
||||||
}
|
CheckAchievement();
|
||||||
|
}
|
||||||
|
|
||||||
public void OnSdtService(ushort transportStreamId, ushort originalNetworkId, SdtService sdtService)
|
public void OnSdtService(ushort transportStreamId, ushort originalNetworkId, SdtService sdtService)
|
||||||
{
|
{
|
||||||
Score++;
|
hasSdt = true;
|
||||||
}
|
CheckAchievement();
|
||||||
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
@ -51,5 +54,16 @@ namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
|
|||||||
public void SetTransportStreamId(ushort transportStreamId)
|
public void SetTransportStreamId(ushort transportStreamId)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool hasBat, hasSdt;
|
||||||
|
private void CheckAchievement()
|
||||||
|
{
|
||||||
|
if (hasBat && hasSdt)
|
||||||
|
{
|
||||||
|
Score++;
|
||||||
|
hasBat = false;
|
||||||
|
hasSdt = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ using skyscraper5.Skyscraper.Plugins;
|
|||||||
namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
|
namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
|
||||||
{
|
{
|
||||||
[SkyscraperPlugin]
|
[SkyscraperPlugin]
|
||||||
class SdtContestant : Contestant, ISdtEventHandler, IDisposable
|
public class SdtContestant : Contestant, ISdtEventHandler, IDisposable
|
||||||
{
|
{
|
||||||
public SdtContestant(int pid) : base("SDT", pid)
|
public SdtContestant(int pid) : base("SDT", pid)
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@ namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
|
|||||||
|
|
||||||
public override void DeclareWinner(SkyscraperContext skyscraperContext, int pid, ProgramContext programContext)
|
public override void DeclareWinner(SkyscraperContext skyscraperContext, int pid, ProgramContext programContext)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PsiDecoder(pid, new SdtParser(skyscraperContext)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetNetworkId(ushort networkId)
|
public void SetNetworkId(ushort networkId)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user