preprocessAsset(configuration:subprogress:)
Preprocesses the asset by generating a disparity track, writing the result to the URL specified in configuration. Required for assets whose cinematicCapability is .needsPreprocessing; on success the returned CNAssetInfo will be .renderable.
Declaration
func preprocessAsset(configuration: CNAssetPreprocessConfiguration, subprogress: consuming Subprogress? = nil) async throws -> CNAssetInfoParameters
- configuration:
Destination URL and whether to embed or reference source tracks.
- subprogress:
Optional
Subprogressfor integrating into aProgressManagertree.
Return Value
A CNAssetInfo for the preprocessed asset at the destination URL.
Discussion
Ensure resourceStatus is .ready before calling — download resources first if needed.
Cancellation: this method responds to Swift Task cancellation. If the calling task is cancelled, the preprocessing stops; any partially processed destination asset is discarded.