From 37726f553bdc6910ef6df72dafd106ff9b857991 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Mon, 1 Jul 2024 10:58:28 +0200 Subject: [PATCH 1/3] use the global dispatch queue, with a specified QoS priority --- ios/Classes/MobileScanner.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ios/Classes/MobileScanner.swift b/ios/Classes/MobileScanner.swift index e9c066f25..846472796 100644 --- a/ios/Classes/MobileScanner.swift +++ b/ios/Classes/MobileScanner.swift @@ -51,8 +51,6 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega var detectionSpeed: DetectionSpeed = DetectionSpeed.noDuplicates - private let backgroundQueue = DispatchQueue(label: "camera-handling") - var standardZoomFactor: CGFloat = 1 private var nextScanTime = 0.0 @@ -246,7 +244,7 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega } captureSession!.commitConfiguration() - backgroundQueue.async { + DispatchQueue.global(qos: .userInitiated).async { guard let captureSession = self.captureSession else { return } From 14d3fb94ede7958ea9464dfeb6bad428497978d4 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Mon, 1 Jul 2024 10:59:58 +0200 Subject: [PATCH 2/3] bump version & changelog --- CHANGELOG.md | 3 +++ ios/mobile_scanner.podspec | 2 +- macos/mobile_scanner.podspec | 2 +- pubspec.yaml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac8dc4024..275dda172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 5.1.2 +* [iOS] Fixes an issue with priorities for the iOS scanner background thread. + ## 5.1.1 * This release fixes an issue with automatic starts in the examples. diff --git a/ios/mobile_scanner.podspec b/ios/mobile_scanner.podspec index eb5dce984..c82835e40 100644 --- a/ios/mobile_scanner.podspec +++ b/ios/mobile_scanner.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mobile_scanner' - s.version = '5.1.1' + s.version = '5.1.2' s.summary = 'An universal scanner for Flutter based on MLKit.' s.description = <<-DESC An universal scanner for Flutter based on MLKit. diff --git a/macos/mobile_scanner.podspec b/macos/mobile_scanner.podspec index 8d640999b..62ffbe51b 100644 --- a/macos/mobile_scanner.podspec +++ b/macos/mobile_scanner.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mobile_scanner' - s.version = '5.1.1' + s.version = '5.1.2' s.summary = 'An universal scanner for Flutter based on MLKit.' s.description = <<-DESC An universal scanner for Flutter based on MLKit. diff --git a/pubspec.yaml b/pubspec.yaml index f283ccd01..c9a2a4967 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mobile_scanner description: A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS. -version: 5.1.1 +version: 5.1.2 repository: https://github.com/juliansteenbakker/mobile_scanner screenshots: From 9959c42188ad0c03f27f7b6870c28131e85bf2ed Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Sat, 13 Jul 2024 09:29:29 +0200 Subject: [PATCH 3/3] switch from userInitiated to userInteractive --- ios/Classes/MobileScanner.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/MobileScanner.swift b/ios/Classes/MobileScanner.swift index 846472796..04eaa7c43 100644 --- a/ios/Classes/MobileScanner.swift +++ b/ios/Classes/MobileScanner.swift @@ -244,7 +244,7 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega } captureSession!.commitConfiguration() - DispatchQueue.global(qos: .userInitiated).async { + DispatchQueue.global(qos: .userInteractive).async { guard let captureSession = self.captureSession else { return }