Public release to satellitescomunity.de

This commit is contained in:
feyris-tan 2025-09-14 21:47:58 +02:00
parent a1ce51519c
commit cc8e1edd90
41 changed files with 1252 additions and 96 deletions

View File

@ -54,26 +54,41 @@ namespace skyscraper5.Data
{ {
putObjectArgs = putObjectArgs.WithObjectSize(buffer.Length); putObjectArgs = putObjectArgs.WithObjectSize(buffer.Length);
} }
else if (optionalData.ContainsKey("X-Skyscraper-Content-Length"))
lock (_tasks)
{ {
_tasks.Add(_minioClient.PutObjectAsync(putObjectArgs).ContinueWith(task => putObjectArgs = putObjectArgs.WithObjectSize(long.Parse(optionalData["X-Skyscraper-Content-Length"]));
{
droppedFiles.Add(fullName);
Monitor.Enter(definetlyKnownFiles);
definetlyKnownFiles.Add(fullName);
Monitor.Exit(definetlyKnownFiles);
Monitor.Enter(definetlyMissingFiles);
definetlyMissingFiles.Remove(fullName);
Monitor.Exit(definetlyMissingFiles);
buffer.Close();
buffer.Dispose();
}));
} }
if (definetlyKnownFiles == null)
definetlyKnownFiles = new HashSet<string>();
if (definetlyMissingFiles == null)
definetlyMissingFiles = new HashSet<string>();
lock (_tasks)
{
_tasks.Add(_minioClient.PutObjectAsync(putObjectArgs).ContinueWith(task =>
{
if (task.IsFaulted)
{
throw new MinioException("A minio upload task failed.");
}
droppedFiles.Add(fullName);
Monitor.Enter(definetlyKnownFiles);
definetlyKnownFiles.Add(fullName);
Monitor.Exit(definetlyKnownFiles);
Monitor.Enter(definetlyMissingFiles);
definetlyMissingFiles.Remove(fullName);
Monitor.Exit(definetlyMissingFiles);
buffer.Close();
buffer.Dispose();
}));
}
CleanTaskList(); CleanTaskList();
} }
@ -352,9 +367,20 @@ namespace skyscraper5.Data
public void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener) public void DvbNipFileArrival(NipActualCarrierInformation carrier, FluteListener listener)
{ {
string path = "/nip/" + DvbNipUtilities.MakeFilename(listener.FileAssociation.ContentLocation); Dictionary<string, string> bonusInfo = new Dictionary<string, string>();
bonusInfo.Add("X-Skyscraper-NIP-StreamProviderName", carrier.NipStreamProviderName);
bonusInfo.Add("X-Skyscraper-Event", nameof(DvbNipFileArrival));
bonusInfo.Add("X-Skyscraper-Content-Encoding",listener.FileAssociation.ContentEncoding);
bonusInfo.Add("X-Skyscraper-Transfer-Length", listener.FileAssociation.TransferLength.ToString());
bonusInfo.Add("X-Skyscraper-Content-Length", listener.FileAssociation.ContentLength.ToString());
string mime = !string.IsNullOrEmpty(listener.FileAssociation.ContentType)
? listener.FileAssociation.ContentType
: "application/octet-stream";
string path = "/nip/" + DvbNipUtilities.MakeFilename(listener.FileAssociation.ContentLocation);
Stream stream = listener.ToStream(); Stream stream = listener.ToStream();
WriteObject(path, stream); WriteObject(path, stream, mime, bonusInfo);
} }
public void StoreIqGraph(Guid jobGuid, long frequency, char polarity, IqChartData plot) public void StoreIqGraph(Guid jobGuid, long frequency, char polarity, IqChartData plot)

View File

@ -5,11 +5,15 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Minio" Version="6.0.4" /> <PackageReference Include="Minio" Version="6.0.5" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\skyscraper8\skyscraper8.csproj" /> <ProjectReference Include="..\..\skyscraper8\skyscraper8.csproj" />
</ItemGroup> </ItemGroup>
<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
</Project> </Project>

View File

@ -125,7 +125,7 @@ namespace skyscraper5.Data.MySql
} }
public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection, public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection,
bool settingsWindowUseDifferentTunerForSetFilter, int settingsWindowSetFilterTunerSelection, int multitunerMode, int settingsWindowSetFilterTunerSelection,
int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum, int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum,
bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish, bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish,
bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow, bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow,

View File

@ -169,7 +169,7 @@ namespace skyscraper5.Data.PostgreSql
} }
public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection, public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection,
bool settingsWindowUseDifferentTunerForSetFilter, int settingsWindowSetFilterTunerSelection, int multitunerMode, int settingsWindowSetFilterTunerSelection,
int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum, int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum,
bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish, bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish,
bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow, bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow,
@ -182,7 +182,7 @@ namespace skyscraper5.Data.PostgreSql
command.CommandText = command.CommandText =
"INSERT INTO ui_blindscan_setting_history VALUES (DEFAULT,@bstselection,@ustfsfilter,@sftselection,@diseqc,@cigraphs,@crspectrum,@cfilters,@satellite,@lnb,@dish,@hl,@hh,@vl,@vh);"; "INSERT INTO ui_blindscan_setting_history VALUES (DEFAULT,@bstselection,@ustfsfilter,@sftselection,@diseqc,@cigraphs,@crspectrum,@cfilters,@satellite,@lnb,@dish,@hl,@hh,@vl,@vh);";
command.Parameters.AddWithValue("@bstselection", NpgsqlDbType.Integer, settingsWindowBlScanTunerSelection); command.Parameters.AddWithValue("@bstselection", NpgsqlDbType.Integer, settingsWindowBlScanTunerSelection);
command.Parameters.AddWithValue("@ustfsfilter", NpgsqlDbType.Boolean, settingsWindowUseDifferentTunerForSetFilter); command.Parameters.AddWithValue("@ustfsfilter", NpgsqlDbType.Integer, multitunerMode);
command.Parameters.AddWithValue("@sftselection", NpgsqlDbType.Integer, settingsWindowSetFilterTunerSelection); command.Parameters.AddWithValue("@sftselection", NpgsqlDbType.Integer, settingsWindowSetFilterTunerSelection);
command.Parameters.AddWithValue("@diseqc", NpgsqlDbType.Integer, settingsWindowDiseqc); command.Parameters.AddWithValue("@diseqc", NpgsqlDbType.Integer, settingsWindowDiseqc);
command.Parameters.AddWithValue("@cigraphs", NpgsqlDbType.Boolean, settingsWindowCollectIqGraphs); command.Parameters.AddWithValue("@cigraphs", NpgsqlDbType.Boolean, settingsWindowCollectIqGraphs);

View File

@ -0,0 +1 @@
satip autodetect 1 H 11141 S2 23500

View File

