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

fix: update AVCaptureSession.Preset resolution, enable ultrawide camera #236

Closed
wants to merge 1 commit into from

Conversation

prdjed
Copy link

@prdjed prdjed commented Jan 31, 2025

iPhone devices after iPhone 13 have macro mode of capturing, in order for device to use it ultraWideAngle camera must be enabled. This commit enables ultraWide(tripleCamera) if the device supports it, if not it enables dualCamera, if none of them is available then it uses wideCamera that every iPhone has.

also this commit changes AVCaptureSession.Preset resolution to hd1920x1080, since it is not anymore problem for the device to analyze frames of that size. It improves oveerall scanning, scanning is much faster.

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

iPhone devices after iPhone 13 have macro mode of capturing, in order for device to use it ultraWide angle must be enabled. this commit enables ultraWide(tripleCamera) if the device supports it, if not it enables dualCamera, if none of them is available then it uses wideCamera that every iPhone has.

also this commit changes AVCaptureSession.Preset resolution to hd1920x1080, since it is not anymore problem for the device to analyze frames of that size. It improves oveerall scanning, scanning is much faster.
@@ -43,15 +43,25 @@ public protocol BarcodeScannerViewDelegate {

let captureSession = AVCaptureSession()
captureSession.beginConfiguration()
captureSession.sessionPreset = AVCaptureSession.Preset.hd1280x720
captureSession.sessionPreset = AVCaptureSession.Preset.hd1920x1080
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this as this is a breaking change. Instead, you can create a separate PR to fix a bug. It should already be possible to set this setting via the resolution property. However, this does not seem to be the case at the moment.

@robingenz
Copy link
Member

@prdjed Please also take a look at the pull request checklist.

@prdjed prdjed closed this Feb 3, 2025
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

Successfully merging this pull request may close these issues.

2 participants