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.Dvb.DataBroadcasting.DataCarouselDescriptors
{
	[SkyscraperPlugin]
	[TsDescriptor(0x05,"DataCarousel")]
    class Crc32Descriptor : TsDescriptor
    {
        public Crc32Descriptor(byte[] buffer)
        {
            if (buffer.Length != 4)
            {
                Valid = false;
                return;
            }

            MemoryStream ms = new MemoryStream(buffer, false);
            CRC_32 = ms.ReadUInt32BE();
            ms.Close();
            Valid = true;
        }
        
        public uint CRC_32 { get; private set; }
    }
}
