requestMediaDataWhenReady(on:using:)
Tells the target to invoke a client-supplied block in order to gather sample buffers for playback.
Declaration
func requestMediaDataWhenReady(on queue: dispatch_queue_t, using block: @escaping @Sendable () -> Void)Parameters
- queue:
The dispatch queue.
- block:
A block that enqueues sample buffers until the receiver is no longer ready or there is no more data to supply.
Discussion
When this method is called multiple times, only the last call is implemented. Pair each call to requestMediaDataWhenReady(on:using:) with a corresponding call to stopRequestingMediaData(). Releasing the AVQueuedSampleBufferRendering object without a call to stopRequestingMediaData results in undefined behavior.