follow(_:videoFrameDuration:delegate:)
Configures the the device input to follow an external sync device at the given frame duration.
Declaration
func follow(_ externalSyncDevice: AVExternalSyncDevice, videoFrameDuration frameDuration: CMTime, delegate: (any AVExternalSyncDeviceDelegate)?)Parameters
- externalSyncDevice:
The Avexternalsyncdevice hardware to follow.
- delegate:
The delegate to notify when the connection status changes, or an error occurs.
Discussion
Call this method to direct your AVCaptureDeviceInput to follow the external sync pulse from a sync device at the given frame duration.
Your provided videoFrameDuration value must match the sync pulse duration of the external sync device. If it does not, the request times out, the external sync device’s status returns to AVExternalSyncDeviceStatusReady, and your session stops running, posting a runtimeErrorNotification with AVErrorFollowExternalSyncDeviceTimedOut.
The ability to follow an external sync device may change depending on the device configuration. For example, follow(_:videoFrameDuration:delegate:) cannot be used when isAutoVideoFrameRateEnabled is true.
To stop following an external pulse, call unfollowExternalSyncDevice(). External sync device following is also disabled when your device’s AVCaptureDevice.Format changes.
Your provided delegate’s externalSyncDeviceStatusDidChange(_:) method is called with a status of AVExternalSyncDeviceStatusReady if the external pulse signal is not close enough to the provided videoFrameDuration for successful calibration.
Once your status changes to AVExternalSyncDeviceStatusActiveSync, your input’s AVCaptureInput/activeExternalSyncVideoFrameDuration property reports the up-to-date frame duration. AVCaptureInput/activeExternalSyncVideoFrameDuration is also reflected in the activeVideoMinFrameDuration and activeVideoMaxFrameDuration of your input’s associated device.