All three DVB-NIP (and the sole DVB-I) test signals work now.
This commit is contained in:
parent
17b1350185
commit
ec80b97e1d
@ -54,6 +54,9 @@ namespace skyscraper5.Dvb.DataBroadcasting.SkyscraperVfs
|
||||
|
||||
public bool FileExists(string filename)
|
||||
{
|
||||
if (string.IsNullOrEmpty(filename))
|
||||
return false;
|
||||
|
||||
if (filename.StartsWith("/"))
|
||||
filename = filename.Replace('/', '\\');
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ namespace skyscraper8.DvbI
|
||||
|
||||
byte[] slepBytes = vfs.GetFile(INDEX_FILENAME);
|
||||
ServiceListEntryPoints serviceListEntryPoints = DvbIUtils.UnpackServiceListEntryPoints(slepBytes);
|
||||
IEnumerable<DvbiServiceList> enumerable = DvbIUtils.FlattenServiceListEntryPoints(serviceListEntryPoints);
|
||||
List<DvbiServiceList> enumerable = DvbIUtils.FlattenServiceListEntryPoints(serviceListEntryPoints).ToList();
|
||||
foreach(DvbiServiceList serviceList in enumerable)
|
||||
{
|
||||
DateTime serviceListLastChecked;
|
||||
|
||||
@ -17,29 +17,30 @@ namespace skyscraper8.DvbI
|
||||
private static XmlSerializer serviceListEntryPointSerializer;
|
||||
|
||||
public static ServiceListEntryPoints UnpackServiceListEntryPoints(byte[] buffer)
|
||||
{
|
||||
MemoryStream slepStream = new MemoryStream(buffer, false);
|
||||
return UnpackServiceListEntryPoints(slepStream);
|
||||
}
|
||||
|
||||
public static ServiceListEntryPoints UnpackServiceListEntryPoints(Stream slepStream)
|
||||
{
|
||||
if (serviceListEntryPointSerializer == null)
|
||||
serviceListEntryPointSerializer = new XmlSerializer(typeof(ServiceListEntryPoints));
|
||||
|
||||
object slepWrapped = serviceListEntryPointSerializer.Deserialize(slepStream);
|
||||
string s = Encoding.UTF8.GetString(buffer);
|
||||
s = s.Replace("<dvbi-types:URI>", "<URI>");
|
||||
s = s.Replace("</dvbi-types:URI>", "</URI>");
|
||||
|
||||
object slepWrapped = serviceListEntryPointSerializer.Deserialize(new StringReader(s));
|
||||
ServiceListEntryPoints serviceListEntryPoint = (ServiceListEntryPoints)slepWrapped;
|
||||
return serviceListEntryPoint;
|
||||
}
|
||||
|
||||
|
||||
private static XmlSerializer serviceListSerializer;
|
||||
public static ServiceListType UnpackServiceList(byte[] buffer)
|
||||
{
|
||||
if (serviceListSerializer == null)
|
||||
serviceListSerializer = new XmlSerializer(typeof(ServiceListType));
|
||||
|
||||
MemoryStream slStream = new MemoryStream(buffer, false);
|
||||
object slWrapped = serviceListSerializer.Deserialize(slStream);
|
||||
string s = Encoding.UTF8.GetString(buffer);
|
||||
s = s.Replace("<dvbi-types:URI>", "<URI>");
|
||||
s = s.Replace("</dvbi-types:URI>", "</URI>");
|
||||
|
||||
object slWrapped = serviceListSerializer.Deserialize(new StringReader(s));
|
||||
ServiceListType slt = (ServiceListType)slWrapped;
|
||||
return slt;
|
||||
}
|
||||
@ -54,12 +55,16 @@ namespace skyscraper8.DvbI
|
||||
serviceList.Id = serviceListOffering.ServiceListId;
|
||||
serviceList.Name = serviceListOffering.ServiceListName;
|
||||
|
||||
foreach(ServiceListEntryPointsProviderOfferingServiceListOfferingDelivery delivery in serviceListOffering.Delivery)
|
||||
if (serviceListOffering.Delivery != null)
|
||||
{
|
||||
if (delivery.DASHDelivery != null && string.IsNullOrEmpty(serviceList.DashDelivery))
|
||||
serviceList.DashDelivery = delivery.DASHDelivery;
|
||||
if (delivery.DVBSDelivery != null && string.IsNullOrEmpty(serviceList.DvbSDelivery))
|
||||
serviceList.DvbSDelivery = delivery.DVBSDelivery[0].OrbitalPosition;
|
||||
foreach (ServiceListEntryPointsProviderOfferingServiceListOfferingDelivery delivery in
|
||||
serviceListOffering.Delivery)
|
||||
{
|
||||
if (delivery.DASHDelivery != null && string.IsNullOrEmpty(serviceList.DashDelivery))
|
||||
serviceList.DashDelivery = delivery.DASHDelivery;
|
||||
if (delivery.DVBSDelivery != null && string.IsNullOrEmpty(serviceList.DvbSDelivery))
|
||||
serviceList.DvbSDelivery = delivery.DVBSDelivery[0].OrbitalPosition;
|
||||
}
|
||||
}
|
||||
|
||||
if (serviceListOffering.RelatedMaterial != null)
|
||||
|
||||
@ -224,10 +224,11 @@ namespace moe.yo3explorer.skyscraper8.DVBI.Model {
|
||||
private string uRIField;
|
||||
|
||||
private string contentTypeField;
|
||||
|
||||
/// <remarks/>
|
||||
//[System.Xml.Serialization.XmlElementAttribute(Namespace="urn:dvb:metadata:servicediscovery-types:2023")]
|
||||
public string URI {
|
||||
|
||||
/// <remarks/>
|
||||
//[System.Xml.Serialization.XmlElementAttribute(Namespace="urn:dvb:metadata:servicediscovery-types:2023")]
|
||||
[System.Xml.Serialization.XmlElementAttribute("URI")]
|
||||
public string URI {
|
||||
get {
|
||||
return this.uRIField;
|
||||
}
|
||||
|
||||
@ -180,6 +180,9 @@ namespace skyscraper8.DvbNip
|
||||
string rawSlepString = Encoding.UTF8.GetString(rawSlepBytes);
|
||||
rawSlepString = rawSlepString.Replace("<dvbi-types:", "<");
|
||||
rawSlepString = rawSlepString.Replace("</dvbi-types:", "</");
|
||||
rawSlepString = rawSlepString.Replace("<dvbisdt:", "<");
|
||||
rawSlepString = rawSlepString.Replace("</dvbisdt:", "</");
|
||||
File.WriteAllText("slep3.xml", rawSlepString);
|
||||
ServiceListEntryPoints serviceListEntryPoints = DvbIUtils.UnpackServiceListEntryPoints(rawSlepString);
|
||||
EventHandler?.OnServiceListEntryPoints(CurrentCarrierInformation, serviceListEntryPoints, currentTime.Value, this);
|
||||
return true;
|
||||
@ -304,6 +307,8 @@ namespace skyscraper8.DvbNip
|
||||
{
|
||||
if (serviceListUrls == null)
|
||||
serviceListUrls = new Dictionary<string, string>();
|
||||
if (string.IsNullOrEmpty(url))
|
||||
return;
|
||||
|
||||
if (!serviceListUrls.ContainsKey(url))
|
||||
{
|
||||
|
||||
@ -47,6 +47,7 @@ namespace skyscraper8.DvbNip
|
||||
case ".mpd":
|
||||
case ".m4s":
|
||||
case ".m3u8":
|
||||
case ".ts":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@ -66,7 +67,15 @@ namespace skyscraper8.DvbNip
|
||||
privateDataSignallingManifestXmlSerializer = new XmlSerializer(typeof(PrivateDataSignallingManifestType));
|
||||
}
|
||||
|
||||
object v = privateDataSignallingManifestXmlSerializer.Deserialize(toStream);
|
||||
byte[] buffer = new byte[toStream.Length];
|
||||
toStream.Read(buffer, 0, (int)toStream.Length);
|
||||
string bufferString = Encoding.UTF8.GetString(buffer, 0, (int)toStream.Length);
|
||||
if (bufferString.Contains("urn:dvb:metadata:nativeip:2023"))
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2023", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
|
||||
object v = privateDataSignallingManifestXmlSerializer.Deserialize(new StringReader(bufferString));
|
||||
PrivateDataSignallingManifestType result = (PrivateDataSignallingManifestType)v;
|
||||
return result;
|
||||
}
|
||||
@ -80,7 +89,16 @@ namespace skyscraper8.DvbNip
|
||||
timeOffsetFileXmlSerializer = new XmlSerializer(typeof(TimeOffsetFileType));
|
||||
}
|
||||
|
||||
object v = timeOffsetFileXmlSerializer.Deserialize(toStream);
|
||||
byte[] buffer = new byte[toStream.Length];
|
||||
toStream.Read(buffer, 0, (int)toStream.Length);
|
||||
string bufferString = Encoding.UTF8.GetString(buffer, 0, (int)toStream.Length);
|
||||
if (bufferString.Contains("urn:dvb:metadata:nativeip:2023"))
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2023", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
|
||||
|
||||
object v = timeOffsetFileXmlSerializer.Deserialize(new StringReader(bufferString));
|
||||
TimeOffsetFileType result = (TimeOffsetFileType)v;
|
||||
return result;
|
||||
}
|
||||
@ -93,7 +111,15 @@ namespace skyscraper8.DvbNip
|
||||
networkInformationFileXmlSerializer = new XmlSerializer(typeof(NetworkInformationFileType));
|
||||
}
|
||||
|
||||
object v = networkInformationFileXmlSerializer.Deserialize(toStream);
|
||||
byte[] buffer = new byte[toStream.Length];
|
||||
toStream.Read(buffer, 0, (int)toStream.Length);
|
||||
string bufferString = Encoding.UTF8.GetString(buffer, 0, (int)toStream.Length);
|
||||
if (bufferString.Contains("urn:dvb:metadata:nativeip:2023"))
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2023", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
|
||||
object v = networkInformationFileXmlSerializer.Deserialize(new StringReader(bufferString));
|
||||
NetworkInformationFileType result = (NetworkInformationFileType)v;
|
||||
return result;
|
||||
}
|
||||
@ -105,8 +131,16 @@ namespace skyscraper8.DvbNip
|
||||
{
|
||||
serviceInformationFileXmlSerializer = new XmlSerializer(typeof(ServiceInformationFileType));
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[toStream.Length];
|
||||
toStream.Read(buffer, 0, (int)toStream.Length);
|
||||
string bufferString = Encoding.UTF8.GetString(buffer, 0, (int)toStream.Length);
|
||||
if (bufferString.Contains("urn:dvb:metadata:nativeip:2023"))
|
||||
{
|
||||
bufferString = bufferString.Replace("urn:dvb:metadata:nativeip:2023", "urn:dvb:metadata:nativeip:2024");
|
||||
}
|
||||
|
||||
object v = serviceInformationFileXmlSerializer.Deserialize(toStream);
|
||||
object v = serviceInformationFileXmlSerializer.Deserialize(new StringReader(bufferString));
|
||||
ServiceInformationFileType result = (ServiceInformationFileType)v;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"profiles": {
|
||||
"skyscraper8": {
|
||||
"commandName": "Project",
|
||||
"commandLineArgs": "\"E:\\NIP-Research\\nip.m3u8\"",
|
||||
"commandLineArgs": "\"C:\\Temp\\Hotbird130_12380_V_NIP.ts\"\r\n",
|
||||
"remoteDebugEnabled": false
|
||||
},
|
||||
"Container (Dockerfile)": {
|
||||
|
||||
@ -1584,6 +1584,8 @@ namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory
|
||||
{
|
||||
if (_dvbiServiceLists == null)
|
||||
_dvbiServiceLists = new Dictionary<string, DvbiServiceList>();
|
||||
if (string.IsNullOrEmpty(serviceList.Id))
|
||||
return;
|
||||
|
||||
_dvbiServiceLists.Add(serviceList.Id, serviceList);
|
||||
}
|
||||
|
||||
@ -17,7 +17,11 @@ namespace skyscraper8.Skyscraper.Scraper.Storage.Utilities
|
||||
this.LinkId = carrier.NipLinkId;
|
||||
this.NetworkId = carrier.NipNetworkId;
|
||||
this.ServiceId = carrier.NipServiceId;
|
||||
this.SourceAddress = IPAddress.Parse(address.NetworkSourceAddress);
|
||||
if (!string.IsNullOrEmpty(address.NetworkSourceAddress))
|
||||
{
|
||||
this.SourceAddress = IPAddress.Parse(address.NetworkSourceAddress);
|
||||
}
|
||||
|
||||
this.DestinationAddress = IPAddress.Parse(address.NetworkDestinationGroupAddress);
|
||||
this.DestinationPort = ushort.Parse(address.TransportDestinationPort);
|
||||
this.TSI = long.Parse(address.MediaTransportSessionIdentifier);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user