<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMBufferQueueCreate(allocator:capacity:callbacks:queueOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMBufferQueueCreate"
  },
  "title" : "CMBufferQueueCreate(allocator:capacity:callbacks:queueOut:)"
}
-->

# CMBufferQueueCreate(allocator:capacity:callbacks:queueOut:)

Creates a buffer queue with callbacks to inspect buffers.

```
func CMBufferQueueCreate(allocator: CFAllocator?, capacity: CMItemCount, callbacks: UnsafePointer<CMBufferCallbacks>, queueOut: UnsafeMutablePointer<CMBufferQueue?>) -> OSStatus
```

## Parameters

`allocator`

The allocator to use for allocating the `CMBufferQueue` object. Pass `kCFAllocatorDefault` to use the default allocator.

`capacity`

Maximum number of buffers in the queue.  Pass 0 to create a queue that will grow as needed.

`callbacks`

Callbacks the queue should use to interrogate the buffer objects.  This struct is copied internally, so the client can pass a pointer to a temporary struct on the stack.

`queueOut`

On Output, the newly created `CMBufferQueue`.

## Return Value

A result code.

## Discussion

On return, the caller owns the returned `CMBufferQueue`, and must release it when done with it.

---

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)