---
title: "CMSampleBufferMakeDataReady(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmsamplebuffermakedataready(_:)"
---

# CMSampleBufferMakeDataReady(_:)

Makes the sample buffer’s data ready for use by invoking its callback to load the data.

## Declaration

```swift
func CMSampleBufferMakeDataReady(_ sbuf: CMSampleBuffer) -> OSStatus
```

## Parameters

- `sbuf`: The sample buffer being modified.

## Return Value

Return Value A result code. See Sample Buffer Error Codes.

## Discussion

Discussion The CMSampleBufferMakeDataReadyCallback is passed in by the client during creation. It must return 0 if successful, and in that case, CMSampleBufferMakeDataReady sets the data readiness of the CMSampleBuffer to true. If the sample buffer isn’t ready, and there’s no CMSampleBufferMakeDataReadyCallback to call, kCMSampleBufferError_BufferNotReady will be returned. Similarly, if the CMSampleBuffer isn’t ready, and the CMSampleBufferMakeDataReadyCallback fails and returns an error, CMSampleBuffer will be returned.

## See Also

### Determining Readiness

- [CMSampleBufferDataIsReady(_:)](coremedia/cmsamplebufferdataisready(_:).md)
- [CMSampleBufferSetDataReady(_:)](coremedia/cmsamplebuffersetdataready(_:).md)
- [CMSampleBufferSetDataFailed(_:status:)](coremedia/cmsamplebuffersetdatafailed(_:status:).md)
- [CMSampleBufferHasDataFailed(_:statusOut:)](coremedia/cmsamplebufferhasdatafailed(_:statusout:).md)
- [CMSampleBufferTrackDataReadiness(_:sampleBufferToTrack:)](coremedia/cmsamplebuffertrackdatareadiness(_:samplebuffertotrack:).md)
