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

# CMBufferQueueGetTotalSize(_:)

Gets the total size of all sample buffers of a buffer queue.

```
func CMBufferQueueGetTotalSize(_ queue: CMBufferQueue) -> Int
```

## Discussion

The total size of the `CMBufferQueue` is the sum of all the individual buffer sizes, as reported by the `getTotalSize` callback (provided to [`CMBufferQueueCreate(allocator:capacity:callbacks:queueOut:)`](/documentation/CoreMedia/CMBufferQueueCreate(allocator:capacity:callbacks:queueOut:))).

This function returns 0 if there are no buffers in the queue.

---

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)