Skip to content

does not work on iPhone 15 Pro Max #272

@thierrybucco

Description

@thierrybucco

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions