Instance Method

enqueue(_:)

Sends a sample buffer for display.

Declaration

func enqueue(_ sampleBuffer: CMSampleBuffer)

Parameters

sampleBuffer

The sample buffer to display.

Discussion

If sampleBuffer has the kCMSampleAttachmentKey_DoNotDisplay attachment set to kCFBooleanTrue, the frame will be decoded but not displayed.

If sampleBuffer has the kCMSampleAttachmentKey_DisplayImmediately attachment set to kCFBooleanTrue, the decoded image will be displayed as soon as possible, replacing all previously enqueued images regardless of their timestamps.

Otherwise, the decoded image will be displayed at the sampleBuffer output presentation timestamp, as interpreted by the controlTimebase property (or the mach_absolute_time timeline if there is no control timebase).

To schedule the removal of previous images at a specific timestamp, enqueue a marker sample buffer containing no samples, with the kCMSampleBufferAttachmentKey_EmptyMedia attachment set to kCFBooleanTrue.