@ -19,7 +19,7 @@ namespace SDL2Demo.Jobs
private readonly TaskQueue _taskQueue; private readonly TaskQueue _taskQueue;
public int settingsWindowBLScanTunerSelection; public int settingsWindowBLScanTunerSelection;
public bool settingsWindowUseDifferentTunerForSetFilter; public int multitunerMode;
public int settingsWindowSetFilterTunerSelection; public int settingsWindowSetFilterTunerSelection;
public int settingsWindowDiseqc; public int settingsWindowDiseqc;
public bool settingsWindowCollectIqGraphs; public bool settingsWindowCollectIqGraphs;
@ -34,6 +34,8 @@ namespace SDL2Demo.Jobs
public bool settingsWindowScanVerticalLow; public bool settingsWindowScanVerticalLow;
public bool settingsWindowScanVerticalHigh; public bool settingsWindowScanVerticalHigh;
private DataStorage dataStorage; private DataStorage dataStorage;
private ObjectStorage objectStorage; private ObjectStorage objectStorage;
private IGpsReceiver gpsReceiver; private IGpsReceiver gpsReceiver;
@ -43,7 +45,7 @@ namespace SDL2Demo.Jobs
private void StoreSettings() private void StoreSettings()
{ {
dataStorage.InsertUiBlindscanSettingHistory(settingsWindowBLScanTunerSelection, dataStorage.InsertUiBlindscanSettingHistory(settingsWindowBLScanTunerSelection,
settingsWindowUseDifferentTunerForSetFilter, settingsWindowSetFilterTunerSelection, multitunerMode, settingsWindowSetFilterTunerSelection,
settingsWindowDiseqc, settingsWindowCollectIqGraphs, settingsWindowDiseqc, settingsWindowCollectIqGraphs,
settingsWindowCollectRfSpectrum, settingsWindowCaptureFile, settingsWindowSatellite, settingsWindowLNB, settingsWindowCollectRfSpectrum, settingsWindowCaptureFile, settingsWindowSatellite, settingsWindowLNB,
settingsWindowDish, settingsWindowScanHorizontalLow, settingsWindowScanHorizontalHigh, settingsWindowDish, settingsWindowScanHorizontalLow, settingsWindowScanHorizontalHigh,
@ -71,7 +73,7 @@ namespace SDL2Demo.Jobs
if (previousSettings != null) if (previousSettings != null)
{ {
settingsWindowBLScanTunerSelection = Convert.ToInt32(previousSettings[1]); settingsWindowBLScanTunerSelection = Convert.ToInt32(previousSettings[1]);
settingsWindowUseDifferentTunerForSetFilter = Convert.ToBoolean(previousSettings[2]); multitunerMode = Convert.ToInt32(previousSettings[2]);
settingsWindowSetFilterTunerSelection = Convert.ToInt32(previousSettings[3]); settingsWindowSetFilterTunerSelection = Convert.ToInt32(previousSettings[3]);
settingsWindowDiseqc = Convert.ToInt32(previousSettings[4]); settingsWindowDiseqc = Convert.ToInt32(previousSettings[4]);
settingsWindowCollectIqGraphs = Convert.ToBoolean(previousSettings[5]); settingsWindowCollectIqGraphs = Convert.ToBoolean(previousSettings[5]);
@ -112,10 +114,20 @@ namespace SDL2Demo.Jobs
bjc.ObjectStorage = objectStorage; bjc.ObjectStorage = objectStorage;
bjc.SatellitePosition = satellites[settingsWindowSatellite]; bjc.SatellitePosition = satellites[settingsWindowSatellite];
if (settingsWindowUseDifferentTunerForSetFilter) switch (multitunerMode)
bjc.StreamReader = new CoopBlindscanStreamReaderProxy(streamReader, settingsWindowBLScanTunerSelection, settingsWindowSetFilterTunerSelection); {
else case 1:
bjc.StreamReader = streamReader; bjc.StreamReader = streamReader;
break;
case 2:
bjc.StreamReader = new CoopBlindscanStreamReaderProxy(streamReader, settingsWindowBLScanTunerSelection, settingsWindowSetFilterTunerSelection);
break;
case 4:
bjc.StreamReader = new SatIpWithStreamReaderProxy(streamReader, objectStorage);
break;
default:
throw new NotImplementedException(String.Format("Multituner Mode {0}", multitunerMode));
}
bjc.TunerMetadata = tuners[settingsWindowBLScanTunerSelection]; bjc.TunerMetadata = tuners[settingsWindowBLScanTunerSelection];
bjc.Ui = new InheritedBlindscanUiJunction(); bjc.Ui = new InheritedBlindscanUiJunction();
@ -150,9 +162,10 @@ namespace SDL2Demo.Jobs
if (tuners[settingsWindowBLScanTunerSelection].IsSatellite()) if (tuners[settingsWindowBLScanTunerSelection].IsSatellite())
{ {
ImGui.Checkbox("Use different Tuner for IQScan and SetFilter", ref settingsWindowUseDifferentTunerForSetFilter); ImGui.RadioButton("Use the same Tuner for IQScan and SetFilter", ref multitunerMode, 1);
ImGui.RadioButton("Use different Tuner for IQScan and SetFilter", ref multitunerMode, 2);
if (settingsWindowUseDifferentTunerForSetFilter) if (multitunerMode == 2)
{ {
ImGui.Text("This assumes that both tuners are connected to the same antenna set-up, using e.g. a splitter."); ImGui.Text("This assumes that both tuners are connected to the same antenna set-up, using e.g. a splitter.");
@ -172,6 +185,8 @@ namespace SDL2Demo.Jobs
ImGui.PopID(); ImGui.PopID();
} }
ImGui.RadioButton("Use same Tuner for IQScan, but SAT>IP Server for SetFilter", ref multitunerMode, 4);
ImGui.Text("DiSEqC"); ImGui.Text("DiSEqC");
ImGui.SameLine(); ImGui.SameLine();
ImGui.RadioButton("A", ref settingsWindowDiseqc, 1); ImGui.RadioButton("A", ref settingsWindowDiseqc, 1);

View File

@ -1594,13 +1594,19 @@ namespace SDL2Demo.Jobs
_blindscanProgressWindow.Start = minimum; _blindscanProgressWindow.Start = minimum;
_blindscanProgressWindow.Progress = minimum; _blindscanProgressWindow.Progress = minimum;
_blindscanProgressWindow.End = maximum; _blindscanProgressWindow.End = maximum;
jobContext.Renderables.Add(_blindscanProgressWindow); Tasks.EnqueueTask(() =>
{
jobContext.Renderables.Add(_blindscanProgressWindow);
});
} }
public void OnBlindscanAfterBLScan() public void OnBlindscanAfterBLScan()
{ {
jobContext.Renderables.Remove(_blindscanProgressWindow); Tasks.EnqueueTask(() =>
_blindscanProgressWindow = null; {
jobContext.Renderables.Remove(_blindscanProgressWindow);
_blindscanProgressWindow = null;
});
} }
public void OnBlindscanSearchResult1Callback(BlindscanSearchResult searchResult, int polarityIndex, public void OnBlindscanSearchResult1Callback(BlindscanSearchResult searchResult, int polarityIndex,

View File

@ -9,6 +9,14 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Optimize>False</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ImGui.NET" Version="1.88.0" /> <PackageReference Include="ImGui.NET" Version="1.88.0" />
<PackageReference Include="OpenRA-SDL2-CS" Version="1.0.33" /> <PackageReference Include="OpenRA-SDL2-CS" Version="1.0.33" />

View File

@ -97,6 +97,9 @@ namespace skyscraper8.EPGCollectorPort.SkyscraperSide.MediaHighway2
public void OnMhw2Summary(int sourcePid, MediaHighway2SummarySection summarySection) public void OnMhw2Summary(int sourcePid, MediaHighway2SummarySection summarySection)
{ {
if (summarySection == null)
return;
if (_binders == null) if (_binders == null)
_binders = new Dictionary<int, Mhw2EventBinder>(); _binders = new Dictionary<int, Mhw2EventBinder>();

View File

@ -171,6 +171,7 @@ namespace skyscraper8.Ietf.FLUTE
case "ll": case "ll":
case "nunull": case "nunull":
case "nulull": case "nulull":
case "nl":
break; break;
case "gzip": case "gzip":
GZipStream level2 = new GZipStream(level1, CompressionMode.Decompress, false); GZipStream level2 = new GZipStream(level1, CompressionMode.Decompress, false);

View File

@ -60,6 +60,27 @@ namespace skyscraper5.src.InteractionChannel.Model
public int? PowerCorrection { get; internal set; } public int? PowerCorrection { get; internal set; }
public int? EsN0 { get; internal set; } public int? EsN0 { get; internal set; }
public ushort FrequencyCorrection { get; internal set; } public ushort FrequencyCorrection { get; internal set; }
protected bool Equals(CmtEntry other)
{
return GroupId == other.GroupId && LoginId == other.LoginId && SlotType == other.SlotType;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((CmtEntry)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(GroupId, LoginId, (int)SlotType);
}
} }
} }
} }

View File

@ -81,5 +81,26 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
{ {
return new DatabaseKeyRmtLinkage(TransportStreamId, OriginalNetworkId, ServiceId, LinkageType, InteractiveNetworkId); return new DatabaseKeyRmtLinkage(TransportStreamId, OriginalNetworkId, ServiceId, LinkageType, InteractiveNetworkId);
} }
protected bool Equals(_0x4a_LinkageDescriptor other)
{
return TransportStreamId == other.TransportStreamId && OriginalNetworkId == other.OriginalNetworkId && ServiceId == other.ServiceId && LinkageType == other.LinkageType && InteractiveNetworkId == other.InteractiveNetworkId;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((_0x4a_LinkageDescriptor)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(TransportStreamId, OriginalNetworkId, ServiceId, LinkageType, InteractiveNetworkId);
}
} }
} }

View File

@ -134,5 +134,26 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
{ {
return String.Format("{0} kHz,{1}, {2} sym/s", Frequency, Polarization.ToString()[0], SymbolRate); return String.Format("{0} kHz,{1}, {2} sym/s", Frequency, Polarization.ToString()[0], SymbolRate);
} }
protected bool Equals(_0xa8_SatelliteForwardLinkDescriptor other)
{
return SatelliteId == other.SatelliteId && BeamId == other.BeamId && Frequency == other.Frequency && OrbitalPosition == other.OrbitalPosition && East == other.East && Polarization == other.Polarization && SymbolRate == other.SymbolRate;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((_0xa8_SatelliteForwardLinkDescriptor)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(SatelliteId, BeamId, Frequency, OrbitalPosition, East, (int)Polarization, SymbolRate);
}
} }
} }

View File

@ -43,5 +43,26 @@ namespace skyscraper5.src.InteractionChannel.Model.Descriptors
{ {
return String.Format("Sat-ID {0}, Beam-ID {1}, Gateway-ID {2}, Superframe-ID {3}, Freq-Offset {4}", SatelliteId, BeamId, GatewayId, SuperframeId, TxFrequencyOffset); return String.Format("Sat-ID {0}, Beam-ID {1}, Gateway-ID {2}, Superframe-ID {3}, Freq-Offset {4}", SatelliteId, BeamId, GatewayId, SuperframeId, TxFrequencyOffset);
} }
protected bool Equals(_0xa9_SatelliteReturnLinkDescriptor other)
{
return SatelliteId == other.SatelliteId && BeamId == other.BeamId && GatewayId == other.GatewayId && OrbitalPosition == other.OrbitalPosition && Eastern == other.Eastern && SuperframeId == other.SuperframeId && TxFrequencyOffset == other.TxFrequencyOffset;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((_0xa9_SatelliteReturnLinkDescriptor)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(SatelliteId, BeamId, GatewayId, OrbitalPosition, Eastern, SuperframeId, TxFrequencyOffset);
}
} }
} }

View File

@ -62,6 +62,24 @@ namespace skyscraper5.src.InteractionChannel.Model
public byte TimeslotId { get; internal set; } public byte TimeslotId { get; internal set; }
public byte RepeatCount { get; internal set; } public byte RepeatCount { get; internal set; }
} }
protected bool Equals(Frame other)
{
return FrameId == other.FrameId && FrameDuration == other.FrameDuration && TotalTimeslotCount == other.TotalTimeslotCount && StartTimeslotNumber == other.StartTimeslotNumber;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Frame)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(FrameId, FrameDuration, TotalTimeslotCount, StartTimeslotNumber);
}
} }
public Frame[] Frames { get; } public Frame[] Frames { get; }

View File

@ -171,6 +171,66 @@ namespace skyscraper5.src.InteractionChannel.Model
{ {
return new DatabaseKeyRmtTransportStream(networkId, TransportStreamId, OriginalNetworkId); return new DatabaseKeyRmtTransportStream(networkId, TransportStreamId, OriginalNetworkId);
} }
protected bool Equals(TransportStream other)
{
if (this.TransportStreamId != other.TransportStreamId)
return false;
if (this.OriginalNetworkId != other.OriginalNetworkId)
return false;
if (this.SatelliteForwardLink != null)
{
if (other.SatelliteForwardLink != null)
{
if (!this.SatelliteForwardLink.Equals(other.SatelliteForwardLink))
return false;
}
else
{
return false;
}
}
else
{
if (other.SatelliteForwardLink != null)
return false;
}
if (this.SatelliteReturnLink != null)
{
if (other.SatelliteReturnLink != null)
{
if (!this.SatelliteReturnLink.Equals(other.SatelliteReturnLink))
return false;
}
else
{
return false;
}
}
else
{
if (other.SatelliteReturnLink != null)
return false;
}
return true;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((TransportStream)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(TransportStreamId, OriginalNetworkId, SatelliteReturnLink, SatelliteForwardLink);
}
} }
} }
} }

