An object used to create sample buffer opaque objects.


class AVSampleBufferGenerator : NSObject


Each request for CMSampleBuffer creation is described in an AVSampleBufferRequest object. The CMSampleBuffer opaque objects are returned synchronously. If requested, sample data may be loaded asynchronously (depending on file format support).


Creating Sample Buffer Generators

init(asset: AVAsset, timebase: CMTimebase?)

Creates a new sample buffer generator.

Creating a Sample Buffer

func createSampleBuffer(for: AVSampleBufferRequest) -> CMSampleBuffer?

Creates a new sample buffer reference for the specified buffer request.

Retrieving Sample Buffer Data

class func notifyOfDataReady(for: CMSampleBuffer, completionHandler: (Bool, Error) -> Void)

Notifies the sample buffer generator when data is ready for the sample buffer reference or an error has occurred.


Inherits From

Conforms To

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.

protocol AVQueuedSampleBufferRendering

Methods you can implement to enqueue sample buffers for presentation.