Bugfixes to make the DVB-NIP Transmission on Hotbird 12226V work.

This commit is contained in:
feyris-tan 2025-08-10 12:01:06 +02:00
parent c07efd58d1
commit 8383ae02ab
3 changed files with 52 additions and 2 deletions

View File

@ -15,6 +15,7 @@ using System.Globalization;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Minio.DataModel.Response; using Minio.DataModel.Response;
using skyscraper5.Dvb.Descriptors; using skyscraper5.Dvb.Descriptors;
@ -150,7 +151,11 @@ namespace skyscraper5.Data
ObjectNotFoundException objectNotFoundException = minioException as ObjectNotFoundException; ObjectNotFoundException objectNotFoundException = minioException as ObjectNotFoundException;
if (objectNotFoundException != null) if (objectNotFoundException != null)
{ {
Monitor.Enter(definetlyMissingFiles);
definetlyMissingFiles.Add(combine); definetlyMissingFiles.Add(combine);
Monitor.Exit(definetlyMissingFiles);
return false; return false;
} }
else else

View File

@ -412,6 +412,7 @@ namespace skyscraper5.Data.PostgreSql
command.Parameters.AddWithValue("@ct", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.contentType); command.Parameters.AddWithValue("@ct", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.contentType);
command.Parameters.AddWithValue("@mi", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.manifestId); command.Parameters.AddWithValue("@mi", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.manifestId);
command.Parameters.AddWithValue("@to", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.transportObjectURI); command.Parameters.AddWithValue("@to", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.transportObjectURI);
SetNulls(command);
int executeNonQuery = command.ExecuteNonQuery(); int executeNonQuery = command.ExecuteNonQuery();
if (executeNonQuery != 1) if (executeNonQuery != 1)
throw new DataException(String.Format("Expected to insert {0} rows, but it were {1}", 1, executeNonQuery)); throw new DataException(String.Format("Expected to insert {0} rows, but it were {1}", 1, executeNonQuery));
@ -466,7 +467,10 @@ namespace skyscraper5.Data.PostgreSql
if (transport.ForwardErrorCorrectionParameters != null) if (transport.ForwardErrorCorrectionParameters != null)
{ {
throw new NotImplementedException(nameof(transport.ForwardErrorCorrectionParameters)); for (int i = 0; i < transport.ForwardErrorCorrectionParameters.Length; i++)
{
InsertForwardErrorCorrectionParameters(connection,uuid, i, transport.ForwardErrorCorrectionParameters[i]);
}
} }
if (transport.EndpointAddress.Length > 1) if (transport.EndpointAddress.Length > 1)
@ -489,6 +493,35 @@ namespace skyscraper5.Data.PostgreSql
} }
} }
private void InsertForwardErrorCorrectionParameters(NpgsqlConnection connection, Guid uuid, int ordinal, ForwardErrorCorrectionParametersType transportForwardErrorCorrectionParameter)
{
if (transportForwardErrorCorrectionParameter.Any != null)
{
throw new NotImplementedException(nameof(transportForwardErrorCorrectionParameter.Any));
}
if (transportForwardErrorCorrectionParameter.AnyAttr != null)
{
throw new NotImplementedException(nameof(transportForwardErrorCorrectionParameter.AnyAttr));
}
if (transportForwardErrorCorrectionParameter.EndpointAddress != null)
{
throw new NotImplementedException(nameof(transportForwardErrorCorrectionParameter.EndpointAddress));
}
NpgsqlCommand command = connection.CreateCommand();
command.CommandText = "INSERT INTO dvbnip_forward_error_correction_parameter VALUES (@uuid,@ordinal,DEFAULT,@sidentifier,@opercentage)";
command.Parameters.AddWithValue("@uuid", NpgsqlDbType.Uuid, uuid);
command.Parameters.AddWithValue("@ordinal", NpgsqlDbType.Integer, ordinal);
command.Parameters.AddWithValue("@sidentifier", NpgsqlDbType.Text, transportForwardErrorCorrectionParameter.SchemeIdentifier);
command.Parameters.AddWithValue("@opercentage", NpgsqlDbType.Integer, Convert.ToInt32(transportForwardErrorCorrectionParameter.OverheadPercentage));
int executeNonQuery = command.ExecuteNonQuery();
if (executeNonQuery != 1)
throw new DataException(String.Format("Expected {0}, got {1}", 1, executeNonQuery));
command.Dispose();
}
private void DvbNipInsertServiceComponentIdentifier(NpgsqlConnection connection, Guid uuid, int i, ServiceComponentIdentifierType serviceComponentIdentifier) private void DvbNipInsertServiceComponentIdentifier(NpgsqlConnection connection, Guid uuid, int i, ServiceComponentIdentifierType serviceComponentIdentifier)
{ {
NpgsqlCommand command = connection.CreateCommand(); NpgsqlCommand command = connection.CreateCommand();
@ -518,6 +551,18 @@ namespace skyscraper5.Data.PostgreSql
HLSComponentIdentifierType hls = (HLSComponentIdentifierType)serviceComponentIdentifier; HLSComponentIdentifierType hls = (HLSComponentIdentifierType)serviceComponentIdentifier;
command.Parameters["@media_playlist_locator"].Value = hls.mediaPlaylistLocator; command.Parameters["@media_playlist_locator"].Value = hls.mediaPlaylistLocator;
break; break;
case "ns2:DASHComponentIdentifierType":
command.Parameters["@xsiType"].Value = 3;
DASHComponentIdentifierType dash3 = (DASHComponentIdentifierType)serviceComponentIdentifier;
command.Parameters["@adaption_set_id"].Value = (int)dash3.adaptationSetIdentifier;
command.Parameters["@period_id"].Value = dash3.periodIdentifier;
command.Parameters["@representation_id"].Value = dash3.representationIdentifier;
break;
case "ns2:HLSComponentIdentifierType":
command.Parameters["@xsiType"].Value = 4;
HLSComponentIdentifierType hls4 = (HLSComponentIdentifierType)serviceComponentIdentifier;
command.Parameters["@media_playlist_locator"].Value = hls4.mediaPlaylistLocator;
break;
default: default:
throw new NotImplementedException(xsiType); throw new NotImplementedException(xsiType);
} }

View File

@ -2,7 +2,7 @@
"profiles": { "profiles": {
"skyscraper8": { "skyscraper8": {
"commandName": "Project", "commandName": "Project",
"commandLineArgs": "\"Z:\\TelephoneExchange\\11141_h_20250805_2233.ts\"", "commandLineArgs": "file-live \"C:\\Temp\\12226_v_20250809_2131.ts\"",
"remoteDebugEnabled": false "remoteDebugEnabled": false
}, },
"Container (Dockerfile)": { "Container (Dockerfile)": {