Can now parse CAT, PMT, SDT and TDT from SIS.
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 2m42s
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 2m42s
This commit is contained in:
parent
e7db7cb364
commit
3b0dad4ba5
@ -35,7 +35,6 @@ namespace skyscraper8.DvbSis
|
|||||||
|
|
||||||
public void OnT2MiPacketLoss(int pid, byte expectedPacket, T2MIHeader header)
|
public void OnT2MiPacketLoss(int pid, byte expectedPacket, T2MIHeader header)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnT2MiPacket(int pid, byte basebandFramePlpId, byte[] basebandPacket)
|
public void OnT2MiPacket(int pid, byte basebandFramePlpId, byte[] basebandPacket)
|
||||||
|
|||||||
@ -9,7 +9,11 @@ using System.Threading.Tasks;
|
|||||||
namespace skyscraper8.DvbSis
|
namespace skyscraper8.DvbSis
|
||||||
{
|
{
|
||||||
internal class NullSisHandler : SisHandler
|
internal class NullSisHandler : SisHandler
|
||||||
{
|
{
|
||||||
|
public void OnSisCat(int sourcePid, SisCatContainer catContainer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void OnSisDsaci(ushort currentDsaGroupId, int versionNumber, byte sectionNumber, byte lastSectionNumber, Stream dsaci)
|
public void OnSisDsaci(ushort currentDsaGroupId, int versionNumber, byte sectionNumber, byte lastSectionNumber, Stream dsaci)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -26,8 +30,21 @@ namespace skyscraper8.DvbSis
|
|||||||
|
|
||||||
public void OnSisPat(int sourcePid, SisPatContainer patContainer)
|
public void OnSisPat(int sourcePid, SisPatContainer patContainer)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void OnSisPmt(int sourcePid, SisPmtContainer pmtContainer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnSisSdt(int sourcePid, SisSdtContainer sdtContainer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnSisTdt(int sourcePid, SisTdtContainer tdtContainer)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void OnSisTimestamp(int pid, _0x20_DvbT2Timestamp t2Timestamp)
|
public void OnSisTimestamp(int pid, _0x20_DvbT2Timestamp t2Timestamp)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
34
skyscraper8/DvbSis/SisCatContainer.cs
Normal file
34
skyscraper8/DvbSis/SisCatContainer.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using skyscraper5.Mpeg2.Descriptors;
|
||||||
|
using skyscraper5.Mpeg2.Psi;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.DvbSis
|
||||||
|
{
|
||||||
|
internal class SisCatContainer : ICatEventHandler
|
||||||
|
{
|
||||||
|
public void NotifyOfCaSystem(CaDescriptor caDescriptor, bool fromPmt = false)
|
||||||
|
{
|
||||||
|
if (caDescriptors == null)
|
||||||
|
caDescriptors = new List<CaDescriptor>();
|
||||||
|
|
||||||
|
caDescriptors.Add(caDescriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<CaDescriptor> caDescriptors;
|
||||||
|
|
||||||
|
public IReadOnlyList<CaDescriptor> CaDescriptors
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (caDescriptors == null)
|
||||||
|
return new List<CaDescriptor>().AsReadOnly();
|
||||||
|
|
||||||
|
return caDescriptors.AsReadOnly();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,11 +9,15 @@ using System.Threading.Tasks;
|
|||||||
namespace skyscraper8.DvbSis
|
namespace skyscraper8.DvbSis
|
||||||
{
|
{
|
||||||
internal interface SisHandler
|
internal interface SisHandler
|
||||||
{
|
{
|
||||||
|
void OnSisCat(int sourcePid, SisCatContainer catContainer);
|
||||||
void OnSisDsaci(ushort currentDsaGroupId, int versionNumber, byte sectionNumber, byte lastSectionNumber, Stream dsaci);
|
void OnSisDsaci(ushort currentDsaGroupId, int versionNumber, byte sectionNumber, byte lastSectionNumber, Stream dsaci);
|
||||||
void OnSisEit(int sourcePid, SisEitContainer eitContainer);
|
void OnSisEit(int sourcePid, SisEitContainer eitContainer);
|
||||||
void OnSisFti(int relatedPid, _0xF0_FramingTimingInformation fti);
|
void OnSisFti(int relatedPid, _0xF0_FramingTimingInformation fti);
|
||||||
void OnSisPat(int sourcePid, SisPatContainer patContainer);
|
void OnSisPat(int sourcePid, SisPatContainer patContainer);
|
||||||
|
void OnSisPmt(int sourcePid, SisPmtContainer pmtContainer);
|
||||||
|
void OnSisSdt(int sourcePid, SisSdtContainer sdtContainer);
|
||||||
|
void OnSisTdt(int sourcePid, SisTdtContainer tdtContainer);
|
||||||
void OnSisTimestamp(int pid, _0x20_DvbT2Timestamp t2Timestamp);
|
void OnSisTimestamp(int pid, _0x20_DvbT2Timestamp t2Timestamp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
47
skyscraper8/DvbSis/SisNitContainer.cs
Normal file
47
skyscraper8/DvbSis/SisNitContainer.cs
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
using skyscraper5.Dvb.Psi;
|
||||||
|
using skyscraper5.Dvb.Psi.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.DvbSis
|
||||||
|
{
|
||||||
|
internal class SisNitContainer : INitEventHandler
|
||||||
|
{
|
||||||
|
public void OnNitNetwork(NitNetwork nitNetwork)
|
||||||
|
{
|
||||||
|
Network = nitNetwork;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnNitTransportStream(ushort networkId, NitTransportStream transportStream)
|
||||||
|
{
|
||||||
|
if (_transportStreams == null)
|
||||||
|
_transportStreams = new List<Tuple<ushort, NitTransportStream>>();
|
||||||
|
|
||||||
|
_transportStreams.Add(new Tuple<ushort, NitTransportStream> (networkId, transportStream ));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetNetworkId(ushort networkId, bool forceOverrite = false)
|
||||||
|
{
|
||||||
|
this.NetworkId = networkId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ushort? NetworkId { get; private set; }
|
||||||
|
public NitNetwork Network { get; private set; }
|
||||||
|
|
||||||
|
private List<Tuple<ushort, NitTransportStream>> _transportStreams;
|
||||||
|
|
||||||
|
public IReadOnlyList<Tuple<ushort,NitTransportStream>> TransportStreams
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_transportStreams == null)
|
||||||
|
return new List<Tuple<ushort, NitTransportStream>>().AsReadOnly();
|
||||||
|
|
||||||
|
return _transportStreams.AsReadOnly();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
20
skyscraper8/DvbSis/SisPmtContainer.cs
Normal file
20
skyscraper8/DvbSis/SisPmtContainer.cs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
using skyscraper5.Mpeg2.Psi;
|
||||||
|
using skyscraper5.Mpeg2.Psi.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.DvbSis
|
||||||
|
{
|
||||||
|
internal class SisPmtContainer : IPmtEventHandler
|
||||||
|
{
|
||||||
|
public void PmtEvent(ProgramMapping result, int pmtPid)
|
||||||
|
{
|
||||||
|
this.ProgramMapping = result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ProgramMapping ProgramMapping { get; private set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -27,12 +27,39 @@ namespace skyscraper8.DvbSis
|
|||||||
PatParser patParser = new PatParser(patContainer);
|
PatParser patParser = new PatParser(patContainer);
|
||||||
patParser.GatherPsi(section, 0);
|
patParser.GatherPsi(section, 0);
|
||||||
_handler.OnSisPat(sourcePid, patContainer);
|
_handler.OnSisPat(sourcePid, patContainer);
|
||||||
break;
|
break;
|
||||||
|
case 0x01:
|
||||||
|
SisCatContainer catContainer = new SisCatContainer();
|
||||||
|
CatParser catParser = new CatParser(catContainer);
|
||||||
|
catParser.GatherPsi(section, 0);
|
||||||
|
_handler.OnSisCat(sourcePid, catContainer);
|
||||||
|
break;
|
||||||
|
case 0x02:
|
||||||
|
SisPmtContainer pmtContainer = new SisPmtContainer();
|
||||||
|
PmtParser pmtParser = new PmtParser(pmtContainer);
|
||||||
|
pmtParser.GatherPsi(section, 0);
|
||||||
|
_handler.OnSisPmt(sourcePid, pmtContainer);
|
||||||
|
break;
|
||||||
|
case 0x40:
|
||||||
|
|
||||||
|
case 0x42:
|
||||||
|
SisSdtContainer sdtContainer = new SisSdtContainer();
|
||||||
|
SdtParser sdtParser = new SdtParser(sdtContainer);
|
||||||
|
sdtParser.GatherPsi(section, 0);
|
||||||
|
_handler.OnSisSdt(sourcePid, sdtContainer);
|
||||||
|
break;
|
||||||
|
case 0x4e:
|
||||||
case 0x50:
|
case 0x50:
|
||||||
SisEitContainer eitContainer = new SisEitContainer();
|
SisEitContainer eitContainer = new SisEitContainer();
|
||||||
EitParser eitParser = new EitParser(eitContainer);
|
EitParser eitParser = new EitParser(eitContainer);
|
||||||
eitParser.GatherPsi(section, sourcePid);
|
eitParser.GatherPsi(section, sourcePid);
|
||||||
_handler.OnSisEit(sourcePid, eitContainer);
|
_handler.OnSisEit(sourcePid, eitContainer);
|
||||||
|
break;
|
||||||
|
case 0x70:
|
||||||
|
SisTdtContainer tdtContainer = new SisTdtContainer();
|
||||||
|
TimetableParser tdtParser = new TimetableParser(tdtContainer, null);
|
||||||
|
tdtParser.GatherPsi(section, sourcePid);
|
||||||
|
_handler.OnSisTdt(sourcePid, tdtContainer);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NotImplementedException(String.Format("Table ID 0x{0:X2} in DVB-SIS PSI/SI not supported yet. To get this fixed, please share a sample of this stream.", section.TableId));
|
throw new NotImplementedException(String.Format("Table ID 0x{0:X2} in DVB-SIS PSI/SI not supported yet. To get this fixed, please share a sample of this stream.", section.TableId));
|
||||||
|
|||||||
46
skyscraper8/DvbSis/SisSdtContainer.cs
Normal file
46
skyscraper8/DvbSis/SisSdtContainer.cs
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
using skyscraper5.Dvb.Psi;
|
||||||
|
using skyscraper5.Dvb.Psi.Model;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.DvbSis
|
||||||
|
{
|
||||||
|
internal class SisSdtContainer : ISdtEventHandler
|
||||||
|
{
|
||||||
|
public ushort? NetworkId { get; private set; }
|
||||||
|
public ushort? TransportStreamId { get; private set; }
|
||||||
|
|
||||||
|
private List<SdtService> sdtServices;
|
||||||
|
public void OnSdtService(ushort transportStreamId, ushort originalNetworkId, SdtService sdtService)
|
||||||
|
{
|
||||||
|
if (sdtServices == null)
|
||||||
|
sdtServices = new List<SdtService>();
|
||||||
|
|
||||||
|
sdtServices.Add(sdtService);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetNetworkId(ushort networkId)
|
||||||
|
{
|
||||||
|
this.NetworkId = networkId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetTransportStreamId(ushort transportStreamId)
|
||||||
|
{
|
||||||
|
this.TransportStreamId = transportStreamId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IReadOnlyList<SdtService> Services
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (sdtServices == null)
|
||||||
|
return new List<SdtService>().AsReadOnly();
|
||||||
|
|
||||||
|
return sdtServices.AsReadOnly();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
skyscraper8/DvbSis/SisTdtContainer.cs
Normal file
19
skyscraper8/DvbSis/SisTdtContainer.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
using skyscraper5.Dvb.Psi;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace skyscraper8.DvbSis
|
||||||
|
{
|
||||||
|
internal class SisTdtContainer : ITdtEventHandler
|
||||||
|
{
|
||||||
|
public DateTime? UtcTime { get; private set; }
|
||||||
|
|
||||||
|
public void OnTdtTime(DateTime utcTime)
|
||||||
|
{
|
||||||
|
this.UtcTime = utcTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"skyscraper8": {
|
"skyscraper8": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"commandLineArgs": "\"G:\\Stash\\utena\\dvb-sis_eutelsat5_12522_v.ts\"",
|
"commandLineArgs": "\"F:\\utena2\\dvb-sis_eutelsat5_12522_v.ts\"",
|
||||||
"remoteDebugEnabled": false
|
"remoteDebugEnabled": false
|
||||||
},
|
},
|
||||||
"Container (Dockerfile)": {
|
"Container (Dockerfile)": {
|
||||||
"commandName": "Docker"
|
"commandName": "Docker"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user