Sven Op de Hipt

fix macos build error

... ... @@ -108,7 +108,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
latestBuffer = imageBuffer
registry.textureFrameAvailable(textureId)
let currentTime = Date.now.timeIntervalSince1970
let currentTime = Date().timeIntervalSince1970
let eligibleForScan = currentTime > nextScanTime && imagesCurrentlyBeingProcessed == 0;
if ((detectionSpeed == DetectionSpeed.normal || detectionSpeed == DetectionSpeed.noDuplicates) && eligibleForScan || detectionSpeed == DetectionSpeed.unrestricted) {
nextScanTime = currentTime + timeoutSeconds
... ... @@ -118,7 +118,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
orientation: .right)
do {
try imageRequestHandler.perform([VNDetectBarcodesRequest { (request, error) in
try imageRequestHandler.perform([VNDetectBarcodesRequest { [self] (request, error) in
imagesCurrentlyBeingProcessed -= 1
if error == nil {
if let results = request.results as? [VNBarcodeObservation] {
... ... @@ -226,7 +226,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
let speed: Int = (call.arguments as! Dictionary<String, Any?>)["speed"] as? Int ?? 0
let timeoutMs: Int = (call.arguments as! Dictionary<String, Any?>)["timeout"] as? Int ?? 0
timeoutSeconds = timeoutMs * 1000.0
timeoutSeconds = Double(timeoutMs) * 1000.0
detectionSpeed = DetectionSpeed(rawValue: speed)!
// Set the camera to use
... ...