configureForResumableExportWithCompletionHandler:
Attempts to configure the export session into resumption mode.
Declaration
- (void) configureForResumableExportWithCompletionHandler:(void (^)(AVAssetExportSessionResumptionState *resumptionState)) handler;Parameters
- handler:
A callback that receives the resumption configuration state. If configuration fails, the system might call the handler synchronously.
Discussion
For select encoders, an export can be performed in temporal segments, and then stitched together at the end.
You are responsible for configuring the export session identically for subsequent sessions, if the export is to be resumed from partial results from a previous run.
This method validates that the currently configured export properties allow resumption, and interrogates the contents of directoryForTemporaryFiles to determine whether this is a resuming session or a new one. As such, call this method after all settings are finalized for this export session, that is, just prior to exportAsynchronously(completionHandler:).
resumptionState details the currently configured resumption state of the export session. Even if resumptionState indicates that not all conditions for resumption are met, you may still call exportAsynchronously(completionHandler:) using the current session, and the export proceeds in the default, non-resuming manner.
This method cannot be called after the export has started.
Call cancelExport() if an in-flight export needs to be interrupted. The export maintains the partial results.
You are responsible for deleting the temporary directory and its contents if the export will never be resumed.
Because intermediate files are written to support the resume functionality, resumable exports typically double the NAND accesses, because the samples need to be written to disk twice.