<!--
{
  "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/CMBlockBufferCustomBlockSource",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@SA@CMBlockBufferCustomBlockSource"
  },
  "title" : "CMBlockBufferCustomBlockSource"
}
-->

# CMBlockBufferCustomBlockSource

A structure to support custom memory allocation and deallocation for a block used in a block buffer.

```
struct CMBlockBufferCustomBlockSource
```

## Overview

This structure allows a client to provide a custom facility for obtaining the memory block to be used in a `CMBlockBuffer`. You use this structure with functions that accept a memory block allocator.

## Topics

### Initializers

[`init()`](/documentation/CoreMedia/CMBlockBufferCustomBlockSource/init())

[`init(version:AllocateBlock:FreeBlock:refCon:)`](/documentation/CoreMedia/CMBlockBufferCustomBlockSource/init(version:AllocateBlock:FreeBlock:refCon:))

### Properties

[`AllocateBlock`](/documentation/CoreMedia/CMBlockBufferCustomBlockSource/AllocateBlock)

The function to allocate memory.

[`FreeBlock`](/documentation/CoreMedia/CMBlockBufferCustomBlockSource/FreeBlock)

A function to call once when the `CMBlockBuffer` is disposed.

[`refCon`](/documentation/CoreMedia/CMBlockBufferCustomBlockSource/refCon)

Contextual information passed to both the allocate and free function calls.

[`version`](/documentation/CoreMedia/CMBlockBufferCustomBlockSource/version)



---

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)