<!--
{
  "availability" : [
    "iOS: 11.0.0 - 27.0.0",
    "iPadOS: 11.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.13.0 - 27.0.0",
    "tvOS: 11.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 4.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVQueuedSampleBufferRendering/enqueue(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(pl)AVQueuedSampleBufferRendering(im)enqueueSampleBuffer:"
  },
  "title" : "enqueue(_:)"
}
-->

# enqueue(_:)

Sends a sample buffer to the queue for rendering.

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

## Parameters

`sampleBuffer`

The sample buffer to be enqueued.

## Discussion

For video data, the sample buffer is processed according to the attachments it contains. If it has a true value for its <doc://com.apple.documentation/documentation/CoreMedia/kCMSampleAttachmentKey_DoNotDisplay> attachment, the frame is decoded but not displayed. If it has a `true` value for its <doc://com.apple.documentation/documentation/CoreMedia/kCMSampleAttachmentKey_DisplayImmediately> attachment, the frame is displayed as soon as possible, regardless of its presentation timestamp. Otherwise, the frame is displayed according to its presentation timestamp, relative to the timebase.

To schedule the removal of previous images at a specific timestamp, enqueue a marker sample buffer that doesn’t contain any samples, with the <doc://com.apple.documentation/documentation/CoreMedia/kCMSampleBufferAttachmentKey_EmptyMedia> attachment set to <doc://com.apple.documentation/documentation/CoreFoundation/kCFBooleanTrue>.

> Important:
> Attachments with the `kCMSampleAttachmentKey_` prefix must be set using <doc://com.apple.documentation/documentation/CoreMedia/CMSampleBufferGetSampleAttachmentsArray(_:createIfNecessary:)> and <doc://com.apple.documentation/documentation/CoreFoundation/CFDictionarySetValue(_:_:_:)>.  Attachments with the `kCMSampleBufferAttachmentKey_` prefix must be set via <doc://com.apple.documentation/documentation/CoreMedia/CMSetAttachment(_:key:value:attachmentMode:)>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)