From 1463844e4653fae984f9de03a80a92c0c0c3ba36 Mon Sep 17 00:00:00 2001 From: Fey Date: Sat, 14 Mar 2026 15:09:20 +0100 Subject: [PATCH] Patches for adhering to Voile's feature of specifying output directories for PCAPs and Sub-TS --- .../MinioObjectStorage.cs | 15 ++++ .../skyscraper5.Data.PostgreSql/Int.cs | 46 +++++----- .../skyscraper5.Data.PostgreSql.csproj | 4 +- .../TSDuck-Samples/patch-wdr-dab.txt | 11 +++ .../Overrides/Form1UiJunction.cs | 85 ++++++++++++++++++- GUIs/skyscraper8.UI.ImGui/Forms/JobDisplay.cs | 15 +++- .../Jobs/InheritedBlindscanUiJunction.cs | 16 +++- .../skyscraper5.LyngsatMapsScraper.csproj | 2 +- .../skyscraper5.Aprs/skyscraper5.Aprs.csproj | 2 +- .../Dvb/DataBroadcasting/IntModel/Target.cs | 9 +- .../Skyscraper/Scraper/SkyscraperContext.cs | 9 ++ .../Storage/StorageConnectionManager.cs | 5 ++ 12 files changed, 182 insertions(+), 37 deletions(-) create mode 100644 Documentation/TSDuck-Samples/patch-wdr-dab.txt diff --git a/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs b/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs index 991eba8..1e1d560 100644 --- a/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs +++ b/BlobStorages/skyscraper5.Data.Minio/MinioObjectStorage.cs @@ -527,5 +527,20 @@ namespace skyscraper5.Data string filename = String.Format("DVB-SIS/{0}/{1}/Group{2}_Version{3}.xml"); WriteObject(filename, dsaci); } + + public bool TestForObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId) + { + throw new NotImplementedException(); + } + + public byte[] GetObjectCarouselFileArrival(string vfsFile, int transportStreamId, int pid, int networkId) + { + throw new NotImplementedException(); + } + + public byte[] DvbNipGetFile(string path) + { + throw new NotImplementedException(); + } } } diff --git a/DataTableStorages/skyscraper5.Data.PostgreSql/Int.cs b/DataTableStorages/skyscraper5.Data.PostgreSql/Int.cs index d2a178c..480a7c5 100644 --- a/DataTableStorages/skyscraper5.Data.PostgreSql/Int.cs +++ b/DataTableStorages/skyscraper5.Data.PostgreSql/Int.cs @@ -18,7 +18,7 @@ namespace skyscraper5.Data.PostgreSql if (_knownInts == null) _knownInts = new HashSet(); - DatabaseKeyInt key = new DatabaseKeyInt(notification.PlatformId); + DatabaseKeyInt key = new DatabaseKeyInt(notification.Platform.PlatformId, notification.Target.GenerateId()); if (_knownInts.Contains(key)) return true; @@ -28,7 +28,7 @@ namespace skyscraper5.Data.PostgreSql conn.Open(); NpgsqlCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT dateadded FROM dvb_int WHERE platform_id = @id"; - cmd.Parameters.AddWithValue("@id", NpgsqlTypes.NpgsqlDbType.Bigint, (long)notification.PlatformId); + cmd.Parameters.AddWithValue("@id", NpgsqlTypes.NpgsqlDbType.Bigint, (long)notification.Platform.PlatformId); NpgsqlDataReader reader = cmd.ExecuteReader(); result = reader.Read(); reader.Close(); @@ -43,7 +43,7 @@ namespace skyscraper5.Data.PostgreSql public void StoreIpMacNotification(IpMacNotification notification) { EnqueueTask(x => WriteIpMacNotification(x, notification)); - DatabaseKeyInt key = new DatabaseKeyInt(notification.PlatformId); + DatabaseKeyInt key = new DatabaseKeyInt(notification.Platform.PlatformId, notification.Target.GenerateId()); _knownInts.Add(key); } @@ -53,28 +53,28 @@ namespace skyscraper5.Data.PostgreSql cmd.CommandText = "insert into dvb_int (platform_id, platform_name, platform_provider_name,\r\n platform_provider_name_language_code, platform_action_type, platform_name_language_code,\r\n platform_processing_order, target_type, target_name, operational_network_id,\r\n operational_mpe_fec_algorithm, operational_component_tag, operational_transport_stream_id,\r\n operational_time_slice_fec_id, operational_time_slicing, operational_onid, operational_sid,\r\n operational_time_slice_frame_size, operational_time_slice_max_average_rate,\r\n operational_time_slice_max_bust_duration) " + "values " + "(@platform_id,@platform_name,@platform_provider_name,@platform_provider_name_language_code,@platform_action_type,@platform_name_language_code,@platform_processing_order,@target_type,@target_name,@operational_network_id,@operational_mpe_fec_algorithm, @operational_component_tag, @operational_transport_stream_id,\r\n @operational_time_slice_fec_id, @operational_time_slicing, @operational_onid, @operational_sid,\r\n @operational_time_slice_frame_size, @operational_time_slice_max_average_rate,\r\n @operational_time_slice_max_bust_duration\r\n\r\n )"; - cmd.Parameters.AddWithValue("@platform_id", NpgsqlTypes.NpgsqlDbType.Bigint, (long)notification.PlatformId); - cmd.Parameters.AddWithValue("@platform_name", NpgsqlTypes.NpgsqlDbType.Text, notification.PlatformName); - cmd.Parameters.AddWithValue("@platform_provider_name", NpgsqlTypes.NpgsqlDbType.Text, notification.PlatformProviderName); - cmd.Parameters.AddWithValue("@platform_provider_name_language_code", NpgsqlTypes.NpgsqlDbType.Varchar, notification.PlatformProviderNameLanguageCode); - cmd.Parameters.AddWithValue("@platform_action_type", NpgsqlTypes.NpgsqlDbType.Integer, notification.PlatformActionType); - cmd.Parameters.AddWithValue("@platform_name_language_code", NpgsqlTypes.NpgsqlDbType.Varchar, notification.PlatformNameLanguageCode); - cmd.Parameters.AddWithValue("@platform_processing_order", NpgsqlTypes.NpgsqlDbType.Integer, notification.PlatformProcessingOrder); - cmd.Parameters.AddWithValue("@target_type", NpgsqlTypes.NpgsqlDbType.Integer, notification.TargetType); - cmd.Parameters.AddWithValue("@target_name", NpgsqlTypes.NpgsqlDbType.Text, notification.TargetName); + cmd.Parameters.AddWithValue("@platform_id", NpgsqlTypes.NpgsqlDbType.Bigint, (long)notification.Platform.PlatformId); + cmd.Parameters.AddWithValue("@platform_name", NpgsqlTypes.NpgsqlDbType.Text, notification.Platform.Name); + cmd.Parameters.AddWithValue("@platform_provider_name", NpgsqlTypes.NpgsqlDbType.Text, notification.Platform.ProviderName); + cmd.Parameters.AddWithValue("@platform_provider_name_language_code", NpgsqlTypes.NpgsqlDbType.Varchar, notification.Platform.ProviderNameLanguageCode); + cmd.Parameters.AddWithValue("@platform_action_type", NpgsqlTypes.NpgsqlDbType.Integer, notification.Platform.ActionType); + cmd.Parameters.AddWithValue("@platform_name_language_code", NpgsqlTypes.NpgsqlDbType.Varchar, notification.Platform.NameLanguageCode); + cmd.Parameters.AddWithValue("@platform_processing_order", NpgsqlTypes.NpgsqlDbType.Integer, notification.Platform.ProcessingOrder); + cmd.Parameters.AddWithValue("@target_type", NpgsqlTypes.NpgsqlDbType.Integer, notification.Target.GenerateId()); + cmd.Parameters.AddWithValue("@target_name", NpgsqlTypes.NpgsqlDbType.Text, notification.Target.GenerateName()); //@operational_network_id,@operational_mpe_fec_algorithm,@operational_component_tag,@operational_transport_stream_id,@operational_time_slice_fec_id,@operational_time_slicing,@operational_onid,@operational_sid,@operational_time_slice_frame_size, @operational_time_slice_max_average_rate,\r\n @operational_time_slice_max_bust_duration\r\n\r\n )"; - cmd.Parameters.AddWithValue("@operational_network_id", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalNetworkId); - cmd.Parameters.AddWithValue("@operational_mpe_fec_algorithm", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalMpeFecAlgorithm); - cmd.Parameters.AddWithValue("@operational_component_tag", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalComponentTag); - cmd.Parameters.AddWithValue("@operational_transport_stream_id", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalTransportStreamId); - cmd.Parameters.AddWithValue("@operational_time_slice_fec_id", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalTimeSliceFecId); - cmd.Parameters.AddWithValue("@operational_time_slicing", NpgsqlTypes.NpgsqlDbType.Boolean, (bool?)notification.OperationalTimeSlicing); - cmd.Parameters.AddWithValue("@operational_onid", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalOriginalNetworkId); - cmd.Parameters.AddWithValue("@operational_sid", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalServiceId); + cmd.Parameters.AddWithValue("@operational_network_id", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.NetworkId); + cmd.Parameters.AddWithValue("@operational_mpe_fec_algorithm", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.MpeFecAlgorithm); + cmd.Parameters.AddWithValue("@operational_component_tag", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.ComponentTag); + cmd.Parameters.AddWithValue("@operational_transport_stream_id", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.TransportStreamId); + cmd.Parameters.AddWithValue("@operational_time_slice_fec_id", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.TimeSliceFecId); + cmd.Parameters.AddWithValue("@operational_time_slicing", NpgsqlTypes.NpgsqlDbType.Boolean, (bool?)notification.Operational.TimeSlicing); + cmd.Parameters.AddWithValue("@operational_onid", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.OriginalNetworkId); + cmd.Parameters.AddWithValue("@operational_sid", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.ServiceId); //@operational_time_slice_frame_size,@operational_time_slice_max_average_rate,@operational_time_slice_max_bust_duration - cmd.Parameters.AddWithValue("@operational_time_slice_frame_size", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalTimeSliceFrameSize); - cmd.Parameters.AddWithValue("@operational_time_slice_max_average_rate", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalTimeSliceMaxAverageRate); - cmd.Parameters.AddWithValue("@operational_time_slice_max_bust_duration", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.OperationalTimeSliceMaxBurstDuration); + cmd.Parameters.AddWithValue("@operational_time_slice_frame_size", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.TimeSliceFrameSize); + cmd.Parameters.AddWithValue("@operational_time_slice_max_average_rate", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.TimeSliceMaxAverageRate); + cmd.Parameters.AddWithValue("@operational_time_slice_max_bust_duration", NpgsqlTypes.NpgsqlDbType.Integer, (int?)notification.Operational.TimeSliceMaxBurstDuration); cmd.Parameters.CheckNulls(); cmd.ExecuteNonQuery(); } diff --git a/DataTableStorages/skyscraper5.Data.PostgreSql/skyscraper5.Data.PostgreSql.csproj b/DataTableStorages/skyscraper5.Data.PostgreSql/skyscraper5.Data.PostgreSql.csproj index d2e2d87..9240b36 100644 --- a/DataTableStorages/skyscraper5.Data.PostgreSql/skyscraper5.Data.PostgreSql.csproj +++ b/DataTableStorages/skyscraper5.Data.PostgreSql/skyscraper5.Data.PostgreSql.csproj @@ -6,8 +6,8 @@ - - + + diff --git a/Documentation/TSDuck-Samples/patch-wdr-dab.txt b/Documentation/TSDuck-Samples/patch-wdr-dab.txt new file mode 100644 index 0000000..79bca2f --- /dev/null +++ b/Documentation/TSDuck-Samples/patch-wdr-dab.txt @@ -0,0 +1,11 @@ +tsp -b 3248000 -v ^ + -I file astra1_11604v_wdr_b.ts ^ + -P filter --pid 0x1fff --set-label 2 ^ + -P filter --only-label 2 --every 100 --set-label 1 ^ + -P craft --only-label 1 --pid 101 --no-payload --pcr 0 ^ + -P continuity --pid 101 ^ + -P pcradjust --pid 101 ^ + -P pat -c -a 1/100 ^ + -P pmt -p 100 -c -i 1 -a 0x0bb8/0xd --set-data-broadcast-id 0x0bb8/5 -a 101/0x82 ^ + -P history ^ + -O file astra1_11604v_wdr_b_patched.ts \ No newline at end of file diff --git a/GUIs/skyscraper5.UI/Overrides/Form1UiJunction.cs b/GUIs/skyscraper5.UI/Overrides/Form1UiJunction.cs index c583340..b604312 100644 --- a/GUIs/skyscraper5.UI/Overrides/Form1UiJunction.cs +++ b/GUIs/skyscraper5.UI/Overrides/Form1UiJunction.cs @@ -26,6 +26,12 @@ using skyscraper8.Skyscraper.Drawing; using skyscraper8.Skyscraper.FrequencyListGenerator; using skyscraper8.Skyscraper.Scraper; using Platform = skyscraper5.Dvb.DataBroadcasting.IntModel.Platform; +using skyscraper8.GSE.GSE; +using skyscraper8.DvbNip.UiIntegration; +using skyscraper8.DvbNip; +using moe.yo3explorer.skyscraper8.DVBI.Model; +using skyscraper8.Ietf.FLUTE; +using skyscraper8.Ses; namespace skyscraper5.UI.Overrides { @@ -613,6 +619,81 @@ namespace skyscraper5.UI.Overrides return "T2-MI"; return String.Format("??? (Type 0x{0:X2})", (int)stream.StreamType); - } - } + } + + public void NotifyWss(ushort programNumber, WssDataBlock wssDataBlock, int pid) + { + throw new NotImplementedException(); + } + + public void NotifyGsePacket(ushort value, byte[] gseDataBytes, GseLabel label) + { + throw new NotImplementedException(); + } + + public void OnDvbNipFileArrival(FluteUiHandle fuh) + { + throw new NotImplementedException(); + } + + public void OnDvbNipMulticastGatewayConfiguration(NipActualCarrierInformation carrier, MulticastGatewayConfigurationType multicastGatewayConfiguration) + { + throw new NotImplementedException(); + } + + public void OnDvbNipCarrierDetected(NipActualCarrierInformation currentCarrierInformation) + { + throw new NotImplementedException(); + } + + public void OnDvbNipPrivateDataSignallingManifest(PrivateDataSignallingManifestType privateDataSignallingManifest) + { + throw new NotImplementedException(); + } + + public void OnDvbNipServiceListEntryPoints(NipActualCarrierInformation currentCarrierInformation, ServiceListEntryPoints serviceListEntryPoints, DateTime dvbNipTime) + { + throw new NotImplementedException(); + } + + public void OnDvbNipServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId1, ServiceListType serviceListId2) + { + throw new NotImplementedException(); + } + + public void OnDvbNipTimeOffsetFile(NipActualCarrierInformation currentCarrierInformation, TimeOffsetFileType timeOffsetFile) + { + throw new NotImplementedException(); + } + + public void OnDvbNipNetworkInformationFile(NipActualCarrierInformation currentCarrierInformation, NetworkInformationFileType networkInformationFile) + { + throw new NotImplementedException(); + } + + public void DvbNipServiceInformation(NipActualCarrierInformation currentCarrierInformation, ServiceInformationFileType serviceInformationFile) + { + throw new NotImplementedException(); + } + + public void OnDvbNipFileAnnouncement(FDTInstanceType flute) + { + throw new NotImplementedException(); + } + + public void OnAstraSgtList(SgtList list) + { + throw new NotImplementedException(); + } + + public void OnAstraSgtService(SgtService child) + { + throw new NotImplementedException(); + } + + public void NotifyTransportStreamId(int tsid, int nid) + { + throw new NotImplementedException(); + } + } } diff --git a/GUIs/skyscraper8.UI.ImGui/Forms/JobDisplay.cs b/GUIs/skyscraper8.UI.ImGui/Forms/JobDisplay.cs index 7b21a45..4422b5d 100644 --- a/GUIs/skyscraper8.UI.ImGui/Forms/JobDisplay.cs +++ b/GUIs/skyscraper8.UI.ImGui/Forms/JobDisplay.cs @@ -2326,7 +2326,16 @@ namespace SDL2Demo.Forms } return null; - } - - } + } + + public void OnDvbNipServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId1, ServiceListType serviceListId2) + { + throw new NotImplementedException(); + } + + public void NotifyTransportStreamId(int tsid, int nid) + { + throw new NotImplementedException(); + } + } } diff --git a/GUIs/skyscraper8.UI.ImGui/Jobs/InheritedBlindscanUiJunction.cs b/GUIs/skyscraper8.UI.ImGui/Jobs/InheritedBlindscanUiJunction.cs index 9f8c38a..0207cf9 100644 --- a/GUIs/skyscraper8.UI.ImGui/Jobs/InheritedBlindscanUiJunction.cs +++ b/GUIs/skyscraper8.UI.ImGui/Jobs/InheritedBlindscanUiJunction.cs @@ -1919,9 +1919,19 @@ namespace SDL2Demo.Jobs public void OnAstraSgtService(SgtService child) { throw new NotImplementedException(); - } - - public TaskQueue Tasks { get; set; } + } + + public void OnDvbNipServiceList(NipActualCarrierInformation currentCarrierInformation, string serviceListId1, ServiceListType serviceListId2) + { + throw new NotImplementedException(); + } + + public void NotifyTransportStreamId(int tsid, int nid) + { + throw new NotImplementedException(); + } + + public TaskQueue Tasks { get; set; } internal JobContext jobContext; #endregion diff --git a/Gimmicks/skyscraper5.LyngsatMapsScraper/skyscraper5.LyngsatMapsScraper.csproj b/Gimmicks/skyscraper5.LyngsatMapsScraper/skyscraper5.LyngsatMapsScraper.csproj index 618c030..d245651 100644 --- a/Gimmicks/skyscraper5.LyngsatMapsScraper/skyscraper5.LyngsatMapsScraper.csproj +++ b/Gimmicks/skyscraper5.LyngsatMapsScraper/skyscraper5.LyngsatMapsScraper.csproj @@ -8,7 +8,7 @@ - + diff --git a/MpePlugins/skyscraper5.Aprs/skyscraper5.Aprs.csproj b/MpePlugins/skyscraper5.Aprs/skyscraper5.Aprs.csproj index 6beda27..3dd040c 100644 --- a/MpePlugins/skyscraper5.Aprs/skyscraper5.Aprs.csproj +++ b/MpePlugins/skyscraper5.Aprs/skyscraper5.Aprs.csproj @@ -8,7 +8,7 @@ - + diff --git a/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs b/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs index f5a3871..57162b3 100644 --- a/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs +++ b/skyscraper8/Dvb/DataBroadcasting/IntModel/Target.cs @@ -55,6 +55,11 @@ namespace skyscraper5.Dvb.DataBroadcasting.IntModel sb.Append(","); } return sb.ToString(); - } - } + } + + public object GenerateName() + { + throw new NotImplementedException(); + } + } } diff --git a/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs b/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs index eb20a2c..5b6b5fe 100644 --- a/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs +++ b/skyscraper8/Skyscraper/Scraper/SkyscraperContext.cs @@ -2016,6 +2016,15 @@ namespace skyscraper5.Skyscraper.Scraper if (storageConnectionManager.IsSubTsDumpingEnabled()) { string filename = String.Format("{0}_{1}.ts", child.ChildName.SanitizeFileName(), child.ChildTimestamp); + + string outputPath = storageConnectionManager.GetSubTsOutputPath(); + if (!string.IsNullOrEmpty(outputPath)) + { + DirectoryInfo outDir = new DirectoryInfo(outputPath); + outDir.EnsureExists(); + filename = Path.Combine(outDir.FullName, filename); + } + FileInfo fi = new FileInfo(filename); TsRecorder packetDumper = new TsRecorder(); packetDumper.RecordingOutputDirectory = new DirectoryInfo("."); diff --git a/skyscraper8/Skyscraper/Scraper/Storage/StorageConnectionManager.cs b/skyscraper8/Skyscraper/Scraper/Storage/StorageConnectionManager.cs index 00ca2c9..229af23 100644 --- a/skyscraper8/Skyscraper/Scraper/Storage/StorageConnectionManager.cs +++ b/skyscraper8/Skyscraper/Scraper/Storage/StorageConnectionManager.cs @@ -211,5 +211,10 @@ namespace skyscraper8.Skyscraper.Scraper.Storage return true; } } + + internal string GetSubTsOutputPath() + { + return ini.ReadValue("subts", "outdir", ""); + } } }