---
title: CMBlockBuffer
framework: coremedia
role: collectionGroup
role_heading: API Collection
path: coremedia/cmblockbuffer-api
---

# CMBlockBuffer

An object the system uses to move blocks of memory through a processing system.

## Overview

Overview A block buffer is a CFType object that represents a contiguous range of data offsets (from zero to CMBlockBufferGetDataLength(_:)) across a possibly noncontiguous memory region. The memory region contains memory blocks and buffer references. The buffer references can in turn refer to additional regions. CMBlockBuffer uses CMAttachmentBearerProtocol to propagate attachments.

## Topics

### 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)
- [CMBlockBufferCustomBlockSource](coremedia/cmblockbuffercustomblocksource.md)
- [Custom Block Source Version](coremedia/custom-block-source-version.md)

### Modifying a Block Buffer

- [CMBlockBufferAppendMemoryBlock(_:memoryBlock:length:blockAllocator:customBlockSource:offsetToData:dataLength:flags:)](coremedia/cmblockbufferappendmemoryblock(_:memoryblock:length:blockallocator:customblocksource:offsettodata:datalength:flags:).md)
- [CMBlockBufferAppendBufferReference(_:targetBBuf:offsetToData:dataLength:flags:)](coremedia/cmblockbufferappendbufferreference(_:targetbbuf:offsettodata:datalength:flags:).md)
- [CMBlockBufferAssureBlockMemory(_:)](coremedia/cmblockbufferassureblockmemory(_:).md)
- [CMBlockBufferAccessDataBytes(_:atOffset:length:temporaryBlock:returnedPointerOut:)](coremedia/cmblockbufferaccessdatabytes(_:atoffset:length:temporaryblock:returnedpointerout:).md)
- [CMBlockBufferCopyDataBytes(_:atOffset:dataLength:destination:)](coremedia/cmblockbuffercopydatabytes(_:atoffset:datalength:destination:).md)
- [CMBlockBufferReplaceDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)](coremedia/cmblockbufferreplacedatabytes(with:blockbuffer:offsetintodestination:datalength:).md)
- [CMBlockBufferFillDataBytes(with:blockBuffer:offsetIntoDestination:dataLength:)](coremedia/cmblockbufferfilldatabytes(with:blockbuffer:offsetintodestination:datalength:).md)

### Inspecting a Block Buffer

- [CMBlockBufferGetDataPointer(_:atOffset:lengthAtOffsetOut:totalLengthOut:dataPointerOut:)](coremedia/cmblockbuffergetdatapointer(_:atoffset:lengthatoffsetout:totallengthout:datapointerout:).md)
- [CMBlockBufferGetDataLength(_:)](coremedia/cmblockbuffergetdatalength(_:).md)
- [CMBlockBufferIsRangeContiguous(_:atOffset:length:)](coremedia/cmblockbufferisrangecontiguous(_:atoffset:length:).md)
- [CMBlockBufferIsEmpty(_:)](coremedia/cmblockbufferisempty(_:).md)

### Accessing the Type Identifier

- [CMBlockBufferGetTypeID()](coremedia/cmblockbuffergettypeid().md)

### Data Types

- [CMBlockBuffer](coremedia/cmblockbuffer.md)
- [CMBlockBufferProtocol](coremedia/cmblockbufferprotocol.md)

### Errors

- [Block Buffer Error Codes](coremedia/block-buffer-error-codes.md)

## See Also

### Sample Processing

- [CMSampleBuffer](coremedia/cmsamplebuffer-api.md)
- [CMTaggedBufferGroup](coremedia/cmtaggedbuffergroup.md)
- [CMFormatDescription](coremedia/cmformatdescription-api.md)
- [CMAttachment](coremedia/cmattachment-api.md)
- [CMTaggedBuffer](coremedia/cmtaggedbuffer.md)
- [CMMutableDataBlockBuffer](coremedia/cmmutabledatablockbuffer.md)
- [CMReadOnlyDataBlockBuffer](coremedia/cmreadonlydatablockbuffer.md)
- [CMReadySampleBuffer](coremedia/cmreadysamplebuffer.md)
- [CMSampleDataReference](coremedia/cmsampledatareference.md)
- [CMTaggedDynamicBuffer](coremedia/cmtaggeddynamicbuffer.md)
