---
title: CMBufferValidationCallback
framework: coremedia
role: symbol
role_heading: Type Alias
path: coremedia/cmbuffervalidationcallback
---

# CMBufferValidationCallback

A type alias for a callback that tests whether a buffer is in a valid state to add to a queue.

## Declaration

```swift
typealias CMBufferValidationCallback = (CMBufferQueue, CMBuffer, UnsafeMutableRawPointer?) -> OSStatus
```

## Discussion

Discussion CMBufferQueueEnqueue(_:buffer:) will call this function to validate buffers. Return noErr if the buffer is in a valid state to add. Return a nonzero error code if the buffer should be rejected; CMBufferQueueEnqueue(_:buffer:) will return this error to the caller. If you do not have a more descriptive error code, use kCMBufferQueueError_InvalidBuffer. Callback Parameters

## See Also

### Validating a Queue

- [CMBufferQueueSetValidationHandler(_:_:)](coremedia/cmbufferqueuesetvalidationhandler(_:_:).md)
- [CMBufferValidationHandler](coremedia/cmbuffervalidationhandler.md)
- [CMBufferQueueSetValidationCallback(_:callback:refcon:)](coremedia/cmbufferqueuesetvalidationcallback(_:callback:refcon:).md)