View File

@ -72,6 +72,27 @@ namespace skyscraper5.src.InteractionChannel.Model
public uint FrameStartTime { get; internal set; } public uint FrameStartTime { get; internal set; }
public uint FrameCentreFrequencyOffset { get; internal set; } public uint FrameCentreFrequencyOffset { get; internal set; }
} }
protected bool Equals(Superframe other)
{
return SuperframeId == other.SuperframeId && UplinkPolarization == other.UplinkPolarization && SuperframeCentreFrequency == other.SuperframeCentreFrequency;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((Superframe)obj);
}
public override int GetHashCode()
{
return HashCode.Combine(SuperframeId, (int)UplinkPolarization, SuperframeCentreFrequency);
}
} }
} }
} }

View File

@ -34,6 +34,27 @@ namespace skyscraper5.src.InteractionChannel.Model
public uint X { get; internal set; } public uint X { get; internal set; }
public uint Y { get; internal set; } public uint Y { get; internal set; }
public uint Z { get; internal set; } public uint Z { get; internal set; }
protected bool Equals(Satellite other)
{
return Id == other.Id;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((Satellite)obj);
}
public override int GetHashCode()
{
return Id.GetHashCode();
}
} }
} }
} }

View File

@ -39,16 +39,26 @@ namespace skyscraper5
class Program class Program
{ {
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name); private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
private const int PUBLIC_RELEASE = 5; private const int PUBLIC_RELEASE = 7;
private static void IntegrationTest() private static void IntegrationTest()
{ {
/*List<SsdpDevice> ssdpDevices = SsdpClient.GetSsdpDevices(1000).ToList(); PluginManager pluginManager = PluginManager.GetInstance();
foreach (SsdpDevice ssdpDevice in ssdpDevices) StorageConnectionManager storageConnectionManager = StorageConnectionManager.GetInstance();
{ DataStorageFactory dataStorageFactory = storageConnectionManager.GetDefaultDataStorageFactory();
Console.WriteLine("SSDP device: {0}", ssdpDevice.Server); ObjectStorageFactory objectStorageFactory = storageConnectionManager.GetDefaultObjectStorageFactory();
}*/ M3U8Stream m3U8Stream = new M3U8Stream("D:\\NIP-Research\\nip.m3u8");
//"urn:ses-com:device:SatIPServer:1" SkyscraperContext context = new SkyscraperContext(new TsContext(), dataStorageFactory.CreateDataStorage(), objectStorageFactory.CreateObjectStorage());
context.InitalizeFilterChain();
context.IngestFromStream(m3U8Stream);
/*List<SsdpDevice> ssdpDevices = SsdpClient.GetSsdpDevices(1000).ToList();
foreach (SsdpDevice ssdpDevice in ssdpDevices)
{
Console.WriteLine("SSDP device: {0}", ssdpDevice.Server);
}*/
//"urn:ses-com:device:SatIPServer:1"
/*PluginManager pluginManager = PluginManager.GetInstance(); /*PluginManager pluginManager = PluginManager.GetInstance();
StorageConnectionManager storageConnectionManager = StorageConnectionManager.GetInstance(); StorageConnectionManager storageConnectionManager = StorageConnectionManager.GetInstance();
ObjectStorageFactory objectStorageFactory = storageConnectionManager.GetDefaultObjectStorageFactory(); ObjectStorageFactory objectStorageFactory = storageConnectionManager.GetDefaultObjectStorageFactory();
@ -285,6 +295,7 @@ namespace skyscraper5
Console.WriteLine("for example: .\\skyscraper8.exe cscan tcp://127.0.0.1:6969"); Console.WriteLine("for example: .\\skyscraper8.exe cscan tcp://127.0.0.1:6969");
Console.WriteLine(" or: .\\skyscraper8.exe \"C:\\path\\to\\file.ts\\"); Console.WriteLine(" or: .\\skyscraper8.exe \"C:\\path\\to\\file.ts\\");
Console.WriteLine(" or: .\\skyscraper8.exe \"C:\\path\\to\\my\\folder\\with\\ts\\files\\\" (for batch extraction)"); Console.WriteLine(" or: .\\skyscraper8.exe \"C:\\path\\to\\my\\folder\\with\\ts\\files\\\" (for batch extraction)");
Console.WriteLine(" or: .\\skyscraper8.exe satip IP_ADDRESS DISEQC POLARITY FREQUENCY SYSTEM SYMBOL_RATE (see README file)");
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("Bonus feature:"); Console.WriteLine("Bonus feature:");
Console.WriteLine(".\\skyscraper8.exe hlsproxy \"C:\\path\\to\\hls\\files\\\" - to pipe a HLS stream from a local directory into VLC."); Console.WriteLine(".\\skyscraper8.exe hlsproxy \"C:\\path\\to\\hls\\files\\\" - to pipe a HLS stream from a local directory into VLC.");

View File

@ -2,7 +2,7 @@
"profiles": { "profiles": {
"skyscraper8": { "skyscraper8": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "satip autodetect 1 V 12363 S 27500", "commandLineArgs": "cscan tcp://172.20.20.203:6969",
"remoteDebugEnabled": false "remoteDebugEnabled": false
}, },
"Container (Dockerfile)": { "Container (Dockerfile)": {

View File

@ -118,6 +118,7 @@ namespace skyscraper8
context.InitalizeFilterChain(); context.InitalizeFilterChain();
RtspPlayResponse play = rtspClient.GetPlay(setup); RtspPlayResponse play = rtspClient.GetPlay(setup);
DateTime lastTimestamp = DateTime.Now;
while (true) while (true)
{ {
@ -137,25 +138,40 @@ namespace skyscraper8
if (context.IsAbortConditionMet()) if (context.IsAbortConditionMet())
break; break;
if (DateTime.Now.Second != lastTimestamp.Second)
{
Keepalive(url);
lastTimestamp = DateTime.Now;
}
} }
rtspClient.GetTeardown(setup); rtspClient.GetTeardown(setup);
rtspClient.Dispose(); rtspClient.Dispose();
} }
private uint stuffingBytes;
private Queue<byte[]> packetQueue; private Queue<byte[]> packetQueue;
private ObjectStorage objectStorage; private ObjectStorage objectStorage;
private DataStorage dataStorage; private DataStorage dataStorage;
private SkyscraperContext context; private SkyscraperContext context;
private void Setup_OnRtpPacket(byte[] data, int length) private void Setup_OnRtpPacket(byte[] data, int length)
{ {
for (int i = 12; i < length; i += 188) for (int i = 12; i < length; i += 1)
{ {
byte[] buffer = new byte[188]; if (data[i] == 'G')
Array.Copy(data, i, buffer, 0, 188);
lock (packetQueue)
{ {
packetQueue.Enqueue(buffer); byte[] buffer = new byte[188];
Array.Copy(data, i, buffer, 0, 188);
lock (packetQueue)
{
packetQueue.Enqueue(buffer);
}
i += 187;
}
else if (data[i] == 0xff)
{
stuffingBytes++;
} }
} }
} }

View File

@ -255,24 +255,29 @@ namespace skyscraper8.SatIp
public static string MakeUrl(DiSEqC_Opcode diseqcChannel, int freq, bool isS2, int symbolrate) public static string MakeUrl(DiSEqC_Opcode diseqcChannel, int freq, bool isS2, int symbolrate)
{ {
byte diseqc; bool diseqcOk = false;
byte diseqc = 1;
if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_A) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_A)) if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_A) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_A))
{ {
diseqc = 1; diseqc = 1;
diseqcOk = true;
} }
else if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_A) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_B)) if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_A) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_B))
{ {
diseqc = 2; diseqc = 2;
diseqcOk = true;
} }
else if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_B) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_A)) if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_B) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_A))
{ {
diseqc = 3; diseqc = 3;
diseqcOk = true;
} }
else if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_B) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_B)) if (diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_OPTION_B) && diseqcChannel.HasFlag(DiSEqC_Opcode.DISEQC_POSITION_B))
{ {
diseqc = 4; diseqc = 4;
diseqcOk = true;
} }
else if (!diseqcOk)
{ {
throw new ArgumentOutOfRangeException(nameof(diseqcChannel)); throw new ArgumentOutOfRangeException(nameof(diseqcChannel));
} }

View File

@ -0,0 +1,22 @@
How to use skyscraper8 with a SAT>IP server:
The general commandline is as follows:
.\skyscraper8.exe satip IP_ADDRESS DISEQC POLARITY FREQUENCY SYSTEM SYMBOL_RATE
IP_ADDRESS is either the IP address (for example 172.20.20.122) of your SAT>IP server, or "auto" for autodetection of a SAT>IP server.
DISEQC is the DiSEqC 1.0 Port you want to use. Say "1" here for A/A, "2" for B/A, "3" for A/B, 4 for B/B
POLARITY is either "H" or "V"
FREQUENCY is the frequency you want to tune to in MHz. (for example 12226)
SYSTEM is either "S" or "S2"
SYMBOL_RATE is the symbol rate of the transponder you want to tune to in Ks. (for example 27500)
So a valid command would be for example ".\skyscraper8.exe satip 172.20.20.122 2 V 12226 S2 27500" to tune to the Hotbird DVB-NIP demo transponder, assuming Hotbird is at DiSEqC B/A.
If you don't know your SAT>IP server address, the following command would accomplish the same: ".\skyscraper8.exe satip auto 2 V 12226 S2 27500"
If your SAT>IP server features a StiD135 chipset, you can also catch GS/GSE with it.

View File

@ -3,11 +3,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using skyscraper8.SimpleServiceDiscoveryProtocol;
namespace skyscraper8.SatIp namespace skyscraper8.SimpleServiceDiscoveryProtocol
{ {
public interface IRtspCache public interface ISsdpCache
{ {
bool SsdpDeviceKnown(SsdpDevice ssdpDevice); bool SsdpDeviceKnown(SsdpDevice ssdpDevice);
void SsdpStoreMetadata(SsdpDevice ssdpDevice, byte[] ssdpMetadataByteArray); void SsdpStoreMetadata(SsdpDevice ssdpDevice, byte[] ssdpMetadataByteArray);

View File

@ -8,7 +8,6 @@ using System.Net.Sockets;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml.Serialization; using System.Xml.Serialization;
using skyscraper8.SatIp;
using skyscraper8.Ssdp.Schema; using skyscraper8.Ssdp.Schema;
namespace skyscraper8.SimpleServiceDiscoveryProtocol namespace skyscraper8.SimpleServiceDiscoveryProtocol
@ -125,7 +124,7 @@ namespace skyscraper8.SimpleServiceDiscoveryProtocol
return Int32.MinValue; return Int32.MinValue;
} }
public static List<SsdpDevice> GetSsdpDevices(int timeout = 1000, string searchTarget = null, IRtspCache cache = null) public static List<SsdpDevice> GetSsdpDevices(int timeout = 1000, string searchTarget = null, ISsdpCache cache = null)
{ {
List<SsdpDevice> inputList = GetSsdpDevices(timeout).ToList(); List<SsdpDevice> inputList = GetSsdpDevices(timeout).ToList();
List<SsdpDevice> outputList = new List<SsdpDevice>(); List<SsdpDevice> outputList = new List<SsdpDevice>();
@ -168,7 +167,7 @@ namespace skyscraper8.SimpleServiceDiscoveryProtocol
return outputList; return outputList;
} }
public static SsdpDevice GetFirstSatIpServer(int timeout = 1000, IRtspCache cache = null) public static SsdpDevice GetFirstSatIpServer(int timeout = 1000, ISsdpCache cache = null)
{ {
List<SsdpDevice> ssdpDevices = GetSsdpDevices(1000, "urn:ses-com:device:SatIPServer:1", cache); List<SsdpDevice> ssdpDevices = GetSsdpDevices(1000, "urn:ses-com:device:SatIPServer:1", cache);
if (ssdpDevices.Count == 0) if (ssdpDevices.Count == 0)

View File

@ -29,6 +29,7 @@ namespace skyscraper8.Skyscraper.FrequencyListGenerator
case STD_TYPE.STD_DVBC2: return false; case STD_TYPE.STD_DVBC2: return false;
case STD_TYPE.STD_DVBT: return false; case STD_TYPE.STD_DVBT: return false;
case STD_TYPE.STD_DVBT2: return false; case STD_TYPE.STD_DVBT2: return false;
case STD_TYPE.STD_AUTO: return true;
default: throw new NotImplementedException(Standard.ToString()); default: throw new NotImplementedException(Standard.ToString());
} }
} }

View File

@ -0,0 +1,508 @@
using log4net;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.IO.CrazycatStreamReader;
using skyscraper8.SatIp;
using skyscraper8.SatIp.RtspResponses;
using skyscraper8.SimpleServiceDiscoveryProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace skyscraper8.Skyscraper.FrequencyListGenerator
{
public class SatIpWithStreamReaderProxy : IStreamReader
{
public SatIpWithStreamReaderProxy(IStreamReader streamReader, ISsdpCache cache = null)
{
this.ProxiedStreamReader = streamReader;
this.SsdpDescriptorCache = cache;
streamReader.StopDVB();
}
private int satIpLof1;
private bool satIpS2Mode;
private int satipFrequency;
private int satipSymbolrate;
private DiSEqC_Opcode satIpDiseqc;
private IPAddress satIpServerAddress;
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
public ISsdpCache SsdpDescriptorCache { get; private set; }
public IStreamReader ProxiedStreamReader { get; private set; }
public void Dispose()
{
throw new NotImplementedException();
}
public bool CheckForDVB()
{
throw new NotImplementedException();
}
public bool CheckForDVBEx(DvbEnumCallback func)
{
throw new NotImplementedException();
}
public bool CheckForDVBExEx(DvbEnumCallbackEx func)
{
throw new NotImplementedException();
}
public bool StartDVB()
{
throw new NotImplementedException();
}
public bool StartDvbEx(int index)
{
if (satIpServerAddress == null)
{
logger.Info("Looking for SAT>IP Server...");
SsdpDevice satIpServer = SsdpClient.GetFirstSatIpServer(1000, SsdpDescriptorCache);
if (satIpServer == null)
{
logger.Error("Couldn't find any SAT>IP servers.");
return false;
}
satIpServerAddress = satIpServer.GetIpAddress();
if (satIpServerAddress == null)
{
logger.ErrorFormat("Failed to find the IP Address of {0}", satIpServer.Server);
return false;
}
logger.InfoFormat("Found SAT>IP Server at {0}", satIpServerAddress);
}
return ProxiedStreamReader.StartDvbEx(index);
}
public bool StopDVB()
{
throw new NotImplementedException();
}
public bool GetTunerType(ref STD_TYPE type)
{
throw new NotImplementedException();
}
public bool SendDiSEqC(uint diseqcType, DiSEqC_Opcode data)
{
bool result = ProxiedStreamReader.SendDiSEqC(diseqcType, data);
if (result)
satIpDiseqc = data;
return result;
}
public bool SendDiseqCmd(byte[] buffer, int length)
{
throw new NotImplementedException();
}
public bool SendDiseqCmdEx(nint pCmd, int length, nint reply, int replyLength)
{
throw new NotImplementedException();
}
public bool SetChannel(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw)
{
satipFrequency = freq / 1000;
satipSymbolrate = symbrate / 1000;
satIpLof1 = lof1;
return ProxiedStreamReader.SetChannel(freq, symbrate, pol, fec, lof1, lof2, lofsw);
}
public bool SetChannelEx(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw, MOD_TYPE mod)
{
throw new NotImplementedException();
}
public bool SetChannelExEx(int freq, int symbrate, int pol, VITERBIRATE_TYPE fec, int lof1, int lof2, int lofsw, MOD_TYPE mod,
int inv, int pilot, ROLLOFF_TYPE rolloff)
{
throw new NotImplementedException();
}
private bool rtspStopped;
private bool rtspStopAsked;
private Thread rtspWorkerThread;
private IntPtr rtspDummyHandle;
private StdcallDvbCallback rtspCallback;
private RtspSetupResponse rtspSetup;
private Queue<byte[]> rtspPacketQueue;
private string rtspUrl;
private RtspClient rtspClient;
public bool SetFilter(int pid, StdcallDvbCallback func, int callbackType, int size, ref nint lpFilterNum)
{
rtspClient = new RtspClient(satIpServerAddress, 554);
RtspKeepalive();
rtspUrl = RtspClient.MakeUrl(satIpDiseqc, satipFrequency, satIpS2Mode, satipSymbolrate);
RtspDescribeResponse describe = rtspClient.GetDescribe(rtspUrl);
if (describe.RtspStatusCode != 200)
{
return false;
}
SessionDescriptionProtocol sessionDescriptionProtocol = describe.GetSessionDescriptionProtocol();
rtspPacketQueue = new Queue<byte[]>();
rtspSetup = rtspClient.GetSetup(rtspUrl);
if (rtspSetup.RtspStatusCode != 200)
{
return false;
}
rtspSetup.OnRtcpPacket += RtspSetup_OnRtcpPacket;
rtspSetup.OnRtpPacket += RtspSetup_OnRtpPacket;
rtspCallback = func;
RtspPlayResponse play = rtspClient.GetPlay(rtspSetup);
if (play.RtspStatusCode != 200)
{
return false;
}
rtspDummyHandle = new nint(9001);
lpFilterNum = rtspDummyHandle;
rtspStopAsked = false;
rtspWorkerThread = new Thread(RtspWorkerThreadFunction);
rtspWorkerThread.Name = "RTSP Worker Thread";
rtspWorkerThread.Start();
return true;
}
private void RtspWorkerThreadFunction()
{
IntPtr unsafeBuffer = Marshal.AllocHGlobal(188);
DateTime lastKnownTimestamp = DateTime.Now;
while (!rtspStopAsked)
{
DateTime currentTimestamp = DateTime.Now;
if (currentTimestamp.Second != lastKnownTimestamp.Second)
{
RtspKeepalive(rtspUrl);
lastKnownTimestamp = currentTimestamp;
}
if (rtspPacketQueue.Count > 0)
{
byte[] dequeue = rtspPacketQueue.Dequeue();
if (dequeue == null)
continue;
for (int i = 12; i < dequeue.Length; i += 1)
{
if (dequeue[i] == 'G')
{
Marshal.Copy(dequeue, i, unsafeBuffer, 188);
i += 187;
rtspCallback(unsafeBuffer, 188);
}
else
{
throw new Exception("Help! I lost my sync byte!");
}
}
}
else
{
Thread.Sleep(1);
}
}
RtspTeardownResponse teardown = rtspClient.GetTeardown(rtspSetup);
rtspStopAsked = false;
rtspStopped = true;
Marshal.FreeHGlobal(unsafeBuffer);
}
private void RtspSetup_OnRtpPacket(byte[] data, int length)
{
byte[] queuableBuffer = new byte[length];
Array.Copy(data, 0, queuableBuffer, 0, length);
rtspPacketQueue.Enqueue(queuableBuffer);
}
private long rtcps;
private void RtspSetup_OnRtcpPacket(byte[] data, int length)
{
rtcps++;
}
private void RtspKeepalive(string url = "/")
{
RtspOptionsResponse options = rtspClient.GetOptions("/");
if (options.RtspStatusCode != 200)
{
throw new RtspException(String.Format("Unexpected RTSP Status code. Wanted {0}, got {1}", 200, options.RtspStatusCode));
}
}
public bool SetFilterEx(int pid, StdcallDvbCallbackEx lpFunc, int callbackType, int size, ref nint lpFilterNum)
{
throw new NotImplementedException();
}
public bool SetBitFilter(int pid, nint filterData, nint filterMask, byte filterLength, StdcallDvbCallback lpFunc,
ref nint lpFilterNum)
{
throw new NotImplementedException();
}
public bool SetRemoteControl(int irtype, short devAddr, StdcallDvbCallback func, ref nint lpFilterNum)
{
throw new NotImplementedException();
}
public bool DelFilter(nint filterNum)
{
rtspStopAsked = true;
while (!rtspStopped)
Thread.Sleep(10);
rtspStopped = false;
rtspStopAsked = false;
rtspWorkerThread = null;
rtspDummyHandle = IntPtr.Zero;
rtspCallback = null;
rtspSetup = null;
rtspPacketQueue = null;
rtspUrl = null;
rtspClient = null;
return true;
}
public bool GetSignal(ref int pStrength, ref int pQuality)
{
throw new NotImplementedException();
}
public bool GetSignalStrength(ref float pStrength, ref float pQuality)
{
throw new NotImplementedException();
}
public bool GetSignalEx(ref float pSNR, ref float pBER)
{
throw new NotImplementedException();
}
public bool GetSignalExEx(ref bool pPresent, ref bool pLock, ref int pRFLevel, ref float pSNR, ref float pBER)
{
throw new NotImplementedException();
}
public bool Statistic(int[] pStat)
{
throw new NotImplementedException();
}
public bool GetMAC(byte[] pMac)
{
throw new NotImplementedException();
}
public Caps GetCaps()
{
throw new NotImplementedException();
}
public bool RFScan(int freq, int pol, int lof1, int lof2, int lofsw, out double pRFLevel)
{
throw new NotImplementedException();
}
public bool FFTInit()
{
throw new NotImplementedException();
}
public bool FFTScan(int freq, int pol, int lof1, int lof2, int lofsw, uint range, byte mode, byte nb_acc, nint pTab,
nint pBegin, nint pNum)
{
throw new NotImplementedException();
}
public bool BLScan(int freq, int freq_range, int pol, int lof1, int lof2, int lofsw, int minsr,
ref SearchResult pSearchResult)
{
throw new NotImplementedException();
}
public bool BLScanEx(int freq, int freq_range, int pol, int lof1, int lof2, int lofsw, int minsr, STD_TYPE std,
ref SearchResult pSearchResult)
{
bool result = ProxiedStreamReader.BLScanEx(freq, freq_range, pol, lof1, lof2, lofsw, minsr, std, ref pSearchResult);
if (result)
{
satipFrequency = pSearchResult.Freq / 1000;
satipSymbolrate = pSearchResult.SR / 1000;
switch (pSearchResult.StdType)
{
case 0:
//For some reason, StreamReader says this when there's no lock?
satIpS2Mode = false;
break;
case 1:
satIpS2Mode = false;
break;
case 2:
satIpS2Mode = true;
break;
default:
throw new NotImplementedException(String.Format("{0} {1}", nameof(pSearchResult.StdType), pSearchResult.StdType));
}
}
return result;
}
public bool BLScan2(int freq_start, int freq_stop, int pol, int lof1, int lof2, int lofsw, nint pSearchResult, ref int pTpNum,
BlScanCallback lpFunc)
{
return ProxiedStreamReader.BLScan2(freq_start, freq_stop, pol, lof1, lof2, lofsw, pSearchResult, ref pTpNum, lpFunc);
}
public bool SignalInfo(ref SearchResult pSearchResult)
{
bool result = ProxiedStreamReader.SignalInfo(ref pSearchResult);
if (result)
{
switch (pSearchResult.StdType)
{
case 0:
//For some reason, StreamReader says this when there's no lock?
satIpS2Mode = false;
break;
case 1:
satIpS2Mode = false;
break;
case 2:
satIpS2Mode = true;
break;
default:
throw new NotImplementedException(String.Format("{0} {1}", nameof(pSearchResult.StdType), pSearchResult.StdType));
}
}
return result;
}
public bool IQScan(uint input, sbyte[] pIQ, uint num)
{
throw new NotImplementedException();
}
public bool IQScan2(uint point, short[] pIQ, uint num)
{
throw new NotImplementedException();
}
public bool IQScan2Range(byte input, ref ushort pMinPoint, ref ushort pMaxPoint)
{
throw new NotImplementedException();
}
public bool CIRScanRange(bool bHiRes, ref ushort pMinCnum, ref ushort pMaxCnum, ref int pMinDelayNs, ref int pMaxDelayNs)
{
throw new NotImplementedException();
}
public bool CIRScan(bool bHiRes, int[] pPowers, int[] pDelays)
{
throw new NotImplementedException();
}
public bool CarRange(ref ushort pMinCnum, ref ushort pMaxCnum)
{
throw new NotImplementedException();
}
public bool CarEsNo(ref ushort cnum, ref double pEsNo)
{
throw new NotImplementedException();
}
public bool MISSel(bool bEnable, byte misFilter, byte misFilterMask)
{
throw new NotImplementedException();
}
public bool PLSSel(byte plsMode, uint code)
{
throw new NotImplementedException();
}
public bool PLSGet(byte pMode, ref uint pCode)
{
throw new NotImplementedException();
}
public bool ModSel(ref S2Mode ps2Modes, uint num)
{
throw new NotImplementedException();
}
public bool ModInv(uint WaitMs, ref S2Mode pS2Modes, ref uint pNum)
{
throw new NotImplementedException();
}
public bool SetChannel2(uint freq, uint bandwidth)
{
throw new NotImplementedException();
}
public bool SetChannel2Ex(uint freq, uint bandwidth, STD_TYPE std, int stream)
{
throw new NotImplementedException();
}
public bool SetChannel2ExEx(uint freq, uint bandwidth, uint symbrate, STD_TYPE std, int stream)
{
throw new NotImplementedException();
}
public bool SignalInfo2(ref SearchResult2 si2)
{
throw new NotImplementedException();
}
public bool RFScan2(uint freq, STD_TYPE std, ref double pRFLevel)
{
throw new NotImplementedException();
}
public bool AirScan(int freq_start, int freq_stop, uint step, uint bandwidth, int std, nint pSearchResult, ref int pTpNum,
AirScanCallback lpFunc)
{
throw new NotImplementedException();
}
public bool GetEEPROM(byte[] buffer, int offset, int len)
{
throw new NotImplementedException();
}
public bool SetEEPROM(byte[] buffer, int offset, int len)
{
throw new NotImplementedException();
}
public Version GetEngineVersion()
{
throw new NotImplementedException();
}
public string GetEngineName()
{
throw new NotImplementedException();
}
}
}

View File

@ -77,6 +77,45 @@ namespace skyscraper5.Skyscraper.Plugins
{ {
Debug.WriteLine(String.Format("{0} was not found. Create it using the UI!", iniFileInfo.FullName)); Debug.WriteLine(String.Format("{0} was not found. Create it using the UI!", iniFileInfo.FullName));
} }
FileInfo fi = GetSkyscraperMainAssembly();
if (fi != null)
{
DirectoryInfo directory = fi.Directory;
logger.DebugFormat("Found skyscraper main assembly at: {0}", directory.FullName);
FileInfo[] fileInfos = directory.GetFiles("skyscraper5.*.dll");
foreach (FileInfo fileInfo in fileInfos)
{
try
{
logger.Info(String.Format("Trying to load: {0}", fileInfo.Name));
Assembly loadFile = Assembly.LoadFile(fileInfo.FullName);
ScanAssembly(loadFile);
logger.Debug(String.Format("Loaded {0}", fileInfo.Name));
}
catch (Exception e)
{
logger.ErrorFormat("Failed to scan assembly {0}", fileInfo.Name);
}
}
}
}
private FileInfo GetSkyscraperMainAssembly()
{
try
{
Type type = typeof(PluginManager);
Assembly assembly = type.Assembly;
string location = assembly.Location;
FileInfo fileInfo = new FileInfo(location);
return fileInfo;
}
catch (Exception e)
{
logger.Warn(String.Format("Failed to resolve skyscraper main assembly."), e);
return null;
}
} }
private HashSet<DirectoryInfo> resolveDirectoryInfos; private HashSet<DirectoryInfo> resolveDirectoryInfos;

View File

@ -0,0 +1,74 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using log4net;
namespace skyscraper8.Skyscraper.Scraper
{
internal class PmtTracker
{
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
class PmtInfo
{
public bool IsProcessed { get; set; }
}
private Dictionary<int, PmtInfo> knownPmts;
public bool AllPmtsProcessed
{
get
{
foreach (KeyValuePair<int, PmtInfo> kvp in knownPmts)
{
if (!kvp.Value.IsProcessed)
return false;
}
return true;
}
}
public void AddPmtPid(int pmtPid)
{
if (knownPmts == null)
knownPmts = new Dictionary<int, PmtInfo>();
if (!knownPmts.ContainsKey(pmtPid))
knownPmts.Add(pmtPid, new PmtInfo());
}
private bool allProccessedAnnounced;
public void MarkAsProcessed(int pmtPid)
{
if (!knownPmts.ContainsKey(pmtPid))
return;
knownPmts[pmtPid].IsProcessed = true;
if (!allProccessedAnnounced && AllPmtsProcessed)
{
logger.DebugFormat("All {0} PMTs have now been checked.", knownPmts.Count);
allProccessedAnnounced = true;
}
}
private bool autodetectionFired;
public bool ShouldFireAutodetection()
{
if (autodetectionFired)
return false;
if (AllPmtsProcessed)
{
autodetectionFired = true;
return true;
}
return false;
}
}
}

View File

@ -78,6 +78,7 @@ using System.Security.Policy;
using System.Text; using System.Text;
using skyscraper8.Experimentals.NdsSsu; using skyscraper8.Experimentals.NdsSsu;
using skyscraper8.Experimentals.OtvSsu; using skyscraper8.Experimentals.OtvSsu;
using skyscraper8.Skyscraper.Scraper;
using Tsubasa.IO; using Tsubasa.IO;
using Platform = skyscraper5.Dvb.SystemSoftwareUpdate.Model.Platform; using Platform = skyscraper5.Dvb.SystemSoftwareUpdate.Model.Platform;
using RntParser = skyscraper5.Dvb.TvAnytime.RntParser; using RntParser = skyscraper5.Dvb.TvAnytime.RntParser;
@ -417,6 +418,8 @@ namespace skyscraper5.Skyscraper.Scraper
LogEvent(SkyscraperContextEvent.NetworkPidFromPat); LogEvent(SkyscraperContextEvent.NetworkPidFromPat);
} }
private PmtTracker pmtTracker;
public void ProgramMapPidFromPat(int pmtPid, ushort programId) public void ProgramMapPidFromPat(int pmtPid, ushort programId)
{ {
SpecialTsType = 1; SpecialTsType = 1;
@ -437,6 +440,10 @@ namespace skyscraper5.Skyscraper.Scraper
DvbContext.RegisterPacketProcessor(pmtPid, pmtParser); DvbContext.RegisterPacketProcessor(pmtPid, pmtParser);
LogEvent(SkyscraperContextEvent.ProgramMapPidFromPat); LogEvent(SkyscraperContextEvent.ProgramMapPidFromPat);
UiJunction?.NotifyPatProgram(pmtPid, programId); UiJunction?.NotifyPatProgram(pmtPid, programId);
if (pmtTracker == null)
pmtTracker = new PmtTracker();
pmtTracker.AddPmtPid(pmtPid);
} }
public void SetTransportStreamId(ushort transportStreamId) public void SetTransportStreamId(ushort transportStreamId)
@ -453,7 +460,7 @@ namespace skyscraper5.Skyscraper.Scraper
public void PmtEvent(ProgramMapping result, int pmtPid) public void PmtEvent(ProgramMapping result, int pmtPid)
{ {
bool logworthy = false; bool logworthy = false;
if (CurrentNetworkId.HasValue && CurrentTransportStreamId.HasValue) if (CurrentNetworkId.HasValue && CurrentTransportStreamId.HasValue)
{ {
@ -665,6 +672,12 @@ namespace skyscraper5.Skyscraper.Scraper
LogEvent(SkyscraperContextEvent.PmtEvent, String.Format("#{0}", result.ProgramNumber)); LogEvent(SkyscraperContextEvent.PmtEvent, String.Format("#{0}", result.ProgramNumber));
UiJunction?.NotifyPmtProgram(result, pmtPid); UiJunction?.NotifyPmtProgram(result, pmtPid);
pmtTracker?.MarkAsProcessed(pmtPid);
if (pmtTracker.ShouldFireAutodetection())
{
CheckForHiddenMpes();
}
} }
public void MakeUpComponentTags(ProgramMapping target) public void MakeUpComponentTags(ProgramMapping target)
@ -2264,7 +2277,7 @@ namespace skyscraper5.Skyscraper.Scraper
{ {
if (!DataStorage.TestForCmtEntry(interactiveNetworkId,entry)) if (!DataStorage.TestForCmtEntry(interactiveNetworkId,entry))
{ {
LogEvent(SkyscraperContextEvent.CorrectionMessage, String.Format("Network ID = {0}, Group ID = {1}, Logon ID = {2}", interactiveNetworkId, entry.GroupId, entry.LoginId)); LogEvent(SkyscraperContextEvent.CorrectionMessage, String.Format("Network ID = {0}, Group ID = {1}, Logon ID = {2}, Slot Type = {3}", interactiveNetworkId, entry.GroupId, entry.LoginId,entry.SlotType.ToString()));
DataStorage.InsertCmtEntry(interactiveNetworkId, entry); DataStorage.InsertCmtEntry(interactiveNetworkId, entry);
} }
} }
@ -2305,7 +2318,7 @@ namespace skyscraper5.Skyscraper.Scraper
{ {
if (!DataStorage.TestForRmtLinkage(linkage)) if (!DataStorage.TestForRmtLinkage(linkage))
{ {
LogEvent(SkyscraperContextEvent.RmtLinkage, String.Format("{0} -> {1},{2}", linkage.InteractiveNetworkId, linkage.OriginalNetworkId, linkage.TransportStreamId)); LogEvent(SkyscraperContextEvent.RmtLinkage, String.Format("Interactive Network #{0} -> ONID {1}, TSID {2}", linkage.InteractiveNetworkId, linkage.OriginalNetworkId, linkage.TransportStreamId));
DataStorage.InsertRmtLinkage(linkage); DataStorage.InsertRmtLinkage(linkage);
} }
} }
@ -2319,17 +2332,44 @@ namespace skyscraper5.Skyscraper.Scraper
LogEvent(SkyscraperContextEvent.RmtTransportStream, String.Format("{0} -> {1},{2}", rmt.NetworkId, transportStream.OriginalNetworkId, transportStream.TransportStreamId)); LogEvent(SkyscraperContextEvent.RmtTransportStream, String.Format("{0} -> {1},{2}", rmt.NetworkId, transportStream.OriginalNetworkId, transportStream.TransportStreamId));
DataStorage.InsertRmtTransportStream(rmt.NetworkId, transportStream); DataStorage.InsertRmtTransportStream(rmt.NetworkId, transportStream);
} }
} }
} }
} }
private void CheckForHiddenMpes()
{
uint threshold = 1000;
if (pmtTracker != null)
{
if (!pmtTracker.AllPmtsProcessed)
{
return;
}
threshold = 1;
}
int[] occupiedPids = DvbContext.GetOccupiedPids();
ulong[] pidStatistics = DvbContext.GetPidStatistics();
for (int i = 0; i < (pidStatistics.Length - 1); i++)
{
if (pidStatistics[i] > threshold)
{
if (!occupiedPids.Contains(i))
{
LogEvent(SkyscraperContextEvent.SpecialTsMode, String.Format("Attaching stream-type autodetector to PID 0x{0:X4}", i));
DvbContext.RegisterPacketProcessor(i, new StreamTypeAutodetection(i, this));
}
}
}
}
public void OnSatellitePosition(ushort interactiveNetworkId, Spt spt) public void OnSatellitePosition(ushort interactiveNetworkId, Spt spt)
{ {
foreach (Spt.Satellite satellite in spt.Satellites) foreach (Spt.Satellite satellite in spt.Satellites)
{ {
if (!DataStorage.TestForSatellitePosition(interactiveNetworkId,satellite)) if (!DataStorage.TestForSatellitePosition(interactiveNetworkId,satellite))
{ {
LogEvent(SkyscraperContextEvent.SatellitePosition, String.Format("NID = {0}, Satellite ID = {1}", interactiveNetworkId, satellite.Id)); LogEvent(SkyscraperContextEvent.SatellitePosition, String.Format("NID = {0}, Satellite ID = {1} (X = {2}, Y = {3}, Z = {4})", interactiveNetworkId, satellite.Id, satellite.X, satellite.Y, satellite.Z));
DataStorage.StoreSatellitePosition(interactiveNetworkId, satellite); DataStorage.StoreSatellitePosition(interactiveNetworkId, satellite);
} }
} }
@ -2341,7 +2381,7 @@ namespace skyscraper5.Skyscraper.Scraper
{ {
if (!DataStorage.TestForSuperframeComposition(interactiveNetworkId,superframe)) if (!DataStorage.TestForSuperframeComposition(interactiveNetworkId,superframe))
{ {
LogEvent(SkyscraperContextEvent.SuperframeComposition, String.Format("Network ID = {0}, Superframe ID = {1}", interactiveNetworkId, superframe.SuperframeId)); LogEvent(SkyscraperContextEvent.SuperframeComposition, String.Format("Network ID = {0}, Superframe ID = {1}, Frequency = {2}/{3}", interactiveNetworkId, superframe.SuperframeId, superframe.SuperframeCentreFrequency,superframe.UplinkPolarization));
DataStorage.StoreSuperframeComposition(interactiveNetworkId, superframe); DataStorage.StoreSuperframeComposition(interactiveNetworkId, superframe);
} }
} }

View File

@ -191,7 +191,7 @@ namespace skyscraper8.Skyscraper.Scraper.Storage
void Ping(); void Ping();
IEnumerable<Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>> GetBlindscanResultFrequencies(Guid selectedGuid); IEnumerable<Tuple<int, SatelliteDeliverySystemDescriptor.PolarizationEnum>> GetBlindscanResultFrequencies(Guid selectedGuid);
void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection, bool settingsWindowUseDifferentTunerForSetFilter, int settingsWindowSetFilterTunerSelection, int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum, bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish, bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow, bool settingsWindowScanVerticalHigh); void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection, int settingsWindowUseDifferentTunerForSetFilter, int settingsWindowSetFilterTunerSelection, int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum, bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish, bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow, bool settingsWindowScanVerticalHigh);
object[] GetLastUiBlindscanSettings(); object[] GetLastUiBlindscanSettings();
} }
} }

View File

@ -1124,7 +1124,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
} }
public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection, public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection,
bool settingsWindowUseDifferentTunerForSetFilter, int settingsWindowSetFilterTunerSelection, int multitunerMode, int settingsWindowSetFilterTunerSelection,
int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum, int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum,
bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish, bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish,
bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow, bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow,
@ -1133,7 +1133,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.Filesystem
object[] data = new object[] object[] data = new object[]
{ {
DateTime.Now, DateTime.Now,
settingsWindowBlScanTunerSelection, settingsWindowUseDifferentTunerForSetFilter, settingsWindowBlScanTunerSelection, multitunerMode,
settingsWindowSetFilterTunerSelection, settingsWindowDiseqc, settingsWindowCollectIqGraphs, settingsWindowSetFilterTunerSelection, settingsWindowDiseqc, settingsWindowCollectIqGraphs,
settingsWindowCollectRfSpectrum, settingsWindowCaptureFile, settingsWindowSatellite, settingsWindowLnb, settingsWindowCollectRfSpectrum, settingsWindowCaptureFile, settingsWindowSatellite, settingsWindowLnb,
dish, settingsWindowScanHorizontalLow, settingsWindowScanHorizontalHigh, dish, settingsWindowScanHorizontalLow, settingsWindowScanHorizontalHigh,

View File

@ -952,7 +952,7 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
} }
public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection, public void InsertUiBlindscanSettingHistory(int settingsWindowBlScanTunerSelection,
bool settingsWindowUseDifferentTunerForSetFilter, int settingsWindowSetFilterTunerSelection, int multitunerMode, int settingsWindowSetFilterTunerSelection,
int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum, int settingsWindowDiseqc, bool settingsWindowCollectIqGraphs, bool settingsWindowCollectRfSpectrum,
bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish, bool settingsWindowCaptureFile, int settingsWindowSatellite, int settingsWindowLnb, int dish,
bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow, bool settingsWindowScanHorizontalLow, bool settingsWindowScanHorizontalHigh, bool settingsWindowScanVerticalLow,
@ -1161,9 +1161,15 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
throw new NotImplementedException(); throw new NotImplementedException();
} }
private Dictionary<Tuple<ushort, uint, uint>, Tbtp.TbtpFrame.BtpEntity> _tbtpEntities;
public bool TestForTerminalBurstTimePlan(ushort interactiveNetworkId, uint groupId, uint logonId) public bool TestForTerminalBurstTimePlan(ushort interactiveNetworkId, uint groupId, uint logonId)
{ {
throw new NotImplementedException(); if (_tbtpEntities == null)
return false;
Tuple<ushort, uint, uint> tuple = new Tuple<ushort, uint, uint>(interactiveNetworkId, groupId, logonId);
return _tbtpEntities.ContainsKey(tuple);
} }
public void StoreTerminalBurstTimePlan(ushort interactiveNetworkId, uint gtoupId, uint superframeCount, public void StoreTerminalBurstTimePlan(ushort interactiveNetworkId, uint gtoupId, uint superframeCount,
@ -1172,19 +1178,43 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
throw new NotImplementedException(); throw new NotImplementedException();
} }
private HashSet<Cmt.CmtEntry>[] cmtEntries;
public bool TestForCmtEntry(ushort interactiveNetworkId, Cmt.CmtEntry entry) public bool TestForCmtEntry(ushort interactiveNetworkId, Cmt.CmtEntry entry)
{ {
throw new NotImplementedException(); if (cmtEntries == null)
return false;
if (cmtEntries[interactiveNetworkId] == null)
return false;
return cmtEntries[interactiveNetworkId].Contains(entry);
} }
public void InsertCmtEntry(ushort interactiveNetworkId, Cmt.CmtEntry entry) public void InsertCmtEntry(ushort interactiveNetworkId, Cmt.CmtEntry entry)
{ {
throw new NotImplementedException(); if (cmtEntries == null)
cmtEntries = new HashSet<Cmt.CmtEntry>[ushort.MaxValue];
if (cmtEntries[interactiveNetworkId] == null)
cmtEntries[interactiveNetworkId] = new HashSet<Cmt.CmtEntry>();
cmtEntries[interactiveNetworkId].Add(entry);
} }
private bool rmtWasSeen;
public int GetRmtTransmissionStandard(ushort networkId) public int GetRmtTransmissionStandard(ushort networkId)
{ {
throw new NotImplementedException(); if (!rmtWasSeen)
return 0;
if (_rmtTransportStreams[networkId] == null)
return 0;
HashSet<Rmt.TransportStream> rmtSet = _rmtTransportStreams[networkId];
foreach (Rmt.TransportStream transportStream in rmtSet)
{
if (transportStream.SatelliteForwardLink != null)
return (int)transportStream.SatelliteForwardLink.TransmissionStandard;
}
return 0;
} }
public byte[] GetTmst(ushort interactiveNetworkId) public byte[] GetTmst(ushort interactiveNetworkId)
@ -1202,64 +1232,135 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
throw new NotImplementedException(); throw new NotImplementedException();
} }
private HashSet<_0x4a_LinkageDescriptor> _rmtLinkages;
public bool TestForRmtLinkage(_0x4a_LinkageDescriptor linkage) public bool TestForRmtLinkage(_0x4a_LinkageDescriptor linkage)
{ {
throw new NotImplementedException(); if (_rmtLinkages == null)
return false;
return _rmtLinkages.Contains(linkage);
} }
public void InsertRmtLinkage(_0x4a_LinkageDescriptor linkage) public void InsertRmtLinkage(_0x4a_LinkageDescriptor linkage)
{ {
throw new NotImplementedException(); if (_rmtLinkages == null)
_rmtLinkages = new HashSet<_0x4a_LinkageDescriptor>();
_rmtLinkages.Add(linkage);
} }
private HashSet<Rmt.TransportStream>[] _rmtTransportStreams;
public bool TestForRmtTransportStream(ushort networkId, Rmt.TransportStream transportStream) public bool TestForRmtTransportStream(ushort networkId, Rmt.TransportStream transportStream)
{ {
throw new NotImplementedException(); if (_rmtTransportStreams == null)
return false;
if (_rmtTransportStreams[networkId] == null)
return false;
return _rmtTransportStreams[networkId].Contains(transportStream);
} }
public void InsertRmtTransportStream(ushort networkId, Rmt.TransportStream transportStream) public void InsertRmtTransportStream(ushort networkId, Rmt.TransportStream transportStream)
{ {
throw new NotImplementedException(); if (_rmtTransportStreams == null)
_rmtTransportStreams = new HashSet<Rmt.TransportStream>[ushort.MaxValue];
if (_rmtTransportStreams[networkId] == null)
_rmtTransportStreams[networkId] = new HashSet<Rmt.TransportStream>();
_rmtTransportStreams[networkId].Add(transportStream);
if (transportStream.SatelliteForwardLink != null)
rmtWasSeen = true;
} }
private HashSet<Sct.Superframe>[] _sctSuperframes;
public bool TestForSuperframeComposition(ushort interactiveNetworkId, Sct.Superframe superframe) public bool TestForSuperframeComposition(ushort interactiveNetworkId, Sct.Superframe superframe)
{ {
throw new NotImplementedException(); if (_sctSuperframes == null)
return false;
if (_sctSuperframes[interactiveNetworkId] == null)
return false;
return _sctSuperframes[interactiveNetworkId].Contains(superframe);
} }
public void StoreSuperframeComposition(ushort interactiveNetworkId, Sct.Superframe superframe) public void StoreSuperframeComposition(ushort interactiveNetworkId, Sct.Superframe superframe)
{ {
throw new NotImplementedException(); if (_sctSuperframes == null)
_sctSuperframes = new HashSet<Sct.Superframe>[ushort.MaxValue];
if (_sctSuperframes[interactiveNetworkId] == null)
_sctSuperframes[interactiveNetworkId] = new HashSet<Sct.Superframe>();
_sctSuperframes[interactiveNetworkId].Add(superframe);
} }
private HashSet<Fct.Frame>[] _fctFrames;
public bool TestForFrameComposition(ushort interactiveNetworkId, Fct.Frame frame) public bool TestForFrameComposition(ushort interactiveNetworkId, Fct.Frame frame)
{ {
throw new NotImplementedException(); if (_fctFrames == null)
return false;
if (_fctFrames[interactiveNetworkId] == null)
return false;
return _fctFrames[interactiveNetworkId].Contains(frame);
} }
public void InsertFctFrame(ushort interactiveNetworkId, Fct.Frame frame) public void InsertFctFrame(ushort interactiveNetworkId, Fct.Frame frame)
{ {
throw new NotImplementedException(); if (_fctFrames == null)
_fctFrames = new HashSet<Fct.Frame>[ushort.MaxValue];
if (_fctFrames[interactiveNetworkId] == null)
_fctFrames[interactiveNetworkId] = new HashSet<Fct.Frame>();
_fctFrames[interactiveNetworkId].Add(frame);
} }
private HashSet<Spt.Satellite>[] _sptSatellites;
public bool TestForSatellitePosition(ushort interactiveNetworkId, Spt.Satellite satellite) public bool TestForSatellitePosition(ushort interactiveNetworkId, Spt.Satellite satellite)
{ {
throw new NotImplementedException(); if (_sptSatellites == null)
return false;
if (_sptSatellites[interactiveNetworkId] == null)
return false;
return _sptSatellites[interactiveNetworkId].Contains(satellite);
} }
public void StoreSatellitePosition(ushort interactiveNetworkId, Spt.Satellite satellite) public void StoreSatellitePosition(ushort interactiveNetworkId, Spt.Satellite satellite)
{ {
throw new NotImplementedException(); if (_sptSatellites == null)
_sptSatellites = new HashSet<Spt.Satellite>[ushort.MaxValue];
if (_sptSatellites[interactiveNetworkId] == null)
_sptSatellites[interactiveNetworkId] = new HashSet<Spt.Satellite>();
_sptSatellites[interactiveNetworkId].Add(satellite);
} }
class TimContainer
{
public _0xab_ContentionControlDescriptor ContentionControl { get; set; }
public _0xac_CorrectionControlDescriptor CorrectionControl { get; set; }
public DateTime NetworkLayerInfoTimestamp { get; set; }
public _0xa0_NetworkLayerInfoDescriptor NetworkLayerInfoDescriptor { get; set; }
}
private Dictionary<PhysicalAddress, TimContainer> _timContainers;
public bool TestForTim(PhysicalAddress mac) public bool TestForTim(PhysicalAddress mac)
{ {
throw new NotImplementedException(); if (_timContainers == null)
return false;
return _timContainers.ContainsKey(mac);
} }
public void CreateTim(PhysicalAddress mac) public void CreateTim(PhysicalAddress mac)
{ {
throw new NotImplementedException(); if (_timContainers == null)
_timContainers = new Dictionary<PhysicalAddress, TimContainer>();
_timContainers.Add(mac, new TimContainer());
} }
public bool CorrectTim(PhysicalAddress mac, _0xa1_CorrectionMessageDescriptor cmd) public bool CorrectTim(PhysicalAddress mac, _0xa1_CorrectionMessageDescriptor cmd)
@ -1269,18 +1370,38 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
public bool ContentionTim(PhysicalAddress mac, _0xab_ContentionControlDescriptor ccdNew) public bool ContentionTim(PhysicalAddress mac, _0xab_ContentionControlDescriptor ccdNew)
{ {
throw new NotImplementedException(); TimContainer container = _timContainers[mac];
if (container.ContentionControl == null)
{
container.ContentionControl = ccdNew;
return true;
}
return false;
} }
public bool CorrectionControlTim(PhysicalAddress mac, _0xac_CorrectionControlDescriptor descriptor) public bool CorrectionControlTim(PhysicalAddress mac, _0xac_CorrectionControlDescriptor descriptor)
{ {
throw new NotImplementedException(); TimContainer container = _timContainers[mac];
if (container.CorrectionControl == null)
{
container.CorrectionControl = descriptor;
return true;
}
return false;
} }
public bool NetworkLayerInfoTim(PhysicalAddress mac, _0xa0_NetworkLayerInfoDescriptor nlid, public bool NetworkLayerInfoTim(PhysicalAddress mac, _0xa0_NetworkLayerInfoDescriptor nlid,
DateTime timestamped) DateTime timestamped)
{ {
throw new NotImplementedException(); TimContainer container = _timContainers[mac];
if (container.NetworkLayerInfoTimestamp < timestamped)
{
container.NetworkLayerInfoTimestamp = timestamped;
container.NetworkLayerInfoDescriptor = nlid;
return true;
}
return false;
} }
public IEnumerable<DbBlindscanJob> GetDbBlindscanJobs() public IEnumerable<DbBlindscanJob> GetDbBlindscanJobs()
@ -1312,7 +1433,19 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
public bool TestForIp(IPAddress iP) public bool TestForIp(IPAddress iP)
{ {
throw new NotImplementedException(); if (dnsRecords == null)
return false;
foreach (DnsRecord dnsRecord in dnsRecords)
{
if (dnsRecord.RecordType.Item1 != 1 && dnsRecord.RecordType.Item1 != 28)
continue;
if (dnsRecord.IP.Equals(iP))
return true;
}
return false;
} }
private HashSet<DnsRecord> dnsRecords; private HashSet<DnsRecord> dnsRecords;

View File

@ -10,12 +10,12 @@ using skyscraper5.Teletext;
using skyscraper8.DvbNip; using skyscraper8.DvbNip;
using skyscraper8.Experimentals.NdsSsu; using skyscraper8.Experimentals.NdsSsu;
using skyscraper8.Ietf.FLUTE; using skyscraper8.Ietf.FLUTE;
using skyscraper8.SatIp; using skyscraper8.SimpleServiceDiscoveryProtocol;
using skyscraper8.Skyscraper.Drawing; using skyscraper8.Skyscraper.Drawing;
namespace skyscraper8.Skyscraper.Scraper.Storage namespace skyscraper8.Skyscraper.Scraper.Storage
{ {
public interface ObjectStorage : IRtspCache public interface ObjectStorage : ISsdpCache
{ {
bool ObjectCarouselFileArrival(VfsFile vfsFile, int transportStreamId, int networkId); bool ObjectCarouselFileArrival(VfsFile vfsFile, int transportStreamId, int networkId);
void DataCarouselModuleArrival(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleModuleId, byte moduleModuleVersion, Stream result); void DataCarouselModuleArrival(int currentNetworkId, int currentTransportStreamId, int elementaryPid, ushort moduleModuleId, byte moduleModuleVersion, Stream result);

View File

@ -7,6 +7,7 @@ using skyscraper5.Mhp;
using skyscraper5.Mhp.Si; using skyscraper5.Mhp.Si;
using skyscraper5.Mhp.Si.Model; using skyscraper5.Mhp.Si.Model;
using skyscraper5.Mpeg2; using skyscraper5.Mpeg2;
using skyscraper5.Mpeg2.Psi.Model;
using skyscraper5.Skyscraper.Plugins; using skyscraper5.Skyscraper.Plugins;
namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
@ -31,6 +32,10 @@ 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)
{ {
if (programContext.Program == null)
{
programContext.Program = new ProgramMapping(0x1fff, 0x1ff);
}
skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PsiDecoder(pid, new AitParser(skyscraperContext, programContext.ProgramNumber))); skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PsiDecoder(pid, new AitParser(skyscraperContext, programContext.ProgramNumber)));
} }

View File

@ -100,6 +100,12 @@ 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)
{ {
if (programContext.Stream == null)
{
programContext.Stream = new ProgramMappingStream(PmtStreamType.Iso13818_1PrivateSections, 0x1fff);
programContext.Program = new ProgramMapping(0x1fff, 0x1fff);
programContext.Program.Streams.Add(programContext.Stream);
}
if (!programContext.Stream.ComponentTag.HasValue) if (!programContext.Stream.ComponentTag.HasValue)
{ {
skyscraperContext.MakeUpComponentTags(programContext.Program); skyscraperContext.MakeUpComponentTags(programContext.Program);

View File

@ -4,6 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using skyscraper5.Mpeg2; using skyscraper5.Mpeg2;
using skyscraper5.Mpeg2.Psi.Model;
using skyscraper5.Skyscraper.Plugins; using skyscraper5.Skyscraper.Plugins;
using skyscraper5.Skyscraper.Scraper.Utils; using skyscraper5.Skyscraper.Scraper.Utils;
using skyscraper5.src.Teletext; using skyscraper5.src.Teletext;
@ -45,10 +46,22 @@ namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection.Contestants
{ {
if (!skyscraperContext.CurrentNetworkId.HasValue) if (!skyscraperContext.CurrentNetworkId.HasValue)
{ {
//Since we need the network id for teletext, but we don't have it - we'll just have to discard this. //Since we need the network id
skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PacketDiscarder()); skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PacketDiscarder());
return; return;
} }
if (!skyscraperContext.CurrentTransportStreamId.HasValue)
{
//We need the TSID for teletext, but we don't have it - we'll just have to discard this.
skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PacketDiscarder());
return;
}
if (programContext.Program == null)
{
programContext.Program = new ProgramMapping(0x1fff, 0x1fff);
}
TeletextPesProcessor ttp = new TeletextPesProcessor(skyscraperContext, skyscraperContext.CurrentNetworkId.Value, skyscraperContext.CurrentTransportStreamId.Value, programContext.ProgramNumber); TeletextPesProcessor ttp = new TeletextPesProcessor(skyscraperContext, skyscraperContext.CurrentNetworkId.Value, skyscraperContext.CurrentTransportStreamId.Value, programContext.ProgramNumber);
ttp.PrivateDataSpecifier = programContext.PrivateDataSpecifier; ttp.PrivateDataSpecifier = programContext.PrivateDataSpecifier;
skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PesDecoder(ttp)); skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PesDecoder(ttp));

View File

@ -12,13 +12,22 @@ namespace skyscraper5.Skyscraper.Scraper.StreamAutodetection
{ {
public ProgramMapping Program { get; set; } public ProgramMapping Program { get; set; }
public ushort ProgramNumber => Program.ProgramNumber; public ushort ProgramNumber
{
get
{
return Program.ProgramNumber;
}
}
public ProgramMappingStream Stream { get; set; } public ProgramMappingStream Stream { get; set; }
public uint? PrivateDataSpecifier public uint? PrivateDataSpecifier
{ {
get get
{ {
if (Stream == null)
return null;
if (Stream.PrivateDataSpecifier.HasValue) if (Stream.PrivateDataSpecifier.HasValue)
return Stream.PrivateDataSpecifier; return Stream.PrivateDataSpecifier;
if (Program.PrivateDataSpecifier.HasValue) if (Program.PrivateDataSpecifier.HasValue)

View File

@ -58,6 +58,7 @@ namespace skyscraper5.Skyscraper.Text.Encodings
case 0xfa: resultBuilder.Append('ú'); break; case 0xfa: resultBuilder.Append('ú'); break;
case 0xfc: resultBuilder.Append('ü'); break; case 0xfc: resultBuilder.Append('ü'); break;
case 0xfd: resultBuilder.Append('ý'); break; case 0xfd: resultBuilder.Append('ý'); break;
case 0xfe: resultBuilder.Append('ŷ'); break;
default: default:
throw new NotImplementedException(String.Format("0x{0:X2}", preprocessed[i])); throw new NotImplementedException(String.Format("0x{0:X2}", preprocessed[i]));
} }

View File

@ -26,6 +26,7 @@ namespace skyscraper5.Skyscraper.Text.Encodings
case 0xa2: resultBuilder.Append('˘'); break; case 0xa2: resultBuilder.Append('˘'); break;
case 0xa3: resultBuilder.Append('£'); break; case 0xa3: resultBuilder.Append('£'); break;
case 0xa4: resultBuilder.Append('¤'); break; case 0xa4: resultBuilder.Append('¤'); break;
case 0xb7: resultBuilder.Append('·'); break;
case 0xc0: resultBuilder.Append('À'); break; case 0xc0: resultBuilder.Append('À'); break;
case 0xc1: resultBuilder.Append('Á'); break; case 0xc1: resultBuilder.Append('Á'); break;
case 0xc9: resultBuilder.Append('É'); break; case 0xc9: resultBuilder.Append('É'); break;
@ -47,6 +48,7 @@ namespace skyscraper5.Skyscraper.Text.Encodings
case 0xf3: resultBuilder.Append('ó'); break; case 0xf3: resultBuilder.Append('ó'); break;
case 0xf6: resultBuilder.Append('ö'); break; case 0xf6: resultBuilder.Append('ö'); break;
case 0xfa: resultBuilder.Append('ù'); break; case 0xfa: resultBuilder.Append('ù'); break;
case 0xfb: resultBuilder.Append('û'); break;
case 0xfc: resultBuilder.Append('ü'); break; case 0xfc: resultBuilder.Append('ü'); break;
default: default:
throw new NotImplementedException(String.Format("0x{0:X2}", preprocessed[i])); throw new NotImplementedException(String.Format("0x{0:X2}", preprocessed[i]));

View File

@ -12,10 +12,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<Deterministic>False</Deterministic> <Deterministic>False</Deterministic>
<Optimize>False</Optimize>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Deterministic>False</Deterministic> <Deterministic>False</Deterministic>
<Optimize>False</Optimize>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -32,6 +34,9 @@
<None Update="log4net.config"> <None Update="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="SatIpReadme.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>