Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Sven Op de Hipt
2023-08-06 22:33:29 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2b5a874852506ad182be59eaa73af06c98e9ecb8
2b5a8748
1 parent
4a35134d
fix macos build error
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
macos/Classes/MobileScannerPlugin.swift
macos/Classes/MobileScannerPlugin.swift
View file @
2b5a874
...
...
@@ -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
...
...
Please
register
or
login
to post a comment