Initializer

init(dataOutputs:)

Creates a capture output synchronizer for the specified capture outputs.

Declaration

init(dataOutputs: [AVCaptureOutput])

Parameters

dataOutputs

An array of capture output objects. The first object in this array is treated as the master output to which all others are synchronized.

Discussion

The first output in the array acts as the master data output and determines when the synchronized callback is delivered. When data is received for the master data output, the synchronizer holds that data until all other data outputs have received data with an equal or later presentation timestamp, or determines that there is no data for a particular output at the master data output's presentation timestamp. After collecting data from all outputs, the synchronizer sends a single delegate callback, containing all the data aligned with the master data output's data. If the capture system receives data with presentation timestamps earlier than the next master data output time, the synchronizer sends separate delegate callbacks.

For example, if you specify a video data output as your first (master) output and a metadata output for detected faces as your second output, your data callback is not called until there is face data ready for a corresponding video frame, or it is assured that there is no face metadata for that particular video frame.

See Also

Configuring Synchronized Capture

var dataOutputs: [AVCaptureOutput]

The list of data outputs governed by this data output synchronizer.