AVVideoCompositing protocol defines properties and methods that custom video compositors must implement.
- iOS 7.0+
- macOS 10.9+
- tvOS 7.0+
For each AV Foundation object of class
AVAssetReaderVideoCompositionOutput that has a non-
nil value for its
videoComposition property, and the value of the
customVideoCompositorClass property of the
AVVideoComposition is not
nil, AV Foundation creates and uses an instance of that custom video compositor class to process the instructions contained in the
The custom video compositor instance will be created 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, AV Foundation initializes them by calling
init and then makes them available as the value of the
customVideoCompositor property of the object to which it was assigned. You then can do any additional setup or configuration to the custom compositor.
Custom video compositor instances will then be retained by the
AV Foundation object for as long as the value of its
videoComposition property indicates that an instance of the same custom video compositor class should be used, even if the value is changed from one instance of
AVVideoComposition to another instance that's associated with the same custom video compositor class.