Contents

copyPixelBuffer(forItemTime:itemTimeForDisplay:)

Retrieves an image that is appropriate for display at the specified item time, and marks the image as acquired.

Declaration

func copyPixelBuffer(forItemTime itemTime: CMTime, itemTimeForDisplay outItemTimeForDisplay: UnsafeMutablePointer<CMTime>?) -> CVPixelBuffer?

Parameters

  • itemTime:

    The time at which you want to retrieve the image from the item.

  • outItemTimeForDisplay:

    The time by which you intend to use the returned pixel buffer. You may specify nil for this parameter if you do not have a specific deadline.

Return Value

A pixel buffer containing the image data to display or nil if nothing should be displayed at the specified time. The caller is responsible for calling CVBufferRelease on the returned data when it is no longer needed.

Discussion

Typically, you call this method in response to a CVDisplayLink callback or a CADisplayLink delegate method call when the hasNewPixelBuffer(forItemTime:) method also returns true.

After calling this method, the video output object marks the pixel buffer data as having been acquired. This causes the hasNewPixelBuffer(forItemTime:) method to return false unless newer data becomes available.

See Also

Getting pixel buffer data