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

namespace skyscraper5.Mpeg2.Descriptors
{
	[SkyscraperPlugin]
	[TsDescriptor(0x05,"PMT","TSDT")]
    [BannedTable("SDT")]
    class RegistrationDescriptor : TsDescriptor
    {
        public RegistrationDescriptor(byte[] buffer)
        {
            if (buffer.Length < 4)
                return;
            MemoryStream ms = new MemoryStream(buffer, false);
            FormatIdentifier = ms.ReadUInt32BE();
            AdditionalIdentificationInfo = ms.ReadBytes(ms.GetAvailableBytes());
            this.Valid = true;
        }
        
        public byte[] AdditionalIdentificationInfo { get; private set; }

        public uint FormatIdentifier { get; private set; }
    }
}
