You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.
I've run into a similar problem when taking more than one photo in my app. I traced the issue back to the reuse of the self.capturePhotoSettings object that has the same uniqueId.
It is illegal to reuse a AVCapturePhotoSettings instance for multiple captures. Calling the capturePhoto(with:delegate:) method throws an exception (invalidArgumentException) if the settings object’s uniqueID value matches that of any previously used settings object.
To reuse a specific combination of settings, use the init(from:) initializer to create a new, unique AVCapturePhotoSettings instance from an existing photo settings object.
My workaround was to modify the source code as follows.
CameraEngine.swift - line 461
public func capturePhoto(_ blockCompletion: @escaping blockCompletionCapturePhoto) {
let uniqueSettings = AVCapturePhotoSettings.init(from: self.capturePhotoSettings)
self.cameraOutput.capturePhoto(settings: uniqueSettings, blockCompletion)
}
This seems to be working for me now. I hope this is helpful to you guys.
When taking a sequence of photos with the camera example, I get the following error:
-[AVCapturePhotoOutput capturePhotoWithSettings:delegate:] Settings may not be re-used'
Any idea how to create a unique value for the settings?
The text was updated successfully, but these errors were encountered: