consumeSampleBuffer(from:completionHandler:)
Consumes a sample buffer from a client.
Declaration
func consumeSampleBuffer(from client: CMIOExtensionClient, completionHandler: @escaping @Sendable (CMSampleBuffer?, UInt64, CMIOExtensionStream.DiscontinuityFlags, Bool, (any Error)?) -> Void)func consumeSampleBuffer(from client: CMIOExtensionClient) async throws -> (CMSampleBuffer, UInt64, CMIOExtensionStream.DiscontinuityFlags, Bool)Parameters
- client:
The client with a sample to process.
- completionHandler:
A callback the system invokes with the following data:
sampleBufferA sample buffer that contains the media sample to consume, or
nilif an error occurs.sampleBufferSequenceNumberThe sequence number of the current sample.
discontinuityA flag that indicates if there’s a discontinuity in the stream.
hasMoreSampleBuffersA Boolean value that indicates whether there are more buffers available.
errorAn optional error. If an error occurs, it contains the details of the failure.