using skyscraper5.Dvb;
using skyscraper5.Mpeg2;
using skyscraper5.Skyscraper.Plugins;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.Ses.Descriptors
{
	[SkyscraperPlugin]
	[UserDefinedDescriptor(0x01, 0xD1, "Astra SGT")]
	internal class _0xD1_VirtualServiceIdDescriptor : TsDescriptor
	{
		public _0xD1_VirtualServiceIdDescriptor(byte[] buffer) 
		{ 
			if (buffer.Length < 2)
			{
				Valid = false;
				return;
			}

			(buffer[1], buffer[0]) = (buffer[0], buffer[1]);
			VirtualServiceId = BitConverter.ToUInt16(buffer, 0);
			Valid = true;
		}

		public ushort VirtualServiceId { get; }
	}
}
