예제 #1
0
        public CVPixelBuffer CreatePixelBuffer()
        {
            IntPtr   pixelBufferOut = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr)));
            CVReturn ret            = CVPixelBufferPoolCreatePixelBuffer(IntPtr.Zero, handle, pixelBufferOut);

            if (ret != CVReturn.Success)
            {
                Marshal.FreeHGlobal(pixelBufferOut);
                throw new Exception("CVPixelBufferPoolCreatePixelBuffer returned " + ret.ToString());
            }

            CVPixelBuffer pixelBuffer = new CVPixelBuffer(Marshal.ReadIntPtr(pixelBufferOut));

            Marshal.FreeHGlobal(pixelBufferOut);
            return(pixelBuffer);
        }
예제 #2
0
        public CVPixelBuffer CreatePixelBuffer()
        {
            IntPtr pixelBufferOut = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (IntPtr)));
            CVReturn ret = CVPixelBufferPoolCreatePixelBuffer (IntPtr.Zero, handle, pixelBufferOut);

            if (ret != CVReturn.Success) {
                Marshal.FreeHGlobal (pixelBufferOut);
                throw new Exception ("CVPixelBufferPoolCreatePixelBuffer returned " + ret.ToString ());
            }

            CVPixelBuffer pixelBuffer = new CVPixelBuffer (Marshal.ReadIntPtr (pixelBufferOut));
            Marshal.FreeHGlobal (pixelBufferOut);
            return pixelBuffer;
        }