62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using skyscraper5.Mpeg2.Descriptors;
|
|
using skyscraper5.Skyscraper.Scraper;
|
|
using skyscraper5.Skyscraper.Scraper.StreamAutodetection;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using skyscraper5.Dvb.Psi;
|
|
using skyscraper5.Mpeg2;
|
|
using skyscraper5.Skyscraper.Plugins;
|
|
|
|
namespace skyscraper8.EPGCollectorPort.SkyscraperSide
|
|
{
|
|
[SkyscraperPlugin]
|
|
internal class FreesatTdtContestant : Contestant
|
|
{
|
|
public FreesatTdtContestant(int pid)
|
|
: base("Freesat Timestamp", pid)
|
|
{
|
|
}
|
|
|
|
public override void Dispose()
|
|
{
|
|
}
|
|
|
|
public override void DeclareWinner(SkyscraperContext skyscraperContext, int pid, ProgramContext programContext)
|
|
{
|
|
FreesatTunnelScraper freesatScraper = skyscraperContext.PluginContext.FirstOrDefault(x => x is FreesatTunnelScraper) as FreesatTunnelScraper;
|
|
if (freesatScraper == null)
|
|
{
|
|
freesatScraper = new FreesatTunnelScraper();
|
|
freesatScraper.ConnectToStorage(skyscraperContext.DataStorage.GetPluginConnector());
|
|
skyscraperContext.PluginContext.Add(freesatScraper);
|
|
}
|
|
|
|
skyscraperContext.DvbContext.RegisterPacketProcessor(pid, new PsiDecoder(pid, new TimetableParser(freesatScraper, freesatScraper)));
|
|
}
|
|
|
|
public override void Introduce(ProgramContext programContext)
|
|
{
|
|
if (programContext.PrivateDataSpecifier == 0x46534154)
|
|
{
|
|
UserDefinedDescriptor userDefinedDescriptor = programContext.GetFirstUserDefinedDescriptor();
|
|
if (userDefinedDescriptor.DescriptorTag == 0xd1)
|
|
{
|
|
if (userDefinedDescriptor.Data[0] == 0x05)
|
|
{
|
|
if (userDefinedDescriptor.Data[1] == 0x06)
|
|
{
|
|
//Mine.
|
|
Score += 10;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Score = -100;
|
|
}
|
|
}
|
|
}
|