Function

CMSampleBufferGetImageBuffer(_:)

Returns a sample buffer's CVImageBuffer of media data.

Declaration

func CMSampleBufferGetImageBuffer(_ sbuf: CMSampleBuffer) -> CVImageBuffer?

Parameters

sbuf

The CMSampleBuffer being 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 does not own the returned buffer, and must retain it explicitly if the caller needs to maintain a reference to it.

See Also

Inspecting Sample Buffers

func CMSampleBufferGetDataBuffer(CMSampleBuffer) -> CMBlockBuffer?

Returns a CMSampleBuffer's CMBlockBuffer of media data.

func CMSampleBufferGetDecodeTimeStamp(CMSampleBuffer) -> CMTime

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

func CMSampleBufferGetDuration(CMSampleBuffer) -> CMTime

Returns the total duration of a CMSampleBuffer.

func CMSampleBufferGetFormatDescription(CMSampleBuffer) -> CMFormatDescription?

Returns the format description of the samples in a CMSampleBuffer.

func CMSampleBufferGetNumSamples(CMSampleBuffer) -> CMItemCount

Returns the number of media samples in a CMSampleBuffer.

func CMSampleBufferGetOutputDecodeTimeStamp(CMSampleBuffer) -> CMTime

Returns the output decode timestamp of the CMSampleBuffer.

func CMSampleBufferGetOutputDuration(CMSampleBuffer) -> CMTime

Returns the output duration of a CMSampleBuffer.

func CMSampleBufferGetOutputPresentationTimeStamp(CMSampleBuffer) -> CMTime

Returns the output presentation timestamp of the CMSampleBuffer.

func CMSampleBufferGetPresentationTimeStamp(CMSampleBuffer) -> CMTime

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

func CMSampleBufferGetSampleAttachmentsArray(CMSampleBuffer, createIfNecessary: Bool) -> CFArray?

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

func CMSampleBufferGetSampleSize(CMSampleBuffer, at: CMItemIndex) -> Int

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

func CMSampleBufferGetTotalSampleSize(CMSampleBuffer) -> Int

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

func CMSampleBufferDataIsReady(CMSampleBuffer) -> Bool

Determines if the sample buffer's data is ready.

func CMSampleBufferIsValid(CMSampleBuffer) -> Bool

Queries whether a sample buffer is still valid.

func CMSampleBufferGetTypeID() -> CFTypeID

Returns the CFTypeID of CMSampleBuffer objects.