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
Zheng Can
2022-12-19 15:21:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
825987e43bbd6ebc177e58ffaafd2661df38f0d7
825987e4
1 parent
5ebc65e9
Ignore invalid textureId in captureOutput
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
macos/Classes/MobileScannerPlugin.swift
macos/Classes/MobileScannerPlugin.swift
View file @
825987e
...
...
@@ -90,9 +90,13 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
var
i
=
0
// Gets called when a new image is added to the buffer
public
func
captureOutput
(
_
output
:
AVCaptureOutput
,
didOutput
sampleBuffer
:
CMSampleBuffer
,
from
connection
:
AVCaptureConnection
)
{
// Ignore invalid textureId
if
textureId
==
nil
{
return
}
i
=
i
+
1
;
latestBuffer
=
CMSampleBufferGetImageBuffer
(
sampleBuffer
)
...
...
@@ -107,6 +111,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
}
else
{
return
}
let
imageRequestHandler
=
VNImageRequestHandler
(
cvPixelBuffer
:
latestBuffer
,
orientation
:
.
right
)
...
...
Please
register
or
login
to post a comment