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
2023-10-12 21:03:04 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
54693978dd472ae2db0e5aee020aaeed551c1fbe
54693978
1 parent
a7e3c142
guard against a nil device in the background queue
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
11 deletions
ios/Classes/MobileScanner.swift
ios/Classes/MobileScanner.swift
View file @
5469397
...
...
@@ -213,18 +213,28 @@ public class MobileScanner: NSObject, AVCaptureVideoDataOutputSampleBufferDelega
}
catch
{
print
(
"Failed to reset zoom scale"
)
}
let
dimensions
=
CMVideoFormatDescriptionGetDimensions
(
self
.
device
.
activeFormat
.
formatDescription
)
DispatchQueue
.
main
.
async
{
completion
(
MobileScannerStartParameters
(
width
:
Double
(
dimensions
.
height
),
height
:
Double
(
dimensions
.
width
),
hasTorch
:
self
.
device
.
hasTorch
,
textureId
:
self
.
textureId
if
let
device
=
self
.
device
{
let
dimensions
=
CMVideoFormatDescriptionGetDimensions
(
device
.
activeFormat
.
formatDescription
)
let
hasTorch
=
device
.
hasTorch
DispatchQueue
.
main
.
async
{
completion
(
MobileScannerStartParameters
(
width
:
Double
(
dimensions
.
height
),
height
:
Double
(
dimensions
.
width
),
hasTorch
:
hasTorch
,
textureId
:
self
.
textureId
??
0
)
)
)
}
return
}
DispatchQueue
.
main
.
async
{
completion
(
MobileScannerStartParameters
())
}
}
}
...
...
Please
register
or
login
to post a comment