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.IntDescriptors
{
	[SkyscraperPlugin]
	[TsDescriptor(0x13,"INT")]
    internal class IpMacStreamLocationDescriptor : TsDescriptor
    {
        public IpMacStreamLocationDescriptor(byte[] buffer)
        {
            MemoryStream ms = new MemoryStream(buffer, false);
            NetworkId = ms.ReadUInt16BE();
            OriginalNetworkId = ms.ReadUInt16BE();
            TransportStreamId = ms.ReadUInt16BE();
            ServiceId = ms.ReadUInt16BE();
            ComponentTag = ms.ReadUInt8();
        }

        public byte ComponentTag { get; private set; }

        public ushort ServiceId { get; private set; }

        public ushort TransportStreamId { get; private set; }

        public ushort OriginalNetworkId { get; private set; }

        public ushort NetworkId { get; private set; }
    }
}
