---
title: "enqueue(_:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avsamplebufferdisplaylayer/enqueue(_:)"
---

# enqueue(_:)

Sends a sample buffer for display.

## Declaration

```swift
func enqueue(_ sampleBuffer: CMSampleBuffer)
```

## Parameters

- `sampleBuffer`: The sample buffer to display.

## Discussion

Discussion Apple discourages the use of this symbol in iOS 17, tvOS 17, and macOS 14 and later. Use enqueue(_:) on the sampleBufferRenderer instead. 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. important: Attachments with the kCMSampleAttachmentKey_* prefix must be set via CMSampleBufferGetSampleAttachmentsArray(_:createIfNecessary:) and CFDictionarySetValue(_:_:_:). Attachments with the kCMSampleBufferAttachmentKey_* prefix must be set via CMSetAttachment(_:key:value:attachmentMode:).
