<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.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/CMSimpleQueueCreate(allocator:capacity:queueOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMSimpleQueueCreate"
  },
  "title" : "CMSimpleQueueCreate(allocator:capacity:queueOut:)"
}
-->

# CMSimpleQueueCreate(allocator:capacity:queueOut:)

Creates a queue that has the specified capacity.

```
func CMSimpleQueueCreate(allocator: CFAllocator?, capacity: Int32, queueOut: UnsafeMutablePointer<CMSimpleQueue?>) -> OSStatus
```

## Parameters

`allocator`

Allocator used to allocate storage for the queue.

`capacity`

Capacity of the queue (maximum number of elements holdable at any given time). Required (must not be `0`). Must be a positive value.

`queueOut`

On output, a reference to the newly created queue. Must not be `NULL`.

## Return Value

A result code. See [Simple Queue Error Codes](/documentation/CoreMedia/simple-queue-errors).

## Discussion

On return, the caller owns the returned `CMSimpleQueue`, 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)