internal static VideoFrame CreateFrame(int width, int height, VideoCameraFrame cameraFrame)
        {
            var rv = new VideoFrame();

            if (cameraFrame.ImageLayout == VideoFrameLayout.Monochrome)
            {
                rv.pixels = new int[height, width];
                rv.pixels = (int[,])cameraFrame.Pixels;
            }
            else if (cameraFrame.ImageLayout == VideoFrameLayout.Color)
            {
                rv.pixels = new int[height, width, 3];
                rv.pixels = (int[, ,])cameraFrame.Pixels;
            }
            else if (cameraFrame.ImageLayout == VideoFrameLayout.BayerRGGB)
            {
                throw new NotSupportedException();
            }
            else
                throw new NotSupportedException();

            rv.frameNumber = cameraFrame.FrameNumber;
            rv.exposureStartTime = null;
            rv.exposureDuration = null;
            rv.imageInfo = null;

            return rv;
        }
        internal static VideoFrame FakeFrame(int width, int height)
        {
            var rv = new VideoFrame();
            s_Counter++;
            rv.frameNumber = s_Counter;

            rv.pixels = new int[0, 0];
            return rv;
        }