skyscraper8/skyscraper8/Mhp/Descriptors/0x66_OcapAbstractServiceDescriptor.cs
2025-10-04 20:51:01 +02:00

40 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using skyscraper5.Mpeg2;
using skyscraper5.Skyscraper.IO;
using skyscraper5.Skyscraper.Plugins;
namespace skyscraper5.Mhp.Descriptors
{
/// <summary>
/// Found at https://books.google.de/books?id=L5vcAwAAQBAJ&pg=PA96&lpg=PA96&dq=%22Abstract+Service+Descriptor%22&source=bl&ots=BnUrTob2Qr&sig=ACfU3U3tDpf8lRpWaMKlwkizTiDCRItjuA&hl=de&sa=X&ved=2ahUKEwiMt_S7wen3AhU357sIHb3EBLwQ6AF6BAg7EAM#v=onepage&q=%22Abstract%20Service%20Descriptor%22&f=false
/// </summary>
[SkyscraperPlugin]
[TsDescriptor(0x66,"AIT")]
class OcapAbstractServiceDescriptor : TsDescriptor
{
public OcapAbstractServiceDescriptor(byte[] buffer)
{
MemoryStream ms = new MemoryStream(buffer);
ushort readUInt16Be = ms.ReadUInt16BE();
ServiceId = (uint)(readUInt16Be << 8);
ServiceId += ms.ReadUInt8();
AutoSelect = (ms.ReadUInt8() & 0x01) != 0;
ServiceName = Encoding.ASCII.GetString(ms.ReadBytes(ms.GetAvailableBytes()));
Valid = true;
}
public string ServiceName { get; private set; }
public bool AutoSelect { get; private set; }
public uint ServiceId { get; private set; }
}
}