public SharedMemManager(SmVideoInfo videoInfo, int bufferCnt, string mapName) { this.videoInfo = videoInfo; this.mapName = mapName; int sizeOfHdr = Marshal.SizeOf <SharedMemHdr>(); this.sizeOfBitmap = videoInfo.Height * videoInfo.Stride; this.offsetBitmaps = new List <uint>(); uint offset = Align((uint)sizeOfHdr, 256); for (int i = 0; i < bufferCnt; ++i) { this.offsetBitmaps.Add(offset); offset = Align((uint)offset + (uint)this.sizeOfBitmap, 256); } //byte* ptr = (byte*)0; //view.SafeMemoryMappedViewHandle.AcquirePointer(ref ptr); //view.SafeMemoryMappedViewHandle.ReleasePointer(); }
public static int CalcLineSize(SmVideoInfo vi) { return(CalcLineSize((SmPixelTypes)vi.PixelType, vi.Width)); }