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