Function

CMSampleBufferGetSampleAttachmentsArray

Returns a reference to a CMSampleBuffer's immutable array of mutable sample attachments dictionaries (one dictionary per sample in the CMSampleBuffer).

Declaration

CFArrayRef CMSampleBufferGetSampleAttachmentsArray(CMSampleBufferRef sbuf, Boolean createIfNecessary);

Parameters

sbuf

The CMSampleBuffer being interrogated.

createIfNecessary

Specifies whether an empty array should be created (if there are no sample attachments yet).

Return Value

A reference to the CMSampleBuffer's immutable array of mutable sample attachments dictionaries (one dictionary per sample in the CMSampleBuffer). NULL is returned if there is an error

Discussion

Attachments can then be added/removed directly by the caller, using Core Foundation APIs. On return, the caller does not own the returned array of attachments dictionaries, and must retain it if the caller needs to maintain a reference to it. If there are no sample attachments yet, and createIfNecessary is true, a new CFArray containing N empty CFMutableDictionaries is returned (where N is the number of samples in the CMSampleBuffer), so that attachments can be added directly by the caller. If there are no sample attachments yet, and createIfNecessary is false, NULL is returned. Once the CFArray has been created, subsequent calls will return it, even if there are still no sample attachments in the array.

See Also

Inspecting Sample Buffers

CMSampleBufferGetDataBuffer

Returns a CMSampleBuffer's CMBlockBuffer of media data.

CMSampleBufferGetDecodeTimeStamp

Returns the numerically earliest decode timestamp of all the samples in a CMSampleBuffer.

CMSampleBufferGetDuration

Returns the total duration of a CMSampleBuffer.

CMSampleBufferGetFormatDescription

Returns the format description of the samples in a CMSampleBuffer.

CMSampleBufferGetImageBuffer

Returns a sample buffer's CVImageBuffer of media data.

CMSampleBufferGetNumSamples

Returns the number of media samples in a CMSampleBuffer.

CMSampleBufferGetOutputDecodeTimeStamp

Returns the output decode timestamp of the CMSampleBuffer.

CMSampleBufferGetOutputDuration

Returns the output duration of a CMSampleBuffer.

CMSampleBufferGetOutputPresentationTimeStamp

Returns the output presentation timestamp of the CMSampleBuffer.

CMSampleBufferGetOutputSampleTimingInfoArray

Retrieves an array of output CMSampleTimingInfo structs, one for each sample in a CMSampleBuffer.

CMSampleBufferGetPresentationTimeStamp

Returns the numerically earliest presentation timestamp of all the samples in a CMSampleBuffer.

CMSampleBufferGetSampleSize

Returns the size in bytes of a specified sample in a CMSampleBuffer.

CMSampleBufferGetSampleSizeArray

Retrieves an array of sample sizes, one for each sample in a CMSampleBuffer.

CMSampleBufferGetSampleTimingInfo

Retrieves a CMSampleTimingInfo struct describing a specified sample in a CMSampleBuffer.

CMSampleBufferGetSampleTimingInfoArray

Retrieves an array of CMSampleTimingInfo structs, one for each sample in a CMSampleBuffer.

CMSampleBufferGetTotalSampleSize

Returns the total size in bytes of sample data in a CMSampleBuffer.

CMSampleBufferHasDataFailed

Indicates if the sample buffer's data loading request has failed.

CMSampleBufferDataIsReady

Determines if the sample buffer's data is ready.

CMSampleBufferIsValid

Queries whether a sample buffer is still valid.

CMSampleBufferGetTypeID

Returns the CFTypeID of CMSampleBuffer objects.