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)); }
public static CVPixelBuffer Create(XamCore.IOSurface.IOSurface surface, CVPixelBufferAttributes pixelBufferAttributes = null) { CVReturn result; return(Create(surface, out result, pixelBufferAttributes)); }