Methods you can implement to enqueue sample buffers for presentation.


protocol AVQueuedSampleBufferRendering


AVSampleBufferDisplayLayer and AVSampleBufferAudioRenderer conform to this protocol. When used in conjunction with an AVSampleBufferRenderSynchronizer, an object conforming to AVQueuedSampleBufferRendering can only be attached to a single synchronizer.


Requesting Media

var isReadyForMoreMediaData: Bool

A Boolean value that indicates whether the receiver is able to accept more sample buffers.


func enqueue(CMSampleBuffer)

Sends a sample buffer to the queue for rendering.


func requestMediaDataWhenReady(on: DispatchQueue, using: () -> Void)

Tells the target to invoke a client-supplied block in order to gather sample buffers for playback.


Clearing Queued Sample Buffers

func flush()

Discards all pending enqueued sample buffers.


Indentifying the Timebase

var timebase: CMTimebase

The timebase for a renderer.


See Also

Sample Buffer Manipulation

class AVSampleBufferRequest

An object that describes a sample buffer creation request.

class AVSampleCursor

An object that provides information about the current media sample at its current position.

class AVSampleBufferGenerator

An object used to create sample buffer opaque objects.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software