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
Navaron Bracke
2024-09-10 12:08:31 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cdac3f70422b0934f69d20b4d88dd602572dc722
cdac3f70
1 parent
7ec9e586
use a lazy initialized scanner for iOS
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
ios/Classes/MobileScanner.swift
ios/Classes/MobileScanner.swift
View file @
cdac3f7
...
...
@@ -22,8 +22,8 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
/// The selected camera
var
device
:
AVCaptureDevice
!
/// Barcode scanner for results
var
scanner
=
BarcodeScanner
.
barcodeScanner
()
/// The long lived barcode scanner for scanning barcodes from a camera preview.
var
scanner
:
BarcodeScanner
?
=
nil
/// Default position of camera
var
videoPosition
:
AVCaptureDevice
.
Position
=
AVCaptureDevice
.
Position
.
back
...
...
@@ -146,7 +146,7 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
position
:
videoPosition
)
scanner
.
process
(
image
)
{
[
self
]
barcodes
,
error
in
scanner
?
.
process
(
image
)
{
[
self
]
barcodes
,
error
in
imagesCurrentlyBeingProcessed
=
false
if
(
detectionSpeed
==
DetectionSpeed
.
noDuplicates
)
{
...
...
@@ -314,6 +314,7 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
textureId
=
nil
captureSession
=
nil
device
=
nil
scanner
=
nil
}
/// Toggle the torch.
...
...
Please
register
or
login
to post a comment