Esempio n. 1
0
        public static CVPixelBuffer Create(XamCore.IOSurface.IOSurface surface, out CVReturn result, CVPixelBufferAttributes pixelBufferAttributes = null)
        {
            if (surface == null)
            {
                throw new ArgumentNullException(nameof(surface));
            }

            IntPtr pixelBufferPtr;

            result = CVPixelBufferCreateWithIOSurface(
                allocator: IntPtr.Zero,
                surface: surface.Handle,
                pixelBufferAttributes: pixelBufferAttributes?.Dictionary.Handle ?? IntPtr.Zero,
                pixelBufferOut: out pixelBufferPtr
                );

            if (result != CVReturn.Success)
            {
                return(null);
            }

            return(new CVPixelBuffer(pixelBufferPtr, true));
        }
Esempio n. 2
0
        public static CVPixelBuffer Create(XamCore.IOSurface.IOSurface surface, CVPixelBufferAttributes pixelBufferAttributes = null)
        {
            CVReturn result;

            return(Create(surface, out result, pixelBufferAttributes));
        }