CMSampleBufferGetAudioStreamPacketDescriptions(_:allocatedSize:packetDescriptionsOut:packetDescriptionsSizeNeededOut:)
Creates an array of audio stream packet descriptions.
Declaration
func CMSampleBufferGetAudioStreamPacketDescriptions(_ sbuf: CMSampleBuffer, allocatedSize packetDescriptionsSize: Int, packetDescriptionsOut: UnsafeMutablePointer<AudioStreamPacketDescription>?, packetDescriptionsSizeNeededOut: UnsafeMutablePointer<Int>?) -> OSStatusParameters
- sbuf:
CMSampleBufferbeing accessed. - packetDescriptionsSize:
Size of
packetDescriptionsOutas allocated by the caller. - packetDescriptionsOut:
Allocated by the caller, receives the packet descriptions for the samples in the
CMSampleBuffer. If non-NULLandpacketDescriptionsSizeis too small,kFigSampleBufferError_ArrayTooSmallis returned. - packetDescriptionsSizeNeededOut:
Used to query for the correct size required for
packetDescriptionsOut. May beNULL.
Return Value
A result code. See Sample Buffer Error Codes.
Discussion
Creates an array of AudioStreamPacketDescriptions for the variable bytes per packet or variable frames per packet audio data in the provided CMSampleBuffer. Constant bit rate, constant frames-per-packet audio yields a return value of noErr and no packet descriptions.
This API is specific to audio format sample buffers, and will return kCMSampleBufferError_InvalidMediaTypeForOperation if called with a non-audio sample buffer.
See Also
Modifying Sample Buffers
CMSampleBufferGetDataBuffer(_:)CMSampleBufferSetDataBuffer(_:newValue:)CMSampleBufferGetImageBuffer(_:)CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(_:bufferListSizeNeededOut:bufferListOut:bufferListSize:blockBufferAllocator:blockBufferMemoryAllocator:flags:blockBufferOut:)CMSampleBufferSetDataBufferFromAudioBufferList(_:blockBufferAllocator:blockBufferMemoryAllocator:flags:bufferList:)CMSampleBufferCopyPCMDataIntoAudioBufferList(_:at:frameCount:into:)CMSampleBufferGetAudioStreamPacketDescriptionsPtr(_:packetDescriptionsPointerOut:sizeOut:)