Contents

CMBufferQueueCallForEachBuffer(_:callback:refcon:)

Calls a function for every buffer in a queue.

Declaration

func CMBufferQueueCallForEachBuffer(_ queue: CMBufferQueue, callback: (CMBuffer, UnsafeMutableRawPointer?) -> OSStatus, refcon: UnsafeMutableRawPointer?) -> OSStatus

Parameters

  • queue:

    CMBufferQueue that may contain multiple buffers.

  • callback:

    Function to be called for each buffer. The callback may modify buffer attachments but should not modify sort-affecting properties (eg, timestamps). The callback should not make other calls to the buffer queue.

  • refcon:

    Reference constant supplied to the callback function.

Return Value

A result code. See Sample Buffer Error Codes.

Discussion

If the callback function returns an error, iteration will stop immediately and the error will be returned.

See Also

Managing a Queue