Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not work on iPhone 15 Pro Max #272

Open
thierrybucco opened this issue Sep 26, 2023 · 2 comments
Open

does not work on iPhone 15 Pro Max #272

thierrybucco opened this issue Sep 26, 2023 · 2 comments

Comments

@thierrybucco
Copy link

CameraManager does not work anymore on my device: iPhone 15 Pro Max.
It fails in stillImageOutput.captureStillImageAsynchronously.
here is the error (which seems to be generic, without more informations)

▿ CaptureResult

  • failure : Error Domain=AVFoundationErrorDomain Code=-11819 "Cannot perform action" UserInfo={NSLocalizedDescription=Cannot perform action, NSUnderlyingError=0x2828c0480 {Error Domain=NSOSStatusErrorDomain Code=-16405 "(null)"}, NSLocalizedRecoverySuggestion=Try again later., NSLocalizedFailureReason=XXXXDEFAULTVALUEXXXX}
sessionQueue.async { [weak self] in
            if let self = self {
                let stillImageOutput = self._getStillImageOutput()
                if let connection = stillImageOutput.connection(with: AVMediaType.video),
                   connection.isEnabled {
                    if self.cameraDevice == CameraDevice.front, connection.isVideoMirroringSupported,
                       self.shouldFlipFrontCameraImage {
                        connection.isVideoMirrored = true
                    }
                    if connection.isVideoOrientationSupported {
                        connection.videoOrientation = self._currentCaptureVideoOrientation()
                    }
                    
                    stillImageOutput.captureStillImageAsynchronously(from: connection, completionHandler: { [weak self] sample, error in
                        
                        if let error = error {
<<< failed here!
                            self?._show(NSLocalizedString("Error", comment: ""), message: error.localizedDescription)
                            imageCompletion(.failure(error))
                            return
                        }
                        
                        guard let sample = sample else { imageCompletion(.failure(CaptureError.noSampleBuffer)); return }
                        if let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(sample) {
                            imageCompletion(CaptureResult(imageData))
                        } else {
                            imageCompletion(.failure(CaptureError.noImageData))
                        }
                        
                    })
                } else {
                    imageCompletion(.failure(CaptureError.noVideoConnection))
                }
            }
        }

Do you have an idea?
Thanks

@marcnpopa
Copy link

Same here, it works on 15 max only after zooming in - I guess it's after a camera switch

@marcnpopa
Copy link

marcnpopa commented Sep 28, 2023

@thierrybucco try this : #273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants