using skyscraper5.Mpeg2;
using skyscraper5.src.Mpeg2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper5.UI.Overrides
{
	internal class PmtCounter : IPsiDecoderTransformer
	{
		public void Transform(PsiDecoder psiDecoder)
		{
			psiDecoder.OnCrcError += PsiDecoder_OnCrcError;
			psiDecoder.OnValidSection += PsiDecoder_OnValidSection;
		}

		private void PsiDecoder_OnValidSection(PsiSection section, int pid, long available)
		{
			ValidSection++;
		}

		private void PsiDecoder_OnCrcError(PsiSection section, int pid, long available)
		{
			CrcErrors++;
		}

		public long CrcErrors { get; private set; }
		public long ValidSection { get; private set; }
	}
}
