---
title: CMBlockBufferCustomBlockSource
framework: coremedia
role: symbol
role_heading: Structure
path: coremedia/cmblockbuffercustomblocksource
---

# CMBlockBufferCustomBlockSource

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

## Declaration

```swift
struct CMBlockBufferCustomBlockSource
```

## Overview

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()](coremedia/cmblockbuffercustomblocksource/init().md)
- [init(version:AllocateBlock:FreeBlock:refCon:)](coremedia/cmblockbuffercustomblocksource/init(version:allocateblock:freeblock:refcon:).md)

### Properties

- [AllocateBlock](coremedia/cmblockbuffercustomblocksource/allocateblock.md)
- [FreeBlock](coremedia/cmblockbuffercustomblocksource/freeblock.md)
- [refCon](coremedia/cmblockbuffercustomblocksource/refcon.md)
- [version](coremedia/cmblockbuffercustomblocksource/version.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)

## See Also

### Creating a Block Buffer

- [CMBlockBufferCreateEmpty(allocator:capacity:flags:blockBufferOut:)](coremedia/cmblockbuffercreateempty(allocator:capacity:flags:blockbufferout:).md)
- [CMBlockBufferCreateWithMemoryBlock(allocator:memoryBlock:blockLength:blockAllocator:customBlockSource:offsetToData:dataLength:flags:blockBufferOut:)](coremedia/cmblockbuffercreatewithmemoryblock(allocator:memoryblock:blocklength:blockallocator:customblocksource:offsettodata:datalength:flags:blockbufferout:).md)
- [CMBlockBufferCreateWithBufferReference(allocator:referenceBuffer:offsetToData:dataLength:flags:blockBufferOut:)](coremedia/cmblockbuffercreatewithbufferreference(allocator:referencebuffer:offsettodata:datalength:flags:blockbufferout:).md)
- [CMBlockBufferCreateContiguous(allocator:sourceBuffer:blockAllocator:customBlockSource:offsetToData:dataLength:flags:blockBufferOut:)](coremedia/cmblockbuffercreatecontiguous(allocator:sourcebuffer:blockallocator:customblocksource:offsettodata:datalength:flags:blockbufferout:).md)
- [CMBlockBufferFlags](coremedia/cmblockbufferflags.md)
- [Block Buffer Flags](coremedia/block-buffer-flags.md)
- [Custom Block Source Version](coremedia/custom-block-source-version.md)
