CMSampleBufferGetImageBuffer(_:)
Returns an image buffer that contains the media data.
Declaration
func CMSampleBufferGetImageBuffer(_ sbuf: CMSampleBuffer) -> CVImageBuffer?Parameters
- sbuf:
The
CMSampleBufferbeing interrogated.
Return Value
CVImageBuffer of media data. The result will be NULL if the CMSampleBuffer does not contain a CVImageBuffer, if the CMSampleBuffer contains a CMBlockBuffer, or if there is some other error.
Discussion
The caller doesn’t own the returned buffer, and must retain it explicitly if the caller needs to maintain a reference to it.
See Also
Modifying Sample Buffers
CMSampleBufferGetDataBuffer(_:)CMSampleBufferSetDataBuffer(_:newValue:)CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(_:bufferListSizeNeededOut:bufferListOut:bufferListSize:blockBufferAllocator:blockBufferMemoryAllocator:flags:blockBufferOut:)CMSampleBufferSetDataBufferFromAudioBufferList(_:blockBufferAllocator:blockBufferMemoryAllocator:flags:bufferList:)CMSampleBufferCopyPCMDataIntoAudioBufferList(_:at:frameCount:into:)CMSampleBufferGetAudioStreamPacketDescriptions(_:allocatedSize:packetDescriptionsOut:packetDescriptionsSizeNeededOut:)CMSampleBufferGetAudioStreamPacketDescriptionsPtr(_:packetDescriptionsPointerOut:sizeOut:)