Instance Property


A Boolean value that indicates the readiness of the layer to accept more sample buffers.


var isReadyForMoreMediaData: Bool { get }


AVSampleBufferDisplayLayer keeps track of the occupancy levels of its internal queues for the benefit of clients that enqueue sample buffers from non-real-time sources — that is, clients that can supply sample buffers faster than they are consumed and need to decide when to hold back buffers.

Clients enqueueing sample buffers from non-real-time sources may hold off from generating or obtaining more sample buffers to enqueue when the value of readyForMoreMediaData is false.

It is safe to call enqueue(_:) when isReadyForMoreMediaData is false, but enqueing more sample buffers than are required for timely rendering by the receiver is highly discouraged.

To help with control of the non-real-time supply of sample buffers, such clients should use requestMediaDataWhenReady(on:using:) in order to specify a block that the layer should invoke whenever it’s ready for sample buffers to be appended.

The value of readyForMoreMediaData will often change from false to true asynchronously, as previously supplied sample buffers are decoded and displayed.

See Also

Initiating Media Data Requests

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

Instructs the target to invoke a client-supplied block repeatedly, at its convenience, in order to gather sample buffers for display.

func stopRequestingMediaData()

Cancels any current media data request.