Contents

CVPixelBufferCreateWithIOSurface(_:_:_:_:)

Creates a single pixel buffer for the IO surface that you specify.

Declaration

func CVPixelBufferCreateWithIOSurface(_ allocator: CFAllocator?, _ surface: IOSurfaceRef, _ pixelBufferAttributes: CFDictionary?, _ pixelBufferOut: UnsafeMutablePointer<Unmanaged<CVPixelBuffer>?>) -> CVReturn

Parameters

  • allocator:

    The allocator to use for creating the buffer pool. Pass Kcfallocatordefault for the allocator parameter to use the default allocator. See Predefined Allocators for additional values you can use.

  • surface:

    The IOSurface to use in the pixel buffer.

  • pixelBufferAttributes:

    An optional dictionary that contains the attributes for the pixel buffer. See Pixel Buffer Attribute Keys for possible values.

  • pixelBufferOut:

    On output, the newly created pixel buffer.

Return Value

A Core Video result code. See Result Codes for possible values.

Discussion

Use CVPixelBufferRelease to release ownership of the pixelBufferOut object when you’re done with it.

See Also

Creating pixel buffers