Removed the discrimination between "TBS-style GS encapsulation" and "Digital Devices style GS encapsulation" as it was factually wrong.
This commit is contained in:
parent
39f8e936f3
commit
3da10ae897
@ -71,7 +71,7 @@ namespace skyscraper8.GSE
|
|||||||
HandleGseHem(ms);
|
HandleGseHem(ms);
|
||||||
break;
|
break;
|
||||||
default: //0 = generic packetized, 1 = generic continouus, 2 = gse, 3 = ts
|
default: //0 = generic packetized, 1 = generic continouus, 2 = gse, 3 = ts
|
||||||
logger.Warn(string.Format("Unsupported: TS/GS field says 0x{0:X2}", tsGsField));
|
logger.Warn(string.Format("Unsupported: TS/GS field says 0x{0:X2}, please share a sample of this stream.", tsGsField));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,16 +6,15 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using skyscraper8.GSE;
|
|
||||||
|
|
||||||
namespace skyscraper5.src.Skyscraper
|
namespace skyscraper8.GSE
|
||||||
{
|
{
|
||||||
internal class DigitalDevicesBbFrameReader : ITsPacketProcessor
|
internal class Stid135BbFrameReader : ITsPacketProcessor
|
||||||
{
|
{
|
||||||
private IGsEventHandler mpeEventHandler;
|
private IGsEventHandler mpeEventHandler;
|
||||||
private BbframeDeencapsulator deencapsulator;
|
private BbframeDeencapsulator deencapsulator;
|
||||||
|
|
||||||
public DigitalDevicesBbFrameReader(IGsEventHandler mpeEventHandler)
|
public Stid135BbFrameReader(IGsEventHandler mpeEventHandler)
|
||||||
{
|
{
|
||||||
this.mpeEventHandler = mpeEventHandler;
|
this.mpeEventHandler = mpeEventHandler;
|
||||||
}
|
}
|
||||||
@ -27,10 +26,10 @@ namespace skyscraper5.src.Skyscraper
|
|||||||
public void PushPacket(TsPacket packet)
|
public void PushPacket(TsPacket packet)
|
||||||
{
|
{
|
||||||
byte[] packets = packet.RawPacket;
|
byte[] packets = packet.RawPacket;
|
||||||
int pid = (packets[1]);
|
int pid = packets[1];
|
||||||
pid &= 0x01f;
|
pid &= 0x01f;
|
||||||
pid <<= 8;
|
pid <<= 8;
|
||||||
pid |= (packets[2]);
|
pid |= packets[2];
|
||||||
if (pid != 0x010e)
|
if (pid != 0x010e)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -5,6 +5,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using log4net;
|
||||||
using skyscraper5.Dvb;
|
using skyscraper5.Dvb;
|
||||||
using skyscraper5.Dvb.DataBroadcasting;
|
using skyscraper5.Dvb.DataBroadcasting;
|
||||||
using skyscraper5.Mpeg2;
|
using skyscraper5.Mpeg2;
|
||||||
@ -12,13 +13,12 @@ using skyscraper5.Skyscraper.IO;
|
|||||||
|
|
||||||
namespace skyscraper5.Skyscraper
|
namespace skyscraper5.Skyscraper
|
||||||
{
|
{
|
||||||
internal class Tbs6903xGsReader : ITsPacketProcessor
|
internal class OldStreamReaderDetector : ITsPacketProcessor
|
||||||
{
|
{
|
||||||
private readonly IGsEventHandler mpeEventHandler;
|
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
|
||||||
|
|
||||||
public Tbs6903xGsReader(IGsEventHandler mpeEventHandler)
|
public OldStreamReaderDetector()
|
||||||
{
|
{
|
||||||
this.mpeEventHandler = mpeEventHandler;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private MemoryStream outbuf;
|
private MemoryStream outbuf;
|
||||||
@ -27,13 +27,16 @@ namespace skyscraper5.Skyscraper
|
|||||||
|
|
||||||
public void PushPacket(TsPacket packet)
|
public void PushPacket(TsPacket packet)
|
||||||
{
|
{
|
||||||
byte[] packets = packet.RawPacket;
|
if (annoncementDone)
|
||||||
int pid = (packets[1]);
|
return;
|
||||||
pid &= 0x01f;
|
|
||||||
pid <<= 8;
|
byte[] packets = packet.RawPacket;
|
||||||
pid |= (packets[2]);
|
int pid = (packets[1]);
|
||||||
if (pid != 0x0118)
|
pid &= 0x01f;
|
||||||
return;
|
pid <<= 8;
|
||||||
|
pid |= (packets[2]);
|
||||||
|
if (pid != 0x0118)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((packets[8] & 0xff) == 0xd0)
|
if ((packets[8] & 0xff) == 0xd0)
|
||||||
{
|
{
|
||||||
@ -45,10 +48,9 @@ namespace skyscraper5.Skyscraper
|
|||||||
{
|
{
|
||||||
if (!annoncementDone)
|
if (!annoncementDone)
|
||||||
{
|
{
|
||||||
mpeEventHandler.GsIpTrafficDetected();
|
logger.WarnFormat("It seems like you're using a StreamReader.dll version which interferes with the STiD135's BBFrame encapsulation. Try updating to 1.2.5.208, this is known to work.");
|
||||||
annoncementDone = true;
|
annoncementDone = true;
|
||||||
}
|
}
|
||||||
mpeEventHandler.OnIpDatagram(0x0118, ipPacket);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
outbuf = new MemoryStream();
|
outbuf = new MemoryStream();
|
||||||
@ -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.GSE;
|
||||||
using skyscraper8.Skyscraper.Net;
|
using skyscraper8.Skyscraper.Net;
|
||||||
using skyscraper8.Skyscraper.Scraper;
|
using skyscraper8.Skyscraper.Scraper;
|
||||||
using Tsubasa.IO;
|
using Tsubasa.IO;
|
||||||
@ -293,16 +294,14 @@ namespace skyscraper5.Skyscraper.Scraper
|
|||||||
LogEvent(SkyscraperContextEvent.StartPacketProcessing);
|
LogEvent(SkyscraperContextEvent.StartPacketProcessing);
|
||||||
if (buffer[0] == 0x47 && buffer[1] == 0x41 && buffer[2] == 0x18 && (buffer[3] & 0x10) != 0 && buffer[4] == 0x00 && buffer[5] == 0x80 && buffer[6] == 0x00)
|
if (buffer[0] == 0x47 && buffer[1] == 0x41 && buffer[2] == 0x18 && (buffer[3] & 0x10) != 0 && buffer[4] == 0x00 && buffer[5] == 0x80 && buffer[6] == 0x00)
|
||||||
{
|
{
|
||||||
DvbContext.RegisterPacketProcessor(0x0118, new Tbs6903xGsReader(this));
|
DvbContext.RegisterPacketProcessor(0x0118, new OldStreamReaderDetector());
|
||||||
UiJunction?.SetGseMode();
|
|
||||||
LogEvent(SkyscraperContextEvent.SpecialTsMode, "TBS 6903-X GSE Pseudo TS detected.");
|
|
||||||
SpecialTsType = 2;
|
SpecialTsType = 2;
|
||||||
}
|
}
|
||||||
if (buffer[0] == 0x47 && buffer[1] == 0x41 && buffer[2] == 0x0e && (buffer[3] & 0x10) != 0 && buffer[4] == 0x00 && buffer[5] == 0x80 && buffer[6] == 0x00)
|
if (buffer[0] == 0x47 && buffer[1] == 0x41 && buffer[2] == 0x0e && (buffer[3] & 0x10) != 0 && buffer[4] == 0x00 && buffer[5] == 0x80 && buffer[6] == 0x00)
|
||||||
{
|
{
|
||||||
DvbContext.RegisterPacketProcessor(0x010e, new DigitalDevicesBbFrameReader(this));
|
DvbContext.RegisterPacketProcessor(0x010e, new Stid135BbFrameReader(this));
|
||||||
UiJunction?.SetGseMode();
|
UiJunction?.SetGseMode();
|
||||||
LogEvent(SkyscraperContextEvent.SpecialTsMode, "Digital Devices BBFrame Pseudo TS detected.");
|
LogEvent(SkyscraperContextEvent.SpecialTsMode, "STiD135 encapsulated GS detected.");
|
||||||
SpecialTsType = 3;
|
SpecialTsType = 3;
|
||||||
}
|
}
|
||||||
firstPacketDone = true;
|
firstPacketDone = true;
|
||||||
@ -339,10 +338,7 @@ namespace skyscraper5.Skyscraper.Scraper
|
|||||||
{
|
{
|
||||||
if (!DvbContext.IsPidProcessorPresent(0x0118))
|
if (!DvbContext.IsPidProcessorPresent(0x0118))
|
||||||
{
|
{
|
||||||
DvbContext.RegisterPacketProcessor(0x0118, new Tbs6903xGsReader(this));
|
DvbContext.RegisterPacketProcessor(0x0118, new OldStreamReaderDetector());
|
||||||
UiJunction?.SetGseMode();
|
|
||||||
LogEvent(SkyscraperContextEvent.SpecialTsMode, "TBS 6903-X GSE Pseudo TS detected.");
|
|
||||||
SpecialTsType = 2;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -357,9 +353,9 @@ namespace skyscraper5.Skyscraper.Scraper
|
|||||||
{
|
{
|
||||||
if (!DvbContext.IsPidProcessorPresent(0x010e))
|
if (!DvbContext.IsPidProcessorPresent(0x010e))
|
||||||
{
|
{
|
||||||
DvbContext.RegisterPacketProcessor(0x010e, new DigitalDevicesBbFrameReader(this));
|
DvbContext.RegisterPacketProcessor(0x010e, new Stid135BbFrameReader(this));
|
||||||
UiJunction?.SetGseMode();
|
UiJunction?.SetGseMode();
|
||||||
LogEvent(SkyscraperContextEvent.SpecialTsMode, "Digital Devices BBFRAME data TS detected.");
|
LogEvent(SkyscraperContextEvent.SpecialTsMode, "STiD135 encapsulated GS detected.");
|
||||||
SpecialTsType = 3;
|
SpecialTsType = 3;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user