using System; using System.Collections.Generic; using System.Linq; namespace ScreenConnect; public abstract class YuvCodecBase : ScreenCodec { protected int StreamCount { get; } protected List Coders { get; } protected YuvCodecBase(int streamCount, Func coderCreatorFunc) { StreamCount = streamCount; Coders = EnumerableExtensions.Generate(streamCount, coderCreatorFunc).ToList(); } protected unsafe override void Process(byte* data, int width, int height, int stride) { int num = height * width; int num2 = height * width; int num3 = num + num2 * 2; if (num3 != 0) { fixed (byte* yuvPointer = new byte[num3]) { Process(data, width, height, stride, num, num2, num3, yuvPointer); } } } protected unsafe abstract void Process(byte* data, int width, int height, int stride, int lumaSize, int chromaSize, int yuvSize, byte* yuvPointer); }