CMBlockBuffer

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

Overview

A CMBlockBuffer 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 is composed of memory blocks and buffer references. The buffer references can in turn refer to additional regions. CMBlockBuffer uses CMAttachment protocol to propagate attachments.

Topics

Creating Block Buffers

CMBlockBufferCreateWithMemoryBlock

Creates a new CMBlockBuffer backed by a memory block (or promise thereof).

CMBlockBufferCreateContiguous

Creates a new CMBlockBuffer containing a contiguous copy of, or reference to, the data specified by the parameters.

CMBlockBufferCreateWithBufferReference

Creates a new CMBlockBuffer that refers to another CMBlockBuffer.

CMBlockBufferCreateEmpty

Creates an empty CMBlockBuffer.

Modifying Block Buffers

CMBlockBufferAppendBufferReference

Adds a CMBlockBuffer reference to an existing CMBlockBuffer.

CMBlockBufferAppendMemoryBlock

Adds a memory block to an existing CMBlockBuffer.

CMBlockBufferAccessDataBytes

Accesses potentially noncontiguous data in a CMBlockBuffer.

CMBlockBufferFillDataBytes

Fills the destination buffer with the specified data byte.

CMBlockBufferReplaceDataBytes

Copies bytes from a given memory block into a CMBlockBuffer, replacing bytes in the underlying data blocks.

CMBlockBufferAssureBlockMemory

Assures all memory blocks in a CMBlockBuffer are allocated.

CMBlockBufferCopyDataBytes

Copies bytes from a CMBlockBuffer into a provided memory area.

Inspecting Block Buffers

CMBlockBufferGetDataLength

Obtains the total length of data reachable via a CMBlockBuffer.

CMBlockBufferGetDataPointer

Gains access to the data represented by a CMBlockBuffer.

CMBlockBufferIsEmpty

Determines whether the given CMBlockBuffer is empty.

CMBlockBufferIsRangeContiguous

Determines whether the specified range within the given CMBlockBuffer is contiguous.

CMBlockBufferGetTypeID

Obtains the CoreFoundation type ID for the CMBlockBuffer type.

Data Types

CMBlockBufferRef

A reference to a CMBlockBuffer object.

CMBlockBufferFlags

Type used for parameters containing CMBlockBuffer feature and control flags.

CMBlockBufferCustomBlockSource

Structure to support custom memory allocation and/or deallocation for the block used in a CMBlockBuffer.

Constants

CMBlockBuffer Flags

Flags controlling behaviors and features of CMBlockBuffer APIs.

Custom Block Source Version

Provides the custom block source version used in a CMBlockBuffer.

Block Buffer Error Codes

This table lists result codes defined for CMBlockBuffer APIs.

See Also

Sample Processing

CMSampleBuffer

An object containing zero or more media samples of a uniform media type.

CMFormatDescription

A media format descriptor that describes the samples in a sample buffer.

CMAttachment

An API for attaching additional metadata to a sample buffer.