Protocol

AVVideoCompositing

The methods that custom video compositors must implement.

Declaration

@protocol AVVideoCompositing

Overview

For each AVFoundation object of class AVPlayerItem, AVAssetExportSession, AVAssetImageGenerator, or AVAssetReaderVideoCompositionOutput that has a non-nil value for its videoComposition property, and the value of the customVideoCompositorClass property of the AVVideoComposition is not nil, AVFoundation creates and uses an instance of that custom video compositor class to process the instructions contained in the AVVideoComposition.

The system creates a custom video compositor instance when you assign videoComposition an instance of AVVideoComposition that's associated with a different custom video compositor class than the object was previously using.

When creating instances of custom video compositors, AVFoundation initializes them by calling init and then makes them available as the value of the customVideoCompositor property of the object. You then can do any additional setup or configuration to the custom compositor.

The AVFoundation object retains the custom video compositor instances for as long as the value of the videoComposition property indicates that there is an instance of the same custom video compositor class. This is true even when the value changes from one instance of AVVideoComposition to another associated instance with the same custom video compositor class.

Topics

Rendering the Composition

- startVideoCompositionRequest:

Directs a custom video compositor object to create a new pixel buffer composed asynchronously from a collection of sources.

Required.

- cancelAllPendingVideoCompositionRequests

Directs a custom video compositor object to cancel or finish all pending video composition requests.

Render Context Settings

- renderContextChanged:

Notifies the custom compositor that a composition will switch to a different render context.

Required.

supportsWideColorSourceFrames

A Boolean value that indicates whether the client can handle frames that contain wide color properties.

Pixel Buffer Attributes

requiredPixelBufferAttributesForRenderContext

The pixel buffer attributes required by the video compositor for new buffers created for processing.

Required.

sourcePixelBufferAttributes

The types of source frame pixel buffer attributes a video compositor can accept as input.

Required.

Relationships

Inherits From

See Also

Configuring an Item's Settings

audioMix

The audio mix parameters to be applied during playback.

videoComposition

The video composition settings to be applied during playback.

customVideoCompositor

The custom video compositor.

seekingWaitsForVideoCompositionRendering

A Boolean value that indicates whether the item’s timing follows the displayed video frame when seeking with a video composition.

audioTimePitchAlgorithm

The processing algorithm used to manage audio pitch for scaled audio edits.

videoApertureMode

The video aperture mode to apply during playback.

AVVideoApertureMode

A value that describes how a video is scaled or cropped.